/// <summary>
        /// Fetch a specific Entity.
        /// </summary>
        /// <param name="options"> Fetch Entity parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Entity </returns>
        public static EntityResource Fetch(FetchEntityOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// Fetch a specific Entity.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Entity </returns>
        public static async System.Threading.Tasks.Task <EntityResource> FetchAsync(string pathServiceSid,
                                                                                    string pathIdentity,
                                                                                    ITwilioRestClient client = null)
        {
            var options = new FetchEntityOptions(pathServiceSid, pathIdentity);

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

            return(FromJson(response.Content));
        }
 private static Request BuildFetchRequest(FetchEntityOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Authy,
                "/v1/Services/" + options.PathServiceSid + "/Entities/" + options.PathIdentity + "",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Fetch a specific Entity.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="pathIdentity"> Unique identity of the Entity </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Entity </returns>
        public static EntityResource Fetch(string pathServiceSid, string pathIdentity, ITwilioRestClient client = null)
        {
            var options = new FetchEntityOptions(pathServiceSid, pathIdentity);

            return(Fetch(options, client));
        }