Class: Twilio::REST::Oauth::V1::UserInfoInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Oauth::V1::UserInfoInstance
- Defined in:
- lib/twilio-ruby/rest/oauth/v1/user_info.rb
Instance Method Summary collapse
-
#context ⇒ UserInfoContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#email ⇒ String
The end-user’s preferred email address.
-
#fetch ⇒ UserInfoInstance
Fetch the UserInfoInstance.
-
#first_name ⇒ String
The first name of the end-user.
-
#friendly_name ⇒ String
The friendly name of the end-user.
-
#initialize(version, payload) ⇒ UserInfoInstance
constructor
Initialize the UserInfoInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#last_name ⇒ String
The last name of the end-user.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
-
#user_sid ⇒ String
The user sid.
Constructor Details
#initialize(version, payload) ⇒ UserInfoInstance
Initialize the UserInfoInstance
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 104 def initialize(version, payload) super(version) # Marshaled Properties @properties = { 'user_sid' => payload['user_sid'], 'first_name' => payload['first_name'], 'last_name' => payload['last_name'], 'friendly_name' => payload['friendly_name'], 'email' => payload['email'], 'url' => payload['url'], } # Context @instance_context = nil @params = {} end |
Instance Method Details
#context ⇒ UserInfoContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
126 127 128 129 130 131 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 126 def context unless @instance_context @instance_context = UserInfoContext.new(@version, ) end @instance_context end |
#email ⇒ String
Returns The end-user’s preferred email address.
159 160 161 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 159 def email @properties['email'] end |
#fetch ⇒ UserInfoInstance
Fetch the UserInfoInstance
172 173 174 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 172 def fetch context.fetch end |
#first_name ⇒ String
Returns The first name of the end-user.
141 142 143 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 141 def first_name @properties['first_name'] end |
#friendly_name ⇒ String
Returns The friendly name of the end-user.
153 154 155 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 153 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
185 186 187 188 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 185 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Oauth.V1.UserInfoInstance #{values}>" end |
#last_name ⇒ String
Returns The last name of the end-user.
147 148 149 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 147 def last_name @properties['last_name'] end |
#to_s ⇒ Object
Provide a user friendly representation
178 179 180 181 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 178 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Oauth.V1.UserInfoInstance #{values}>" end |
#url ⇒ String
Returns The url.
165 166 167 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 165 def url @properties['url'] end |
#user_sid ⇒ String
Returns The user sid.
135 136 137 |
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 135 def user_sid @properties['user_sid'] end |