• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python serialize.iso8601_datetime函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中twilio.base.serialize.iso8601_datetime函数的典型用法代码示例。如果您正苦于以下问题:Python iso8601_datetime函数的具体用法?Python iso8601_datetime怎么用?Python iso8601_datetime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了iso8601_datetime函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: update

    def update(self, attributes=values.unset, date_created=values.unset,
               date_updated=values.unset):
        """
        Update the ParticipantInstance

        :param unicode attributes: An optional string metadata field you can use to store any data you wish.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.

        :returns: Updated ParticipantInstance
        :rtype: twilio.rest.messaging.v1.session.participant.ParticipantInstance
        """
        data = values.of({
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
        })

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

        return ParticipantInstance(
            self._version,
            payload,
            session_sid=self._solution['session_sid'],
            sid=self._solution['sid'],
        )
开发者ID:twilio,项目名称:twilio-python,代码行数:30,代码来源:participant.py


示例2: fetch

    def fetch(self, minutes=values.unset, start_date=values.unset,
              end_date=values.unset):
        """
        Fetch a WorkerStatisticsInstance

        :param unicode minutes: The minutes
        :param datetime start_date: The start_date
        :param datetime end_date: The end_date

        :returns: Fetched WorkerStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.worker.worker_statistics.WorkerStatisticsInstance
        """
        params = values.of({
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'EndDate': serialize.iso8601_datetime(end_date),
        })

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

        return WorkerStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
            worker_sid=self._solution['worker_sid'],
        )
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:30,代码来源:worker_statistics.py


示例3: create

    def create(self, friendly_name=values.unset, unique_name=values.unset,
               attributes=values.unset, type=values.unset,
               date_created=values.unset, date_updated=values.unset,
               created_by=values.unset):
        """
        Create a new ChannelInstance

        :param unicode friendly_name: A string to describe the new resource
        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param unicode attributes: A valid JSON string that contains application-specific data
        :param ChannelInstance.ChannelType type: The visibility of the channel
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode created_by: The identity of the User that created the Channel

        :returns: Newly created ChannelInstance
        :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance
        """
        data = values.of({
            'FriendlyName': friendly_name,
            'UniqueName': unique_name,
            'Attributes': attributes,
            'Type': type,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'CreatedBy': created_by,
        })

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

        return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], )
开发者ID:twilio,项目名称:twilio-python,代码行数:35,代码来源:__init__.py


示例4: create

    def create(self, friendly_name=values.unset, unique_name=values.unset,
               attributes=values.unset, type=values.unset,
               date_created=values.unset, date_updated=values.unset,
               created_by=values.unset):
        """
        Create a new ChannelInstance

        :param unicode friendly_name: A human-readable name for the Channel.
        :param unicode unique_name: A unique, addressable name for the Channel.
        :param unicode attributes: An optional metadata field you can use to store any data you wish.
        :param ChannelInstance.ChannelType type: The visibility of the channel - public or private.
        :param datetime date_created: The optional ISO8601 time specifying the datetime the Channel should be set as being created.
        :param datetime date_updated: The optional ISO8601 time specifying the datetime the Channel should be set as having been last updated.
        :param unicode created_by: Optional field to specify the Identity of the User that created the Channel.

        :returns: Newly created ChannelInstance
        :rtype: twilio.rest.chat.v2.service.channel.ChannelInstance
        """
        data = values.of({
            'FriendlyName': friendly_name,
            'UniqueName': unique_name,
            'Attributes': attributes,
            'Type': type,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'CreatedBy': created_by,
        })

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

        return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], )
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:35,代码来源:__init__.py


