twilio-ruby 7.8.7 → 7.9.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.
@@ -0,0 +1,208 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Messaging
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class Messaging < MessagingBase
19
+ class V1 < Version
20
+ class DomainValidateDnList < ListResource
21
+
22
+ ##
23
+ # Initialize the DomainValidateDnList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [DomainValidateDnList] DomainValidateDnList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+
31
+
32
+ end
33
+
34
+
35
+
36
+ # Provide a user friendly representation
37
+ def to_s
38
+ '#<Twilio.Messaging.V1.DomainValidateDnList>'
39
+ end
40
+ end
41
+
42
+
43
+ class DomainValidateDnContext < InstanceContext
44
+ ##
45
+ # Initialize the DomainValidateDnContext
46
+ # @param [Version] version Version that contains the resource
47
+ # @param [String] domain_sid Unique string used to identify the domain.
48
+ # @return [DomainValidateDnContext] DomainValidateDnContext
49
+ def initialize(version, domain_sid)
50
+ super(version)
51
+
52
+ # Path Solution
53
+ @solution = { domain_sid: domain_sid, }
54
+ @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/ValidateDns"
55
+
56
+
57
+ end
58
+ ##
59
+ # Fetch the DomainValidateDnInstance
60
+ # @return [DomainValidateDnInstance] Fetched DomainValidateDnInstance
61
+ def fetch
62
+
63
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
64
+
65
+
66
+
67
+
68
+
69
+ payload = @version.fetch('GET', @uri, headers: headers)
70
+ DomainValidateDnInstance.new(
71
+ @version,
72
+ payload,
73
+ domain_sid: @solution[:domain_sid],
74
+ )
75
+ end
76
+
77
+
78
+ ##
79
+ # Provide a user friendly representation
80
+ def to_s
81
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
82
+ "#<Twilio.Messaging.V1.DomainValidateDnContext #{context}>"
83
+ end
84
+
85
+ ##
86
+ # Provide a detailed, user friendly representation
87
+ def inspect
88
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
89
+ "#<Twilio.Messaging.V1.DomainValidateDnContext #{context}>"
90
+ end
91
+ end
92
+
93
+ class DomainValidateDnPage < Page
94
+ ##
95
+ # Initialize the DomainValidateDnPage
96
+ # @param [Version] version Version that contains the resource
97
+ # @param [Response] response Response from the API
98
+ # @param [Hash] solution Path solution for the resource
99
+ # @return [DomainValidateDnPage] DomainValidateDnPage
100
+ def initialize(version, response, solution)
101
+ super(version, response)
102
+
103
+ # Path Solution
104
+ @solution = solution
105
+ end
106
+
107
+ ##
108
+ # Build an instance of DomainValidateDnInstance
109
+ # @param [Hash] payload Payload response from the API
110
+ # @return [DomainValidateDnInstance] DomainValidateDnInstance
111
+ def get_instance(payload)
112
+ DomainValidateDnInstance.new(@version, payload)
113
+ end
114
+
115
+ ##
116
+ # Provide a user friendly representation
117
+ def to_s
118
+ '<Twilio.Messaging.V1.DomainValidateDnPage>'
119
+ end
120
+ end
121
+ class DomainValidateDnInstance < InstanceResource
122
+ ##
123
+ # Initialize the DomainValidateDnInstance
124
+ # @param [Version] version Version that contains the resource
125
+ # @param [Hash] payload payload that contains response from Twilio
126
+ # @param [String] account_sid The SID of the
127
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this DomainValidateDn
128
+ # resource.
129
+ # @param [String] sid The SID of the Call resource to fetch.
130
+ # @return [DomainValidateDnInstance] DomainValidateDnInstance
131
+ def initialize(version, payload , domain_sid: nil)
132
+ super(version)
133
+
134
+ # Marshaled Properties
135
+ @properties = {
136
+ 'domain_sid' => payload['domain_sid'],
137
+ 'is_valid' => payload['is_valid'],
138
+ 'reason' => payload['reason'],
139
+ 'url' => payload['url'],
140
+ }
141
+
142
+ # Context
143
+ @instance_context = nil
144
+ @params = { 'domain_sid' => domain_sid || @properties['domain_sid'] , }
145
+ end
146
+
147
+ ##
148
+ # Generate an instance context for the instance, the context is capable of
149
+ # performing various actions. All instance actions are proxied to the context
150
+ # @return [DomainValidateDnContext] CallContext for this CallInstance
151
+ def context
152
+ unless @instance_context
153
+ @instance_context = DomainValidateDnContext.new(@version , @params['domain_sid'])
154
+ end
155
+ @instance_context
156
+ end
157
+
158
+ ##
159
+ # @return [String] The unique string that we created to identify the Domain resource.
160
+ def domain_sid
161
+ @properties['domain_sid']
162
+ end
163
+
164
+ ##
165
+ # @return [Boolean]
166
+ def is_valid
167
+ @properties['is_valid']
168
+ end
169
+
170
+ ##
171
+ # @return [String]
172
+ def reason
173
+ @properties['reason']
174
+ end
175
+
176
+ ##
177
+ # @return [String]
178
+ def url
179
+ @properties['url']
180
+ end
181
+
182
+ ##
183
+ # Fetch the DomainValidateDnInstance
184
+ # @return [DomainValidateDnInstance] Fetched DomainValidateDnInstance
185
+ def fetch
186
+
187
+ context.fetch
188
+ end
189
+
190
+ ##
191
+ # Provide a user friendly representation
192
+ def to_s
193
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
194
+ "<Twilio.Messaging.V1.DomainValidateDnInstance #{values}>"
195
+ end
196
+
197
+ ##
198
+ # Provide a detailed, user friendly representation
199
+ def inspect
200
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
201
+ "<Twilio.Messaging.V1.DomainValidateDnInstance #{values}>"
202
+ end
203
+ end
204
+
205
+ end
206
+ end
207
+ end
208
+ end
@@ -26,6 +26,7 @@ module Twilio
26
26
  @domain_certs = nil
27
27
  @domain_config = nil
28
28
  @domain_config_messaging_service = nil
29
+ @domain_validate_dns = nil
29
30
  @external_campaign = nil
30
31
  @linkshortening_messaging_service = nil
31
32
  @linkshortening_messaging_service_domain_association = nil
@@ -97,6 +98,20 @@ module Twilio
97
98
  end
98
99
  end
99
100
  ##
101
+ # @param [String] domain_sid Unique string used to identify the domain.
102
+ # @return [Twilio::REST::Messaging::V1::DomainValidateDnContext] if domainSid was passed.
103
+ # @return [Twilio::REST::Messaging::V1::DomainValidateDnList]
104
+ def domain_validate_dns(domain_sid=:unset)
105
+ if domain_sid.nil?
106
+ raise ArgumentError, 'domain_sid cannot be nil'
107
+ end
108
+ if domain_sid == :unset
109
+ @domain_validate_dns ||= DomainValidateDnList.new self
110
+ else
111
+ DomainValidateDnContext.new(self, domain_sid)
112
+ end
113
+ end
114
+ ##
100
115
  # @return [Twilio::REST::Messaging::V1::ExternalCampaignList]
101
116
  def external_campaign
102
117
  @external_campaign ||= ExternalCampaignList.new self
@@ -0,0 +1,250 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Messaging
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class Messaging < MessagingBase
19
+ class V2 < Version
20
+ class DomainCertsList < ListResource
21
+
22
+ ##
23
+ # Initialize the DomainCertsList
24
+ # @param [Version] version Version that contains the resource
25
+ # @return [DomainCertsList] DomainCertsList
26
+ def initialize(version)
27
+ super(version)
28
+ # Path Solution
29
+ @solution = { }
30
+
31
+
32
+ end
33
+
34
+
35
+
36
+ # Provide a user friendly representation
37
+ def to_s
38
+ '#<Twilio.Messaging.V2.DomainCertsList>'
39
+ end
40
+ end
41
+
42
+
43
+ class DomainCertsContext < InstanceContext
44
+ ##
45
+ # Initialize the DomainCertsContext
46
+ # @param [Version] version Version that contains the resource
47
+ # @param [String] domain_sid Unique string used to identify the domain that this certificate should be associated with.
48
+ # @return [DomainCertsContext] DomainCertsContext
49
+ def initialize(version, domain_sid)
50
+ super(version)
51
+
52
+ # Path Solution
53
+ @solution = { domain_sid: domain_sid, }
54
+ @uri = "/LinkShortening/Domains/#{@solution[:domain_sid]}/Certificate"
55
+
56
+
57
+ end
58
+ ##
59
+ # Fetch the DomainCertsInstance
60
+ # @return [DomainCertsInstance] Fetched DomainCertsInstance
61
+ def fetch
62
+
63
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
64
+
65
+
66
+
67
+
68
+
69
+ payload = @version.fetch('GET', @uri, headers: headers)
70
+ DomainCertsInstance.new(
71
+ @version,
72
+ payload,
73
+ domain_sid: @solution[:domain_sid],
74
+ )
75
+ end
76
+
77
+
78
+ ##
79
+ # Provide a user friendly representation
80
+ def to_s
81
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
82
+ "#<Twilio.Messaging.V2.DomainCertsContext #{context}>"
83
+ end
84
+
85
+ ##
86
+ # Provide a detailed, user friendly representation
87
+ def inspect
88
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
89
+ "#<Twilio.Messaging.V2.DomainCertsContext #{context}>"
90
+ end
91
+ end
92
+
93
+ class DomainCertsPage < Page
94
+ ##
95
+ # Initialize the DomainCertsPage
96
+ # @param [Version] version Version that contains the resource
97
+ # @param [Response] response Response from the API
98
+ # @param [Hash] solution Path solution for the resource
99
+ # @return [DomainCertsPage] DomainCertsPage
100
+ def initialize(version, response, solution)
101
+ super(version, response)
102
+
103
+ # Path Solution
104
+ @solution = solution
105
+ end
106
+
107
+ ##
108
+ # Build an instance of DomainCertsInstance
109
+ # @param [Hash] payload Payload response from the API
110
+ # @return [DomainCertsInstance] DomainCertsInstance
111
+ def get_instance(payload)
112
+ DomainCertsInstance.new(@version, payload)
113
+ end
114
+
115
+ ##
116
+ # Provide a user friendly representation
117
+ def to_s
118
+ '<Twilio.Messaging.V2.DomainCertsPage>'
119
+ end
120
+ end
121
+ class DomainCertsInstance < InstanceResource
122
+ ##
123
+ # Initialize the DomainCertsInstance
124
+ # @param [Version] version Version that contains the resource
125
+ # @param [Hash] payload payload that contains response from Twilio
126
+ # @param [String] account_sid The SID of the
127
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this DomainCerts
128
+ # resource.
129
+ # @param [String] sid The SID of the Call resource to fetch.
130
+ # @return [DomainCertsInstance] DomainCertsInstance
131
+ def initialize(version, payload , domain_sid: nil)
132
+ super(version)
133
+
134
+ # Marshaled Properties
135
+ @properties = {
136
+ 'domain_sid' => payload['domain_sid'],
137
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
138
+ 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
139
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
140
+ 'domain_name' => payload['domain_name'],
141
+ 'certificate_sid' => payload['certificate_sid'],
142
+ 'managed' => payload['managed'],
143
+ 'requesting' => payload['requesting'],
144
+ 'url' => payload['url'],
145
+ 'cert_in_validation' => payload['cert_in_validation'],
146
+ }
147
+
148
+ # Context
149
+ @instance_context = nil
150
+ @params = { 'domain_sid' => domain_sid || @properties['domain_sid'] , }
151
+ end
152
+
153
+ ##
154
+ # Generate an instance context for the instance, the context is capable of
155
+ # performing various actions. All instance actions are proxied to the context
156
+ # @return [DomainCertsContext] CallContext for this CallInstance
157
+ def context
158
+ unless @instance_context
159
+ @instance_context = DomainCertsContext.new(@version , @params['domain_sid'])
160
+ end
161
+ @instance_context
162
+ end
163
+
164
+ ##
165
+ # @return [String] The unique string that we created to identify the Domain resource.
166
+ def domain_sid
167
+ @properties['domain_sid']
168
+ end
169
+
170
+ ##
171
+ # @return [Time] Date that this Domain was last updated.
172
+ def date_updated
173
+ @properties['date_updated']
174
+ end
175
+
176
+ ##
177
+ # @return [Time] Date that the private certificate associated with this domain expires. You will need to update the certificate before that date to ensure your shortened links will continue to work.
178
+ def date_expires
179
+ @properties['date_expires']
180
+ end
181
+
182
+ ##
183
+ # @return [Time] Date that this Domain was registered to the Twilio platform to create a new Domain object.
184
+ def date_created
185
+ @properties['date_created']
186
+ end
187
+
188
+ ##
189
+ # @return [String] Full url path for this domain.
190
+ def domain_name
191
+ @properties['domain_name']
192
+ end
193
+
194
+ ##
195
+ # @return [String] The unique string that we created to identify this Certificate resource.
196
+ def certificate_sid
197
+ @properties['certificate_sid']
198
+ end
199
+
200
+ ##
201
+ # @return [Boolean] Boolean field that indicates whether the certificate is managed by Twilio or uploaded by the customer.
202
+ def managed
203
+ @properties['managed']
204
+ end
205
+
206
+ ##
207
+ # @return [Boolean] Boolean field that indicates whether a Twilio managed cert request is in progress or completed. True indicates a request is in progress and false indicates the request has completed or not requested yet.
208
+ def requesting
209
+ @properties['requesting']
210
+ end
211
+
212
+ ##
213
+ # @return [String]
214
+ def url
215
+ @properties['url']
216
+ end
217
+
218
+ ##
219
+ # @return [Hash] Optional JSON field describing the status and upload date of a new certificate in the process of validation
220
+ def cert_in_validation
221
+ @properties['cert_in_validation']
222
+ end
223
+
224
+ ##
225
+ # Fetch the DomainCertsInstance
226
+ # @return [DomainCertsInstance] Fetched DomainCertsInstance
227
+ def fetch
228
+
229
+ context.fetch
230
+ end
231
+
232
+ ##
233
+ # Provide a user friendly representation
234
+ def to_s
235
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
236
+ "<Twilio.Messaging.V2.DomainCertsInstance #{values}>"
237
+ end
238
+
239
+ ##
240
+ # Provide a detailed, user friendly representation
241
+ def inspect
242
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
243
+ "<Twilio.Messaging.V2.DomainCertsInstance #{values}>"
244
+ end
245
+ end
246
+
247
+ end
248
+ end
249
+ end
250
+ end
@@ -22,6 +22,7 @@ module Twilio
22
22
  super
