Beispiel #1
0
        /// <summary>
        /// Retrieve a specific environment.
        /// </summary>
        /// <param name="options"> Fetch Environment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Environment </returns>
        public static EnvironmentResource Fetch(FetchEnvironmentOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }
Beispiel #2
0
        /// <summary>
        /// Retrieve a specific environment.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the Environment resource from </param>
        /// <param name="pathSid"> The SID of the Environment resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Environment </returns>
        public static async System.Threading.Tasks.Task <EnvironmentResource> FetchAsync(string pathServiceSid,
                                                                                         string pathSid,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchEnvironmentOptions(pathServiceSid, pathSid);

            return(await FetchAsync(options, client));
        }
Beispiel #3
0
 private static Request BuildFetchRequest(FetchEnvironmentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Environments/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Beispiel #4
0
        /// <summary>
        /// Retrieve a specific environment.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the Environment resource from </param>
        /// <param name="pathSid"> The SID of the Environment resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Environment </returns>
        public static EnvironmentResource Fetch(string pathServiceSid, string pathSid, ITwilioRestClient client = null)
        {
            var options = new FetchEnvironmentOptions(pathServiceSid, pathSid);

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

            return(FromJson(response.Content));
        }