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.



128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 128

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

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

Instance Method Details

#contextInsightsUserRolesContext

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

Returns:



146
147
148
149
150
151
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 146

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:



169
170
171
172
173
174
175
176
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 169

def fetch(
    authorization: :unset
)

    context.fetch(
        authorization: authorization, 
    )
end

#inspectObject

Provide a detailed, user friendly representation



187
188
189
190
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 187

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

#rolesArray<String>

Returns Flex Insights roles for the user.

Returns:

  • (Array<String>)

    Flex Insights roles for the user



155
156
157
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 155

def roles
    @properties['roles']
end

#to_sObject

Provide a user friendly representation



180
181
182
183
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 180

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

#urlString

Returns:

  • (String)


161
162
163
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb', line 161

def url
    @properties['url']
end