Build an instance of TodayInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.api.v2010.account.usage.record.today.TodayInstance
        :rtype: twilio.rest.api.v2010.account.usage.record.today.TodayInstance
494
def get_instance(self, payload):
        
        return TodayInstance(self._version, payload, account_sid=self._solution['account_sid'], )
302768
def yesterday(self):
        
        if self._yesterday is None:
            self._yesterday = YesterdayList(self._version, account_sid=self._solution['account_sid'], )
        return self._yesterday
564289
def get_instance(self, payload):
        
        return SyncListInstance(self._version, payload, service_sid=self._solution['service_sid'], )
850228
def createJWT(self, payload={}, expiredSeconds=3600):
        
        #1. check params
        if isinstance(payload, dict):
            for i in self._payloadkey:
                if i in payload:
                    raise KeyError("Standard key exists in payload")
        else:
            raise TypeError("payload is not a dict")

        #2. predefined data
        payload.update(self._payload)
        payload.update(
            exp=self.timestamp_after_timestamp(self.get_current_timestamp(), seconds=expiredSeconds),
            iat=self.get_current_timestamp()
        )

        #3. base64 urlsafe encode
        #头部编码
        first_part  = base64.urlsafe_b64encode(json.dumps(self._header, sort_keys=True, separators=(',', ':')))
        #载荷消息体编码
        second_part = base64.urlsafe_b64encode(json.dumps(payload, sort_keys=True, separators=(',', ':')))
        #签名以上两部分: 把header、playload的base64url编码加密后再次base64编码
        third_part  = base64.urlsafe_b64encode(self.signatureJWT("{0}.{1}".format(first_part, second_part)))

        #4. returns the available token
        token = first_part + '.' + second_part + '.' + third_part
        logging.info("Generating token ok")
        return token
1120232
def create(schedule_payload)
      schedule_payload = schedule_payload.is_a?(JPush::Schedule::SchedulePayload) ? schedule_payload : nil
      body = schedule_payload.to_hash
      Http::Client.post(@jpush, base_url, body: body)
    end
787263
def get_instance(self, payload):
        
        return WebhookInstance(self._version, payload, session_sid=self._solution['session_sid'], )
127926
def get_instance(self, payload):
        
        return EntityInstance(self._version, payload, service_sid=self._solution['service_sid'], )
486416
def get_instance(self, payload):
        
        return MemberInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            channel_sid=self._solution['channel_sid'],
        )
1203291
def add_time(data):
    
    payload = data['data']
    updated = data['updated'].date()
    if updated == date.today():
        payload['last_updated'] = data['updated'].strftime('today at %H:%M:%S')
    elif updated >= (date.today() - timedelta(days=1)):
        payload['last_updated'] = 'yesterday'
    elif updated >= (date.today() - timedelta(days=7)):
        payload['last_updated'] = updated.strftime('on %A')
    else:
        payload['last_updated'] = updated.strftime('%Y-%m-%d')
    return payload
307564
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return ChallengeInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
            factor_sid=self._solution['factor_sid'],
            sid=self._solution['sid'],
        )
113003
def update(self, auth_payload=values.unset):
        
        data = values.of({'AuthPayload': auth_payload, })

        payload = self._version.update(
            'POST',
            self._uri,
            data=data,
        )

        return ChallengeInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            identity=self._solution['identity'],
            factor_sid=self._solution['factor_sid'],
            sid=self._solution['sid'],
        )
148136
def get_instance(self, payload):
        
        return FeedbackInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            call_sid=self._solution['call_sid'],
        )
757945
def get_instance(self, payload):
        
        return SessionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
616013
async def _get_payload(self, user):
        
        payload = await utils.call(self.build_payload, user)

        if (
            not isinstance(payload, dict)
            or self.config.user_id() not in payload
        ):
            raise exceptions.InvalidPayload

        payload = await utils.call(self.add_claims, payload, user)

        extend_payload_args = inspect.getfullargspec(self.extend_payload)
        args = [payload]
        if "user" in extend_payload_args.args:
            args.append(user)
        payload = await utils.call(self.extend_payload, *args)

        if self.config.scopes_enabled():
            scopes = await utils.call(self.add_scopes_to_payload, user)
            if not isinstance(scopes, (tuple, list)):
                scopes = [scopes]
            payload[self.config.scopes_name()] = scopes

        claims = self.claims + [x.get_key() for x in self._custom_claims]
        missing = [x for x in claims if x not in payload]
        if missing:
            logger.debug("")
            raise exceptions.MissingRegisteredClaim(missing=missing)

        return payload
1056876
def get_instance(self, payload):
        
        return BuildInstance(self._version, payload, service_sid=self._solution['service_sid'], )
1182379
def get_daily(self, date=None):
        
        if date == None:
            return self.get("/daily.json")
        url = "/daily/{}/{}/{}.json".format(date.year, date.month, date.day)
        return self.get(url)
1130012
def get_instance(self, payload):
        
        return SampleInstance(
            self._version,
            payload,
            assistant_sid=self._solution['assistant_sid'],
            task_sid=self._solution['task_sid'],
        )