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

Python serialize.map函数代码示例

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

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



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

示例1: page

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

        :param BindingInstance.BindingType binding_type: The push technology used for the bindings returned.
        :param unicode identity: The identity
        :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 BindingInstance
        :rtype: twilio.rest.chat.v2.service.binding.BindingPage
        """
        params = values.of({
            'BindingType': serialize.map(binding_type, lambda e: e),
            'Identity': serialize.map(identity, lambda e: e),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

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


示例2: fetch

    def fetch(self, country_code=values.unset, type=values.unset,
              add_ons=values.unset, add_ons_data=values.unset):
        """
        Fetch a PhoneNumberInstance

        :param unicode country_code: The ISO country code of the phone number
        :param unicode type: The type of information to return
        :param unicode add_ons: The unique_name of an Add-on you would like to invoke
        :param dict add_ons_data: Data specific to the add-on you would like to invoke

        :returns: Fetched PhoneNumberInstance
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberInstance
        """
        params = values.of({
            'CountryCode': country_code,
            'Type': serialize.map(type, lambda e: e),
            'AddOns': serialize.map(add_ons, lambda e: e),
        })

        params.update(serialize.prefixed_collapsible_map(add_ons_data, 'AddOns'))
        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

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


示例3: page

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

        :param date start_date: Only list Bindings created on or after the given date.
        :param date end_date: Only list Bindings created on or before the given date.
        :param unicode identity: Only list Bindings that have any of the specified Identities.
        :param unicode tag: Only list Bindings that have all of the specified Tags.
        :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 BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingPage
        """
        params = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'Identity': serialize.map(identity, lambda e: e),
            'Tag': serialize.map(tag, lambda e: e),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

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


示例4: fetch

    def fetch(self, country_code=values.unset, type=values.unset,
              add_ons=values.unset, add_ons_data=values.unset):
        """
        Fetch a PhoneNumberInstance

        :param unicode country_code: Optional ISO country code of the phone number.
        :param unicode type: Indicates the type of information you would like returned with your request.
        :param unicode add_ons: Indicates the particular Add-on you would like to use to get more information.
        :param dict add_ons_data: The add_ons_data

        :returns: Fetched PhoneNumberInstance
        :rtype: twilio.rest.lookups.v1.phone_number.PhoneNumberInstance
        """
        params = values.of({
            'CountryCode': country_code,
            'Type': serialize.map(type, lambda e: e),
            'AddOns': serialize.map(add_ons, lambda e: e),
        })

        params.update(serialize.prefixed_collapsible_map(add_ons_data, 'AddOns'))
        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

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


示例5: create

    def create(self, body=values.unset, priority=values.unset, ttl=values.unset,
               title=values.unset, sound=values.unset, action=values.unset,
               data=values.unset, apn=values.unset, gcm=values.unset,
               sms=values.unset, facebook_messenger=values.unset, fcm=values.unset,
               segment=values.unset, alexa=values.unset, to_binding=values.unset,
               identity=values.unset, tag=values.unset):
        """
        Create a new NotificationInstance

        :param unicode body: The notification body text
        :param NotificationInstance.Priority priority: The priority of the notification
        :param unicode ttl: How long, in seconds, the notification is valid
        :param unicode title: The notification title
        :param unicode sound: The name of the sound to be played for the notification
        :param unicode action: The actions to display for the notification
        :param dict data: The custom key-value pairs of the notification's payload
        :param dict apn: The APNS-specific payload that overrides corresponding attributes in a generic payload for APNS Bindings
        :param dict gcm: The GCM-specific payload that overrides corresponding attributes in generic payload for GCM Bindings
        :param dict sms: The SMS-specific payload that overrides corresponding attributes in generic payload for SMS Bindings
        :param dict facebook_messenger: Deprecated
        :param dict fcm: The FCM-specific payload that overrides corresponding attributes in generic payload for FCM Bindings
        :param unicode segment: A Segment to notify
        :param dict alexa: Deprecated
        :param unicode to_binding: The destination address specified as a JSON string
        :param unicode identity: The `identity` value that identifies the new resource's User
        :param unicode tag: A tag that selects the Bindings to notify

        :returns: Newly created NotificationInstance
        :rtype: twilio.rest.notify.v1.service.notification.NotificationInstance
        """
        data = values.of({
            'Identity': serialize.map(identity, lambda e: e),
            'Tag': serialize.map(tag, lambda e: e),
            'Body': body,
            'Priority': priority,
            'Ttl': ttl,
            'Title': title,
            'Sound': sound,
            'Action': action,
            'Data': serialize.object(data),
            'Apn': serialize.object(apn),
            'Gcm': serialize.object(gcm),
            'Sms': serialize.object(sms),
            'FacebookMessenger': serialize.object(facebook_messenger),
            'Fcm': serialize.object(fcm),
            'Segment': serialize.map(segment, lambda e: e),
            'Alexa': serialize.object(alexa),
            'ToBinding': serialize.map(to_binding, lambda e: e),
        })

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

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