23
23
  @version = 'v2'
24
24
  @channels_senders = nil
25
+ @domain_certs = nil
25
26
  @typing_indicator = nil
26
27
  end
27
28
 
@@ -40,6 +41,20 @@ module Twilio
40
41
  end
41
42
  end
42
43
  ##
44
+ # @param [String] domain_sid Unique string used to identify the domain that this certificate should be associated with.
45
+ # @return [Twilio::REST::Messaging::V2::DomainCertsContext] if domainSid was passed.
46
+ # @return [Twilio::REST::Messaging::V2::DomainCertsList]
47
+ def domain_certs(domain_sid=:unset)
48
+ if domain_sid.nil?
49
+ raise ArgumentError, 'domain_sid cannot be nil'
50
+ end
51
+ if domain_sid == :unset
52
+ @domain_certs ||= DomainCertsList.new self
53
+ else
54
+ DomainCertsContext.new(self, domain_sid)
55
+ end
56
+ end
57
+ ##
43
58
  # @return [Twilio::REST::Messaging::V2::TypingIndicatorList]
44
59
  def typing_indicator
45
60
  @typing_indicator ||= TypingIndicatorList.new self
@@ -39,8 +39,8 @@ module Twilio
39
39
  # @param [String] size Number of items per page
40
40
  # @param [String] port_in_request_sid Filter by Port in request SID, supports multiple values separated by comma
41
41
  # @param [String] port_in_request_status Filter by Port In request status
42
- # @param [Time] created_before Find all created before a certain date
43
- # @param [Time] created_after Find all created after a certain date
42
+ # @param [String] created_before Find all created before a certain date
43
+ # @param [String] created_after Find all created after a certain date
44
44
  # @param [Integer] limit Upper limit for the number of records to return. stream()
45
45
  # guarantees to never return more than limit. Default is no limit
46
46
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -69,8 +69,8 @@ module Twilio
69
69
  # @param [String] size Number of items per page
70
70
  # @param [String] port_in_request_sid Filter by Port in request SID, supports multiple values separated by comma
71
71
  # @param [String] port_in_request_status Filter by Port In request status
72
- # @param [Time] created_before Find all created before a certain date
73
- # @param [Time] created_after Find all created after a certain date
72
+ # @param [String] created_before Find all created before a certain date
73
+ # @param [String] created_after Find all created after a certain date
74
74
  # @param [Integer] limit Upper limit for the number of records to return. stream()
75
75
  # guarantees to never return more than limit. Default is no limit
76
76
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -114,8 +114,8 @@ module Twilio
114
114
  # @param [String] size Number of items per page
115
115
  # @param [String] port_in_request_sid Filter by Port in request SID, supports multiple values separated by comma
