Class: Twilio::REST::FlexApi::V1::InsightsUserRolesInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ InsightsUserRolesInstance

Initialize the InsightsUserRolesInstance

Parameters:

  • version (Version) —

    Version that contains the resource

  • payload (Hash) —

    payload that contains response from Twilio

  • account_sid (String) —

    The SID of the Account that created this InsightsUserRoles resource.

  • sid (String) —

    The SID of the Call resource to fetch.



210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 210

def initialize(version, payload )
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'roles' => payload['roles'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = {  }
end

Instance Method Details

#context ⇒ InsightsUserRolesContext

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

Returns:



229
230
231
232
233
234
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 229

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

#fetch(authorization: :unset) ⇒ InsightsUserRolesInstance

Fetch the InsightsUserRolesInstance

Parameters:

  • authorization (String) (defaults to: :unset) —

    The Authorization HTTP request header

Returns:



252
253
254
255
256
257
258
259
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 252

def fetch(
  authorization: :unset
)

    context.fetch(
        authorization: authorization, 
    )
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



270
271
272
273
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 270

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

#roles ⇒ Array<String>

Returns Flex Insights roles for the user.

Returns:

  • (Array<String>) —

    Flex Insights roles for the user



238
239
240
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 238

def roles
    @properties['roles']
end

#to_s ⇒ Object

Provide a user friendly representation



263
264
265
266
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 263

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

#url ⇒ String

Returns:

  • (String)


244
245
246
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 244

def url
    @properties['url']
end