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.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGES.md +104 -0
  4. data/LICENSE +1 -1
  5. data/README.md +16 -2
  6. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +1 -1
  7. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +12 -12
  8. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +13 -13
  9. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +1 -1
  10. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +8 -8
  11. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +15 -15
  12. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +3 -3
  13. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +5 -5
  14. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +6 -3
  15. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +1 -1
  16. data/lib/twilio-ruby/rest/bulkexports.rb +4 -2
  17. data/lib/twilio-ruby/rest/bulkexports/v1.rb +4 -2
  18. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +7 -4
  19. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +7 -4
  20. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +5 -3
  21. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +5 -3
  22. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +5 -3
  23. data/lib/twilio-ruby/rest/chat/v1/service.rb +5 -5
  24. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +6 -6
  25. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +3 -3
  26. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +3 -3
  27. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +9 -9
  28. data/lib/twilio-ruby/rest/chat/v2/service.rb +5 -5
  29. data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +7 -7
  30. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +6 -6
  31. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +3 -3
  32. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +3 -3
  33. data/lib/twilio-ruby/rest/chat/v2/service/channel/webhook.rb +27 -24
  34. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +9 -9
  35. data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +10 -10
  36. data/lib/twilio-ruby/rest/client.rb +7 -0
  37. data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +9 -9
  38. data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +1 -1
  39. data/lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb +32 -2
  40. data/lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb +9 -9
  41. data/lib/twilio-ruby/rest/conversations/v1/role.rb +9 -9
  42. data/lib/twilio-ruby/rest/conversations/v1/service/binding.rb +7 -7
  43. data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +17 -2
  44. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +1 -1
  45. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb +32 -2
  46. data/lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb +9 -9
  47. data/lib/twilio-ruby/rest/conversations/v1/service/role.rb +9 -9
  48. data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +8 -1
  49. data/lib/twilio-ruby/rest/conversations/v1/user.rb +8 -1
  50. data/lib/twilio-ruby/rest/events/v1/sink.rb +4 -2
  51. data/lib/twilio-ruby/rest/events/v1/subscription.rb +3 -2
  52. data/lib/twilio-ruby/rest/flex_api.rb +1 -1
  53. data/lib/twilio-ruby/rest/flex_api/v1.rb +1 -1
  54. data/lib/twilio-ruby/rest/flex_api/v1/channel.rb +5 -5
  55. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +18 -4
  56. data/lib/twilio-ruby/rest/flex_api/v1/flex_flow.rb +88 -76
  57. data/lib/twilio-ruby/rest/flex_api/v1/web_channel.rb +2 -2
  58. data/lib/twilio-ruby/rest/insights/v1/call/summary.rb +8 -9
  59. data/lib/twilio-ruby/rest/insights/v1/room.rb +7 -7
  60. data/lib/twilio-ruby/rest/insights/v1/room/participant.rb +1 -1
  61. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +3 -3
  62. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +3 -3
  63. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +3 -3
  64. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +3 -3
  65. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +4 -4
  66. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +3 -3
  67. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +7 -7
  68. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +3 -3
  69. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +3 -3
  70. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +3 -3
  71. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/webhook.rb +6 -6
  72. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +4 -4
  73. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +4 -4
  74. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +16 -16
  75. data/lib/twilio-ruby/rest/messaging.rb +8 -0
  76. data/lib/twilio-ruby/rest/messaging/v1.rb +15 -0
  77. data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +328 -0
  78. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +1 -1
  79. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +1 -1
  80. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +1 -1
  81. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +16 -15
  82. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +18 -18
  83. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/evaluation.rb +1 -1
  84. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/end_user_type.rb +1 -1
  85. data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/supporting_document_type.rb +1 -1
  86. data/lib/twilio-ruby/rest/preview.rb +4 -2
  87. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +4 -2
  88. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +7 -4
  89. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +7 -4
  90. data/lib/twilio-ruby/rest/preview/bulk_exports/export/export_custom_job.rb +5 -3
  91. data/lib/twilio-ruby/rest/preview/bulk_exports/export/job.rb +5 -3
  92. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +5 -3
  93. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +13 -13
  94. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.rb +2 -2
  95. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +8 -8
  96. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +4 -8
  97. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +2 -2
  98. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +2 -2
  99. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +1 -1
  100. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +2 -2
  101. data/lib/twilio-ruby/rest/pricing/v2/voice/country.rb +2 -2
  102. data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +1 -1
  103. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +1 -1
  104. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +1 -1
  105. data/lib/twilio-ruby/rest/serverless/v1/service/build.rb +17 -7
  106. data/lib/twilio-ruby/rest/studio/v2/flow.rb +6 -14
  107. data/lib/twilio-ruby/rest/studio/v2/flow/execution.rb +0 -8
  108. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +0 -8
  109. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step.rb +0 -8
  110. data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +0 -8
  111. data/lib/twilio-ruby/rest/studio/v2/flow/flow_revision.rb +2 -10
  112. data/lib/twilio-ruby/rest/studio/v2/flow/test_user.rb +10 -16
  113. data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +6 -11
  114. data/lib/twilio-ruby/rest/supersim/v1/command.rb +4 -4
  115. data/lib/twilio-ruby/rest/supersim/v1/fleet.rb +33 -12
  116. data/lib/twilio-ruby/rest/supersim/v1/network.rb +5 -5
  117. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile.rb +6 -6
  118. data/lib/twilio-ruby/rest/supersim/v1/network_access_profile/network_access_profile_network.rb +5 -5
  119. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +4 -4
  120. data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +3 -3
  121. data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -8
  122. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +16 -36
  123. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -8
  124. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +9 -25
  125. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +24 -43
  126. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -8
  127. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +9 -25
  128. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +25 -44
  129. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +1 -9
  130. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +5 -23
  131. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +1 -7
  132. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +17 -17
  133. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +10 -10
  134. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +1 -1
  135. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +10 -10
  136. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +1 -1
  137. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +1 -1
  138. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +1 -1
  139. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +1 -1
  140. data/lib/twilio-ruby/rest/trusthub.rb +100 -0
  141. data/lib/twilio-ruby/rest/trusthub/v1.rb +139 -0
  142. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +523 -0
  143. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.rb +359 -0
  144. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +330 -0
  145. data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.rb +328 -0
  146. data/lib/twilio-ruby/rest/trusthub/v1/end_user.rb +356 -0
  147. data/lib/twilio-ruby/rest/trusthub/v1/end_user_type.rb +271 -0
  148. data/lib/twilio-ruby/rest/trusthub/v1/policies.rb +262 -0
  149. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document.rb +369 -0
  150. data/lib/twilio-ruby/rest/trusthub/v1/supporting_document_type.rb +271 -0
  151. data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +523 -0
  152. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.rb +359 -0
  153. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +330 -0
  154. data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_evaluations.rb +328 -0
  155. data/lib/twilio-ruby/rest/verify.rb +9 -0
  156. data/lib/twilio-ruby/rest/verify/v2.rb +15 -0
  157. data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +3 -3
  158. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  159. data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +10 -10
  160. data/lib/twilio-ruby/rest/verify/v2/verification_attempt.rb +329 -0
  161. data/lib/twilio-ruby/rest/video/v1/composition.rb +16 -15
  162. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +26 -26
  163. data/lib/twilio-ruby/rest/video/v1/recording.rb +6 -6
  164. data/lib/twilio-ruby/rest/video/v1/room.rb +10 -3
  165. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +1 -1
  166. data/lib/twilio-ruby/rest/video/v1/room/room_recording_rule.rb +1 -1
  167. data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb +1 -1
  168. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +4 -4
  169. data/lib/twilio-ruby/twiml/voice_response.rb +17 -8
  170. data/lib/twilio-ruby/version.rb +1 -1
  171. data/spec/integration/api/v2010/account/conference_spec.rb +302 -44
  172. data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +4 -16
  173. data/spec/integration/conversations/v1/conversation/participant_spec.rb +30 -10
  174. data/spec/integration/conversations/v1/service/configuration_spec.rb +2 -0
  175. data/spec/integration/conversations/v1/service/conversation/participant_spec.rb +30 -10
  176. data/spec/integration/conversations/v1/service/user_spec.rb +9 -4
  177. data/spec/integration/conversations/v1/user_spec.rb +9 -4
  178. data/spec/integration/events/v1/sink_spec.rb +14 -0
  179. data/spec/integration/flex_api/v1/configuration_spec.rb +24 -0
  180. data/spec/integration/insights/v1/call/summary_spec.rb +1 -0
  181. data/spec/integration/messaging/v1/brand_registration_spec.rb +143 -0
  182. data/spec/integration/preview/sync/service/document_spec.rb +1 -3
  183. data/spec/integration/serverless/v1/service/build_spec.rb +12 -2
  184. data/spec/integration/supersim/v1/fleet_spec.rb +8 -0
  185. data/spec/integration/sync/v1/service/document_spec.rb +1 -3
  186. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment_spec.rb +192 -0
  187. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_entity_assignments_spec.rb +186 -0
  188. data/spec/integration/trusthub/v1/customer_profiles/customer_profiles_evaluations_spec.rb +615 -0
  189. data/spec/integration/trusthub/v1/customer_profiles_spec.rb +255 -0
  190. data/spec/integration/trusthub/v1/end_user_spec.rb +247 -0
  191. data/spec/integration/trusthub/v1/end_user_type_spec.rb +176 -0
  192. data/spec/integration/trusthub/v1/policies_spec.rb +252 -0
  193. data/spec/integration/trusthub/v1/supporting_document_spec.rb +235 -0
  194. data/spec/integration/trusthub/v1/supporting_document_type_spec.rb +159 -0
  195. data/spec/integration/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment_spec.rb +192 -0
  196. data/spec/integration/trusthub/v1/trust_products/trust_products_entity_assignments_spec.rb +186 -0
  197. data/spec/integration/trusthub/v1/trust_products/trust_products_evaluations_spec.rb +615 -0
  198. data/spec/integration/trusthub/v1/trust_products_spec.rb +255 -0
  199. data/spec/integration/verify/v2/verification_attempt_spec.rb +146 -0
  200. data/spec/integration/video/v1/room_spec.rb +5 -0
  201. data/spec/twiml/voice_response_spec.rb +1 -1
  202. metadata +49 -2
