Пример #1
0
        /// <summary>
        /// Fetch a specific schema with its nested versions.
        /// </summary>
        /// <param name="pathId"> The unique identifier of the schema. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Schema </returns>
        public static async System.Threading.Tasks.Task <SchemaResource> FetchAsync(string pathId,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new FetchSchemaOptions(pathId);

            return(await FetchAsync(options, client));
        }
Пример #2
0
        /// <summary>
        /// Fetch a specific schema with its nested versions.
        /// </summary>
        /// <param name="options"> Fetch Schema parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Schema </returns>
        public static SchemaResource Fetch(FetchSchemaOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Пример #3
0
        /// <summary>
        /// Fetch a specific schema with its nested versions.
        /// </summary>
        /// <param name="options"> Fetch Schema parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Schema </returns>
        public static async System.Threading.Tasks.Task <SchemaResource> FetchAsync(FetchSchemaOptions options,
                                                                                    ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Пример #4
0
 private static Request BuildFetchRequest(FetchSchemaOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Events,
                "/v1/Schemas/" + options.PathId + "",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
Пример #5
0
        /// <summary>
        /// Fetch a specific schema with its nested versions.
        /// </summary>
        /// <param name="pathId"> The unique identifier of the schema. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Schema </returns>
        public static SchemaResource Fetch(string pathId, ITwilioRestClient client = null)
        {
            var options = new FetchSchemaOptions(pathId);

            return(Fetch(options, client));
        }