/// <summary> /// Retrieve a list of Network resources. /// </summary> /// <param name="options"> Read Network parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Network </returns> public static ResourceSet <NetworkResource> Read(ReadNetworkOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <NetworkResource> .FromJson("networks", response.Content); return(new ResourceSet <NetworkResource>(page, options, client)); }
private static Request BuildReadRequest(ReadNetworkOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Supersim, "/v1/Networks", queryParams: options.GetParams() )); }
/// <summary> /// Retrieve a list of Network resources. /// </summary> /// <param name="isoCountry"> The ISO country code of the Network resources to read </param> /// <param name="mcc"> The MCC of Network resource identifiers to be read </param> /// <param name="mnc"> The MNC of Network resource identifiers to be read </param> /// <param name="pageSize"> Page size </param> /// <param name="limit"> Record limit </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Network </returns> public static async System.Threading.Tasks.Task <ResourceSet <NetworkResource> > ReadAsync(string isoCountry = null, string mcc = null, string mnc = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadNetworkOptions() { IsoCountry = isoCountry, Mcc = mcc, Mnc = mnc, PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a list of Network resources. /// </summary> /// <param name="isoCountry"> The ISO country code of the Network resources to read </param> /// <param name="mcc"> The MCC of Network resource identifiers to be read </param> /// <param name="mnc"> The MNC of Network resource identifiers to be read </param> /// <param name="pageSize"> Page size </param> /// <param name="limit"> Record limit </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Network </returns> public static ResourceSet <NetworkResource> Read(string isoCountry = null, string mcc = null, string mnc = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadNetworkOptions() { IsoCountry = isoCountry, Mcc = mcc, Mnc = mnc, PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// Retrieve a list of Network resources. /// </summary> /// <param name="options"> Read Network parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Network </returns> public static async System.Threading.Tasks.Task <ResourceSet <NetworkResource> > ReadAsync(ReadNetworkOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <NetworkResource> .FromJson("networks", response.Content); return(new ResourceSet <NetworkResource>(page, options, client)); }