def update(self,
               friendly_name=values.unset,
               log_queries=values.unset,
               unique_name=values.unset,
               callback_url=values.unset,
               callback_events=values.unset,
               fallback_actions=values.unset,
               initiation_actions=values.unset):
        """
        Update the AssistantInstance

        :param unicode friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long.
        :param bool log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided.
        :param unicode unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
        :param unicode callback_url: The callback_url
        :param unicode callback_events: The callback_events
        :param dict fallback_actions: The fallback_actions
        :param dict initiation_actions: The initiation_actions

        :returns: Updated AssistantInstance
        :rtype: twilio.rest.preview.understand.assistant.AssistantInstance
        """
        data = values.of({
            'FriendlyName':
            friendly_name,
            'LogQueries':
            log_queries,
            'UniqueName':
            unique_name,
            'CallbackUrl':
            callback_url,
            'CallbackEvents':
            callback_events,
            'FallbackActions':
            serialize.object(fallback_actions),
            'InitiationActions':
            serialize.object(initiation_actions),
        })

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

        return AssistantInstance(
            self._version,
            payload,
            sid=self._solution['sid'],
        )
示例#2
0
    def create(self, key, data, ttl=values.unset):
        """
        Create a new SyncMapItemInstance

        :param unicode key: The unique user-defined key of this Map Item.
        :param dict data: Contains arbitrary user-defined, schema-less data that this Map Item stores, represented by a JSON object, up to 16KB.
        :param unicode ttl: Time-to-live of this Map in seconds, defaults to no expiration.

        :returns: Newly created SyncMapItemInstance
        :rtype: twilio.rest.sync.v1.service.sync_map.sync_map_item.SyncMapItemInstance
        """
        data = values.of({
            'Key': key,
            'Data': serialize.object(data),
            'Ttl': ttl,
        })

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

        return SyncMapItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            map_sid=self._solution['map_sid'],
        )
    def update(self, actions=values.unset):
        """
        Update the IntentActionsInstance

        :param dict actions: The actions

        :returns: Updated IntentActionsInstance
        :rtype: twilio.rest.preview.understand.assistant.intent.intent_actions.IntentActionsInstance
        """
        data = values.of({
            'Actions': serialize.object(actions),
        })

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

        return IntentActionsInstance(
            self._version,
            payload,
            assistant_sid=self._solution['assistant_sid'],
            intent_sid=self._solution['intent_sid'],
        )
    def update(self, data):
        """
        Update the SyncMapItemInstance

        :param dict data: The data

        :returns: Updated SyncMapItemInstance
        :rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance
        """
        data = values.of({
            'Data': serialize.object(data),
        })

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

        return SyncMapItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            map_sid=self._solution['map_sid'],
            key=self._solution['key'],
        )
示例#5
0
    def create(self, data):
        """
        Create a new StreamMessageInstance

        :param dict data: Stream Message body.

        :returns: Newly created StreamMessageInstance
        :rtype: twilio.rest.sync.v1.service.sync_stream.stream_message.StreamMessageInstance
        """
        data = values.of({
            'Data': serialize.object(data),
        })

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

        return StreamMessageInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            stream_sid=self._solution['stream_sid'],
        )
    def create(self, data):
        """
        Create a new SyncListItemInstance

        :param dict data: The data

        :returns: Newly created SyncListItemInstance
        :rtype: twilio.rest.preview.sync.service.sync_list.sync_list_item.SyncListItemInstance
        """
        data = values.of({
            'Data': serialize.object(data),
        })

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

        return SyncListItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            list_sid=self._solution['list_sid'],
        )
    def update(self, data=values.unset, ttl=values.unset):
        """
        Update the SyncListItemInstance

        :param dict data: Contains arbitrary user-defined, schema-less data that this List Item stores, represented by a JSON object, up to 16KB.
        :param unicode ttl: Time-to-live of this item in seconds, defaults to no expiration.

        :returns: Updated SyncListItemInstance
        :rtype: twilio.rest.sync.v1.service.sync_list.sync_list_item.SyncListItemInstance
        """
        data = values.of({'Data': serialize.object(data), 'Ttl': ttl, })

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

        return SyncListItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            list_sid=self._solution['list_sid'],
            index=self._solution['index'],
        )
    def create(self, to, from_, parameters=values.unset):
        """
        Create a new EngagementInstance

        :param unicode to: The Contact phone number to start a Studio Flow Engagement.
        :param unicode from_: The Twilio phone number to send messages or initiate calls from during the Flow Engagement.
        :param dict parameters: JSON data that will be added to your flow's context and can accessed as variables inside your flow.

        :returns: Newly created EngagementInstance
        :rtype: twilio.rest.studio.v1.flow.engagement.EngagementInstance
        """
        data = values.of({
            'To': to,
            'From': from_,
            'Parameters': serialize.object(parameters),
        })

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

        return EngagementInstance(
            self._version,
            payload,
            flow_sid=self._solution['flow_sid'],
        )
