Esempio n. 1
0
        /// <summary>
        /// Fetch a specific Business.
        /// </summary>
        /// <param name="pathSid"> A string that uniquely identifies this Business. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Business </returns>
        public static async System.Threading.Tasks.Task <BusinessResource> FetchAsync(string pathSid,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new FetchBusinessOptions(pathSid);

            return(await FetchAsync(options, client));
        }
Esempio n. 2
0
        /// <summary>
        /// Fetch a specific Business.
        /// </summary>
        /// <param name="options"> Fetch Business parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Business </returns>
        public static BusinessResource Fetch(FetchBusinessOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildFetchRequest(FetchBusinessOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/TrustedComms/Businesses/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Esempio n. 4
0
        /// <summary>
        /// Fetch a specific Business.
        /// </summary>
        /// <param name="pathSid"> A string that uniquely identifies this Business. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Business </returns>
        public static BusinessResource Fetch(string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchBusinessOptions(pathSid);

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

            return(FromJson(response.Content));
        }