Class: Twilio::REST::Insights::V3::QueryInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/insights/v3/query.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ QueryInstance

Initialize the QueryInstance

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 Query resource.

  • sid (String) —

    The SID of the Call resource to fetch.



287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 287

def initialize(version, payload )
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'domain' => payload['domain'],
        'items' => payload['items'],
        'meta' => payload['meta'],
    }
end

Instance Method Details

#domain ⇒ String

Returns Indicates the business domain the query was executed against.

Returns:

  • (String) —

    Indicates the business domain the query was executed against



303
304
305
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 303

def domain
    @properties['domain']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



327
328
329
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 327

def inspect
    "<Twilio.Insights.V3.QueryInstance>"
end

#items ⇒ Array<Hash<String, Object>>

Returns Array of result objects containing the query results. Each object contains properties matching the requested measures and dimensions.

Returns:

  • (Array<Hash<String, Object>>) —

    Array of result objects containing the query results. Each object contains properties matching the requested measures and dimensions.



309
310
311
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 309

def items
    @properties['items']
end

#meta ⇒ PaginationMeta

Returns:

  • (PaginationMeta)


315
316
317
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 315

def meta
    @properties['meta']
end

#to_s ⇒ Object

Provide a user friendly representation



321
322
323
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 321

def to_s
    "<Twilio.Insights.V3.QueryInstance>"
end