/// <summary>
        /// Fetch a specific Event Type.
        /// </summary>
        /// <param name="pathType"> A string that uniquely identifies this Event Type. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of EventType </returns>
        public static async System.Threading.Tasks.Task <EventTypeResource> FetchAsync(string pathType,
                                                                                       ITwilioRestClient client = null)
        {
            var options = new FetchEventTypeOptions(pathType);

            return(await FetchAsync(options, client));
        }
        /// <summary>
        /// Fetch a specific Event Type.
        /// </summary>
        /// <param name="options"> Fetch EventType parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of EventType </returns>
        public static EventTypeResource Fetch(FetchEventTypeOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
 private static Request BuildFetchRequest(FetchEventTypeOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Events,
                "/v1/Types/" + options.PathType + "",
                queryParams: options.GetParams(),
                headerParams: null
                ));
 }
        /// <summary>
        /// Fetch a specific Event Type.
        /// </summary>
        /// <param name="pathType"> A string that uniquely identifies this Event Type. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of EventType </returns>
        public static EventTypeResource Fetch(string pathType, ITwilioRestClient client = null)
        {
            var options = new FetchEventTypeOptions(pathType);

            return(Fetch(options, client));
        }
        /// <summary>
        /// Fetch a specific Event Type.
        /// </summary>
        /// <param name="options"> Fetch EventType parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of EventType </returns>
        public static async System.Threading.Tasks.Task <EventTypeResource> FetchAsync(FetchEventTypeOptions options,
                                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }