Exemplo n.º 1
0
        /// <summary>
        /// Update configuration settings of a conversation service
        /// </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));
        }
Exemplo n.º 2
0
 private static Request BuildUpdateRequest(UpdateConfigurationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Conversations,
                "/v1/Services/" + options.PathChatServiceSid + "/Configuration",
                postParams: options.GetParams(),
                headerParams: null
                ));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Update configuration settings of a conversation service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Service configuration resource to update </param>
        /// <param name="defaultConversationCreatorRoleSid"> The role assigned to a conversation creator when they join a new
        ///                                         conversation </param>
        /// <param name="defaultConversationRoleSid"> The role assigned to users when they are added to a conversation </param>
        /// <param name="defaultChatServiceRoleSid"> The service role assigned to users when they are added to the service
        ///                                 </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 pathChatServiceSid,
                                                                                            string defaultConversationCreatorRoleSid = null,
                                                                                            string defaultConversationRoleSid        = null,
                                                                                            string defaultChatServiceRoleSid         = null,
                                                                                            ITwilioRestClient client = null)
        {
            var options = new UpdateConfigurationOptions(pathChatServiceSid)
            {
                DefaultConversationCreatorRoleSid = defaultConversationCreatorRoleSid, DefaultConversationRoleSid = defaultConversationRoleSid, DefaultChatServiceRoleSid = defaultChatServiceRoleSid
            };

            return(await UpdateAsync(options, client));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Update configuration settings of a conversation service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Service configuration resource to update </param>
        /// <param name="defaultConversationCreatorRoleSid"> The role assigned to a conversation creator when they join a new
        ///                                         conversation </param>
        /// <param name="defaultConversationRoleSid"> The role assigned to users when they are added to a conversation </param>
        /// <param name="defaultChatServiceRoleSid"> The service role assigned to users when they are added to the service
        ///                                 </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Configuration </returns>
        public static ConfigurationResource Update(string pathChatServiceSid,
                                                   string defaultConversationCreatorRoleSid = null,
                                                   string defaultConversationRoleSid        = null,
                                                   string defaultChatServiceRoleSid         = null,
                                                   ITwilioRestClient client = null)
        {
            var options = new UpdateConfigurationOptions(pathChatServiceSid)
            {
                DefaultConversationCreatorRoleSid = defaultConversationCreatorRoleSid, DefaultConversationRoleSid = defaultConversationRoleSid, DefaultChatServiceRoleSid = defaultChatServiceRoleSid
            };

            return(Update(options, client));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Update configuration settings of a conversation service
        /// </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));
        }