Beispiel #1
0
        /// <summary>
        /// Update the global configuration of conversations on your account
        /// </summary>
        /// <param name="options"> Update Configuration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Configuration </returns>
        public static ConfigurationResource Update(UpdateConfigurationOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #2
0
 private static Request BuildUpdateRequest(UpdateConfigurationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Configuration",
                postParams: options.GetParams(),
                headerParams: null
                ));
 }
Beispiel #3
0
        /// <summary>
        /// Update the global configuration of conversations on your account
        /// </summary>
        /// <param name="defaultChatServiceSid"> The SID of the default Conversation Service that every new conversation will
        ///                             be associated with. </param>
        /// <param name="defaultMessagingServiceSid"> The SID of the default Messaging Service that every new conversation will
        ///                                  be associated with. </param>
        /// <param name="defaultInactiveTimer"> Default ISO8601 duration when conversation will be switched to `inactive`
        ///                            state. </param>
        /// <param name="defaultClosedTimer"> Default ISO8601 duration when conversation will be switched to `closed` state.
        ///                          </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Configuration </returns>
        public static async System.Threading.Tasks.Task <ConfigurationResource> UpdateAsync(string defaultChatServiceSid      = null,
                                                                                            string defaultMessagingServiceSid = null,
                                                                                            string defaultInactiveTimer       = null,
                                                                                            string defaultClosedTimer         = null,
                                                                                            ITwilioRestClient client          = null)
        {
            var options = new UpdateConfigurationOptions()
            {
                DefaultChatServiceSid = defaultChatServiceSid, DefaultMessagingServiceSid = defaultMessagingServiceSid, DefaultInactiveTimer = defaultInactiveTimer, DefaultClosedTimer = defaultClosedTimer
            };

            return(await UpdateAsync(options, client));
        }
Beispiel #4
0
        /// <summary>
        /// Update the global configuration of conversations on your account
        /// </summary>
        /// <param name="defaultChatServiceSid"> The SID of the default Conversation Service that every new conversation will
        ///                             be associated with. </param>
        /// <param name="defaultMessagingServiceSid"> The SID of the default Messaging Service that every new conversation will
        ///                                  be associated with. </param>
        /// <param name="defaultInactiveTimer"> Default ISO8601 duration when conversation will be switched to `inactive`
        ///                            state. </param>
        /// <param name="defaultClosedTimer"> Default ISO8601 duration when conversation will be switched to `closed` state.
        ///                          </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Configuration </returns>
        public static ConfigurationResource Update(string defaultChatServiceSid      = null,
                                                   string defaultMessagingServiceSid = null,
                                                   string defaultInactiveTimer       = null,
                                                   string defaultClosedTimer         = null,
                                                   ITwilioRestClient client          = null)
        {
            var options = new UpdateConfigurationOptions()
            {
                DefaultChatServiceSid = defaultChatServiceSid, DefaultMessagingServiceSid = defaultMessagingServiceSid, DefaultInactiveTimer = defaultInactiveTimer, DefaultClosedTimer = defaultClosedTimer
            };

            return(Update(options, client));
        }
Beispiel #5
0
        /// <summary>
        /// Update the global configuration of conversations on your account
        /// </summary>
        /// <param name="options"> Update Configuration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Configuration </returns>
        public static async System.Threading.Tasks.Task <ConfigurationResource> UpdateAsync(UpdateConfigurationOptions options,
                                                                                            ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }