File: //usr/local/CyberCP/lib/python3.10/site-packages/CloudFlare/__pycache__/cloudflare.cpython-310.pyc
o
�h�� � @ s� d Z ddlZddlZddlmZmZ ddlmZ ddlm Z m
Z
ddlmZmZ ddl
m
Z
dd lmZ dd
lmZ ddlmZmZ ddlmZmZmZ d
ZdZdZdZG dd� d�ZG dd� de�ZG dd� de�ZdS )z� Cloudflare v4 API
A Python interface Cloudflare's v4 API.
See README.md for detailed/further reading.
Copyright (c) 2016 thru 2024, Cloudflare. All rights reserved.
� N� )� CFnetwork�CFnetworkError)�CFlogger)�
user_agent�
build_curl)�read_configs�ReadConfigError)�api_v4)�
api_extras)�api_decode_from_openapi)�CloudFlareAPIError�CloudFlareInternalError)�warning_2_20�warn_warning_2_20�indent_warning_2_20z$https://api.cloudflare.com/client/v4z?https://github.com/cloudflare/api-schemas/raw/main/openapi.json� c @ s e Zd ZdZG dd� d�ZG dd� d�ZG dd� de�ZG dd � d e�ZG d
d� de�ZG dd
� d
e�Z G dd� de�Z
edd� �Zdd�dd�Z
ddd�dd�Zdd� Zdd� Zd4dd �Zd5d!d"�Zd6d$d%�Zd&d'� Zd(d)� Zd*d+� Zd,d-� Zd.d/� Zd0d1� Zd2d3� ZdS )7�
CloudFlarea� A Python interface Cloudflare's v4 API.
:param email: Authentication email (if not provided by config methods).
:param key: Authentication key (if not provided by config methods).
:param token: Authentication token (if not provided by config methods).
:param certtoken: Authentication certtoken (if not provided by config methods).
:param debug: Debug is enabled by setting to True.
:param raw: Set to True to force raw responses so you can see paging.
:param use_sessions: The default is True; rarely needs changing.
:param profile: Profile name (default is "CloudFlare").
:param base_url: Rarely changed Cloudflare API URL.
:param global_request_timeout: Timeout value (default is 5 seconds).
:param max_request_retries: Number of retry times (default is 5 times).
:param http_headers: Additional HTTP headers (as a list).
:return: New instance of CloudFlare()
A Python interface Cloudflare's v4 API.
c @ s� e Zd ZdZd$dd�Zdd� Zd%dd �Zd
d� Zdd
� Zd&dd�Z d&dd�Z
d&dd�Zd&dd�Zd&dd�Z
dd� Zdd� Zdd� Zdd� Zd%d d!�Zd"d#� ZdS )'zCloudFlare._v4base� :meta private: Tc C s� d| _ || _d|v r|d nd| _d|v r|d nd| _d|v r$|d nd| _d|v r/|d nd| _d|v r:|d nt| _d|v rE|d nt| _ |d | _
|d | _d
|v rZ|d
nt| _
d|v re|d nt| _zt| j
�| _
W n ttfy~ t| _
Y nw zt| j�| _W n ttfy� t| _Y nw d|v r�|d nd| _|d
| _t| j| j
| jd�| _ t� | _d|v r�|d r�t|d ��� nd| _|r�t� }|r�| jr�| j�t|�� dS tt|�� dS dS dS )r N�email�key�token� certtoken�base_url�openapi_url�raw�use_sessions�global_request_timeout�max_request_retries�http_headers�profile)r r r �debug)�network�config� api_email�api_key� api_token�
api_certtoken�BASE_URLr �OPENAPI_URLr r r �DEFAULT_GLOBAL_REQUEST_TIMEOUTr �DEFAULT_MAX_REQUEST_RETRIESr �int� TypeError�
ValueError�additional_http_headersr r r r � getLogger�loggerr �warningr r )�selfr# �warningsr2 � r5 �H/usr/local/CyberCP/lib/python3.10/site-packages/CloudFlare/cloudflare.py�__init__4 sN
�
�
�&�zCloudFlare._v4base.__init__c C s | j r
| ` d | _ d S d S �N)r"