示例#1
0
        /// <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));
        }
示例#2
0
 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
                ));
 }
示例#3
0
        /// <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));
        }
示例#4
0
        /// <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));
        }
示例#5
0
        /// <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));
        }