/// <summary> /// Retrieve a paginated list of versions of the schema. /// </summary> /// <param name="options"> Read Version parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> A single instance of Version </returns> public static ResourceSet <VersionResource> Read(ReadVersionOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = client.Request(BuildReadRequest(options, client)); var page = Page <VersionResource> .FromJson("schema_versions", response.Content); return(new ResourceSet <VersionResource>(page, options, client)); }
private static Request BuildReadRequest(ReadVersionOptions options, ITwilioRestClient client) { return(new Request( HttpMethod.Get, Rest.Domain.Events, "/v1/Schemas/" + options.PathId + "/Versions", queryParams: options.GetParams(), headerParams: null )); }
/// <summary> /// Retrieve a paginated list of versions of the schema. /// </summary> /// <param name="pathId"> The unique identifier of the schema. </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 Version </returns> public static ResourceSet <VersionResource> Read(string pathId, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadVersionOptions(pathId) { PageSize = pageSize, Limit = limit }; return(Read(options, client)); }
/// <summary> /// Retrieve a paginated list of versions of the schema. /// </summary> /// <param name="pathId"> The unique identifier of the schema. </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 Version </returns> public static async System.Threading.Tasks.Task <ResourceSet <VersionResource> > ReadAsync(string pathId, int?pageSize = null, long?limit = null, ITwilioRestClient client = null) { var options = new ReadVersionOptions(pathId) { PageSize = pageSize, Limit = limit }; return(await ReadAsync(options, client)); }
/// <summary> /// Retrieve a paginated list of versions of the schema. /// </summary> /// <param name="options"> Read Version parameters </param> /// <param name="client"> Client to make requests to Twilio </param> /// <returns> Task that resolves to A single instance of Version </returns> public static async System.Threading.Tasks.Task <ResourceSet <VersionResource> > ReadAsync(ReadVersionOptions options, ITwilioRestClient client = null) { client = client ?? TwilioClient.GetRestClient(); var response = await client.RequestAsync(BuildReadRequest(options, client)); var page = Page <VersionResource> .FromJson("schema_versions", response.Content); return(new ResourceSet <VersionResource>(page, options, client)); }