示例#9
0
    def create(self,
               available_add_on_sid,
               accept_terms_of_service,
               configuration=values.unset,
               unique_name=values.unset):
        """
        Create a new InstalledAddOnInstance

        :param unicode available_add_on_sid: A string that uniquely identifies the Add-on to install
        :param bool accept_terms_of_service: A boolean reflecting your acceptance of the Terms of Service
        :param dict configuration: The JSON object representing the configuration
        :param unicode unique_name: The string that uniquely identifies this Add-on installation

        :returns: Newly created InstalledAddOnInstance
        :rtype: twilio.rest.preview.marketplace.installed_add_on.InstalledAddOnInstance
        """
        data = values.of({
            'AvailableAddOnSid': available_add_on_sid,
            'AcceptTermsOfService': accept_terms_of_service,
            'Configuration': serialize.object(configuration),
            'UniqueName': unique_name,
        })

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

        return InstalledAddOnInstance(
            self._version,
            payload,
        )
示例#10
0
    def update(self, data=values.unset, ttl=values.unset):
        """
        Update the SyncMapItemInstance

        :param dict data: Contains an arbitrary JSON object to be stored in this Map Item.
        :param unicode ttl: New time-to-live of this Map in seconds.

        :returns: Updated SyncMapItemInstance
        :rtype: twilio.rest.sync.v1.service.sync_map.sync_map_item.SyncMapItemInstance
        """
        data = values.of({
            'Data': serialize.object(data),
            'Ttl': ttl,
        })

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

        return SyncMapItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            map_sid=self._solution['map_sid'],
            key=self._solution['key'],
        )
示例#11
0
    def update(self, configuration=values.unset, unique_name=values.unset):
        """
        Update the InstalledAddOnInstance

        :param dict configuration: The JSON object representing the configuration
        :param unicode unique_name: The string that uniquely identifies this Add-on installation

        :returns: Updated InstalledAddOnInstance
        :rtype: twilio.rest.preview.marketplace.installed_add_on.InstalledAddOnInstance
        """
        data = values.of({
            'Configuration': serialize.object(configuration),
            'UniqueName': unique_name,
        })

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

        return InstalledAddOnInstance(
            self._version,
            payload,
            sid=self._solution['sid'],
        )
    def update(self, initiation_actions=values.unset):
        """
        Update the AssistantInitiationActionsInstance

        :param dict initiation_actions: The initiation_actions

        :returns: Updated AssistantInitiationActionsInstance
        :rtype: twilio.rest.preview.understand.assistant.assistant_initiation_actions.AssistantInitiationActionsInstance
        """
        data = values.of({
            'InitiationActions':
            serialize.object(initiation_actions),
        })

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

        return AssistantInitiationActionsInstance(
            self._version,
            payload,
            assistant_sid=self._solution['assistant_sid'],
        )
    def create(self, key, data):
        """
        Create a new SyncMapItemInstance

        :param unicode key: The key
        :param dict data: The data

        :returns: Newly created SyncMapItemInstance
        :rtype: twilio.rest.preview.sync.service.sync_map.sync_map_item.SyncMapItemInstance
        """
        data = values.of({
            'Key': key,
            'Data': serialize.object(data),
        })

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

        return SyncMapItemInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            map_sid=self._solution['map_sid'],
        )
    def update(self,
               friendly_name=values.unset,
               unique_name=values.unset,
               actions=values.unset):
        """
        Update the IntentInstance

        :param unicode friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long.
        :param unicode unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long.
        :param dict actions: The actions

        :returns: Updated IntentInstance
        :rtype: twilio.rest.preview.understand.assistant.intent.IntentInstance
        """
        data = values.of({
            'FriendlyName': friendly_name,
            'UniqueName': unique_name,
            'Actions': serialize.object(actions),
        })

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

        return IntentInstance(
            self._version,
            payload,
            assistant_sid=self._solution['assistant_sid'],
            sid=self._solution['sid'],
        )