@@ -0,0 +1,369 @@
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 SupportingDocumentList < ListResource
14
+ ##
15
+ # Initialize the SupportingDocumentList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [SupportingDocumentList] SupportingDocumentList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/SupportingDocuments"
24
+ end
25
+
26
+ ##
27
+ # Create the SupportingDocumentInstance
28
+ # @param [String] friendly_name The string that you assigned to describe the
29
+ # resource.
30
+ # @param [String] type The type of the Supporting Document.
31
+ # @param [Hash] attributes The set of parameters that are the attributes of the
32
+ # Supporting Documents resource which are derived Supporting Document Types.
33
+ # @return [SupportingDocumentInstance] Created SupportingDocumentInstance
34
+ def create(friendly_name: nil, type: nil, attributes: :unset)
35
+ data = Twilio::Values.of({
36
+ 'FriendlyName' => friendly_name,
37
+ 'Type' => type,
38
+ 'Attributes' => Twilio.serialize_object(attributes),
39
+ })
40
+
41
+ payload = @version.create('POST', @uri, data: data)
42
+
43
+ SupportingDocumentInstance.new(@version, payload, )
44
+ end
45
+
46
+ ##
47
+ # Lists SupportingDocumentInstance records from the API as a list.
48
+ # Unlike stream(), this operation is eager and will load `limit` records into
49
+ # memory before returning.
50
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
51
+ # guarantees to never return more than limit. Default is no limit
52
+ # @param [Integer] page_size Number of records to fetch per request, when
53
+ # not set will use the default value of 50 records. If no page_size is defined
54
+ # but a limit is defined, stream() will attempt to read the limit with the most
55
+ # efficient page size, i.e. min(limit, 1000)
56
+ # @return [Array] Array of up to limit results
57
+ def list(limit: nil, page_size: nil)
58
+ self.stream(limit: limit, page_size: page_size).entries
59
+ end
60
+
61
+ ##
62
+ # Streams SupportingDocumentInstance records from the API as an Enumerable.
63
+ # This operation lazily loads records as efficiently as possible until the limit
64
+ # is reached.
65
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
66
+ # guarantees to never return more than limit. Default is no limit.
67
+ # @param [Integer] page_size Number of records to fetch per request, when
68
+ # not set will use the default value of 50 records. If no page_size is defined
69
+ # but a limit is defined, stream() will attempt to read the limit with the most
70
+ # efficient page size, i.e. min(limit, 1000)
71
+ # @return [Enumerable] Enumerable that will yield up to limit results
72
+ def stream(limit: nil, page_size: nil)
73
+ limits = @version.read_limits(limit, page_size)
74
+
75
+ page = self.page(page_size: limits[:page_size], )
76
+
77
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
78
+ end
79
+
80
+ ##
81
+ # When passed a block, yields SupportingDocumentInstance records from the API.
82
+ # This operation lazily loads records as efficiently as possible until the limit
83
+ # is reached.
84
+ def each
85
+ limits = @version.read_limits
86
+
87
+ page = self.page(page_size: limits[:page_size], )
88
+
89
+ @version.stream(page,
90
+ limit: limits[:limit],
91
+ page_limit: limits[:page_limit]).each {|x| yield x}
92
+ end
93
+
94
+ ##
95
+ # Retrieve a single page of SupportingDocumentInstance records from the API.
96
+ # Request is executed immediately.
97
+ # @param [String] page_token PageToken provided by the API
98
+ # @param [Integer] page_number Page Number, this value is simply for client state
99
+ # @param [Integer] page_size Number of records to return, defaults to 50
100
+ # @return [Page] Page of SupportingDocumentInstance
101
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
102
+ params = Twilio::Values.of({
103
+ 'PageToken' => page_token,
104
+ 'Page' => page_number,
105
+ 'PageSize' => page_size,
106
+ })
107
+
108
+ response = @version.page('GET', @uri, params: params)
109
+
110
+ SupportingDocumentPage.new(@version, response, @solution)
111
+ end
112
+
113
+ ##
114
+ # Retrieve a single page of SupportingDocumentInstance records from the API.
115
+ # Request is executed immediately.
116
+ # @param [String] target_url API-generated URL for the requested results page
117
+ # @return [Page] Page of SupportingDocumentInstance
118
+ def get_page(target_url)
119
+ response = @version.domain.request(
120
+ 'GET',
121
+ target_url
122
+ )
123
+ SupportingDocumentPage.new(@version, response, @solution)
124
+ end
125
+
126
+ ##
127
+ # Provide a user friendly representation
128
+ def to_s
129
+ '#<Twilio.Trusthub.V1.SupportingDocumentList>'
130
+ end
131
+ end
132
+
133
+ class SupportingDocumentPage < Page
134
+ ##
135
+ # Initialize the SupportingDocumentPage
136
+ # @param [Version] version Version that contains the resource
137
+ # @param [Response] response Response from the API
138
+ # @param [Hash] solution Path solution for the resource
139
+ # @return [SupportingDocumentPage] SupportingDocumentPage
140
+ def initialize(version, response, solution)
141
+ super(version, response)
142
+
143
+ # Path Solution
144
+ @solution = solution
145
+ end
146
+
147
+ ##
148
+ # Build an instance of SupportingDocumentInstance
149
+ # @param [Hash] payload Payload response from the API
150
+ # @return [SupportingDocumentInstance] SupportingDocumentInstance
151
+ def get_instance(payload)
152
+ SupportingDocumentInstance.new(@version, payload, )
153
+ end
154
+
155
+ ##
156
+ # Provide a user friendly representation
157
+ def to_s
158
+ '<Twilio.Trusthub.V1.SupportingDocumentPage>'
159
+ end
160
+ end
161
+
162
+ class SupportingDocumentContext < InstanceContext
163
+ ##
164
+ # Initialize the SupportingDocumentContext
165
+ # @param [Version] version Version that contains the resource
166
+ # @param [String] sid The unique string created by Twilio to identify the
167
+ # Supporting Document resource.
168
+ # @return [SupportingDocumentContext] SupportingDocumentContext
169
+ def initialize(version, sid)
170
+ super(version)
171
+
172
+ # Path Solution
173
+ @solution = {sid: sid, }
174
+ @uri = "/SupportingDocuments/#{@solution[:sid]}"
175
+ end
176
+
177
+ ##
178
+ # Fetch the SupportingDocumentInstance
179
+ # @return [SupportingDocumentInstance] Fetched SupportingDocumentInstance
180
+ def fetch
181
+ payload = @version.fetch('GET', @uri)
182
+
183
+ SupportingDocumentInstance.new(@version, payload, sid: @solution[:sid], )
184
+ end
185
+
186
+ ##
187
+ # Update the SupportingDocumentInstance
188
+ # @param [String] friendly_name The string that you assigned to describe the
189
+ # resource.
190
+ # @param [Hash] attributes The set of parameters that are the attributes of the
191
+ # Supporting Document resource which are derived Supporting Document Types.
192
+ # @return [SupportingDocumentInstance] Updated SupportingDocumentInstance
193
+ def update(friendly_name: :unset, attributes: :unset)
194
+ data = Twilio::Values.of({
195
+ 'FriendlyName' => friendly_name,
196
+ 'Attributes' => Twilio.serialize_object(attributes),
197
+ })
198
+
199
+ payload = @version.update('POST', @uri, data: data)
200
+
201
+ SupportingDocumentInstance.new(@version, payload, sid: @solution[:sid], )
202
+ end
203
+
204
+ ##
205
+ # Delete the SupportingDocumentInstance
206
+ # @return [Boolean] true if delete succeeds, false otherwise
207
+ def delete
208
+ @version.delete('DELETE', @uri)
209
+ end
210
+
211
+ ##
212
+ # Provide a user friendly representation
213
+ def to_s
214
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
215
+ "#<Twilio.Trusthub.V1.SupportingDocumentContext #{context}>"
216
+ end
217
+
218
+ ##
219
+ # Provide a detailed, user friendly representation
220
+ def inspect
221
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
222
+ "#<Twilio.Trusthub.V1.SupportingDocumentContext #{context}>"
223
+ end
224
+ end
225
+
226
+ class SupportingDocumentInstance < InstanceResource
227
+ ##
228
+ # Initialize the SupportingDocumentInstance
229
+ # @param [Version] version Version that contains the resource
230
+ # @param [Hash] payload payload that contains response from Twilio
231
+ # @param [String] sid The unique string created by Twilio to identify the
232
+ # Supporting Document resource.
233
+ # @return [SupportingDocumentInstance] SupportingDocumentInstance
234
+ def initialize(version, payload, sid: nil)
235
+ super(version)
236
+
237
+ # Marshaled Properties
238
+ @properties = {
239
+ 'sid' => payload['sid'],
240
+ 'account_sid' => payload['account_sid'],
241
+ 'friendly_name' => payload['friendly_name'],
242
+ 'mime_type' => payload['mime_type'],
243
+ 'status' => payload['status'],
244
+ 'type' => payload['type'],
245
+ 'attributes' => payload['attributes'],
246
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
247
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
248
+ 'url' => payload['url'],
249
+ }
250
+
251
+ # Context
252
+ @instance_context = nil
253
+ @params = {'sid' => sid || @properties['sid'], }
254
+ end
255
+
256
+ ##
257
+ # Generate an instance context for the instance, the context is capable of
258
+ # performing various actions. All instance actions are proxied to the context
259
+ # @return [SupportingDocumentContext] SupportingDocumentContext for this SupportingDocumentInstance
260
+ def context
261
+ unless @instance_context
262
+ @instance_context = SupportingDocumentContext.new(@version, @params['sid'], )
263
+ end
264
+ @instance_context
265
+ end
266
+
267
+ ##
268
+ # @return [String] The unique string that identifies the resource
269
+ def sid
270
+ @properties['sid']
271
+ end
272
+
273
+ ##
274
+ # @return [String] The SID of the Account that created the resource
275
+ def account_sid
276
+ @properties['account_sid']
277
+ end
278
+
279
+ ##
280
+ # @return [String] The string that you assigned to describe the resource
281
+ def friendly_name
282
+ @properties['friendly_name']
283
+ end
284
+
285
+ ##
286
+ # @return [String] The image type of the file
287
+ def mime_type
288
+ @properties['mime_type']
289
+ end
290
+
291
+ ##
292
+ # @return [supporting_document.Status] The verification status of the Supporting Document resource
293
+ def status
294
+ @properties['status']
295
+ end
296
+
297
+ ##
298
+ # @return [String] The type of the Supporting Document
299
+ def type
300
+ @properties['type']
301
+ end
302
+
303
+ ##
304
+ # @return [Hash] The set of parameters that compose the Supporting Documents resource
305
+ def attributes
306
+ @properties['attributes']
307
+ end
308
+
309
+ ##
310
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was created
311
+ def date_created
312
+ @properties['date_created']
313
+ end
314
+
315
+ ##
316
+ # @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
317
+ def date_updated
318
+ @properties['date_updated']
319
+ end
320
+
321
+ ##
322
+ # @return [String] The absolute URL of the Supporting Document resource
323
+ def url
324
+ @properties['url']
325
+ end
326
+
327
+ ##
328
+ # Fetch the SupportingDocumentInstance
329
+ # @return [SupportingDocumentInstance] Fetched SupportingDocumentInstance
330
+ def fetch
331
+ context.fetch
332
+ end
333
+
334
+ ##
335
+ # Update the SupportingDocumentInstance
336
+ # @param [String] friendly_name The string that you assigned to describe the
337
+ # resource.
338
+ # @param [Hash] attributes The set of parameters that are the attributes of the
339
+ # Supporting Document resource which are derived Supporting Document Types.
340
+ # @return [SupportingDocumentInstance] Updated SupportingDocumentInstance
341
+ def update(friendly_name: :unset, attributes: :unset)
342
+ context.update(friendly_name: friendly_name, attributes: attributes, )
343
+ end
344
+
345
+ ##
346
+ # Delete the SupportingDocumentInstance
347
+ # @return [Boolean] true if delete succeeds, false otherwise
348
+ def delete
349
+ context.delete
350
+ end
351
+
352
+ ##
353
+ # Provide a user friendly representation
354
+ def to_s
355
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
356
+ "<Twilio.Trusthub.V1.SupportingDocumentInstance #{values}>"
357
+ end
358
+
359
+ ##
360
+ # Provide a detailed, user friendly representation
361
+ def inspect
362
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
363
+ "<Twilio.Trusthub.V1.SupportingDocumentInstance #{values}>"
364
+ end
365
+ end
366
+ end
367
+ end
368
+ end
369
+ end
@@ -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 SupportingDocumentTypeList < ListResource
14
+ ##
15
+ # Initialize the SupportingDocumentTypeList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [SupportingDocumentTypeList] SupportingDocumentTypeList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/SupportingDocumentTypes"
24
+ end
25
+
26
+ ##
27
+ # Lists SupportingDocumentTypeInstance 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 SupportingDocumentTypeInstance 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 SupportingDocumentTypeInstance 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 SupportingDocumentTypeInstance 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 SupportingDocumentTypeInstance
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
+ SupportingDocumentTypePage.new(@version, response, @solution)
91
+ end
92
+
93
+ ##
94
+ # Retrieve a single page of SupportingDocumentTypeInstance 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 SupportingDocumentTypeInstance
98
+ def get_page(target_url)
99
+ response = @version.domain.request(
100
+ 'GET',
101
+ target_url
102
+ )
103
+ SupportingDocumentTypePage.new(@version, response, @solution)
104
+ end
105
+
106
+ ##
107
+ # Provide a user friendly representation
108
+ def to_s
109
+ '#<Twilio.Trusthub.V1.SupportingDocumentTypeList>'
110
+ end
111
+ end
112
+
113
+ class SupportingDocumentTypePage < Page
114
+ ##
115
+ # Initialize the SupportingDocumentTypePage
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 [SupportingDocumentTypePage] SupportingDocumentTypePage
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 SupportingDocumentTypeInstance
129
+ # @param [Hash] payload Payload response from the API
130
+ # @return [SupportingDocumentTypeInstance] SupportingDocumentTypeInstance
131
+ def get_instance(payload)
132
+ SupportingDocumentTypeInstance.new(@version, payload, )
133
+ end
134
+
135
+ ##
136
+ # Provide a user friendly representation
137
+ def to_s
138
+ '<Twilio.Trusthub.V1.SupportingDocumentTypePage>'
139
+ end
140
+ end
141
+
142
+ class SupportingDocumentTypeContext < InstanceContext
143
+ ##
144
+ # Initialize the SupportingDocumentTypeContext
145
+ # @param [Version] version Version that contains the resource
146
+ # @param [String] sid The unique string that identifies the Supporting Document
147
+ # Type resource.
148
+ # @return [SupportingDocumentTypeContext] SupportingDocumentTypeContext
149
+ def initialize(version, sid)
150
+ super(version)
151
+
152
+ # Path Solution
153
+ @solution = {sid: sid, }
154
+ @uri = "/SupportingDocumentTypes/#{@solution[:sid]}"
155
+ end
156
+
157
+ ##
158
+ # Fetch the SupportingDocumentTypeInstance
159
+ # @return [SupportingDocumentTypeInstance] Fetched SupportingDocumentTypeInstance
160
+ def fetch
161
+ payload = @version.fetch('GET', @uri)
162
+
163
+ SupportingDocumentTypeInstance.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.SupportingDocumentTypeContext #{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.SupportingDocumentTypeContext #{context}>"
178
+ end
179
+ end
180
+
181
+ class SupportingDocumentTypeInstance < InstanceResource
182
+ ##
183
+ # Initialize the SupportingDocumentTypeInstance
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 Supporting Document
187
+ # Type resource.
188
+ # @return [SupportingDocumentTypeInstance] SupportingDocumentTypeInstance
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 [SupportingDocumentTypeContext] SupportingDocumentTypeContext for this SupportingDocumentTypeInstance
210
+ def context
211
+ unless @instance_context
212
+ @instance_context = SupportingDocumentTypeContext.new(@version, @params['sid'], )
213
+ end
214
+ @instance_context
215
+ end
216
+
217
+ ##
218
+ # @return [String] The unique string that identifies the Supporting Document Type resource
219
+ def sid
220
+ @properties['sid']
221
+ end
222
+
223
+ ##
224
+ # @return [String] A human-readable description of the Supporting Document Type resource
225
+ def friendly_name
226
+ @properties['friendly_name']
227
+ end
228
+
229
+ ##
230
+ # @return [String] The machine-readable description of the Supporting Document Type resource
231
+ def machine_name
232
+ @properties['machine_name']
233
+ end
234
+
235
+ ##
236
+ # @return [Array[Hash]] The required information for creating a Supporting Document
237
+ def fields
238
+ @properties['fields']
239
+ end
240
+
241
+ ##
242
+ # @return [String] The absolute URL of the Supporting Document Type resource
243
+ def url
244
+ @properties['url']
245
+ end
246
+
247
+ ##
248
+ # Fetch the SupportingDocumentTypeInstance
249
+ # @return [SupportingDocumentTypeInstance] Fetched SupportingDocumentTypeInstance
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.SupportingDocumentTypeInstance #{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.SupportingDocumentTypeInstance #{values}>"
266
+ end
267
+ end
268
+ end
269
+ end
270
+ end
271
+ end