Exemplo n.º 1
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="options"> Update Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(UpdateServiceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="pathSid"> The sid </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="apnCredentialSid"> The apn_credential_sid </param>
        /// <param name="gcmCredentialSid"> The gcm_credential_sid </param>
        /// <param name="messagingServiceSid"> The messaging_service_sid </param>
        /// <param name="facebookMessengerPageId"> The facebook_messenger_page_id </param>
        /// <param name="defaultApnNotificationProtocolVersion"> The default_apn_notification_protocol_version </param>
        /// <param name="defaultGcmNotificationProtocolVersion"> The default_gcm_notification_protocol_version </param>
        /// <param name="fcmCredentialSid"> The fcm_credential_sid </param>
        /// <param name="defaultFcmNotificationProtocolVersion"> The default_fcm_notification_protocol_version </param>
        /// <param name="logEnabled"> The log_enabled </param>
        /// <param name="alexaSkillId"> The alexa_skill_id </param>
        /// <param name="defaultAlexaNotificationProtocolVersion"> The default_alexa_notification_protocol_version </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(string pathSid, string friendlyName = null, string apnCredentialSid = null, string gcmCredentialSid = null, string messagingServiceSid = null, string facebookMessengerPageId = null, string defaultApnNotificationProtocolVersion = null, string defaultGcmNotificationProtocolVersion = null, string fcmCredentialSid = null, string defaultFcmNotificationProtocolVersion = null, bool?logEnabled = null, string alexaSkillId = null, string defaultAlexaNotificationProtocolVersion = null, ITwilioRestClient client = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, ApnCredentialSid = apnCredentialSid, GcmCredentialSid = gcmCredentialSid, MessagingServiceSid = messagingServiceSid, FacebookMessengerPageId = facebookMessengerPageId, DefaultApnNotificationProtocolVersion = defaultApnNotificationProtocolVersion, DefaultGcmNotificationProtocolVersion = defaultGcmNotificationProtocolVersion, FcmCredentialSid = fcmCredentialSid, DefaultFcmNotificationProtocolVersion = defaultFcmNotificationProtocolVersion, LogEnabled = logEnabled, AlexaSkillId = alexaSkillId, DefaultAlexaNotificationProtocolVersion = defaultAlexaNotificationProtocolVersion
            };

            return(await UpdateAsync(options, client));
        }
 private static Request BuildUpdateRequest(UpdateServiceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Notify,
                "/v1/Services/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// update
        /// </summary>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="apnCredentialSid"> The SID of the Credential to use for APN Bindings </param>
        /// <param name="gcmCredentialSid"> The SID of the Credential to use for GCM Bindings </param>
        /// <param name="messagingServiceSid"> The SID of the Messaging Service to use for SMS Bindings </param>
        /// <param name="facebookMessengerPageId"> Deprecated </param>
        /// <param name="defaultApnNotificationProtocolVersion"> The protocol version to use for sending APNS notifications
        ///                                             </param>
        /// <param name="defaultGcmNotificationProtocolVersion"> The protocol version to use for sending GCM notifications
        ///                                             </param>
        /// <param name="fcmCredentialSid"> The SID of the Credential to use for FCM Bindings </param>
        /// <param name="defaultFcmNotificationProtocolVersion"> The protocol version to use for sending FCM notifications
        ///                                             </param>
        /// <param name="logEnabled"> Whether to log notifications </param>
        /// <param name="alexaSkillId"> Deprecated </param>
        /// <param name="defaultAlexaNotificationProtocolVersion"> Deprecated </param>
        /// <param name="deliveryCallbackUrl"> Webhook URL </param>
        /// <param name="deliveryCallbackEnabled"> Enable delivery callbacks </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Service </returns>
        public static ServiceResource Update(string pathSid,
                                             string friendlyName            = null,
                                             string apnCredentialSid        = null,
                                             string gcmCredentialSid        = null,
                                             string messagingServiceSid     = null,
                                             string facebookMessengerPageId = null,
                                             string defaultApnNotificationProtocolVersion = null,
                                             string defaultGcmNotificationProtocolVersion = null,
                                             string fcmCredentialSid = null,
                                             string defaultFcmNotificationProtocolVersion = null,
                                             bool?logEnabled     = null,
                                             string alexaSkillId = null,
                                             string defaultAlexaNotificationProtocolVersion = null,
                                             string deliveryCallbackUrl   = null,
                                             bool?deliveryCallbackEnabled = null,
                                             ITwilioRestClient client     = null)
        {
            var options = new UpdateServiceOptions(pathSid)
            {
                FriendlyName = friendlyName, ApnCredentialSid = apnCredentialSid, GcmCredentialSid = gcmCredentialSid, MessagingServiceSid = messagingServiceSid, FacebookMessengerPageId = facebookMessengerPageId, DefaultApnNotificationProtocolVersion = defaultApnNotificationProtocolVersion, DefaultGcmNotificationProtocolVersion = defaultGcmNotificationProtocolVersion, FcmCredentialSid = fcmCredentialSid, DefaultFcmNotificationProtocolVersion = defaultFcmNotificationProtocolVersion, LogEnabled = logEnabled, AlexaSkillId = alexaSkillId, DefaultAlexaNotificationProtocolVersion = defaultAlexaNotificationProtocolVersion, DeliveryCallbackUrl = deliveryCallbackUrl, DeliveryCallbackEnabled = deliveryCallbackEnabled
            };

            return(Update(options, client));
        }
Exemplo n.º 5
0
        /// <summary>
        /// update
        /// </summary>
        ///
        /// <param name="options"> Update Service parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Service </returns>
        public static async System.Threading.Tasks.Task <ServiceResource> UpdateAsync(UpdateServiceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }