File: //opt/alt/python37/lib/python3.7/site-packages/vendors_api/__pycache__/exceptions.cpython-37.pyc
B
ib:rc��� @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd� d�ZG dd � d e�ZG d
d� de�Z G dd
� d
e�Z
G dd� de�ZG dd� de�ZG dd� de�Z
G dd� de
�ZG dd� de
�ZG dd� de
�ZG dd� de
�ZG dd� de�ZdS )z8
Module contains various exceptions raised by this api.
� )�absolute_import)�division)�print_function)�FormattedExceptionc @ s e Zd ZdZdZdZdZdZdS )�ErrorMessagezL
Documented constants that can be
received from vendors scripts
ZInternalAPIError�PermissionDenied�
BadRequest�NotFoundN)�__name__�
__module__�__qualname__�__doc__ZINTERNAL_ERRORZPERMISSION_DENIEDZBAD_REQUESTZ NOT_FOUND� r r ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.1-1.el9.cloudlinux.x86_64/opt/alt/python37/lib/python3.7/site-packages/vendors_api/exceptions.pyr s
r c s e Zd ZdZ� fdd�Z� ZS )�VendorScriptErrorz0
Any errors related to vendors scripts.
c s t t| ��||d�� d S )N)�message�context)�superr �__init__)�selfr r )� __class__r r r ! s
zVendorScriptError.__init__)r
r r r
r �
__classcell__r r )r r r s r c @ s e Zd ZdZdS )�UnexpectedResultzc
An error that is raised in case of
any unexpected results returned by vendors script.
N)r
r r r
r r r r r ( s r c s e Zd ZdZ� fdd�Z� ZS )�MalformedErrorzV
An error that is raised in case of
malformed output that we cannot parse
c s t t| �jd|d� d S )NzXvendor api returned invalid response that cannot be parsed with json, output: %(output)s)�output)r r r )r r )r r r r 5 s
zMalformedError.__init__)r
r r r
r r r r )r r r 0 s r c @ s e Zd ZdZdS )�BadScriptErrorzY
An error that is raised when we cannot
run vendor's script for some reason.
N)r
r r r
r r r r r = s r c s e Zd ZdZ� fdd�Z� ZS )�NotImplementedByVendorzR
Raised when we try to start script that is
not implemented by vendor
c s t t| �jd|d� d S )NzdCommand `%(command)s` is not implemented in integration scripts. Please, implement it and try again.)�command)r r r )r r )r r r r J s
zNotImplementedByVendor.__init__)r
r r r
r r r r )r r r E s r c s e Zd ZdZ� fdd�Z� ZS )�_VendorApiFailedz9
Bunch of api errors returned by vendors scripts
c s t t| �j|d� d S )N)r )r r r )r r )r r r r V s z_VendorApiFailed.__init__)r
r r r
r r r r )r r r R s r c @ s e Zd ZdZdS )�
InternalErrorz�
n case when data is temporarily unavailable
due to internal errors in the integration script
(database unavailable or something like that)
N)r
r r r
r r r r r Z s r c @ s e Zd ZdZdS )r zh
In case when data is unavailable due to restricted
access of a user that called the script
N)r
r r r
r r r r r c s r c @ s e Zd ZdZdS )r zQ
In case when known to be false arguments are passed
to the utility.
N)r
r r r
r r r r r k s r c @ s e Zd ZdZdS )r ze
In case when during data filtering the target entity
doesn't exist in the control panel
N)r
r r r
r r r r r s s r c s e Zd ZdZ� fdd�Z� ZS )�VendorApiMalformedDataz5
Raised when vendor script returns bad data.
c s t t| �jd|d� d S )NzwIntegration script returned invalid response which is not accepted by internal schema check. See error below.
%(error)s)�error)r r r )r r! )r r r r s
zVendorApiMalformedData.__init__)r
r r r
r r r r )r r r { s r N)r
Z
__future__r r r Zclcommonr r r r r r r r r r r r r r r r r �<module>
s