1+ import os
2+ import sys
3+ import enum
4+ import logging
5+ sys .path .insert (0 , os .path .abspath ('.' ))
6+
17"""
28Config
39contentstack
612
713"""
814
9- import logging
10- import enum
1115
1216logging .basicConfig (filename = 'report.log' , format = '%(asctime)s - %(message)s' , level = logging .INFO )
1317logging .getLogger (__name__ )
@@ -28,11 +32,16 @@ def region(self, region=ContentstackRegion.US):
2832 """
2933 The base URL for Content Delivery API is cdn.contentstack.io.
3034 default region is for ContentstackRegion is US
31- :param region: ContentstackRegion
32- :return: self
35+
36+ :param region: Region support given for US and EU
37+ :return: ContentstackRegion
38+
3339 ==============================
40+
3441 [Example:]
42+
3543 >>> config = Config().region(region=ContentstackRegion.US)
44+
3645 ==============================
3746 """
3847
@@ -44,20 +53,13 @@ def host(self, host):
4453
4554 """
4655 The base URL for Content Delivery API is cdn.contentstack.io.
47- host is the domain name or IP address (
48- IPv4) of the host that serves the API. It may include the port number if different from the scheme's default
56+ host is the domain name or IP address of the host that serves the API. It may include the
57+ port number if different from the scheme's default
4958 port (443 for HTTPS).
59+
60+ Returns:
61+ [Config] -- Config, So we can chain more functions
5062
51- Note: contentstack supports HTTPS only
52- :param host: host is the domain name
53- :type host: str
54- :return: self
55- :rtype: Config
56-
57- ==============================
58- [Example:]
59- >>> config = Config().host('api.contentstack.io')
60- ==============================
6163 """
6264
6365 if host is not None and isinstance (host , str ):
@@ -73,11 +75,14 @@ def version(self, version=None):
7375 :type version: str
7476 :return: self
7577 :rtype: Config
78+
7679 ==============================
80+
7781 [Example:] The API version (in our case, 'v3') can be found in the URL
7882
7983 >>> config = Config()
8084 >>> config.version = 'v3'
85+
8186 ==============================
8287 """
8388
@@ -91,6 +96,7 @@ def endpoint(self):
9196
9297 """
9398 :return: url endpoint to make Http requst
99+
94100 """
95101 return self .__get_url ()
96102
0 commit comments