示例6: create

    def create(self, body=values.unset, priority=values.unset, ttl=values.unset,
               title=values.unset, sound=values.unset, action=values.unset,
               data=values.unset, apn=values.unset, gcm=values.unset,
               sms=values.unset, facebook_messenger=values.unset, fcm=values.unset,
               segment=values.unset, alexa=values.unset, to_binding=values.unset,
               identity=values.unset, tag=values.unset):
        """
        Create a new NotificationInstance

        :param unicode body: Indicates the notification body text.
        :param NotificationInstance.Priority priority: Two priorities defined: low and high.
        :param unicode ttl: This parameter specifies how long the notification is valid.
        :param unicode title: Indicates the notification title.
        :param unicode sound: Indicates a sound to be played.
        :param unicode action: Specifies the actions to be displayed for the notification.
        :param dict data: This parameter specifies the custom key-value pairs of the notification's payload.
        :param dict apn: APNS specific payload that overrides corresponding attributes in a generic payload for Bindings with the apn BindingType.
        :param dict gcm: GCM specific payload that overrides corresponding attributes in generic payload for Bindings with gcm BindingType.
        :param dict sms: SMS specific payload that overrides corresponding attributes in generic payload for Bindings with sms BindingType.
        :param dict facebook_messenger: Messenger specific payload that overrides corresponding attributes in generic payload for Bindings with facebook-messenger BindingType.
        :param dict fcm: FCM specific payload that overrides corresponding attributes in generic payload for Bindings with fcm BindingType.
        :param unicode segment: The segment
        :param dict alexa: The alexa
        :param unicode to_binding: The destination address in a JSON object.
        :param unicode identity: Delivery will be attempted only to Bindings with an Identity in this list.
        :param unicode tag: Delivery will be attempted only to Bindings that have all of the Tags in this list.

        :returns: Newly created NotificationInstance
        :rtype: twilio.rest.notify.v1.service.notification.NotificationInstance
        """
        data = values.of({
            'Identity': serialize.map(identity, lambda e: e),
            'Tag': serialize.map(tag, lambda e: e),
            'Body': body,
            'Priority': priority,
            'Ttl': ttl,
            'Title': title,
            'Sound': sound,
            'Action': action,
            'Data': serialize.object(data),
            'Apn': serialize.object(apn),
            'Gcm': serialize.object(gcm),
            'Sms': serialize.object(sms),
            'FacebookMessenger': serialize.object(facebook_messenger),
            'Fcm': serialize.object(fcm),
            'Segment': serialize.map(segment, lambda e: e),
            'Alexa': serialize.object(alexa),
            'ToBinding': serialize.map(to_binding, lambda e: e),
        })

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

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


示例7: test_does_not_change_other_types

    def test_does_not_change_other_types(self):
        actual = serialize.map("abc", lambda e: e * 2)
        self.assertEqual("abc", actual)

        actual = serialize.map(123, lambda e: e * 2)
        self.assertEqual(123, actual)

        actual = serialize.map({'some': 'val'}, lambda e: e * 2)
        self.assertEqual({'some': 'val'}, actual)
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:9,代码来源:test_serialize.py


