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.



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

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_urlString

Returns The base URL to fetch reports and dashboards.

Returns:

  • (String)

    The base URL to fetch reports and dashboards



176
177
178
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 176

def base_url
    @properties['base_url']
end

#contextInsightsSessionContext

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

Returns:



149
150
151
152
153
154
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 149

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:



190
191
192
193
194
195
196
197
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 190

def create(
    authorization: :unset
)

    context.create(
        authorization: authorization, 
    )
end

#inspectObject

Provide a detailed, user friendly representation



208
209
210
211
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 208

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

#session_expiryString

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.



164
165
166
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 164

def session_expiry
    @properties['session_expiry']
end

#session_idString

Returns The unique ID for the session.

Returns:

  • (String)

    The unique ID for the session



170
171
172
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 170

def session_id
    @properties['session_id']
end

#to_sObject

Provide a user friendly representation



201
202
203
204
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 201

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

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



182
183
184
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 182

def url
    @properties['url']
end

#workspace_idString

Returns Unique ID to identify the user’s workspace.

Returns:

  • (String)

    Unique ID to identify the user’s workspace



158
159
160
# File 'lib/twilio-ruby/rest/flex_api/v1/insights_session.rb', line 158

def workspace_id
    @properties['workspace_id']
end