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

            return(FromJson(response.Content));
        }
Beispiel #2
0
        /// <summary>
        /// Fetch a specific AuthorizationDocument.
        /// </summary>
        /// <param name="pathSid"> AuthorizationDocument sid. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of AuthorizationDocument </returns>
        public static async System.Threading.Tasks.Task <AuthorizationDocumentResource> FetchAsync(string pathSid,
                                                                                                   ITwilioRestClient client = null)
        {
            var options = new FetchAuthorizationDocumentOptions(pathSid);

            return(await FetchAsync(options, client));
        }
Beispiel #3
0
 private static Request BuildFetchRequest(FetchAuthorizationDocumentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/HostedNumbers/AuthorizationDocuments/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Beispiel #4
0
        /// <summary>
        /// Fetch a specific AuthorizationDocument.
        /// </summary>
        /// <param name="pathSid"> AuthorizationDocument sid. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of AuthorizationDocument </returns>
        public static AuthorizationDocumentResource Fetch(string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchAuthorizationDocumentOptions(pathSid);

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

            return(FromJson(response.Content));
        }