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

            return(FromJson(response.Content));
        }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathTrunkSid"> The SID of the Trunk from which to fetch the credential list </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CredentialList </returns>
        public static async System.Threading.Tasks.Task <CredentialListResource> FetchAsync(string pathTrunkSid,
                                                                                            string pathSid,
                                                                                            ITwilioRestClient client = null)
        {
            var options = new FetchCredentialListOptions(pathTrunkSid, pathSid);

            return(await FetchAsync(options, client));
        }
Пример #3
0
 private static Request BuildFetchRequest(FetchCredentialListOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Trunking,
                "/v1/Trunks/" + options.PathTrunkSid + "/CredentialLists/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathTrunkSid"> The SID of the Trunk from which to fetch the credential list </param>
        /// <param name="pathSid"> The unique string that identifies the resource </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CredentialList </returns>
        public static CredentialListResource Fetch(string pathTrunkSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchCredentialListOptions(pathTrunkSid, pathSid);

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

            return(FromJson(response.Content));
        }