Build an instance of TokenInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.token.TokenInstance
        :rtype: twilio.rest.api.v2010.account.token.TokenInstance
5457
def get_instance(self, payload):
        
        return TokenInstance(self._version, payload, account_sid=self._solution['account_sid'], )
1330392
def get_instance(self, payload):
        
        return DomainInstance(self._version, payload, account_sid=self._solution['account_sid'], )
788267
def get_token(self, token):
        '''
        
        '''
        load = {}
        load['token'] = token
        load['cmd'] = 'get_token'
        tdata = self._send_token_request(load)
        return tdata
784665
def get_instance(self, payload):
        
        return AddressInstance(self._version, payload, account_sid=self._solution['account_sid'], )
423263
def info(self, token):
        
        verifier = JWT(key_jar=self.key_jar, allowed_sign_algs=[self.alg])
        _payload = verifier.unpack(token)
        if is_expired(_payload['exp']):
            raise ToOld('Token has expired')
        return _payload['sid'], _payload['ttype']
603766
def _sign_single(self, payload, signing_key):
        
        if not isinstance(payload, Mapping):
            raise TypeError('Expecting a mapping object, as only '
                            'JSON objects can be used as payloads.')

        token_segments = []

        signing_key = load_signing_key(signing_key, self.crypto_backend)

        header = self._make_header()
        header_b64 = base64url_encode(json_encode(header))
        payload_b64 = base64url_encode(json_encode(payload))
        signature_b64 = self._make_signature(header_b64, payload_b64, signing_key)

        token_segments = [header_b64, payload_b64, signature_b64]

        # combine the header, payload, and signature into a token and return it
        token = b'.'.join(token_segments)
        return token
411201
def get_instance(self, payload):
        
        return ExecutionInstance(self._version, payload, flow_sid=self._solution['flow_sid'], )
757945
def get_instance(self, payload):
        
        return SessionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
1060695
def get_instance(self, payload):
        
        return UserInstance(self._version, payload, service_sid=self._solution['service_sid'], )
703288
def get_instance(self, payload):
        
        return UsageInstance(self._version, payload, account_sid=self._solution['account_sid'], )
750863
def get_instance(self, payload):
        
        return MessageInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            channel_sid=self._solution['channel_sid'],
        )
1329758
def get_instance(self, payload):
        
        return WorkerInstance(self._version, payload, workspace_sid=self._solution['workspace_sid'], )
766570
def get_instance(self, payload):
        
        return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], )
318341
def build_payload(cls, method, args):
        
        ref = str(uuid.uuid4())
        return (method, args, ref)
148136
def get_instance(self, payload):
        
        return FeedbackInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            call_sid=self._solution['call_sid'],
        )
1056876
def get_instance(self, payload):
        
        return BuildInstance(self._version, payload, service_sid=self._solution['service_sid'], )
251416
def _token_request(self, grant_type, **kwargs):
        
        payload = {
            'grant_type': grant_type,
            'client_id': self._client_id,
            'client_secret': self._client_secret
        }

        payload.update(**kwargs)

        return self._realm.client.post(self.get_url('token_endpoint'),
                                       data=payload)