示例5: page

    def page(self, end=values.unset, start=values.unset, granularity=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of UsageRecordInstance records from the API.
        Request is executed immediately

        :param datetime end: Only include usage that has occurred on or before this date.
        :param datetime start: Only include usage that has occurred on or after this date.
        :param UsageRecordInstance.Granularity granularity: The time-based grouping that results are aggregated by.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of UsageRecordInstance
        :rtype: twilio.rest.wireless.v1.sim.usage_record.UsageRecordPage
        """
        params = values.of({
            'End': serialize.iso8601_datetime(end),
            'Start': serialize.iso8601_datetime(start),
            'Granularity': granularity,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return UsageRecordPage(self._version, response, self._solution)
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:33,代码来源:usage_record.py


示例6: page

    def page(self, end=values.unset, start=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of DataSessionInstance records from the API.
        Request is executed immediately

        :param datetime end: The end
        :param datetime start: The start
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of DataSessionInstance
        :rtype: twilio.rest.wireless.v1.sim.data_session.DataSessionPage
        """
        params = values.of({
            'End': serialize.iso8601_datetime(end),
            'Start': serialize.iso8601_datetime(start),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return DataSessionPage(self._version, response, self._solution)
开发者ID:twilio,项目名称:twilio-python,代码行数:30,代码来源:data_session.py


示例7: page

    def page(self, date_created_before=values.unset, date_created=values.unset,
             date_created_after=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of MediaInstance records from the API.
        Request is executed immediately

        :param datetime date_created_before: The `YYYY-MM-DD` value of the resources to read
        :param datetime date_created: The `YYYY-MM-DD` value of the resources to read
        :param datetime date_created_after: The `YYYY-MM-DD` value of the resources to read
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of MediaInstance
        :rtype: twilio.rest.api.v2010.account.message.media.MediaPage
        """
        params = values.of({
            'DateCreated<': serialize.iso8601_datetime(date_created_before),
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateCreated>': serialize.iso8601_datetime(date_created_after),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return MediaPage(self._version, response, self._solution)
开发者ID:twilio,项目名称:twilio-python,代码行数:33,代码来源:media.py


示例8: create

    def create(self, attributes=values.unset, twilio_address=values.unset,
               date_created=values.unset, date_updated=values.unset,
               identity=values.unset, user_address=values.unset):
        """
        Create a new ParticipantInstance

        :param unicode attributes: An optional string metadata field you can use to store any data you wish.
        :param unicode twilio_address: The address of the Twilio phone number that the participant is in contact with.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.
        :param unicode identity: A unique string identifier for the session participant as Chat User.
        :param unicode user_address: The address of the participant's device.

        :returns: Newly created ParticipantInstance
        :rtype: twilio.rest.messaging.v1.session.participant.ParticipantInstance
        """
        data = values.of({
            'Identity': identity,
            'UserAddress': user_address,
            'Attributes': attributes,
            'TwilioAddress': twilio_address,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
        })

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

        return ParticipantInstance(self._version, payload, session_sid=self._solution['session_sid'], )
开发者ID:twilio,项目名称:twilio-python,代码行数:32,代码来源:participant.py


示例9: page

    def page(self, end_date=values.unset, friendly_name=values.unset,
             minutes=values.unset, start_date=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of TaskQueuesStatisticsInstance records from the API.
        Request is executed immediately

        :param datetime end_date: The end_date
        :param unicode friendly_name: The friendly_name
        :param unicode minutes: The minutes
        :param datetime start_date: The start_date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of TaskQueuesStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.task_queue.task_queues_statistics.TaskQueuesStatisticsPage
        """
        params = values.of({
            'EndDate': serialize.iso8601_datetime(end_date),
            'FriendlyName': friendly_name,
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return TaskQueuesStatisticsPage(self._version, response, self._solution)
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:35,代码来源:task_queues_statistics.py


示例10: page

    def page(self, date_created_from=values.unset, date_created_to=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of ExecutionInstance records from the API.
        Request is executed immediately

        :param datetime date_created_from: Only show Executions that started on or after this ISO8601 date-time.
        :param datetime date_created_to: Only show Executions that started before this this ISO8601 date-time.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of ExecutionInstance
        :rtype: twilio.rest.studio.v1.flow.execution.ExecutionPage
        """
        params = values.of({
            'DateCreatedFrom': serialize.iso8601_datetime(date_created_from),
            'DateCreatedTo': serialize.iso8601_datetime(date_created_to),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return ExecutionPage(self._version, response, self._solution)
开发者ID:twilio,项目名称:twilio-python,代码行数:31,代码来源:__init__.py


示例11: create

    def create(self, author=values.unset, attributes=values.unset,
               date_created=values.unset, date_updated=values.unset,
               body=values.unset):
        """
        Create a new MessageInstance

        :param unicode author: The identity of the message's author.
        :param unicode attributes: A string metadata field you can use to store any data you wish.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.
        :param unicode body: The contents of the message.

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.messaging.v1.session.message.MessageInstance
        """
        data = values.of({
            'Author': author,
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'Body': body,
        })

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

        return MessageInstance(self._version, payload, session_sid=self._solution['session_sid'], )
开发者ID:twilio,项目名称:twilio-python,代码行数:30,代码来源:message.py


示例12: fetch

    def fetch(self, end_date=values.unset, minutes=values.unset,
              start_date=values.unset, task_channel=values.unset):
        """
        Fetch a WorkersCumulativeStatisticsInstance

        :param datetime end_date: Filter cumulative statistics by a end date.
        :param unicode minutes: Filter cumulative statistics by up to 'x' minutes in the past.
        :param datetime start_date: Filter cumulative statistics by a start date.
        :param unicode task_channel: Filter cumulative statistics by TaskChannel.

        :returns: Fetched WorkersCumulativeStatisticsInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.worker.workers_cumulative_statistics.WorkersCumulativeStatisticsInstance
        """
        params = values.of({
            'EndDate': serialize.iso8601_datetime(end_date),
            'Minutes': minutes,
            'StartDate': serialize.iso8601_datetime(start_date),
            'TaskChannel': task_channel,
        })

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

        return WorkersCumulativeStatisticsInstance(
            self._version,
            payload,
            workspace_sid=self._solution['workspace_sid'],
        )
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:31,代码来源:workers_cumulative_statistics.py


示例13: create

    def create(self, messaging_service_sid, friendly_name=values.unset,
               attributes=values.unset, date_created=values.unset,
               date_updated=values.unset, created_by=values.unset):
        """
        Create a new SessionInstance

        :param unicode messaging_service_sid: The unique id of the SMS Service this session belongs to.
        :param unicode friendly_name: The human-readable name of this session.
        :param unicode attributes: An optional string metadata field you can use to store any data you wish.
        :param datetime date_created: The date that this resource was created.
        :param datetime date_updated: The date that this resource was last updated.
        :param unicode created_by: Identity of the session's creator.

        :returns: Newly created SessionInstance
        :rtype: twilio.rest.messaging.v1.session.SessionInstance
        """
        data = values.of({
            'MessagingServiceSid': messaging_service_sid,
            'FriendlyName': friendly_name,
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'CreatedBy': created_by,
        })

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

        return SessionInstance(self._version, payload, )
开发者ID:twilio,项目名称:twilio-python,代码行数:32,代码来源:__init__.py


示例14: page

    def page(self, end_date=values.unset, event_type=values.unset,
             minutes=values.unset, reservation_sid=values.unset,
             start_date=values.unset, task_queue_sid=values.unset,
             task_sid=values.unset, worker_sid=values.unset,
             workflow_sid=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param datetime end_date: Filter events by an end date.
        :param unicode event_type: Filter events by those of a certain event type
        :param unicode minutes: Filter events by up to 'x' minutes in the past.
        :param unicode reservation_sid: Filter events by those pertaining to a particular reservation
        :param datetime start_date: Filter events by a start date.
        :param unicode task_queue_sid: Filter events by those pertaining to a particular queue
        :param unicode task_sid: Filter events by those pertaining to a particular task
        :param unicode worker_sid: Filter events by those pertaining to a particular worker
        :param unicode workflow_sid: The workflow_sid
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of EventInstance
        :rtype: twilio.rest.taskrouter.v1.workspace.event.EventPage
        """
        params = values.of({
            'EndDate': serialize.iso8601_datetime(end_date),
            'EventType': event_type,
            'Minutes': minutes,
            'ReservationSid': reservation_sid,
            'StartDate': serialize.iso8601_datetime(start_date),
            'TaskQueueSid': task_queue_sid,
            'TaskSid': task_sid,
            'WorkerSid': worker_sid,
            'WorkflowSid': workflow_sid,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return EventPage(self._version, response, self._solution)
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:48,代码来源:event.py


示例15: update

    def update(self, date_expiry=values.unset, ttl=values.unset, mode=values.unset,
               status=values.unset, participants=values.unset):
        """
        Update the SessionInstance

        :param datetime date_expiry: The ISO 8601 date when the Session should expire
        :param unicode ttl: When the session will expire
        :param SessionInstance.Mode mode: The Mode of the Session
        :param SessionInstance.Status status: The new status of the resource
        :param dict participants: The Participant objects to include in the session

        :returns: Updated SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Mode': mode,
            'Status': status,
            'Participants': serialize.map(participants, lambda e: serialize.object(e)),
        })

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

        return SessionInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
开发者ID:twilio,项目名称:twilio-python,代码行数:34,代码来源:__init__.py


示例16: create

    def create(self, unique_name=values.unset, date_expiry=values.unset,
               ttl=values.unset, mode=values.unset, status=values.unset,
               participants=values.unset):
        """
        Create a new SessionInstance

        :param unicode unique_name: An application-defined string that uniquely identifies the resource
        :param datetime date_expiry: The ISO 8601 date when the Session should expire
        :param unicode ttl: When the session will expire
        :param SessionInstance.Mode mode: The Mode of the Session
        :param SessionInstance.Status status: Session status
        :param dict participants: The Participant objects to include in the new session

        :returns: Newly created SessionInstance
        :rtype: twilio.rest.proxy.v1.service.session.SessionInstance
        """
        data = values.of({
            'UniqueName': unique_name,
            'DateExpiry': serialize.iso8601_datetime(date_expiry),
            'Ttl': ttl,
            'Mode': mode,
            'Status': status,
            'Participants': serialize.map(participants, lambda e: serialize.object(e)),
        })

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

        return SessionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
开发者ID:twilio,项目名称:twilio-python,代码行数:32,代码来源:__init__.py


示例17: page

    def page(self, actor_sid=values.unset, event_type=values.unset,
             resource_sid=values.unset, source_ip_address=values.unset,
             start_date=values.unset, end_date=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of EventInstance records from the API.
        Request is executed immediately

        :param unicode actor_sid: Only include Events initiated by this Actor
        :param unicode event_type: Only include Events of this EventType
        :param unicode resource_sid: Only include Events referring to this resource
        :param unicode source_ip_address: Only include Events that originated from this IP address
        :param datetime start_date: Only show events on or after this date
        :param datetime end_date: Only show events on or before this date
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of EventInstance
        :rtype: twilio.rest.monitor.v1.event.EventPage
        """
        params = values.of({
            'ActorSid': actor_sid,
            'EventType': event_type,
            'ResourceSid': resource_sid,
            'SourceIpAddress': source_ip_address,
            'StartDate': serialize.iso8601_datetime(start_date),
            'EndDate': serialize.iso8601_datetime(end_date),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return EventPage(self._version, response, self._solution)
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:41,代码来源:event.py


示例18: page

    def page(self, status=values.unset, source_sid=values.unset,
             grouping_sid=values.unset, date_created_after=values.unset,
             date_created_before=values.unset, media_type=values.unset,
             page_token=values.unset, page_number=values.unset,
             page_size=values.unset):
        """
        Retrieve a single page of RecordingInstance records from the API.
        Request is executed immediately

        :param RecordingInstance.Status status: Only show Recordings with the given status.
        :param unicode source_sid: Only show the Recordings with the given source Sid.
        :param unicode grouping_sid: Only show Recordings that have this GroupingSid.
        :param datetime date_created_after: Only show Recordings that started on or after this ISO8601 date-time with timezone.
        :param datetime date_created_before: Only show Recordings that started before this ISO8601 date-time with timezone.
        :param RecordingInstance.Type media_type: Only show Recordings that have this media type.
        :param str page_token: PageToken provided by the API
        :param int page_number: Page Number, this value is simply for client state
        :param int page_size: Number of records to return, defaults to 50

        :returns: Page of RecordingInstance
        :rtype: twilio.rest.video.v1.recording.RecordingPage
        """
        params = values.of({
            'Status': status,
            'SourceSid': source_sid,
            'GroupingSid': serialize.map(grouping_sid, lambda e: e),
            'DateCreatedAfter': serialize.iso8601_datetime(date_created_after),
            'DateCreatedBefore': serialize.iso8601_datetime(date_created_before),
            'MediaType': media_type,
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

        response = self._version.page(
            'GET',
            self._uri,
            params=params,
        )

        return RecordingPage(self._version, response, self._solution)
开发者ID:twilio,项目名称:twilio-python,代码行数:41,代码来源:__init__.py


示例19: create

    def create(self, from_=values.unset, attributes=values.unset,
               date_created=values.unset, date_updated=values.unset,
               last_updated_by=values.unset, body=values.unset,
               media_sid=values.unset):
        """
        Create a new MessageInstance

        :param unicode from_: The identity of the new message's author
        :param unicode attributes: A valid JSON string that contains application-specific data
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode last_updated_by: The Identity of the User who last updated the Message
        :param unicode body: The message to send to the channel
        :param unicode media_sid:  The Media Sid to be attached to the new Message

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.chat.v2.service.channel.message.MessageInstance
        """
        data = values.of({
            'From': from_,
            'Attributes': attributes,
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'LastUpdatedBy': last_updated_by,
            'Body': body,
            'MediaSid': media_sid,
        })

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

        return MessageInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            channel_sid=self._solution['channel_sid'],
        )
开发者ID:twilio,项目名称:twilio-python,代码行数:40,代码来源:message.py


示例20: create

    def create(self, identity, role_sid=values.unset,
               last_consumed_message_index=values.unset,
               last_consumption_timestamp=values.unset, date_created=values.unset,
               date_updated=values.unset, attributes=values.unset):
        """
        Create a new MemberInstance

        :param unicode identity: The `identity` value that identifies the new resource's User
        :param unicode role_sid: The SID of the Role to assign to the member
        :param unicode last_consumed_message_index: The index of the last Message in the Channel the Member has read
        :param datetime last_consumption_timestamp: The ISO 8601 based timestamp string representing the date-time of the last Message read event for the Member within the Channel
        :param datetime date_created: The ISO 8601 date and time in GMT when the resource was created
        :param datetime date_updated: The ISO 8601 date and time in GMT when the resource was updated
        :param unicode attributes: A valid JSON string that contains application-specific data

        :returns: Newly created MemberInstance
        :rtype: twilio.rest.chat.v2.service.channel.member.MemberInstance
        """
        data = values.of({
            'Identity': identity,
            'RoleSid': role_sid,
            'LastConsumedMessageIndex': last_consumed_message_index,
            'LastConsumptionTimestamp': serialize.iso8601_datetime(last_consumption_timestamp),
            'DateCreated': serialize.iso8601_datetime(date_created),
            'DateUpdated': serialize.iso8601_datetime(date_updated),
            'Attributes': attributes,
        })

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

        return MemberInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            channel_sid=self._solution['channel_sid'],
        )
开发者ID:twilio,项目名称:twilio-python,代码行数:40,代码来源:member.py



注:本文中的twilio.base.serialize.iso8601_datetime函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python serialize.map函数代码示例发布时间:2022-05-27
下一篇:
Python deserialize.rfc2822_datetime函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap