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

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

            return(await FetchAsync(options, client));
        }
Example #3
0
        /// <summary>
        /// Retrieve a specific deployment.
        /// </summary>
        /// <param name="pathServiceSid"> The SID of the Service to fetch the Deployment resource from </param>
        /// <param name="pathEnvironmentSid"> The SID of the environment used by the Deployment to fetch </param>
        /// <param name="pathSid"> The SID that identifies the Deployment resource to fetch </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Deployment </returns>
        public static DeploymentResource Fetch(string pathServiceSid,
                                               string pathEnvironmentSid,
                                               string pathSid,
                                               ITwilioRestClient client = null)
        {
            var options = new FetchDeploymentOptions(pathServiceSid, pathEnvironmentSid, pathSid);

            return(Fetch(options, client));
        }
Example #4
0
 private static Request BuildFetchRequest(FetchDeploymentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Serverless,
                "/v1/Services/" + options.PathServiceSid + "/Environments/" + options.PathEnvironmentSid + "/Deployments/" + options.PathSid + "",
                queryParams: options.GetParams()
                ));
 }
Example #5
0
        /// <summary>
        /// Retrieve a specific deployment.
        /// </summary>
        /// <param name="options"> Fetch Deployment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Deployment </returns>
        public static async System.Threading.Tasks.Task <DeploymentResource> FetchAsync(FetchDeploymentOptions options,
                                                                                        ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildFetchRequest(options, client));

            return(FromJson(response.Content));
        }