示例8: create

    def create(self, phone_number, sms_capability, account_sid=values.unset,
               friendly_name=values.unset, unique_name=values.unset,
               cc_emails=values.unset, sms_url=values.unset,
               sms_method=values.unset, sms_fallback_url=values.unset,
               sms_fallback_method=values.unset, status_callback_url=values.unset,
               status_callback_method=values.unset,
               sms_application_sid=values.unset, address_sid=values.unset,
               email=values.unset, verification_type=values.unset,
               verification_document_sid=values.unset):
        """
        Create a new HostedNumberOrderInstance

        :param unicode phone_number: An E164 formatted phone number.
        :param bool sms_capability: Specify SMS capability to host.
        :param unicode account_sid: Account Sid.
        :param unicode friendly_name: A human readable description of this resource.
        :param unicode unique_name: A unique, developer assigned name of this HostedNumberOrder.
        :param unicode cc_emails: A list of emails.
        :param unicode sms_url: SMS URL.
        :param unicode sms_method: SMS Method.
        :param unicode sms_fallback_url: SMS Fallback URL.
        :param unicode sms_fallback_method: SMS Fallback Method.
        :param unicode status_callback_url: Status Callback URL.
        :param unicode status_callback_method: Status Callback Method.
        :param unicode sms_application_sid: SMS Application Sid.
        :param unicode address_sid: Address sid.
        :param unicode email: Email.
        :param HostedNumberOrderInstance.VerificationType verification_type: Verification Type.
        :param unicode verification_document_sid: Verification Document Sid

        :returns: Newly created HostedNumberOrderInstance
        :rtype: twilio.rest.preview.hosted_numbers.hosted_number_order.HostedNumberOrderInstance
        """
        data = values.of({
            'PhoneNumber': phone_number,
            'SmsCapability': sms_capability,
            'AccountSid': account_sid,
            'FriendlyName': friendly_name,
            'UniqueName': unique_name,
            'CcEmails': serialize.map(cc_emails, lambda e: e),
            'SmsUrl': sms_url,
            'SmsMethod': sms_method,
            'SmsFallbackUrl': sms_fallback_url,
            'SmsFallbackMethod': sms_fallback_method,
            'StatusCallbackUrl': status_callback_url,
            'StatusCallbackMethod': status_callback_method,
            'SmsApplicationSid': sms_application_sid,
            'AddressSid': address_sid,
            'Email': email,
            'VerificationType': verification_type,
            'VerificationDocumentSid': verification_document_sid,
        })

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

        return HostedNumberOrderInstance(self._version, payload, )
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:60,代码来源:hosted_number_order.py


示例9: update

    def update(self, webhook_method=values.unset, webhook_filters=values.unset,
               pre_webhook_url=values.unset, post_webhook_url=values.unset,
               pre_webhook_retry_count=values.unset,
               post_webhook_retry_count=values.unset, target=values.unset):
        """
        Update the WebhookInstance

        :param unicode webhook_method: The HTTP method to be used when sending a webhook request.
        :param unicode webhook_filters: The list of webhook event triggers that are enabled for this Service.
        :param unicode pre_webhook_url: The absolute url the pre-event webhook request should be sent to.
        :param unicode post_webhook_url: The absolute url the post-event webhook request should be sent to.
        :param unicode pre_webhook_retry_count: The number of retries in case of pre-event webhook request failures.
        :param unicode post_webhook_retry_count: The number of retries in case of post-event webhook request failures.
        :param WebhookInstance.Target target: The routing target of the webhook.

        :returns: Updated WebhookInstance
        :rtype: twilio.rest.messaging.v1.webhook.WebhookInstance
        """
        data = values.of({
            'WebhookMethod': webhook_method,
            'WebhookFilters': serialize.map(webhook_filters, lambda e: e),
            'PreWebhookUrl': pre_webhook_url,
            'PostWebhookUrl': post_webhook_url,
            'PreWebhookRetryCount': pre_webhook_retry_count,
            'PostWebhookRetryCount': post_webhook_retry_count,
            'Target': target,
        })

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

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


