Example #1
0
        /// <summary>
        /// Retrieve a list of all Deployments belonging to the Fleet.
        /// </summary>
        /// <param name="options"> Read Deployment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Deployment </returns>
        public static ResourceSet <DeploymentResource> Read(ReadDeploymentOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildReadRequest(options, client));

            var page = Page <DeploymentResource> .FromJson("deployments", response.Content);

            return(new ResourceSet <DeploymentResource>(page, options, client));
        }
        /// <summary>
        /// Retrieve a list of all Deployments belonging to the Fleet.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </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 <ResourceSet <DeploymentResource> > ReadAsync(string pathFleetSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadDeploymentOptions(pathFleetSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
 private static Request BuildReadRequest(ReadDeploymentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Get,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Deployments",
                queryParams: options.GetParams()
                ));
 }
        /// <summary>
        /// Retrieve a list of all Deployments belonging to the Fleet.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Deployment </returns>
        public static ResourceSet <DeploymentResource> Read(string pathFleetSid, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadDeploymentOptions(pathFleetSid)
            {
                PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Example #5
0
        /// <summary>
        /// Retrieve a list of all Deployments belonging to the Fleet.
        /// </summary>
        /// <param name="options"> Read 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 <ResourceSet <DeploymentResource> > ReadAsync(ReadDeploymentOptions options,
                                                                                                      ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildReadRequest(options, client));

            var page = Page <DeploymentResource> .FromJson("deployments", response.Content);

            return(new ResourceSet <DeploymentResource>(page, options, client));
        }