/// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch TaskChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskChannel </returns>
        public static TaskChannelResource Fetch(FetchTaskChannelOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathWorkspaceSid"> The unique ID of the Workspace that this TaskChannel belongs to. </param>
        /// <param name="pathSid"> The unique ID for this TaskChannel. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskChannel </returns>
        public static async System.Threading.Tasks.Task <TaskChannelResource> FetchAsync(string pathWorkspaceSid,
                                                                                         string pathSid,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchTaskChannelOptions(pathWorkspaceSid, pathSid);

            return(await FetchAsync(options, client));
        }
Exemplo n.º 3
0
 private static Request BuildFetchRequest(FetchTaskChannelOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Taskrouter,
                "/v1/Workspaces/" + options.PathWorkspaceSid + "/TaskChannels/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathWorkspaceSid"> The unique ID of the Workspace that this TaskChannel belongs to. </param>
        /// <param name="pathSid"> The unique ID for this TaskChannel. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of TaskChannel </returns>
        public static TaskChannelResource Fetch(string pathWorkspaceSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchTaskChannelOptions(pathWorkspaceSid, pathSid);

            return(Fetch(options, client));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="options"> Fetch TaskChannel parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TaskChannel </returns>
        public static async System.Threading.Tasks.Task <TaskChannelResource> FetchAsync(FetchTaskChannelOptions options,
                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }