Class: Twilio::REST::Messaging::V1::BrandRegistrationContext::BrandRegistrationOtpPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.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) ⇒ BrandRegistrationOtpPageMetadata

Returns a new instance of BrandRegistrationOtpPageMetadata.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb', line 122

def initialize(version, response, solution, limit)
    super(version, response)
    @brand_registration_otp_page = []
    @limit = limit
    key = get_key(response.body)
    records = 0
    while( limit != :unset && records < limit )
        @brand_registration_otp_page << BrandRegistrationOtpListResponse.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

#brand_registration_otp_pageObject (readonly)

Returns the value of attribute brand_registration_otp_page.



120
121
122
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb', line 120

def brand_registration_otp_page
  @brand_registration_otp_page
end

Instance Method Details

#eachObject



138
139
140
141
142
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb', line 138

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

#to_sObject



144
145
146
# File 'lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb', line 144

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