Class: Twilio::REST::Conversations::V1::ServiceContext::ConfigurationContext::WebhookPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb

Constant Summary

Constants inherited from PageMetadata

PageMetadata::META_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PageMetadata

#get_key, #next_page, #next_page_url, #previous_page, #previous_page_url, #process_response

Constructor Details

#initialize(version, response, solution, limit) ⇒ WebhookPageMetadata

Returns a new instance of WebhookPageMetadata.



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb', line 279

def initialize(version, response, solution, limit)
    super(version, response)
    @webhook_page = []
    @limit = limit
    key = get_key(response.body)
    records = 0
    while( limit != :unset && records < limit )
        @webhook_page << WebhookListResponse.new(version, @payload, key, limit - records)
        @payload = self.next_page
        break unless @payload
        records += @payload.body[key].size
    end
    # Path Solution
    @solution = solution
end

Instance Attribute Details

#webhook_pageObject (readonly)

Returns the value of attribute webhook_page.



277
278
279
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb', line 277

def webhook_page
  @webhook_page
end

Instance Method Details

#eachObject



295
296
297
298
299
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb', line 295

def each
    @webhook_page.each do |record|
      yield record
    end
end

#to_sObject



301
302
303
# File 'lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb', line 301

def to_s
  '<Twilio::REST::Conversations::V1PageMetadata>';
end