コード例 #1
0
        /// <summary>
        /// Fetch a specific a Brand.
        /// </summary>
        /// <param name="options"> Fetch Brand parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Brand </returns>
        public static BrandResource Fetch(FetchBrandOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #2
0
        /// <summary>
        /// Fetch a specific a Brand.
        /// </summary>
        /// <param name="pathBusinessSid"> Business Sid. </param>
        /// <param name="pathSid"> Brand Sid. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Brand </returns>
        public static async System.Threading.Tasks.Task <BrandResource> FetchAsync(string pathBusinessSid,
                                                                                   string pathSid,
                                                                                   ITwilioRestClient client = null)
        {
            var options = new FetchBrandOptions(pathBusinessSid, pathSid);

            return(await FetchAsync(options, client));
        }
コード例 #3
0
        /// <summary>
        /// Fetch a specific a Brand.
        /// </summary>
        /// <param name="options"> Fetch Brand parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Brand </returns>
        public static async System.Threading.Tasks.Task <BrandResource> FetchAsync(FetchBrandOptions options,
                                                                                   ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #4
0
 private static Request BuildFetchRequest(FetchBrandOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/TrustedComms/Businesses/" + options.PathBusinessSid + "/Brands/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
コード例 #5
0
        /// <summary>
        /// Fetch a specific a Brand.
        /// </summary>
        /// <param name="pathBusinessSid"> Business Sid. </param>
        /// <param name="pathSid"> Brand Sid. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Brand </returns>
        public static BrandResource Fetch(string pathBusinessSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchBrandOptions(pathBusinessSid, pathSid);

            return(Fetch(options, client));
        }