99from contentstack .https_connection import HTTPSConnection
1010from contentstack .image_transform import ImageTransform
1111
12- __author__ = "ishaileshmishra (shailesh.mishra@contentstack.com)"
13- __license__ = "MIT"
14- __version__ = '1.8.0'
15-
1612log = logging .getLogger (__name__ )
1713DEFAULT_HOST = 'cdn.contentstack.io'
1814
@@ -44,6 +40,7 @@ def __init__(self, api_key: str, delivery_token: str, environment: str,
4440 total = 5 , backoff_factor = 0 , status_forcelist = [408 , 429 ]),
4541 live_preview = None ,
4642 branch = None ,
43+ early_access = None ,
4744 ):
4845 """
4946 # Class that wraps the credentials of the authenticated user. Think of
@@ -96,6 +93,7 @@ def __init__(self, api_key: str, delivery_token: str, environment: str,
9693 self .branch = branch
9794 self .retry_strategy = retry_strategy
9895 self .live_preview = live_preview
96+ self .early_access = early_access
9997 self ._validate_stack ()
10098
10199 def _validate_stack (self ):
@@ -127,6 +125,9 @@ def _validate_stack(self):
127125 'access_token' : self .delivery_token ,
128126 'environment' : self .environment
129127 }
128+ if self .early_access is not None :
129+ early_access_str = ', ' .join (self .early_access )
130+ self .headers ['x-header-ea' ] = early_access_str
130131
131132 if self .branch is not None :
132133 self .headers ['branch' ] = self .branch
@@ -145,6 +146,13 @@ def get_api_key(self):
145146 :return: api_key of the stack
146147 """
147148 return self .api_key
149+
150+ @property
151+ def get_early_access (self ):
152+ """
153+ :return: early access
154+ """
155+ return self .early_access
148156
149157 @property
150158 def get_delivery_token (self ):
0 commit comments