class Twilio::REST::Api::V2010::AccountContext::ConferenceList
Public Class Methods
Initialize the ConferenceList
@param [Version] version Version
that contains the resource @param [String] account_sid The SID of the
{Account}[https://www.twilio.com/docs/iam/api/account] that created this Conference resource.
@return [ConferenceList] ConferenceList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 22 def initialize(version, account_sid: nil) 23 super(version) 24 25 # Path Solution 26 @solution = {account_sid: account_sid} 27 @uri = "/Accounts/#{@solution[:account_sid]}/Conferences.json" 28 end
Public Instance Methods
When passed a block, yields ConferenceInstance
records from the API. This operation lazily loads records as efficiently as possible until the limit is reached.
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 109 def each 110 limits = @version.read_limits 111 112 page = self.page(page_size: limits[:page_size], ) 113 114 @version.stream(page, 115 limit: limits[:limit], 116 page_limit: limits[:page_limit]).each {|x| yield x} 117 end
Retrieve a single page of ConferenceInstance
records from the API. Request
is executed immediately. @param [String] target_url API-generated URL for the requested results page @return [Page] Page
of ConferenceInstance
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 161 def get_page(target_url) 162 response = @version.domain.request( 163 'GET', 164 target_url 165 ) 166 ConferencePage.new(@version, response, @solution) 167 end
Lists ConferenceInstance
records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. @param [Time] date_created_before The `YYYY-MM-DD` value of the resources to read @param [Time] date_created The `YYYY-MM-DD` value of the resources to read @param [Time] date_created_after The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated_before The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated_after The `YYYY-MM-DD` value of the resources to read @param [String] friendly_name The string that identifies the Conference
resources to read.
@param [conference.Status] status The status of the resources to read. Can be:
`init`, `in-progress`, or `completed`.
@param [Integer] limit Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit
@param [Integer] page_size Number of records to fetch per request, when
not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
@return [Array] Array of up to limit results
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 51 def list(date_created_before: :unset, date_created: :unset, date_created_after: :unset, date_updated_before: :unset, date_updated: :unset, date_updated_after: :unset, friendly_name: :unset, status: :unset, limit: nil, page_size: nil) 52 self.stream( 53 date_created_before: date_created_before, 54 date_created: date_created, 55 date_created_after: date_created_after, 56 date_updated_before: date_updated_before, 57 date_updated: date_updated, 58 date_updated_after: date_updated_after, 59 friendly_name: friendly_name, 60 status: status, 61 limit: limit, 62 page_size: page_size 63 ).entries 64 end
Retrieve a single page of ConferenceInstance
records from the API. Request
is executed immediately. @param [Time] date_created_before The `YYYY-MM-DD` value of the resources to read @param [Time] date_created The `YYYY-MM-DD` value of the resources to read @param [Time] date_created_after The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated_before The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated_after The `YYYY-MM-DD` value of the resources to read @param [String] friendly_name The string that identifies the Conference
resources to read.
@param [conference.Status] status The status of the resources to read. Can be:
`init`, `in-progress`, or `completed`.
@param [String] page_token PageToken provided by the API @param [Integer] page_number Page
Number, this value is simply for client state @param [Integer] page_size Number of records to return, defaults to 50 @return [Page] Page
of ConferenceInstance
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 136 def page(date_created_before: :unset, date_created: :unset, date_created_after: :unset, date_updated_before: :unset, date_updated: :unset, date_updated_after: :unset, friendly_name: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset) 137 params = Twilio::Values.of({ 138 'DateCreated<' => Twilio.serialize_iso8601_date(date_created_before), 139 'DateCreated' => Twilio.serialize_iso8601_date(date_created), 140 'DateCreated>' => Twilio.serialize_iso8601_date(date_created_after), 141 'DateUpdated<' => Twilio.serialize_iso8601_date(date_updated_before), 142 'DateUpdated' => Twilio.serialize_iso8601_date(date_updated), 143 'DateUpdated>' => Twilio.serialize_iso8601_date(date_updated_after), 144 'FriendlyName' => friendly_name, 145 'Status' => status, 146 'PageToken' => page_token, 147 'Page' => page_number, 148 'PageSize' => page_size, 149 }) 150 151 response = @version.page('GET', @uri, params: params) 152 153 ConferencePage.new(@version, response, @solution) 154 end
Streams ConferenceInstance
records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached. @param [Time] date_created_before The `YYYY-MM-DD` value of the resources to read @param [Time] date_created The `YYYY-MM-DD` value of the resources to read @param [Time] date_created_after The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated_before The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated The `YYYY-MM-DD` value of the resources to read @param [Time] date_updated_after The `YYYY-MM-DD` value of the resources to read @param [String] friendly_name The string that identifies the Conference
resources to read.
@param [conference.Status] status The status of the resources to read. Can be:
`init`, `in-progress`, or `completed`.
@param [Integer] limit Upper limit for the number of records to return. stream()
guarantees to never return more than limit. Default is no limit.
@param [Integer] page_size Number of records to fetch per request, when
not set will use the default value of 50 records. If no page_size is defined but a limit is defined, stream() will attempt to read the limit with the most efficient page size, i.e. min(limit, 1000)
@return [Enumerable] Enumerable that will yield up to limit results
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 87 def stream(date_created_before: :unset, date_created: :unset, date_created_after: :unset, date_updated_before: :unset, date_updated: :unset, date_updated_after: :unset, friendly_name: :unset, status: :unset, limit: nil, page_size: nil) 88 limits = @version.read_limits(limit, page_size) 89 90 page = self.page( 91 date_created_before: date_created_before, 92 date_created: date_created, 93 date_created_after: date_created_after, 94 date_updated_before: date_updated_before, 95 date_updated: date_updated, 96 date_updated_after: date_updated_after, 97 friendly_name: friendly_name, 98 status: status, 99 page_size: limits[:page_size], 100 ) 101 102 @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) 103 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/conference.rb 171 def to_s 172 '#<Twilio.Api.V2010.ConferenceList>' 173 end