Ejemplo n.º 1
0
        /// <summary>
        /// Update the given properties of a specific Device in the Fleet, giving it a friendly name, assigning to a Deployment,
        /// or a human identity.
        /// </summary>
        /// <param name="options"> Update Device parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Device </returns>
        public static DeviceResource Update(UpdateDeviceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Update the given properties of a specific Device in the Fleet, giving it a friendly name, assigning to a Deployment,
        /// or a human identity.
        /// </summary>
        ///
        /// <param name="options"> Update Device parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Device </returns>
        public static async System.Threading.Tasks.Task <DeviceResource> UpdateAsync(UpdateDeviceOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Update the given properties of a specific Device in the Fleet, giving it a friendly name, assigning to a Deployment,
        /// or a human identity.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pathSid"> A string that uniquely identifies the Device. </param>
        /// <param name="friendlyName"> A human readable description for this Device. </param>
        /// <param name="identity"> An identifier of the Device user. </param>
        /// <param name="deploymentSid"> The unique SID of the Deployment group. </param>
        /// <param name="enabled"> The enabled </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Device </returns>
        public static async System.Threading.Tasks.Task <DeviceResource> UpdateAsync(string pathFleetSid, string pathSid, string friendlyName = null, string identity = null, string deploymentSid = null, bool?enabled = null, ITwilioRestClient client = null)
        {
            var options = new UpdateDeviceOptions(pathFleetSid, pathSid)
            {
                FriendlyName = friendlyName, Identity = identity, DeploymentSid = deploymentSid, Enabled = enabled
            };

            return(await UpdateAsync(options, client));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Update the given properties of a specific Device in the Fleet, giving it a friendly name, assigning to a Deployment,
        /// or a human identity.
        /// </summary>
        ///
        /// <param name="pathFleetSid"> The fleet_sid </param>
        /// <param name="pathSid"> A string that uniquely identifies the Device. </param>
        /// <param name="friendlyName"> A human readable description for this Device. </param>
        /// <param name="identity"> An identifier of the Device user. </param>
        /// <param name="deploymentSid"> The unique SID of the Deployment group. </param>
        /// <param name="enabled"> The enabled </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Device </returns>
        public static DeviceResource Update(string pathFleetSid, string pathSid, string friendlyName = null, string identity = null, string deploymentSid = null, bool?enabled = null, ITwilioRestClient client = null)
        {
            var options = new UpdateDeviceOptions(pathFleetSid, pathSid)
            {
                FriendlyName = friendlyName, Identity = identity, DeploymentSid = deploymentSid, Enabled = enabled
            };

            return(Update(options, client));
        }
 private static Request BuildUpdateRequest(UpdateDeviceOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/DeployedDevices/Fleets/" + options.PathFleetSid + "/Devices/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }