def __init__(self, access_token, base_url,
                 single_request_timeout=DEFAULT_SINGLE_REQUEST_TIMEOUT,
                 wait_on_rate_limit=DEFAULT_WAIT_ON_RATE_LIMIT):
        """Initialize a new RestSession object.

        Args:
            access_token(basestring): The Webex Teams access token to be used
                for this session.
            base_url(basestring): The base URL that will be suffixed onto API
                endpoint relative URLs to produce a callable absolute URL.
            single_request_timeout(int): The timeout (seconds) for a single
                HTTP REST API request.
            wait_on_rate_limit(bool): Enable or disable automatic rate-limit
                handling.

        Raises:
            TypeError: If the parameter types are incorrect.

        """
        check_type(access_token, basestring, may_be_none=False)
        check_type(base_url, basestring, may_be_none=False)
        check_type(single_request_timeout, int)
        check_type(wait_on_rate_limit, bool, may_be_none=False)

        super(RestSession, self).__init__()

        # Initialize attributes and properties
        self._base_url = str(validate_base_url(base_url))
        self._access_token = str(access_token)
        self._single_request_timeout = single_request_timeout
        self._wait_on_rate_limit = wait_on_rate_limit

        # Initialize a new `requests` session
        self._req_session = requests.session()

        # Update the headers of the `requests` session
        self.update_headers({'Authorization': 'Bearer ' + access_token,
                             'Content-type': 'application/json;charset=utf-8'})
def __init__ ( self , access_token , base_url , single_request_timeout = DEFAULT_SINGLE_REQUEST_TIMEOUT , wait_on_rate_limit = DEFAULT_WAIT_ON_RATE_LIMIT ) : check_type ( access_token , basestring , may_be_none = False ) check_type ( base_url , basestring , may_be_none = False ) check_type ( single_request_timeout , int ) check_type ( wait_on_rate_limit , bool , may_be_none = False ) super ( RestSession , self ) . __init__ ( ) self . _base_url = str ( validate_base_url ( base_url ) ) self . _access_token = str ( access_token ) self . _single_request_timeout = single_request_timeout self . _wait_on_rate_limit = wait_on_rate_limit self . _req_session = requests . session ( ) self . update_headers ( { 'Authorization' : 'Bearer ' + access_token , 'Content-type' : 'application/json;charset=utf-8' } )
Initialize a new RestSession object.

        Args:
            access_token(basestring): The Webex Teams access token to be used
                for this session.
            base_url(basestring): The base URL that will be suffixed onto API
                endpoint relative URLs to produce a callable absolute URL.
            single_request_timeout(int): The timeout (seconds) for a single
                HTTP REST API request.
            wait_on_rate_limit(bool): Enable or disable automatic rate-limit
                handling.

        Raises:
            TypeError: If the parameter types are incorrect.