コード例 #1
0
        /// <summary>
        /// Fetch the configuration of a conversation service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Service configuration resource to fetch </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> FetchAsync(string pathChatServiceSid,
                                                                                           ITwilioRestClient client = null)
        {
            var options = new FetchConfigurationOptions(pathChatServiceSid);

            return(await FetchAsync(options, client));
        }
コード例 #2
0
        /// <summary>
        /// Fetch the configuration of a conversation service
        /// </summary>
        /// <param name="options"> Fetch Configuration parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Configuration </returns>
        public static ConfigurationResource Fetch(FetchConfigurationOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #3
0
 private static Request BuildFetchRequest(FetchConfigurationOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Conversations,
                "/v1/Services/" + options.PathChatServiceSid + "/Configuration",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
コード例 #4
0
        /// <summary>
        /// Fetch the configuration of a conversation service
        /// </summary>
        /// <param name="pathChatServiceSid"> The SID of the Service configuration resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Configuration </returns>
        public static ConfigurationResource Fetch(string pathChatServiceSid, ITwilioRestClient client = null)
        {
            var options = new FetchConfigurationOptions(pathChatServiceSid);

            return(Fetch(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Fetch the configuration of a conversation service
        /// </summary>
        /// <param name="options"> Fetch 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> FetchAsync(FetchConfigurationOptions options,
                                                                                           ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }