Example #1
0
        /// <summary>
        /// Fetch a specific schema and version.
        /// </summary>
        /// <param name="options"> Fetch Version parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Version </returns>
        public static VersionResource Fetch(FetchVersionOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #2
0
        /// <summary>
        /// Fetch a specific schema and version.
        /// </summary>
        /// <param name="pathId"> The unique identifier of the schema. </param>
        /// <param name="pathSchemaVersion"> The version of the schema </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 <VersionResource> FetchAsync(string pathId,
                                                                                     int?pathSchemaVersion,
                                                                                     ITwilioRestClient client = null)
        {
            var options = new FetchVersionOptions(pathId, pathSchemaVersion);

            return(await FetchAsync(options, client));
        }
Example #3
0
        /// <summary>
        /// Fetch a specific schema and version.
        /// </summary>
        /// <param name="options"> Fetch 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 <VersionResource> FetchAsync(FetchVersionOptions options,
                                                                                     ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Example #4
0
 private static Request BuildFetchRequest(FetchVersionOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Events,
                "/v1/Schemas/" + options.PathId + "/Versions/" + options.PathSchemaVersion + "",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
Example #5
0
        /// <summary>
        /// Fetch a specific schema and version.
        /// </summary>
        /// <param name="pathId"> The unique identifier of the schema. </param>
        /// <param name="pathSchemaVersion"> The version of the schema </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Version </returns>
        public static VersionResource Fetch(string pathId, int?pathSchemaVersion, ITwilioRestClient client = null)
        {
            var options = new FetchVersionOptions(pathId, pathSchemaVersion);

            return(Fetch(options, client));
        }