Class: Twilio::REST::FlexApi::V1::InsightsSessionInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ InsightsSessionInstance

Initialize the InsightsSessionInstance

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 InsightsSession 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
224
225
226
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 210

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

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

Instance Method Details

#base_url ⇒ String

Returns The base URL to fetch reports and dashboards.

Returns:

  • (String) —

    The base URL to fetch reports and dashboards



259
260
261
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 259

def base_url
    @properties['base_url']
end

#context ⇒ InsightsSessionContext

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

Returns:



232
233
234
235
236
237
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 232

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

#create(authorization: :unset) ⇒ InsightsSessionInstance

Create the InsightsSessionInstance

Parameters:

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

    The Authorization HTTP request header

Returns:



273
274
275
276
277
278
279
280
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 273

def create(
  authorization: :unset
)

    context.create(
        authorization: authorization, 
    )
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



291
292
293
294
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 291

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

#session_expiry ⇒ String

Returns The session expiry date and time, given in ISO 8601 format.

Returns:

  • (String) —

    The session expiry date and time, given in ISO 8601 format.



247
248
249
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 247

def session_expiry
    @properties['session_expiry']
end

#session_id ⇒ String

Returns The unique ID for the session.

Returns:

  • (String) —

    The unique ID for the session



253
254
255
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 253

def session_id
    @properties['session_id']
end

#to_s ⇒ Object

Provide a user friendly representation



284
285
286
287
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 284

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

#url ⇒ String

Returns The URL of this resource.

Returns:

  • (String) —

    The URL of this resource.



265
266
267
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 265

def url
    @properties['url']
end

#workspace_id ⇒ String

Returns Unique ID to identify the user's workspace.

Returns:

  • (String) —

    Unique ID to identify the user's workspace



241
242
243
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 241

def workspace_id
    @properties['workspace_id']
end