示例10: page

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

        :param unicode identity: A unique string identifier for this User in this Service.
        :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 InviteInstance
        :rtype: twilio.rest.chat.v1.service.channel.invite.InvitePage
        """
        params = values.of({
            'Identity': serialize.map(identity, lambda e: e),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

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


示例11: 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


示例12: create

    def create(self, identity, binding_type, address, tag=values.unset,
               notification_protocol_version=values.unset,
               credential_sid=values.unset, endpoint=values.unset):
        """
        Create a new BindingInstance

        :param unicode identity: The `identity` value that identifies the new resource's User
        :param BindingInstance.BindingType binding_type: The type of the Binding
        :param unicode address: The channel-specific address
        :param unicode tag: A tag that can be used to select the Bindings to notify
        :param unicode notification_protocol_version: The protocol version to use to send the notification
        :param unicode credential_sid: The SID of the Credential resource to be used to send notifications to this Binding
        :param unicode endpoint: Deprecated

        :returns: Newly created BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingInstance
        """
        data = values.of({
            'Identity': identity,
            'BindingType': binding_type,
            'Address': address,
            'Tag': serialize.map(tag, lambda e: e),
            'NotificationProtocolVersion': notification_protocol_version,
            'CredentialSid': credential_sid,
            'Endpoint': endpoint,
        })

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

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


示例13: create

    def create(self, identity, binding_type, address, tag=values.unset,
               notification_protocol_version=values.unset,
               credential_sid=values.unset, endpoint=values.unset):
        """
        Create a new BindingInstance

        :param unicode identity: The Identity to which this Binding belongs to.
        :param BindingInstance.BindingType binding_type: The type of the Binding.
        :param unicode address: The address specific to the channel.
        :param unicode tag: The list of tags associated with this Binding.
        :param unicode notification_protocol_version: The version of the protocol used to send the notification.
        :param unicode credential_sid: The unique identifier of the Credential resource to be used to send notifications to this Binding.
        :param unicode endpoint: DEPRECATED*

        :returns: Newly created BindingInstance
        :rtype: twilio.rest.notify.v1.service.binding.BindingInstance
        """
        data = values.of({
            'Identity': identity,
            'BindingType': binding_type,
            'Address': address,
            'Tag': serialize.map(tag, lambda e: e),
            'NotificationProtocolVersion': notification_protocol_version,
            'CredentialSid': credential_sid,
            'Endpoint': endpoint,
        })

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

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


示例14: page

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

        :param date start_date: The start_date
        :param date end_date: The end_date
        :param unicode tag: The tag
        :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 UserBindingInstance
        :rtype: twilio.rest.notify.v1.service.user.user_binding.UserBindingPage
        """
        params = values.of({
            'StartDate': serialize.iso8601_date(start_date),
            'EndDate': serialize.iso8601_date(end_date),
            'Tag': serialize.map(tag, lambda e: e),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

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


示例15: update

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

        :param unicode unique_name: A unique, developer assigned name of this Session.
        :param unicode ttl: How long will this session stay open, in seconds.
        :param SessionInstance.Status status: The Status of this Session
        :param unicode participants: The participants

        :returns: Updated SessionInstance
        :rtype: twilio.rest.preview.proxy.service.session.SessionInstance
        """
        data = values.of({
            'UniqueName': unique_name,
            'Ttl': ttl,
            'Status': status,
            'Participants': serialize.map(participants, lambda e: 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:kanyapnp,项目名称:twilio-python,代码行数:32,代码来源:__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, type=values.unset, page_token=values.unset,
             page_number=values.unset, page_size=values.unset):
        """
        Retrieve a single page of ChannelInstance records from the API.
        Request is executed immediately

        :param ChannelInstance.ChannelType type: The 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 ChannelInstance
        :rtype: twilio.rest.chat.v2.service.channel.ChannelPage
        """
        params = values.of({
            'Type': serialize.map(type, lambda e: e),
            'PageToken': page_token,
            'Page': page_number,
            'PageSize': page_size,
        })

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

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


示例18: create

    def create(self, body=values.unset, media_url=values.unset):
        """
        Create a new MessageInteractionInstance

        :param unicode body: Message body
        :param unicode media_url: Reserved

        :returns: Newly created MessageInteractionInstance
        :rtype: twilio.rest.proxy.v1.service.session.participant.message_interaction.MessageInteractionInstance
        """
        data = values.of({'Body': body, 'MediaUrl': serialize.map(media_url, lambda e: e), })

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

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


示例19: update

    def update(self, configuration_url=values.unset,
               configuration_method=values.unset,
               configuration_filters=values.unset,
               configuration_triggers=values.unset,
               configuration_flow_sid=values.unset,
               configuration_retry_count=values.unset,
               configuration_buffer_messages=values.unset,
               configuration_buffer_window=values.unset):
        """
        Update the WebhookInstance

        :param unicode configuration_url: The absolute url the webhook request should be sent to.
        :param WebhookInstance.Method configuration_method: The HTTP method to be used when sending a webhook request.
        :param unicode configuration_filters: The list of events, firing webhook event for this Session.
        :param unicode configuration_triggers: The list of keywords, firing webhook event for this Session.
        :param unicode configuration_flow_sid: The studio flow sid, where the webhook should be sent to.
        :param unicode configuration_retry_count: The number of retries in case of webhook request failures.
        :param bool configuration_buffer_messages: The flag whether buffering should be applied to messages.
        :param unicode configuration_buffer_window: The period of buffering messages.

        :returns: Updated WebhookInstance
        :rtype: twilio.rest.messaging.v1.session.webhook.WebhookInstance
        """
        data = values.of({
            'Configuration.Url': configuration_url,
            'Configuration.Method': configuration_method,
            'Configuration.Filters': serialize.map(configuration_filters, lambda e: e),
            'Configuration.Triggers': serialize.map(configuration_triggers, lambda e: e),
            'Configuration.FlowSid': configuration_flow_sid,
            'Configuration.RetryCount': configuration_retry_count,
            'Configuration.BufferMessages': configuration_buffer_messages,
            'Configuration.BufferWindow': configuration_buffer_window,
        })

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

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


示例20: create

    def create(self, to, status_callback=values.unset, application_sid=values.unset,
               max_price=values.unset, provide_feedback=values.unset,
               validity_period=values.unset, max_rate=values.unset,
               force_delivery=values.unset, provider_sid=values.unset,
               content_retention=values.unset, address_retention=values.unset,
               smart_encoded=values.unset, from_=values.unset,
               messaging_service_sid=values.unset, body=values.unset,
               media_url=values.unset):
        """
        Create a new MessageInstance

        :param unicode to: The phone number to receive the message
        :param unicode status_callback: URL Twilio will request when the status changes
        :param unicode application_sid: The application to use for callbacks
        :param unicode max_price: The total maximum price up to the fourth decimal in US dollars acceptable for the message to be delivered.
        :param bool provide_feedback: Set this value to true if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the Message Feedback API.
        :param unicode validity_period: The number of seconds that the message can remain in a Twilio queue.
        :param unicode max_rate: The max_rate
        :param bool force_delivery: The force_delivery
        :param unicode provider_sid: The provider_sid
        :param MessageInstance.ContentRetention content_retention: The content_retention
        :param MessageInstance.AddressRetention address_retention: The address_retention
        :param bool smart_encoded: The smart_encoded
        :param unicode from_: The phone number that initiated the message
        :param unicode messaging_service_sid: The 34 character unique id of the Messaging Service you want to associate with this Message.
        :param unicode body: The text of the message you want to send, limited to 1600 characters.
        :param unicode media_url: The URL of the media you wish to send out with the message.

        :returns: Newly created MessageInstance
        :rtype: twilio.rest.api.v2010.account.message.MessageInstance
        """
        data = values.of({
            'To': to,
            'From': from_,
            'MessagingServiceSid': messaging_service_sid,
            'Body': body,
            'MediaUrl': serialize.map(media_url, lambda e: e),
            'StatusCallback': status_callback,
            'ApplicationSid': application_sid,
            'MaxPrice': max_price,
            'ProvideFeedback': provide_feedback,
            'ValidityPeriod': validity_period,
            'MaxRate': max_rate,
            'ForceDelivery': force_delivery,
            'ProviderSid': provider_sid,
            'ContentRetention': content_retention,
            'AddressRetention': address_retention,
            'SmartEncoded': smart_encoded,
        })

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

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python serialize.object函数代码示例发布时间:2022-05-27
下一篇:
Python serialize.iso8601_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