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

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Messaging Service to fetch the resource from </param>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AlphaSender </returns>
        public static async System.Threading.Tasks.Task <AlphaSenderResource> FetchAsync(string pathServiceSid,
                                                                                         string pathSid,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchAlphaSenderOptions(pathServiceSid, pathSid);

            return(await FetchAsync(options, client));
        }
Example #3
0
 private static Request BuildFetchRequest(FetchAlphaSenderOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Messaging,
                "/v1/Services/" + options.PathServiceSid + "/AlphaSenders/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Example #4
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Messaging Service to fetch the resource from </param>
        /// <param name="pathSid"> The SID that identifies the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AlphaSender </returns>
        public static AlphaSenderResource Fetch(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchAlphaSenderOptions(pathServiceSid, pathSid);

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

            return(FromJson(response.Content));
        }