twilio-ruby 5.45.0 → 5.48.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGES.md +104 -0
- data/LICENSE +1 -1
- data/README.md +16 -2
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +12 -12
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +13 -13
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +8 -8
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +15 -15
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +3 -3
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -5
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +6 -3
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +1 -1
- data/lib/twilio-ruby/rest/bulkexports.rb +4 -2
- data/lib/twilio-ruby/rest/bulkexports/v1.rb +4 -2
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +7 -4
- data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +7 -4
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +5 -3
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +5 -3
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +5 -3
- data/lib/twilio-ruby/rest/chat/v1/service.rb +5 -5
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +6 -6
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +9 -9
- data/lib/twilio-ruby/rest/chat/v2/service.rb +5 -5
- data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +7 -7
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +6 -6
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +3 -3
- data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +27 -24
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +9 -9
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +10 -10
- data/lib/twilio-ruby/rest/client.rb +7 -0
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +32 -2
- data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/role.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +7 -7
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +17 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +32 -2
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +9 -9
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +8 -1
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +8 -1
- data/lib/twilio-ruby/rest/events/v1/sink.rb +4 -2
- data/lib/twilio-ruby/rest/events/v1/subscription.rb +3 -2
- data/lib/twilio-ruby/rest/flex_api.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +5 -5
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +18 -4
- data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +88 -76
- data/lib/twilio-ruby/rest/flex_api/v1/web_channel.rb +2 -2
- data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +8 -9
- data/lib/twilio-ruby/rest/insights/v1/room.rb +7 -7
- data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +4 -4
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +7 -7
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +3 -3
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +6 -6
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +4 -4
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +4 -4
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +16 -16
- data/lib/twilio-ruby/rest/messaging.rb +8 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +15 -0
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +328 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +1 -1
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +1 -1
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +16 -15
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +18 -18
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +1 -1
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb +1 -1
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb +1 -1
- data/lib/twilio-ruby/rest/preview.rb +4 -2
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +4 -2
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +7 -4
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +7 -4
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +5 -3
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +5 -3
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +5 -3
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +13 -13
- data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +8 -8
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +4 -8
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +1 -1
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v2/voice/country.rb +2 -2
- data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +1 -1
- data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +1 -1
- data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +17 -7
- data/lib/twilio-ruby/rest/studio/v2/flow.rb +6 -14
- data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +0 -8
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +2 -10
- data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +10 -16
- data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +6 -11
- data/lib/twilio-ruby/rest/supersim/v1/command.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +33 -12
- data/lib/twilio-ruby/rest/supersim/v1/network.rb +5 -5
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +6 -6
- data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +5 -5
- data/lib/twilio-ruby/rest/supersim/v1/sim.rb +4 -4
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +3 -3
- data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +16 -36
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +9 -25
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +24 -43
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -8
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +9 -25
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +25 -44
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +1 -9
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +5 -23
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +1 -7
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +17 -17
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +10 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +10 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +1 -1
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +1 -1
- data/lib/twilio-ruby/rest/trusthub.rb +100 -0
- data/lib/twilio-ruby/rest/trusthub/v1.rb +139 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +523 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb +359 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +330 -0
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb +328 -0
- data/lib/twilio-ruby/rest/trusthub/v1/end_user.rb +356 -0
- data/lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb +271 -0
- data/lib/twilio-ruby/rest/trusthub/v1/policies.rb +262 -0
- data/lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb +369 -0
- data/lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb +271 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +523 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb +359 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +330 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb +328 -0
- data/lib/twilio-ruby/rest/verify.rb +9 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +15 -0
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +3 -3
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +10 -10
- data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +329 -0
- data/lib/twilio-ruby/rest/video/v1/composition.rb +16 -15
- data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +26 -26
- data/lib/twilio-ruby/rest/video/v1/recording.rb +6 -6
- data/lib/twilio-ruby/rest/video/v1/room.rb +10 -3
- data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +1 -1
- data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +1 -1
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +1 -1
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -4
- data/lib/twilio-ruby/twiml/voice_response.rb +17 -8
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/conference_spec.rb +302 -44
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +4 -16
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +30 -10
- data/spec/integration/conversations/v1/service/configuration_spec.rb +2 -0
- data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +30 -10
- data/spec/integration/conversations/v1/service/user_spec.rb +9 -4
- data/spec/integration/conversations/v1/user_spec.rb +9 -4
- data/spec/integration/events/v1/sink_spec.rb +14 -0
- data/spec/integration/flex_api/v1/configuration_spec.rb +24 -0
- data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
- data/spec/integration/messaging/v1/brand_registration_spec.rb +143 -0
- data/spec/integration/preview/sync/service/document_spec.rb +1 -3
- data/spec/integration/serverless/v1/service/build_spec.rb +12 -2
- data/spec/integration/supersim/v1/fleet_spec.rb +8 -0
- data/spec/integration/sync/v1/service/document_spec.rb +1 -3
- data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment_spec.rb +192 -0
- data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_entity_assignments_spec.rb +186 -0
- data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_evaluations_spec.rb +615 -0
- data/spec/integration/trusthub/v1/customer_profiles_spec.rb +255 -0
- data/spec/integration/trusthub/v1/end_user_spec.rb +247 -0
- data/spec/integration/trusthub/v1/end_user_type_spec.rb +176 -0
- data/spec/integration/trusthub/v1/policies_spec.rb +252 -0
- data/spec/integration/trusthub/v1/supporting_document_spec.rb +235 -0
- data/spec/integration/trusthub/v1/supporting_document_type_spec.rb +159 -0
- data/spec/integration/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment_spec.rb +192 -0
- data/spec/integration/trusthub/v1/trust_products/trust_products_entity_assignments_spec.rb +186 -0
- data/spec/integration/trusthub/v1/trust_products/trust_products_evaluations_spec.rb +615 -0
- data/spec/integration/trusthub/v1/trust_products_spec.rb +255 -0
- data/spec/integration/verify/v2/verification_attempt_spec.rb +146 -0
- data/spec/integration/video/v1/room_spec.rb +5 -0
- data/spec/twiml/voice_response_spec.rb +1 -1
- metadata +49 -2
@@ -0,0 +1,271 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Trusthub < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class EndUserTypeList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the EndUserTypeList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [EndUserTypeList] EndUserTypeList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
@uri = "/EndUserTypes"
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Lists EndUserTypeInstance records from the API as a list.
|
28
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
29
|
+
# memory before returning.
|
30
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
31
|
+
# guarantees to never return more than limit. Default is no limit
|
32
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
33
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
34
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
35
|
+
# efficient page size, i.e. min(limit, 1000)
|
36
|
+
# @return [Array] Array of up to limit results
|
37
|
+
def list(limit: nil, page_size: nil)
|
38
|
+
self.stream(limit: limit, page_size: page_size).entries
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Streams EndUserTypeInstance records from the API as an Enumerable.
|
43
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
44
|
+
# is reached.
|
45
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
46
|
+
# guarantees to never return more than limit. Default is no limit.
|
47
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
48
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
49
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
50
|
+
# efficient page size, i.e. min(limit, 1000)
|
51
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
52
|
+
def stream(limit: nil, page_size: nil)
|
53
|
+
limits = @version.read_limits(limit, page_size)
|
54
|
+
|
55
|
+
page = self.page(page_size: limits[:page_size], )
|
56
|
+
|
57
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
58
|
+
end
|
59
|
+
|
60
|
+
##
|
61
|
+
# When passed a block, yields EndUserTypeInstance records from the API.
|
62
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
63
|
+
# is reached.
|
64
|
+
def each
|
65
|
+
limits = @version.read_limits
|
66
|
+
|
67
|
+
page = self.page(page_size: limits[:page_size], )
|
68
|
+
|
69
|
+
@version.stream(page,
|
70
|
+
limit: limits[:limit],
|
71
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# Retrieve a single page of EndUserTypeInstance records from the API.
|
76
|
+
# Request is executed immediately.
|
77
|
+
# @param [String] page_token PageToken provided by the API
|
78
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
79
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
80
|
+
# @return [Page] Page of EndUserTypeInstance
|
81
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
82
|
+
params = Twilio::Values.of({
|
83
|
+
'PageToken' => page_token,
|
84
|
+
'Page' => page_number,
|
85
|
+
'PageSize' => page_size,
|
86
|
+
})
|
87
|
+
|
88
|
+
response = @version.page('GET', @uri, params: params)
|
89
|
+
|
90
|
+
EndUserTypePage.new(@version, response, @solution)
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Retrieve a single page of EndUserTypeInstance records from the API.
|
95
|
+
# Request is executed immediately.
|
96
|
+
# @param [String] target_url API-generated URL for the requested results page
|
97
|
+
# @return [Page] Page of EndUserTypeInstance
|
98
|
+
def get_page(target_url)
|
99
|
+
response = @version.domain.request(
|
100
|
+
'GET',
|
101
|
+
target_url
|
102
|
+
)
|
103
|
+
EndUserTypePage.new(@version, response, @solution)
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Provide a user friendly representation
|
108
|
+
def to_s
|
109
|
+
'#<Twilio.Trusthub.V1.EndUserTypeList>'
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
class EndUserTypePage < Page
|
114
|
+
##
|
115
|
+
# Initialize the EndUserTypePage
|
116
|
+
# @param [Version] version Version that contains the resource
|
117
|
+
# @param [Response] response Response from the API
|
118
|
+
# @param [Hash] solution Path solution for the resource
|
119
|
+
# @return [EndUserTypePage] EndUserTypePage
|
120
|
+
def initialize(version, response, solution)
|
121
|
+
super(version, response)
|
122
|
+
|
123
|
+
# Path Solution
|
124
|
+
@solution = solution
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# Build an instance of EndUserTypeInstance
|
129
|
+
# @param [Hash] payload Payload response from the API
|
130
|
+
# @return [EndUserTypeInstance] EndUserTypeInstance
|
131
|
+
def get_instance(payload)
|
132
|
+
EndUserTypeInstance.new(@version, payload, )
|
133
|
+
end
|
134
|
+
|
135
|
+
##
|
136
|
+
# Provide a user friendly representation
|
137
|
+
def to_s
|
138
|
+
'<Twilio.Trusthub.V1.EndUserTypePage>'
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
class EndUserTypeContext < InstanceContext
|
143
|
+
##
|
144
|
+
# Initialize the EndUserTypeContext
|
145
|
+
# @param [Version] version Version that contains the resource
|
146
|
+
# @param [String] sid The unique string that identifies the End-User Type
|
147
|
+
# resource.
|
148
|
+
# @return [EndUserTypeContext] EndUserTypeContext
|
149
|
+
def initialize(version, sid)
|
150
|
+
super(version)
|
151
|
+
|
152
|
+
# Path Solution
|
153
|
+
@solution = {sid: sid, }
|
154
|
+
@uri = "/EndUserTypes/#{@solution[:sid]}"
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# Fetch the EndUserTypeInstance
|
159
|
+
# @return [EndUserTypeInstance] Fetched EndUserTypeInstance
|
160
|
+
def fetch
|
161
|
+
payload = @version.fetch('GET', @uri)
|
162
|
+
|
163
|
+
EndUserTypeInstance.new(@version, payload, sid: @solution[:sid], )
|
164
|
+
end
|
165
|
+
|
166
|
+
##
|
167
|
+
# Provide a user friendly representation
|
168
|
+
def to_s
|
169
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
170
|
+
"#<Twilio.Trusthub.V1.EndUserTypeContext #{context}>"
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# Provide a detailed, user friendly representation
|
175
|
+
def inspect
|
176
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
177
|
+
"#<Twilio.Trusthub.V1.EndUserTypeContext #{context}>"
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
class EndUserTypeInstance < InstanceResource
|
182
|
+
##
|
183
|
+
# Initialize the EndUserTypeInstance
|
184
|
+
# @param [Version] version Version that contains the resource
|
185
|
+
# @param [Hash] payload payload that contains response from Twilio
|
186
|
+
# @param [String] sid The unique string that identifies the End-User Type
|
187
|
+
# resource.
|
188
|
+
# @return [EndUserTypeInstance] EndUserTypeInstance
|
189
|
+
def initialize(version, payload, sid: nil)
|
190
|
+
super(version)
|
191
|
+
|
192
|
+
# Marshaled Properties
|
193
|
+
@properties = {
|
194
|
+
'sid' => payload['sid'],
|
195
|
+
'friendly_name' => payload['friendly_name'],
|
196
|
+
'machine_name' => payload['machine_name'],
|
197
|
+
'fields' => payload['fields'],
|
198
|
+
'url' => payload['url'],
|
199
|
+
}
|
200
|
+
|
201
|
+
# Context
|
202
|
+
@instance_context = nil
|
203
|
+
@params = {'sid' => sid || @properties['sid'], }
|
204
|
+
end
|
205
|
+
|
206
|
+
##
|
207
|
+
# Generate an instance context for the instance, the context is capable of
|
208
|
+
# performing various actions. All instance actions are proxied to the context
|
209
|
+
# @return [EndUserTypeContext] EndUserTypeContext for this EndUserTypeInstance
|
210
|
+
def context
|
211
|
+
unless @instance_context
|
212
|
+
@instance_context = EndUserTypeContext.new(@version, @params['sid'], )
|
213
|
+
end
|
214
|
+
@instance_context
|
215
|
+
end
|
216
|
+
|
217
|
+
##
|
218
|
+
# @return [String] The unique string that identifies the End-User Type resource
|
219
|
+
def sid
|
220
|
+
@properties['sid']
|
221
|
+
end
|
222
|
+
|
223
|
+
##
|
224
|
+
# @return [String] A human-readable description of the End-User Type resource
|
225
|
+
def friendly_name
|
226
|
+
@properties['friendly_name']
|
227
|
+
end
|
228
|
+
|
229
|
+
##
|
230
|
+
# @return [String] A machine-readable description of the End-User Type resource
|
231
|
+
def machine_name
|
232
|
+
@properties['machine_name']
|
233
|
+
end
|
234
|
+
|
235
|
+
##
|
236
|
+
# @return [Array[Hash]] The required information for creating an End-User.
|
237
|
+
def fields
|
238
|
+
@properties['fields']
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# @return [String] The absolute URL of the End-User Type resource
|
243
|
+
def url
|
244
|
+
@properties['url']
|
245
|
+
end
|
246
|
+
|
247
|
+
##
|
248
|
+
# Fetch the EndUserTypeInstance
|
249
|
+
# @return [EndUserTypeInstance] Fetched EndUserTypeInstance
|
250
|
+
def fetch
|
251
|
+
context.fetch
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# Provide a user friendly representation
|
256
|
+
def to_s
|
257
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
258
|
+
"<Twilio.Trusthub.V1.EndUserTypeInstance #{values}>"
|
259
|
+
end
|
260
|
+
|
261
|
+
##
|
262
|
+
# Provide a detailed, user friendly representation
|
263
|
+
def inspect
|
264
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
265
|
+
"<Twilio.Trusthub.V1.EndUserTypeInstance #{values}>"
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
end
|
@@ -0,0 +1,262 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Trusthub < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class PoliciesList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the PoliciesList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [PoliciesList] PoliciesList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
@uri = "/Policies"
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Lists PoliciesInstance records from the API as a list.
|
28
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
29
|
+
# memory before returning.
|
30
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
31
|
+
# guarantees to never return more than limit. Default is no limit
|
32
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
33
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
34
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
35
|
+
# efficient page size, i.e. min(limit, 1000)
|
36
|
+
# @return [Array] Array of up to limit results
|
37
|
+
def list(limit: nil, page_size: nil)
|
38
|
+
self.stream(limit: limit, page_size: page_size).entries
|
39
|
+
end
|
40
|
+
|
41
|
+
##
|
42
|
+
# Streams PoliciesInstance records from the API as an Enumerable.
|
43
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
44
|
+
# is reached.
|
45
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
46
|
+
# guarantees to never return more than limit. Default is no limit.
|
47
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
48
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
49
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
50
|
+
# efficient page size, i.e. min(limit, 1000)
|
51
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
52
|
+
def stream(limit: nil, page_size: nil)
|
53
|
+
limits = @version.read_limits(limit, page_size)
|
54
|
+
|
55
|
+
page = self.page(page_size: limits[:page_size], )
|
56
|
+
|
57
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
58
|
+
end
|
59
|
+
|
60
|
+
##
|
61
|
+
# When passed a block, yields PoliciesInstance records from the API.
|
62
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
63
|
+
# is reached.
|
64
|
+
def each
|
65
|
+
limits = @version.read_limits
|
66
|
+
|
67
|
+
page = self.page(page_size: limits[:page_size], )
|
68
|
+
|
69
|
+
@version.stream(page,
|
70
|
+
limit: limits[:limit],
|
71
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# Retrieve a single page of PoliciesInstance records from the API.
|
76
|
+
# Request is executed immediately.
|
77
|
+
# @param [String] page_token PageToken provided by the API
|
78
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
79
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
80
|
+
# @return [Page] Page of PoliciesInstance
|
81
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
82
|
+
params = Twilio::Values.of({
|
83
|
+
'PageToken' => page_token,
|
84
|
+
'Page' => page_number,
|
85
|
+
'PageSize' => page_size,
|
86
|
+
})
|
87
|
+
|
88
|
+
response = @version.page('GET', @uri, params: params)
|
89
|
+
|
90
|
+
PoliciesPage.new(@version, response, @solution)
|
91
|
+
end
|
92
|
+
|
93
|
+
##
|
94
|
+
# Retrieve a single page of PoliciesInstance records from the API.
|
95
|
+
# Request is executed immediately.
|
96
|
+
# @param [String] target_url API-generated URL for the requested results page
|
97
|
+
# @return [Page] Page of PoliciesInstance
|
98
|
+
def get_page(target_url)
|
99
|
+
response = @version.domain.request(
|
100
|
+
'GET',
|
101
|
+
target_url
|
102
|
+
)
|
103
|
+
PoliciesPage.new(@version, response, @solution)
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Provide a user friendly representation
|
108
|
+
def to_s
|
109
|
+
'#<Twilio.Trusthub.V1.PoliciesList>'
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
class PoliciesPage < Page
|
114
|
+
##
|
115
|
+
# Initialize the PoliciesPage
|
116
|
+
# @param [Version] version Version that contains the resource
|
117
|
+
# @param [Response] response Response from the API
|
118
|
+
# @param [Hash] solution Path solution for the resource
|
119
|
+
# @return [PoliciesPage] PoliciesPage
|
120
|
+
def initialize(version, response, solution)
|
121
|
+
super(version, response)
|
122
|
+
|
123
|
+
# Path Solution
|
124
|
+
@solution = solution
|
125
|
+
end
|
126
|
+
|
127
|
+
##
|
128
|
+
# Build an instance of PoliciesInstance
|
129
|
+
# @param [Hash] payload Payload response from the API
|
130
|
+
# @return [PoliciesInstance] PoliciesInstance
|
131
|
+
def get_instance(payload)
|
132
|
+
PoliciesInstance.new(@version, payload, )
|
133
|
+
end
|
134
|
+
|
135
|
+
##
|
136
|
+
# Provide a user friendly representation
|
137
|
+
def to_s
|
138
|
+
'<Twilio.Trusthub.V1.PoliciesPage>'
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
class PoliciesContext < InstanceContext
|
143
|
+
##
|
144
|
+
# Initialize the PoliciesContext
|
145
|
+
# @param [Version] version Version that contains the resource
|
146
|
+
# @param [String] sid The unique string that identifies the Policy resource.
|
147
|
+
# @return [PoliciesContext] PoliciesContext
|
148
|
+
def initialize(version, sid)
|
149
|
+
super(version)
|
150
|
+
|
151
|
+
# Path Solution
|
152
|
+
@solution = {sid: sid, }
|
153
|
+
@uri = "/Policies/#{@solution[:sid]}"
|
154
|
+
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Fetch the PoliciesInstance
|
158
|
+
# @return [PoliciesInstance] Fetched PoliciesInstance
|
159
|
+
def fetch
|
160
|
+
payload = @version.fetch('GET', @uri)
|
161
|
+
|
162
|
+
PoliciesInstance.new(@version, payload, sid: @solution[:sid], )
|
163
|
+
end
|
164
|
+
|
165
|
+
##
|
166
|
+
# Provide a user friendly representation
|
167
|
+
def to_s
|
168
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
169
|
+
"#<Twilio.Trusthub.V1.PoliciesContext #{context}>"
|
170
|
+
end
|
171
|
+
|
172
|
+
##
|
173
|
+
# Provide a detailed, user friendly representation
|
174
|
+
def inspect
|
175
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
176
|
+
"#<Twilio.Trusthub.V1.PoliciesContext #{context}>"
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
class PoliciesInstance < InstanceResource
|
181
|
+
##
|
182
|
+
# Initialize the PoliciesInstance
|
183
|
+
# @param [Version] version Version that contains the resource
|
184
|
+
# @param [Hash] payload payload that contains response from Twilio
|
185
|
+
# @param [String] sid The unique string that identifies the Policy resource.
|
186
|
+
# @return [PoliciesInstance] PoliciesInstance
|
187
|
+
def initialize(version, payload, sid: nil)
|
188
|
+
super(version)
|
189
|
+
|
190
|
+
# Marshaled Properties
|
191
|
+
@properties = {
|
192
|
+
'sid' => payload['sid'],
|
193
|
+
'friendly_name' => payload['friendly_name'],
|
194
|
+
'requirements' => payload['requirements'],
|
195
|
+
'url' => payload['url'],
|
196
|
+
}
|
197
|
+
|
198
|
+
# Context
|
199
|
+
@instance_context = nil
|
200
|
+
@params = {'sid' => sid || @properties['sid'], }
|
201
|
+
end
|
202
|
+
|
203
|
+
##
|
204
|
+
# Generate an instance context for the instance, the context is capable of
|
205
|
+
# performing various actions. All instance actions are proxied to the context
|
206
|
+
# @return [PoliciesContext] PoliciesContext for this PoliciesInstance
|
207
|
+
def context
|
208
|
+
unless @instance_context
|
209
|
+
@instance_context = PoliciesContext.new(@version, @params['sid'], )
|
210
|
+
end
|
211
|
+
@instance_context
|
212
|
+
end
|
213
|
+
|
214
|
+
##
|
215
|
+
# @return [String] The unique string that identifies the Policy resource
|
216
|
+
def sid
|
217
|
+
@properties['sid']
|
218
|
+
end
|
219
|
+
|
220
|
+
##
|
221
|
+
# @return [String] A human-readable description of the Policy resource
|
222
|
+
def friendly_name
|
223
|
+
@properties['friendly_name']
|
224
|
+
end
|
225
|
+
|
226
|
+
##
|
227
|
+
# @return [Hash] The sid of a Policy object that dictates requirements
|
228
|
+
def requirements
|
229
|
+
@properties['requirements']
|
230
|
+
end
|
231
|
+
|
232
|
+
##
|
233
|
+
# @return [String] The absolute URL of the Policy resource
|
234
|
+
def url
|
235
|
+
@properties['url']
|
236
|
+
end
|
237
|
+
|
238
|
+
##
|
239
|
+
# Fetch the PoliciesInstance
|
240
|
+
# @return [PoliciesInstance] Fetched PoliciesInstance
|
241
|
+
def fetch
|
242
|
+
context.fetch
|
243
|
+
end
|
244
|
+
|
245
|
+
##
|
246
|
+
# Provide a user friendly representation
|
247
|
+
def to_s
|
248
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
249
|
+
"<Twilio.Trusthub.V1.PoliciesInstance #{values}>"
|
250
|
+
end
|
251
|
+
|
252
|
+
##
|
253
|
+
# Provide a detailed, user friendly representation
|
254
|
+
def inspect
|
255
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
256
|
+
"<Twilio.Trusthub.V1.PoliciesInstance #{values}>"
|
257
|
+
end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|