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.



346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 346

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

#domainString

Returns Indicates the business domain the query was executed against.

Returns:

  • (String)

    Indicates the business domain the query was executed against



362
363
364
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 362

def domain
    @properties['domain']
end

#inspectObject

Provide a detailed, user friendly representation



386
387
388
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 386

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

#itemsArray<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.



368
369
370
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 368

def items
    @properties['items']
end

#metaPaginationMeta

Returns:

  • (PaginationMeta)


374
375
376
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 374

def meta
    @properties['meta']
end

#to_sObject

Provide a user friendly representation



380
381
382
# File 'lib/twilio-ruby/rest/insights/v3/query.rb', line 380

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