/
request_proxy.py
executable file
·66 lines (50 loc) · 1.82 KB
/
request_proxy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
try:
from zohocrmsdk.src.com.zoho.crm.api.exception import SDKException
from zohocrmsdk.src.com.zoho.crm.api.util.constants import Constants
except Exception:
from .exception import SDKException
from .util import Constants
class RequestProxy(object):
def __init__(self, host, port, user=None, password=""):
"""
Creates a RequestProxy class instance with the specified parameters.
Parameters:
host(str): A String containing the hostname or address of the proxy server
port(int): An Integer containing The port number of the proxy server
user(str): A String containing the user name of the proxy server
password(str) : A String containing the password of the proxy server. Default value is an empty string
Raises:
SDKException
"""
if host is None:
raise SDKException(Constants.USER_PROXY_ERROR, Constants.HOST_ERROR_MESSAGE)
if port is None:
raise SDKException(Constants.USER_PROXY_ERROR, Constants.PORT_ERROR_MESSAGE)
self.__host = host
self.__port = port
self.__user = user
self.__password = password
def get_host(self):
"""
This is a getter method to get __host.
Returns:
string: A string representing __host
"""
def get_port(self):
"""
This is a getter method to get __port.
Returns:
string: A string representing __port
"""
def get_user(self):
"""
This is a getter method to get __user.
Returns:
string: A string representing __user
"""
def get_password(self):
"""
This is a getter method to get __password.
Returns:
string: A string representing __password
"""