twilio-ruby 5.32.0 → 5.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +26 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/jwt/task_router.rb +2 -2
  5. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +22 -3
  6. data/lib/twilio-ruby/rest/authy/v1/service.rb +14 -5
  7. data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +89 -0
  8. data/lib/twilio-ruby/rest/bulkexports.rb +54 -0
  9. data/lib/twilio-ruby/rest/bulkexports/v1.rb +58 -0
  10. data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +254 -0
  11. data/lib/twilio-ruby/rest/bulkexports/v1/export/day.rb +316 -0
  12. data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +298 -0
  13. data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +253 -0
  14. data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +242 -0
  15. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +1 -1
  16. data/lib/twilio-ruby/rest/client.rb +7 -0
  17. data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +14 -0
  18. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +1 -1
  19. data/lib/twilio-ruby/rest/serverless/v1/service/environment/deployment.rb +1 -1
  20. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version.rb +30 -0
  21. data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +247 -0
  22. data/lib/twilio-ruby/rest/supersim/v1/sim.rb +5 -5
  23. data/lib/twilio-ruby/version.rb +1 -1
  24. data/spec/integration/api/v2010/account/sip/domain_spec.rb +8 -4
  25. data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +91 -0
  26. data/spec/integration/bulkexports/v1/export/day_spec.rb +117 -0
  27. data/spec/integration/bulkexports/v1/export/export_custom_job_spec.rb +129 -0
  28. data/spec/integration/bulkexports/v1/export/job_spec.rb +80 -0
  29. data/spec/integration/bulkexports/v1/export_configuration_spec.rb +79 -0
  30. data/spec/integration/bulkexports/v1/export_spec.rb +45 -0
  31. data/spec/integration/flex_api/v1/configuration_spec.rb +150 -0
  32. data/spec/integration/serverless/v1/service/environment/deployment_spec.rb +3 -4
  33. data/spec/integration/serverless/v1/service/function/function_version/function_version_content_spec.rb +52 -0
  34. data/spec/integration/serverless/v1/service/function/function_version_spec.rb +4 -1
  35. metadata +22 -2
@@ -0,0 +1,253 @@
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 Bulkexports < Domain
12
+ class V1 < Version
13
+ class ExportList < ListResource
14
+ ##
15
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
+ class JobList < ListResource
17
+ ##
18
+ # Initialize the JobList
19
+ # @param [Version] version Version that contains the resource
20
+ # @return [JobList] JobList
21
+ def initialize(version)
22
+ super(version)
23
+
24
+ # Path Solution
25
+ @solution = {}
26
+ end
27
+
28
+ ##
29
+ # Provide a user friendly representation
30
+ def to_s
31
+ '#<Twilio.Bulkexports.V1.JobList>'
32
+ end
33
+ end
34
+
35
+ ##
36
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
37
+ class JobPage < Page
38
+ ##
39
+ # Initialize the JobPage
40
+ # @param [Version] version Version that contains the resource
41
+ # @param [Response] response Response from the API
42
+ # @param [Hash] solution Path solution for the resource
43
+ # @return [JobPage] JobPage
44
+ def initialize(version, response, solution)
45
+ super(version, response)
46
+
47
+ # Path Solution
48
+ @solution = solution
49
+ end
50
+
51
+ ##
52
+ # Build an instance of JobInstance
53
+ # @param [Hash] payload Payload response from the API
54
+ # @return [JobInstance] JobInstance
55
+ def get_instance(payload)
56
+ JobInstance.new(@version, payload, )
57
+ end
58
+
59
+ ##
60
+ # Provide a user friendly representation
61
+ def to_s
62
+ '<Twilio.Bulkexports.V1.JobPage>'
63
+ end
64
+ end
65
+
66
+ ##
67
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
68
+ class JobContext < InstanceContext
69
+ ##
70
+ # Initialize the JobContext
71
+ # @param [Version] version Version that contains the resource
72
+ # @param [String] job_sid The job_sid
73
+ # @return [JobContext] JobContext
74
+ def initialize(version, job_sid)
75
+ super(version)
76
+
77
+ # Path Solution
78
+ @solution = {job_sid: job_sid, }
79
+ @uri = "/Exports/Jobs/#{@solution[:job_sid]}"
80
+ end
81
+
82
+ ##
83
+ # Fetch a JobInstance
84
+ # @return [JobInstance] Fetched JobInstance
85
+ def fetch
86
+ params = Twilio::Values.of({})
87
+
88
+ payload = @version.fetch(
89
+ 'GET',
90
+ @uri,
91
+ params,
92
+ )
93
+
94
+ JobInstance.new(@version, payload, job_sid: @solution[:job_sid], )
95
+ end
96
+
97
+ ##
98
+ # Deletes the JobInstance
99
+ # @return [Boolean] true if delete succeeds, false otherwise
100
+ def delete
101
+ @version.delete('delete', @uri)
102
+ end
103
+
104
+ ##
105
+ # Provide a user friendly representation
106
+ def to_s
107
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
108
+ "#<Twilio.Bulkexports.V1.JobContext #{context}>"
109
+ end
110
+
111
+ ##
112
+ # Provide a detailed, user friendly representation
113
+ def inspect
114
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
115
+ "#<Twilio.Bulkexports.V1.JobContext #{context}>"
116
+ end
117
+ end
118
+
119
+ ##
120
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
121
+ class JobInstance < InstanceResource
122
+ ##
123
+ # Initialize the JobInstance
124
+ # @param [Version] version Version that contains the resource
125
+ # @param [Hash] payload payload that contains response from Twilio
126
+ # @param [String] job_sid The job_sid
127
+ # @return [JobInstance] JobInstance
128
+ def initialize(version, payload, job_sid: nil)
129
+ super(version)
130
+
131
+ # Marshaled Properties
132
+ @properties = {
133
+ 'resource_type' => payload['resource_type'],
134
+ 'friendly_name' => payload['friendly_name'],
135
+ 'details' => payload['details'],
136
+ 'start_day' => payload['start_day'],
137
+ 'end_day' => payload['end_day'],
138
+ 'job_sid' => payload['job_sid'],
139
+ 'webhook_url' => payload['webhook_url'],
140
+ 'webhook_method' => payload['webhook_method'],
141
+ 'email' => payload['email'],
142
+ 'url' => payload['url'],
143
+ }
144
+
145
+ # Context
146
+ @instance_context = nil
147
+ @params = {'job_sid' => job_sid || @properties['job_sid'], }
148
+ end
149
+
150
+ ##
151
+ # Generate an instance context for the instance, the context is capable of
152
+ # performing various actions. All instance actions are proxied to the context
153
+ # @return [JobContext] JobContext for this JobInstance
154
+ def context
155
+ unless @instance_context
156
+ @instance_context = JobContext.new(@version, @params['job_sid'], )
157
+ end
158
+ @instance_context
159
+ end
160
+
161
+ ##
162
+ # @return [String] The type of communication – Messages, Calls
163
+ def resource_type
164
+ @properties['resource_type']
165
+ end
166
+
167
+ ##
168
+ # @return [String] The friendly name specified when creating the job
169
+ def friendly_name
170
+ @properties['friendly_name']
171
+ end
172
+
173
+ ##
174
+ # @return [Hash] This is a list of the completed, pending, or errored dates within the export time range, with one entry for each status with more than one day in that status
175
+ def details
176
+ @properties['details']
177
+ end
178
+
179
+ ##
180
+ # @return [String] The start time for the export specified when creating the job
181
+ def start_day
182
+ @properties['start_day']
183
+ end
184
+
185
+ ##
186
+ # @return [String] The end time for the export specified when creating the job
187
+ def end_day
188
+ @properties['end_day']
189
+ end
190
+
191
+ ##
192
+ # @return [String] The job_sid returned when the export was created
193
+ def job_sid
194
+ @properties['job_sid']
195
+ end
196
+
197
+ ##
198
+ # @return [String] The optional webhook url called on completion
199
+ def webhook_url
200
+ @properties['webhook_url']
201
+ end
202
+
203
+ ##
204
+ # @return [String] This is the method used to call the webhook
205
+ def webhook_method
206
+ @properties['webhook_method']
207
+ end
208
+
209
+ ##
210
+ # @return [String] The optional email to send the completion notification to
211
+ def email
212
+ @properties['email']
213
+ end
214
+
215
+ ##
216
+ # @return [String] The url
217
+ def url
218
+ @properties['url']
219
+ end
220
+
221
+ ##
222
+ # Fetch a JobInstance
223
+ # @return [JobInstance] Fetched JobInstance
224
+ def fetch
225
+ context.fetch
226
+ end
227
+
228
+ ##
229
+ # Deletes the JobInstance
230
+ # @return [Boolean] true if delete succeeds, false otherwise
231
+ def delete
232
+ context.delete
233
+ end
234
+
235
+ ##
236
+ # Provide a user friendly representation
237
+ def to_s
238
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
239
+ "<Twilio.Bulkexports.V1.JobInstance #{values}>"
240
+ end
241
+
242
+ ##
243
+ # Provide a detailed, user friendly representation
244
+ def inspect
245
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
246
+ "<Twilio.Bulkexports.V1.JobInstance #{values}>"
247
+ end
248
+ end
249
+ end
250
+ end
251
+ end
252
+ end
253
+ end
@@ -0,0 +1,242 @@
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 Bulkexports < Domain
12
+ class V1 < Version
13
+ ##
14
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
15
+ class ExportConfigurationList < ListResource
16
+ ##
17
+ # Initialize the ExportConfigurationList
18
+ # @param [Version] version Version that contains the resource
19
+ # @return [ExportConfigurationList] ExportConfigurationList
20
+ def initialize(version)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {}
25
+ end
26
+
27
+ ##
28
+ # Provide a user friendly representation
29
+ def to_s
30
+ '#<Twilio.Bulkexports.V1.ExportConfigurationList>'
31
+ end
32
+ end
33
+
34
+ ##
35
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
36
+ class ExportConfigurationPage < Page
37
+ ##
38
+ # Initialize the ExportConfigurationPage
39
+ # @param [Version] version Version that contains the resource
40
+ # @param [Response] response Response from the API
41
+ # @param [Hash] solution Path solution for the resource
42
+ # @return [ExportConfigurationPage] ExportConfigurationPage
43
+ def initialize(version, response, solution)
44
+ super(version, response)
45
+
46
+ # Path Solution
47
+ @solution = solution
48
+ end
49
+
50
+ ##
51
+ # Build an instance of ExportConfigurationInstance
52
+ # @param [Hash] payload Payload response from the API
53
+ # @return [ExportConfigurationInstance] ExportConfigurationInstance
54
+ def get_instance(payload)
55
+ ExportConfigurationInstance.new(@version, payload, )
56
+ end
57
+
58
+ ##
59
+ # Provide a user friendly representation
60
+ def to_s
61
+ '<Twilio.Bulkexports.V1.ExportConfigurationPage>'
62
+ end
63
+ end
64
+
65
+ ##
66
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
67
+ class ExportConfigurationContext < InstanceContext
68
+ ##
69
+ # Initialize the ExportConfigurationContext
70
+ # @param [Version] version Version that contains the resource
71
+ # @param [String] resource_type The type of communication – Messages, Calls
72
+ # @return [ExportConfigurationContext] ExportConfigurationContext
73
+ def initialize(version, resource_type)
74
+ super(version)
75
+
76
+ # Path Solution
77
+ @solution = {resource_type: resource_type, }
78
+ @uri = "/Exports/#{@solution[:resource_type]}/Configuration"
79
+ end
80
+
81
+ ##
82
+ # Fetch a ExportConfigurationInstance
83
+ # @return [ExportConfigurationInstance] Fetched ExportConfigurationInstance
84
+ def fetch
85
+ params = Twilio::Values.of({})
86
+
87
+ payload = @version.fetch(
88
+ 'GET',
89
+ @uri,
90
+ params,
91
+ )
92
+
93
+ ExportConfigurationInstance.new(@version, payload, resource_type: @solution[:resource_type], )
94
+ end
95
+
96
+ ##
97
+ # Update the ExportConfigurationInstance
98
+ # @param [Boolean] enabled If true, Twilio will automatically generate every day's
99
+ # file when the day is over.
100
+ # @param [String] webhook_url Stores the URL destination for the method specified
101
+ # in webhook_method.
102
+ # @param [String] webhook_method Sets whether Twilio should call a webhook URL
103
+ # when the automatic generation is complete, using GET or POST. The actual
104
+ # destination is set in the webhook_url
105
+ # @return [ExportConfigurationInstance] Updated ExportConfigurationInstance
106
+ def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset)
107
+ data = Twilio::Values.of({
108
+ 'Enabled' => enabled,
109
+ 'WebhookUrl' => webhook_url,
110
+ 'WebhookMethod' => webhook_method,
111
+ })
112
+
113
+ payload = @version.update(
114
+ 'POST',
115
+ @uri,
116
+ data: data,
117
+ )
118
+
119
+ ExportConfigurationInstance.new(@version, payload, resource_type: @solution[:resource_type], )
120
+ end
121
+
122
+ ##
123
+ # Provide a user friendly representation
124
+ def to_s
125
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
126
+ "#<Twilio.Bulkexports.V1.ExportConfigurationContext #{context}>"
127
+ end
128
+
129
+ ##
130
+ # Provide a detailed, user friendly representation
131
+ def inspect
132
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
133
+ "#<Twilio.Bulkexports.V1.ExportConfigurationContext #{context}>"
134
+ end
135
+ end
136
+
137
+ ##
138
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
139
+ class ExportConfigurationInstance < InstanceResource
140
+ ##
141
+ # Initialize the ExportConfigurationInstance
142
+ # @param [Version] version Version that contains the resource
143
+ # @param [Hash] payload payload that contains response from Twilio
144
+ # @param [String] resource_type The type of communication – Messages, Calls
145
+ # @return [ExportConfigurationInstance] ExportConfigurationInstance
146
+ def initialize(version, payload, resource_type: nil)
147
+ super(version)
148
+
149
+ # Marshaled Properties
150
+ @properties = {
151
+ 'enabled' => payload['enabled'],
152
+ 'webhook_url' => payload['webhook_url'],
153
+ 'webhook_method' => payload['webhook_method'],
154
+ 'resource_type' => payload['resource_type'],
155
+ 'url' => payload['url'],
156
+ }
157
+
158
+ # Context
159
+ @instance_context = nil
160
+ @params = {'resource_type' => resource_type || @properties['resource_type'], }
161
+ end
162
+
163
+ ##
164
+ # Generate an instance context for the instance, the context is capable of
165
+ # performing various actions. All instance actions are proxied to the context
166
+ # @return [ExportConfigurationContext] ExportConfigurationContext for this ExportConfigurationInstance
167
+ def context
168
+ unless @instance_context
169
+ @instance_context = ExportConfigurationContext.new(@version, @params['resource_type'], )
170
+ end
171
+ @instance_context
172
+ end
173
+
174
+ ##
175
+ # @return [Boolean] Whether files are automatically generated
176
+ def enabled
177
+ @properties['enabled']
178
+ end
179
+
180
+ ##
181
+ # @return [String] URL targeted at export
182
+ def webhook_url
183
+ @properties['webhook_url']
184
+ end
185
+
186
+ ##
187
+ # @return [String] Whether to GET or POST to the webhook url
188
+ def webhook_method
189
+ @properties['webhook_method']
190
+ end
191
+
192
+ ##
193
+ # @return [String] The type of communication – Messages, Calls
194
+ def resource_type
195
+ @properties['resource_type']
196
+ end
197
+
198
+ ##
199
+ # @return [String] The URL of this resource.
200
+ def url
201
+ @properties['url']
202
+ end
203
+
204
+ ##
205
+ # Fetch a ExportConfigurationInstance
206
+ # @return [ExportConfigurationInstance] Fetched ExportConfigurationInstance
207
+ def fetch
208
+ context.fetch
209
+ end
210
+
211
+ ##
212
+ # Update the ExportConfigurationInstance
213
+ # @param [Boolean] enabled If true, Twilio will automatically generate every day's
214
+ # file when the day is over.
215
+ # @param [String] webhook_url Stores the URL destination for the method specified
216
+ # in webhook_method.
217
+ # @param [String] webhook_method Sets whether Twilio should call a webhook URL
218
+ # when the automatic generation is complete, using GET or POST. The actual
219
+ # destination is set in the webhook_url
220
+ # @return [ExportConfigurationInstance] Updated ExportConfigurationInstance
221
+ def update(enabled: :unset, webhook_url: :unset, webhook_method: :unset)
222
+ context.update(enabled: enabled, webhook_url: webhook_url, webhook_method: webhook_method, )
223
+ end
224
+
225
+ ##
226
+ # Provide a user friendly representation
227
+ def to_s
228
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
229
+ "<Twilio.Bulkexports.V1.ExportConfigurationInstance #{values}>"
230
+ end
231
+
232
+ ##
233
+ # Provide a detailed, user friendly representation
234
+ def inspect
235
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
236
+ "<Twilio.Bulkexports.V1.ExportConfigurationInstance #{values}>"
237
+ end
238
+ end
239
+ end
240
+ end
241
+ end
242
+ end