class Twilio::REST::Insights::V1::CallSummariesList
Public Class Methods
Initialize the CallSummariesList
@param [Version] version Version
that contains the resource @return [CallSummariesList] CallSummariesList
Twilio::REST::ListResource::new
# File lib/twilio-ruby/rest/insights/v1/call_summaries.rb 18 def initialize(version) 19 super(version) 20 21 # Path Solution 22 @solution = {} 23 @uri = "/Voice/Summaries" 24 end
Public Instance Methods
When passed a block, yields CallSummariesInstance
records from the API. This operation lazily loads records as efficiently as possible until the limit is reached.
# File lib/twilio-ruby/rest/insights/v1/call_summaries.rb 143 def each 144 limits = @version.read_limits 145 146 page = self.page(page_size: limits[:page_size], ) 147 148 @version.stream(page, 149 limit: limits[:limit], 150 page_limit: limits[:page_limit]).each {|x| yield x} 151 end
Retrieve a single page of CallSummariesInstance
records from the API. Request
is executed immediately. @param [String] target_url API-generated URL for the requested results page @return [Page] Page
of CallSummariesInstance
# File lib/twilio-ruby/rest/insights/v1/call_summaries.rb 214 def get_page(target_url) 215 response = @version.domain.request( 216 'GET', 217 target_url 218 ) 219 CallSummariesPage.new(@version, response, @solution) 220 end
Lists CallSummariesInstance
records from the API as a list. Unlike stream(), this operation is eager and will load `limit` records into memory before returning. @param [Array] from The from @param [Array] to The to @param [Array] from_carrier The from_carrier @param [Array] to_carrier The to_carrier @param [Array] from_country_code The from_country_code @param [Array] to_country_code The to_country_code @param [Boolean] branded The branded @param [Boolean] verified_caller The verified_caller @param [Boolean] has_tag The has_tag @param [String] start_time The start_time @param [String] end_time The end_time @param [Array] call_type The call_type @param [Array] call_state The call_state @param [Array] direction The direction @param [call_summaries.ProcessingStateRequest] processing_state The
processing_state
@param [call_summaries.SortBy] sort_by The sort_by @param [String] subaccount The subaccount @param [Boolean] abnormal_session The abnormal_session @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/insights/v1/call_summaries.rb 56 def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, limit: nil, page_size: nil) 57 self.stream( 58 from: from, 59 to: to, 60 from_carrier: from_carrier, 61 to_carrier: to_carrier, 62 from_country_code: from_country_code, 63 to_country_code: to_country_code, 64 branded: branded, 65 verified_caller: verified_caller, 66 has_tag: has_tag, 67 start_time: start_time, 68 end_time: end_time, 69 call_type: call_type, 70 call_state: call_state, 71 direction: direction, 72 processing_state: processing_state, 73 sort_by: sort_by, 74 subaccount: subaccount, 75 abnormal_session: abnormal_session, 76 limit: limit, 77 page_size: page_size 78 ).entries 79 end
Retrieve a single page of CallSummariesInstance
records from the API. Request
is executed immediately. @param [Array] from The from @param [Array] to The to @param [Array] from_carrier The from_carrier @param [Array] to_carrier The to_carrier @param [Array] from_country_code The from_country_code @param [Array] to_country_code The to_country_code @param [Boolean] branded The branded @param [Boolean] verified_caller The verified_caller @param [Boolean] has_tag The has_tag @param [String] start_time The start_time @param [String] end_time The end_time @param [Array] call_type The call_type @param [Array] call_state The call_state @param [Array] direction The direction @param [call_summaries.ProcessingStateRequest] processing_state The
processing_state
@param [call_summaries.SortBy] sort_by The sort_by @param [String] subaccount The subaccount @param [Boolean] abnormal_session The abnormal_session @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 CallSummariesInstance
# File lib/twilio-ruby/rest/insights/v1/call_summaries.rb 179 def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, page_token: :unset, page_number: :unset, page_size: :unset) 180 params = Twilio::Values.of({ 181 'From' => Twilio.serialize_list(from) { |e| e }, 182 'To' => Twilio.serialize_list(to) { |e| e }, 183 'FromCarrier' => Twilio.serialize_list(from_carrier) { |e| e }, 184 'ToCarrier' => Twilio.serialize_list(to_carrier) { |e| e }, 185 'FromCountryCode' => Twilio.serialize_list(from_country_code) { |e| e }, 186 'ToCountryCode' => Twilio.serialize_list(to_country_code) { |e| e }, 187 'Branded' => branded, 188 'VerifiedCaller' => verified_caller, 189 'HasTag' => has_tag, 190 'StartTime' => start_time, 191 'EndTime' => end_time, 192 'CallType' => Twilio.serialize_list(call_type) { |e| e }, 193 'CallState' => Twilio.serialize_list(call_state) { |e| e }, 194 'Direction' => Twilio.serialize_list(direction) { |e| e }, 195 'ProcessingState' => processing_state, 196 'SortBy' => sort_by, 197 'Subaccount' => subaccount, 198 'AbnormalSession' => abnormal_session, 199 'PageToken' => page_token, 200 'Page' => page_number, 201 'PageSize' => page_size, 202 }) 203 204 response = @version.page('GET', @uri, params: params) 205 206 CallSummariesPage.new(@version, response, @solution) 207 end
Streams CallSummariesInstance
records from the API as an Enumerable. This operation lazily loads records as efficiently as possible until the limit is reached. @param [Array] from The from @param [Array] to The to @param [Array] from_carrier The from_carrier @param [Array] to_carrier The to_carrier @param [Array] from_country_code The from_country_code @param [Array] to_country_code The to_country_code @param [Boolean] branded The branded @param [Boolean] verified_caller The verified_caller @param [Boolean] has_tag The has_tag @param [String] start_time The start_time @param [String] end_time The end_time @param [Array] call_type The call_type @param [Array] call_state The call_state @param [Array] direction The direction @param [call_summaries.ProcessingStateRequest] processing_state The
processing_state
@param [call_summaries.SortBy] sort_by The sort_by @param [String] subaccount The subaccount @param [Boolean] abnormal_session The abnormal_session @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/insights/v1/call_summaries.rb 111 def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, limit: nil, page_size: nil) 112 limits = @version.read_limits(limit, page_size) 113 114 page = self.page( 115 from: from, 116 to: to, 117 from_carrier: from_carrier, 118 to_carrier: to_carrier, 119 from_country_code: from_country_code, 120 to_country_code: to_country_code, 121 branded: branded, 122 verified_caller: verified_caller, 123 has_tag: has_tag, 124 start_time: start_time, 125 end_time: end_time, 126 call_type: call_type, 127 call_state: call_state, 128 direction: direction, 129 processing_state: processing_state, 130 sort_by: sort_by, 131 subaccount: subaccount, 132 abnormal_session: abnormal_session, 133 page_size: limits[:page_size], 134 ) 135 136 @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) 137 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/insights/v1/call_summaries.rb 224 def to_s 225 '#<Twilio.Insights.V1.CallSummariesList>' 226 end