/// <summary>
        /// Fetch a Network Access Profile resource's Network resource.
        /// </summary>
        /// <param name="pathNetworkAccessProfileSid"> The unique string that identifies the Network Access Profile resource
        ///                                   </param>
        /// <param name="pathSid"> The SID of the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of NetworkAccessProfileNetwork </returns>
        public static async System.Threading.Tasks.Task <NetworkAccessProfileNetworkResource> FetchAsync(string pathNetworkAccessProfileSid,
                                                                                                         string pathSid,
                                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, pathSid);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// Fetch a Network Access Profile resource's Network resource.
        /// </summary>
        /// <param name="pathNetworkAccessProfileSid"> The unique string that identifies the Network Access Profile resource
        ///                                   </param>
        /// <param name="pathSid"> The SID of the resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of NetworkAccessProfileNetwork </returns>
        public static NetworkAccessProfileNetworkResource Fetch(string pathNetworkAccessProfileSid,
                                                                string pathSid,
                                                                ITwilioRestClient client = null)
        {
            var options = new FetchNetworkAccessProfileNetworkOptions(pathNetworkAccessProfileSid, pathSid);

            return(Fetch(options, client));
        }
        /// <summary>
        /// Fetch a Network Access Profile resource's Network resource.
        /// </summary>
        /// <param name="options"> Fetch NetworkAccessProfileNetwork parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of NetworkAccessProfileNetwork </returns>
        public static NetworkAccessProfileNetworkResource Fetch(FetchNetworkAccessProfileNetworkOptions options,
                                                                ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #4
0
 private static Request BuildFetchRequest(FetchNetworkAccessProfileNetworkOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Supersim,
                "/v1/NetworkAccessProfiles/" + options.PathNetworkAccessProfileSid + "/Networks/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Fetch a Network Access Profile resource's Network resource.
        /// </summary>
        /// <param name="options"> Fetch NetworkAccessProfileNetwork parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of NetworkAccessProfileNetwork </returns>
        public static async System.Threading.Tasks.Task <NetworkAccessProfileNetworkResource> FetchAsync(FetchNetworkAccessProfileNetworkOptions options,
                                                                                                         ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }