File tree Expand file tree Collapse file tree 6 files changed +116
-4
lines changed
deployed-devices/rest/devices/update-device Expand file tree Collapse file tree 6 files changed +116
-4
lines changed Original file line number Diff line number Diff line change 1- const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
2- const authToken = 'your_auth_token' ;
1+ // Get the Node helper library from https://twilio.com/docs/libraries/node
2+ const fs = require ( 'fs' ) ;
33const Twilio = require ( 'twilio' ) . Twilio ;
44
5+ // Get your Account SID and Auth Token from https://twilio.com/console
6+ const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
7+ const authToken = 'your_auth_token' ;
58const client = new Twilio ( accountSid , authToken ) ;
6- const fleet = client . preview . deployed_devices . fleets ( 'FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ) ;
79
8- fleet
10+ const fleetSid = 'FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ;
11+ const fleetService = client . preview . deployed_devices . fleets ( fleetSid ) ;
12+
13+ fleetService
914 . devices ( 'THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' )
1015 . update ( {
1116 friendlyName : 'My New Device' ,
Original file line number Diff line number Diff line change 1+ // Get the Node helper library from https://twilio.com/docs/libraries/csharp
2+ using System ;
3+ using System . Collections . Generic ;
4+ using Twilio ;
5+ using Twilio . Rest . Preview . DeployedDevices . Fleet
6+
7+ public class Example
8+ {
9+ public static void Main ( string [ ] args )
10+ {
11+ // Get your Account SID and Auth Token from https://twilio.com/console
12+ const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
13+ const string authToken = "your_auth_token" ;
14+ TwilioClient . Init ( accountSid , authToken ) ;
15+
16+ const string fleetSid = "FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
17+ const string deviceSid = "THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
18+
19+ DeviceResource device = DeviceResource
20+ . Fetch ( fleetSid , deviceSid )
21+ . Update ( friendlyName : "My New Device" , identity : "bob@twilio.com" ) ;
22+
23+ Console . WriteLine ( device . FriendlyName ) ;
24+ }
25+ }
Original file line number Diff line number Diff line change 1+ <?php
2+ // Get the Node helper library from https://twilio.com/docs/libraries/php
3+ require_once '/path/to/vendor/autoload.php ' ; // Loads the library
4+
5+ use Twilio \Rest \Client ;
6+
7+ // Get your Account SID and Auth Token from https://twilio.com/console
8+ $ accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' ;
9+ $ authToken = 'your_auth_token ' ;
10+ $ client = new Client ($ sid , $ token );
11+
12+ $ fleetSid = 'FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ' ;
13+ $ fleetService = $ client ->preview ->deployedDevices ->fleets ($ fleetSid );
14+
15+ $ deviceSid = "THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX " ;
16+ $ device = $ fleetService ->devices ($ deviceSid )
17+ ->fetch ()
18+ ->update ([
19+ 'FriendlyName ' => "My New Device " ,
20+ 'identity ' => "bob@twilio.com " ,
21+ ]);
22+
23+ echo $ device ->friendlyName ;
Original file line number Diff line number Diff line change 1+ # Get the Node helper library from https://twilio.com/docs/libraries/ruby
2+ require 'twilio-ruby'
3+
4+ # Get your Account SID and Auth Token from https://twilio.com/console
5+ account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
6+ auth_token = 'your_auth_token'
7+ client = Twilio ::REST ::Client . new ( account_sid , auth_token )
8+
9+ fleet_sid = 'FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
10+ fleet_service = client . preview . deployed_devices . fleets ( fleet_sid )
11+
12+ device = fleet_service
13+ . devices ( 'THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' )
14+ . fetch ( )
15+ . update ( friendly_name : "My New Device" , identity : "bob@twilio.com" )
16+
17+ puts device . friendly_name
Original file line number Diff line number Diff line change 1+ # Get the Node helper library from https://twilio.com/docs/libraries/python
2+ from pathlib import Path
3+ from Twilio .rest import Client
4+
5+ # Get your Account SID and Auth Token from https://twilio.com/console
6+ account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
7+ auth_token = 'your_auth_token'
8+ client = Client (account_sid , auth_token )
9+
10+ fleet_sid = 'FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
11+ fleet_service = client .preview .deployed_devices .fleets (fleet_sid )
12+
13+ device = fleet_service \
14+ .devices ('THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' )\
15+ .fetch ()\
16+ .update (friendly_name = "My New Device" ,
17+ identity = "bob@twilio.com" )
18+
19+ print (device .friendly_name )
Original file line number Diff line number Diff line change 1+ // Get the Node helper library from https://twilio.com/docs/libraries/java
2+ import com .twilio .Twilio ;
3+ import com .twilio .base .ResourceSet ;
4+ import com .twilio .rest .preview .deployedDevices .fleet ;
5+
6+ public class Example {
7+ // Get your Account SID and Auth Token from https://twilio.com/console
8+ public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
9+ public static final String AUTH_TOKEN = "your_auth_token" ;
10+
11+ public static void main (String [] args ) {
12+ Twilio .init (ACCOUNT_SID , AUTH_TOKEN );
13+
14+ String fleetSid = "FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
15+ String deviceSid = "THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" ;
16+ Device device = DeviceUpdater (fleetSid , deviceSid )
17+ .setFriendlyName ("My New Device" )
18+ .setIdentity ("bob@twilio.com" )
19+ .update ();
20+
21+ System .out .println (device .getFriendlyName ());
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments