Class: Twilio::REST::Oauth::V1::UserInfoInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/oauth/v1/user_info.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ UserInfoInstance

Initialize the UserInfoInstance



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 122

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

#contextUserInfoContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



144
145
146
147
148
149
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 144

def context
    unless @instance_context
        @instance_context = UserInfoContext.new(@version )
    end
    @instance_context
end

#emailString



177
178
179
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 177

def email
    @properties['email']
end

#fetchUserInfoInstance

Fetch the UserInfoInstance



190
191
192
193
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 190

def fetch

    context.fetch
end

#first_nameString



159
160
161
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 159

def first_name
    @properties['first_name']
end

#friendly_nameString



171
172
173
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 171

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



204
205
206
207
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 204

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Oauth.V1.UserInfoInstance #{values}>"
end

#last_nameString



165
166
167
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 165

def last_name
    @properties['last_name']
end

#to_sObject

Provide a user friendly representation



197
198
199
200
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 197

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Oauth.V1.UserInfoInstance #{values}>"
end

#urlString



183
184
185
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 183

def url
    @properties['url']
end

#user_sidString



153
154
155
# File 'lib/twilio-ruby/rest/oauth/v1/user_info.rb', line 153

def user_sid
    @properties['user_sid']
end