116
116
  # @param [String] port_in_request_status Filter by Port In request status
117
- # @param [Time] created_before Find all created before a certain date
118
- # @param [Time] created_after Find all created after a certain date
117
+ # @param [String] created_before Find all created before a certain date
118
+ # @param [String] created_after Find all created after a certain date
119
119
  # @param [String] page_token PageToken provided by the API
120
120
  # @param [Integer] page_number Page Number, this value is simply for client state
121
121
  # @param [Integer] page_size Number of records to return, defaults to 50
@@ -126,8 +126,8 @@ module Twilio
126
126
  'Size' => size,
127
127
  'PortInRequestSid' => port_in_request_sid,
128
128
  'PortInRequestStatus' => port_in_request_status,
129
- 'CreatedBefore' => Twilio.serialize_iso8601_datetime(created_before),
130
- 'CreatedAfter' => Twilio.serialize_iso8601_datetime(created_after),
129
+ 'CreatedBefore' => created_before,
130
+ 'CreatedAfter' => created_after,
131
131
  'PageToken' => page_token,
132
132
  'Page' => page_number,
133
133
  'PageSize' => page_size,
@@ -32,6 +32,7 @@ module Twilio
32
32
  end
33
33
  ##
34
34
  # Create the TokenInstance
35
+ # @param [String] account_sid Optional Account SID to perform on behalf of requests.
35
36
  # @param [String] grant_type Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token.
36
37
  # @param [String] client_id A 34 character string that uniquely identifies this OAuth App.
37
38
  # @param [String] client_secret The credential for confidential OAuth App.
@@ -42,6 +43,7 @@ module Twilio
42
43
  # @param [String] scope The scope of token
43
44
  # @return [TokenInstance] Created TokenInstance
44
45
  def create(
46
+ account_sid: :unset,
45
47
  grant_type: :unset,
46
48
  client_id: :unset,
47
49
  client_secret: :unset,
@@ -52,6 +54,9 @@ module Twilio
52
54
  scope: :unset
53
55
  )
54
56
 
57
+ params = Twilio::Values.of({
58
+ 'account_sid' => account_sid,
59
+ })
55
60
  data = Twilio::Values.of({
56
61
  'grant_type' => grant_type,
57
62
  'client_id' => client_id,
@@ -69,7 +74,7 @@ module Twilio
69
74
 
70
75
 
71
76
 
72
- payload = @version.create('POST', @uri, data: data, headers: headers)
77
+ payload = @version.create('POST', @uri, params: params, data: data, headers: headers)
73
78
  TokenInstance.new(
74
79
  @version,
75
80
  payload,
@@ -331,7 +331,7 @@ module Twilio
331
331
  end
332
332
 
333
333
  ##
334
- # @return [Hash] The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` or `false`.
334
+ # @return [TrunkingV1TrunkPhoneNumberCapabilities]
335
335
  def capabilities
336
336
  @properties['capabilities']
337
337
  end