Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 12 additions & 14 deletions lib/twilio-ruby/rest/flex_api/v1/assessments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,19 @@ def create_with_metadata(
# Lists AssessmentsInstance records from the API as a list.
# Unlike stream(), this operation is eager and will load `limit` records into
# memory before returning.
# @param [String] authorization The Authorization HTTP request header
# @param [String] segment_id The id of the segment.
# @param [String] authorization The Authorization HTTP request header
# @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
def list(authorization: :unset, segment_id: :unset, limit: nil, page_size: nil)
def list(segment_id: :unset, authorization: :unset, limit: nil, page_size: nil)
self.stream(
authorization: authorization,
segment_id: segment_id,
authorization: authorization,
limit: limit,
page_size: page_size
).entries
Expand All @@ -172,21 +172,21 @@ def list(authorization: :unset, segment_id: :unset, limit: nil, page_size: nil)
# Streams Instance records from the API as an Enumerable.
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
# @param [String] authorization The Authorization HTTP request header
# @param [String] segment_id The id of the segment.
# @param [String] authorization The Authorization HTTP request header
# @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
def stream(authorization: :unset, segment_id: :unset, limit: nil, page_size: nil)
def stream(segment_id: :unset, authorization: :unset, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)

page = self.page(
authorization: authorization,
segment_id: segment_id,
authorization: authorization,
page_size: limits[:page_size], )

return [].each if page.nil?
Expand All @@ -198,24 +198,23 @@ def stream(authorization: :unset, segment_id: :unset, limit: nil, page_size: nil

##
# Lists AssessmentsPageMetadata records from the API as a list.
# @param [String] authorization The Authorization HTTP request header
# @param [String] segment_id The id of the segment.
# @param [String] authorization The Authorization HTTP request header
# @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
def list_with_metadata(authorization: :unset, segment_id: :unset, limit: nil, page_size: nil)
def list_with_metadata(segment_id: :unset, authorization: :unset, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
params = Twilio::Values.of({
'Authorization' => authorization,
'SegmentId' => segment_id,

'PageSize' => limits[:page_size],
});
headers = Twilio::Values.of({})
headers = Twilio::Values.of({ 'Authorization' => authorization, })

response = @version.page('GET', @uri, params: params, headers: headers)

Expand Down Expand Up @@ -243,21 +242,20 @@ def each
##
# Retrieve a single page of AssessmentsInstance records from the API.
# Request is executed immediately.
# @param [String] authorization The Authorization HTTP request header
# @param [String] segment_id The id of the segment.
# @param [String] authorization The Authorization HTTP request header
# @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 AssessmentsInstance
def page(authorization: :unset, segment_id: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
def page(segment_id: :unset, authorization: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
params = Twilio::Values.of({
'Authorization' => authorization,
'SegmentId' => segment_id,
'PageToken' => page_token,
'Page' => page_number,
'PageSize' => page_size,
})
headers = Twilio::Values.of({})
headers = Twilio::Values.of({ 'Authorization' => authorization, })



Expand Down
26 changes: 12 additions & 14 deletions lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,21 @@ def create_with_metadata(
# Lists InsightsAssessmentsCommentInstance records from the API as a list.
# Unlike stream(), this operation is eager and will load `limit` records into
# memory before returning.
# @param [String] authorization The Authorization HTTP request header
# @param [String] segment_id The id of the segment.
# @param [String] agent_id The id of the agent.
# @param [String] authorization The Authorization HTTP request header
# @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
def list(authorization: :unset, segment_id: :unset, agent_id: :unset, limit: nil, page_size: nil)
def list(segment_id: :unset, agent_id: :unset, authorization: :unset, limit: nil, page_size: nil)
self.stream(
authorization: authorization,
segment_id: segment_id,
agent_id: agent_id,
authorization: authorization,
limit: limit,
page_size: page_size
).entries
Expand All @@ -150,23 +150,23 @@ def list(authorization: :unset, segment_id: :unset, agent_id: :unset, limit: nil
# Streams Instance records from the API as an Enumerable.
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
# @param [String] authorization The Authorization HTTP request header
# @param [String] segment_id The id of the segment.
# @param [String] agent_id The id of the agent.
# @param [String] authorization The Authorization HTTP request header
# @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
def stream(authorization: :unset, segment_id: :unset, agent_id: :unset, limit: nil, page_size: nil)
def stream(segment_id: :unset, agent_id: :unset, authorization: :unset, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)

page = self.page(
authorization: authorization,
segment_id: segment_id,
agent_id: agent_id,
authorization: authorization,
page_size: limits[:page_size], )

return [].each if page.nil?
Expand All @@ -178,26 +178,25 @@ def stream(authorization: :unset, segment_id: :unset, agent_id: :unset, limit: n

##
# Lists InsightsAssessmentsCommentPageMetadata records from the API as a list.
# @param [String] authorization The Authorization HTTP request header
# @param [String] segment_id The id of the segment.
# @param [String] agent_id The id of the agent.
# @param [String] authorization The Authorization HTTP request header
# @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
def list_with_metadata(authorization: :unset, segment_id: :unset, agent_id: :unset, limit: nil, page_size: nil)
def list_with_metadata(segment_id: :unset, agent_id: :unset, authorization: :unset, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
params = Twilio::Values.of({
'Authorization' => authorization,
'SegmentId' => segment_id,
'AgentId' => agent_id,

'PageSize' => limits[:page_size],
});
headers = Twilio::Values.of({})
headers = Twilio::Values.of({ 'Authorization' => authorization, })

response = @version.page('GET', @uri, params: params, headers: headers)

Expand Down Expand Up @@ -225,23 +224,22 @@ def each
##
# Retrieve a single page of InsightsAssessmentsCommentInstance records from the API.
# Request is executed immediately.
# @param [String] authorization The Authorization HTTP request header
# @param [String] segment_id The id of the segment.
# @param [String] agent_id The id of the agent.
# @param [String] authorization The Authorization HTTP request header
# @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 InsightsAssessmentsCommentInstance
def page(authorization: :unset, segment_id: :unset, agent_id: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
def page(segment_id: :unset, agent_id: :unset, authorization: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
params = Twilio::Values.of({
'Authorization' => authorization,
'SegmentId' => segment_id,
'AgentId' => agent_id,
'PageToken' => page_token,
'Page' => page_number,
'PageSize' => page_size,
})
headers = Twilio::Values.of({})
headers = Twilio::Values.of({ 'Authorization' => authorization, })



Expand Down
Loading
Loading