/// <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)); }
/// <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)); }
/// <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)); }
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 )); }
/// <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)); }