Class: Twilio::REST::FlexApi::V2::FlexUserContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::FlexApi::V2::FlexUserContext
- Defined in:
- lib/twilio-ruby/rest/flex_api/v2/flex_user.rb
Instance Method Summary collapse
-
#fetch ⇒ FlexUserInstance
Fetch the FlexUserInstance.
-
#initialize(version, instance_sid, flex_user_sid) ⇒ FlexUserContext
constructor
Initialize the FlexUserContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(first_name: :unset, last_name: :unset, email: :unset, friendly_name: :unset, user_sid: :unset, locale: :unset) ⇒ FlexUserInstance
Update the FlexUserInstance.
Constructor Details
#initialize(version, instance_sid, flex_user_sid) ⇒ FlexUserContext
Initialize the FlexUserContext
50 51 52 53 54 55 56 57 58 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 50 def initialize(version, instance_sid, flex_user_sid) super(version) # Path Solution @solution = { instance_sid: instance_sid, flex_user_sid: flex_user_sid, } @uri = "/Instances/#{@solution[:instance_sid]}/Users/#{@solution[:flex_user_sid]}" end |
Instance Method Details
#fetch ⇒ FlexUserInstance
Fetch the FlexUserInstance
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 62 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) FlexUserInstance.new( @version, payload, instance_sid: @solution[:instance_sid], flex_user_sid: @solution[:flex_user_sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
123 124 125 126 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 123 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V2.FlexUserContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
116 117 118 119 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 116 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.FlexApi.V2.FlexUserContext #{context}>" end |
#update(first_name: :unset, last_name: :unset, email: :unset, friendly_name: :unset, user_sid: :unset, locale: :unset) ⇒ FlexUserInstance
Update the FlexUserInstance
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/twilio-ruby/rest/flex_api/v2/flex_user.rb', line 84 def update( first_name: :unset, last_name: :unset, email: :unset, friendly_name: :unset, user_sid: :unset, locale: :unset ) data = Twilio::Values.of({ 'FirstName' => first_name, 'LastName' => last_name, 'Email' => email, 'FriendlyName' => friendly_name, 'UserSid' => user_sid, 'Locale' => locale, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) FlexUserInstance.new( @version, payload, instance_sid: @solution[:instance_sid], flex_user_sid: @solution[:flex_user_sid], ) end |