示例#15
0
    def create(self,
               room_sid=values.unset,
               video_layout=values.unset,
               audio_sources=values.unset,
               audio_sources_excluded=values.unset,
               resolution=values.unset,
               format=values.unset,
               status_callback=values.unset,
               status_callback_method=values.unset,
               trim=values.unset):
        """
        Create a new CompositionInstance

        :param unicode room_sid: Twilio Room SID.
        :param dict video_layout: The JSON video layout description.
        :param unicode audio_sources: A list of audio sources related to this Composition.
        :param unicode audio_sources_excluded: A list of audio sources excluded related to this Composition.
        :param unicode resolution: Pixel resolution of the composed video.
        :param CompositionInstance.Format format: Container format of the Composition media file. Any of the following: `mp4`, `webm`.
        :param unicode status_callback: A URL that Twilio sends asynchronous webhook requests to on every composition event.
        :param unicode status_callback_method: HTTP method Twilio should use when requesting the above URL.
        :param bool trim: Boolean flag for clipping intervals that have no media.

        :returns: Newly created CompositionInstance
        :rtype: twilio.rest.video.v1.composition.CompositionInstance
        """
        data = values.of({
            'RoomSid':
            room_sid,
            'VideoLayout':
            serialize.object(video_layout),
            'AudioSources':
            serialize.map(audio_sources, lambda e: e),
            'AudioSourcesExcluded':
            serialize.map(audio_sources_excluded, lambda e: e),
            'Resolution':
            resolution,
            'Format':
            format,
            'StatusCallback':
            status_callback,
            'StatusCallbackMethod':
            status_callback_method,
            'Trim':
            trim,
        })

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

        return CompositionInstance(
            self._version,
            payload,
        )
    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: A unique, developer assigned name of this Session.
        :param datetime date_expiry: The date this Session should expire
        :param unicode ttl: TTL for a Session, in seconds.
        :param SessionInstance.Mode mode: The Mode of this Session
        :param SessionInstance.Status status: Session status
        :param dict participants: The participants

        :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'],
        )
    def create(self, unique_name=values.unset, data=values.unset):
        """
        Create a new DocumentInstance

        :param unicode unique_name: The unique_name
        :param dict data: The data

        :returns: Newly created DocumentInstance
        :rtype: twilio.rest.preview.sync.service.document.DocumentInstance
        """
        data = values.of({'UniqueName': unique_name, 'Data': serialize.object(data), })

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

        return DocumentInstance(self._version, payload, service_sid=self._solution['service_sid'], )
    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 date this Session should expire
        :param unicode ttl: TTL for a Session, in seconds.
        :param SessionInstance.Mode mode: The mode
        :param SessionInstance.Status status: The Status of this Session
        :param dict participants: The participants

        :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'],
        )
    def create(self, unique_name=values.unset, data=values.unset, ttl=values.unset):
        """
        Create a new DocumentInstance

        :param unicode unique_name: Human-readable name for this document
        :param dict data: JSON data to be stored in this document
        :param unicode ttl: Time-to-live of this Document in seconds, defaults to no expiration.

        :returns: Newly created DocumentInstance
        :rtype: twilio.rest.sync.v1.service.document.DocumentInstance
        """
        data = values.of({'UniqueName': unique_name, 'Data': serialize.object(data), 'Ttl': ttl, })

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

        return DocumentInstance(self._version, payload, service_sid=self._solution['service_sid'], )
    def update(self, data):
        """
        Update the DocumentInstance

        :param dict data: The data

        :returns: Updated DocumentInstance
        :rtype: twilio.rest.preview.sync.service.document.DocumentInstance
        """
        data = values.of({'Data': serialize.object(data), })

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

        return DocumentInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
    def update(self, data=values.unset, ttl=values.unset):
        """
        Update the DocumentInstance

        :param dict data: Contains an arbitrary JSON object to be stored in this Document.
        :param unicode ttl: New time-to-live of this Document in seconds.

        :returns: Updated DocumentInstance
        :rtype: twilio.rest.sync.v1.service.document.DocumentInstance
        """
        data = values.of({'Data': serialize.object(data), 'Ttl': ttl, })

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

        return DocumentInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            sid=self._solution['sid'],
        )
    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'],
        )