zernio-sdk 0.0.846 → 0.0.848
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.
- checksums.yaml +4 -4
- data/docs/CreatePhoneNumberStockWatchRequest.md +3 -1
- data/docs/PhoneNumberStockWatch.md +2 -0
- data/docs/PhoneNumbersApi.md +1 -1
- data/docs/SendInboxMessage400Response.md +1 -1
- data/lib/zernio-sdk/api/phone_numbers_api.rb +2 -2
- data/lib/zernio-sdk/models/create_inbox_conversation400_response.rb +2 -2
- data/lib/zernio-sdk/models/create_phone_number_stock_watch_request.rb +48 -4
- data/lib/zernio-sdk/models/phone_number_stock_watch.rb +48 -1
- data/lib/zernio-sdk/models/send_inbox_message400_response.rb +3 -3
- data/lib/zernio-sdk/version.rb +1 -1
- data/openapi.yaml +22 -9
- data/spec/api/phone_numbers_api_spec.rb +1 -1
- data/spec/models/create_inbox_conversation400_response_spec.rb +1 -1
- data/spec/models/create_phone_number_stock_watch_request_spec.rb +10 -0
- data/spec/models/phone_number_stock_watch_spec.rb +10 -0
- data/spec/models/send_inbox_message400_response_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8bae5f1c84fdec763ef43f93d2ac74de874a656369e398bf5198433a08848e4
|
|
4
|
+
data.tar.gz: 6ad3b2aec91a9bdcf7ded38410d06cf3d9cf5e2d82ccb86e59fc441f41641050
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 424648936bb7436db8b8d66655347bbd71100915773bd1ab2f5f4180097215a488bf4cef238c8331c14b738678787f506d21917da12b82776339637da68ecf3c
|
|
7
|
+
data.tar.gz: b9a1c4555a35505382c0d2f54af4157567dc9fcf57ed7158833a558d06dec9f5b6cc4b1fca2b15566836c232842744fa410a864cff9cff8a844f924acaa5f7e8
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **country** | **String** | ISO 3166-1 alpha-2 code of a country listed by GET /v1/phone-numbers/countries. | |
|
|
8
|
+
| **number_type** | **String** | Narrow the watch to one number type. Omit to be notified when any type in the country is back. | [optional] |
|
|
8
9
|
|
|
9
10
|
## Example
|
|
10
11
|
|
|
@@ -12,7 +13,8 @@
|
|
|
12
13
|
require 'zernio-sdk'
|
|
13
14
|
|
|
14
15
|
instance = Zernio::CreatePhoneNumberStockWatchRequest.new(
|
|
15
|
-
country: null
|
|
16
|
+
country: null,
|
|
17
|
+
number_type: null
|
|
16
18
|
)
|
|
17
19
|
```
|
|
18
20
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
| **id** | **String** | | |
|
|
8
8
|
| **country** | **String** | ISO 3166-1 alpha-2. | |
|
|
9
9
|
| **country_name** | **String** | | |
|
|
10
|
+
| **number_type** | **String** | The watched number type, or null when the watch covers every type in the country. | |
|
|
10
11
|
| **created_at** | **Time** | | |
|
|
11
12
|
|
|
12
13
|
## Example
|
|
@@ -18,6 +19,7 @@ instance = Zernio::PhoneNumberStockWatch.new(
|
|
|
18
19
|
id: null,
|
|
19
20
|
country: null,
|
|
20
21
|
country_name: null,
|
|
22
|
+
number_type: null,
|
|
21
23
|
created_at: null
|
|
22
24
|
)
|
|
23
25
|
```
|
data/docs/PhoneNumbersApi.md
CHANGED
|
@@ -391,7 +391,7 @@ end
|
|
|
391
391
|
|
|
392
392
|
Watch an out-of-stock country
|
|
393
393
|
|
|
394
|
-
Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 countries can be watched
|
|
394
|
+
Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country and number type; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 watches at once. Countries and types marked `fulfilment: request` by GET /v1/phone-numbers/countries can also be watched. Those are sourced by a carrier request rather than held in stock, so a watch records interest and no date is implied.
|
|
395
395
|
|
|
396
396
|
### Examples
|
|
397
397
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **error** | **String** | | [optional] |
|
|
8
|
-
| **code** | **String** | Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to. | [optional] |
|
|
8
|
+
| **code** | **String** | Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to; DIRECT_SEND_NOT_ELIGIBLE and DIRECT_SEND_BLOCKED mean the WhatsApp Business Account needs Meta to grant or restore Direct Send access; DIRECT_SEND_LIMITED is temporary, Meta lifts it on its own. | [optional] |
|
|
9
9
|
| **platform_error** | [**SendInboxMessage400ResponsePlatformError**](SendInboxMessage400ResponsePlatformError.md) | | [optional] |
|
|
10
10
|
|
|
11
11
|
## Example
|
|
@@ -361,7 +361,7 @@ module Zernio
|
|
|
361
361
|
end
|
|
362
362
|
|
|
363
363
|
# Watch an out-of-stock country
|
|
364
|
-
# Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 countries can be watched
|
|
364
|
+
# Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country and number type; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 watches at once. Countries and types marked `fulfilment: request` by GET /v1/phone-numbers/countries can also be watched. Those are sourced by a carrier request rather than held in stock, so a watch records interest and no date is implied.
|
|
365
365
|
# @param create_phone_number_stock_watch_request [CreatePhoneNumberStockWatchRequest]
|
|
366
366
|
# @param [Hash] opts the optional parameters
|
|
367
367
|
# @return [PhoneNumberStockWatch]
|
|
@@ -371,7 +371,7 @@ module Zernio
|
|
|
371
371
|
end
|
|
372
372
|
|
|
373
373
|
# Watch an out-of-stock country
|
|
374
|
-
# Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 countries can be watched
|
|
374
|
+
# Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country and number type; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 watches at once. Countries and types marked `fulfilment: request` by GET /v1/phone-numbers/countries can also be watched. Those are sourced by a carrier request rather than held in stock, so a watch records interest and no date is implied.
|
|
375
375
|
# @param create_phone_number_stock_watch_request [CreatePhoneNumberStockWatchRequest]
|
|
376
376
|
# @param [Hash] opts the optional parameters
|
|
377
377
|
# @return [Array<(PhoneNumberStockWatch, Integer, Hash)>] PhoneNumberStockWatch data, response status code and response headers
|
|
@@ -110,7 +110,7 @@ module Zernio
|
|
|
110
110
|
# @return true if the model is valid
|
|
111
111
|
def valid?
|
|
112
112
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
113
|
-
code_validator = EnumAttributeValidator.new('String', ["PLATFORM_NOT_SUPPORTED"])
|
|
113
|
+
code_validator = EnumAttributeValidator.new('String', ["PLATFORM_NOT_SUPPORTED", "PLATFORM_LIMITATION", "TEMPLATE_REQUIRED", "INVALID_TEMPLATE_PARAMS", "INVALID_TEMPLATE_BUTTON_PARAM", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED"])
|
|
114
114
|
return false unless code_validator.valid?(@code)
|
|
115
115
|
true
|
|
116
116
|
end
|
|
@@ -118,7 +118,7 @@ module Zernio
|
|
|
118
118
|
# Custom attribute writer method checking allowed values (enum).
|
|
119
119
|
# @param [Object] code Object to be assigned
|
|
120
120
|
def code=(code)
|
|
121
|
-
validator = EnumAttributeValidator.new('String', ["PLATFORM_NOT_SUPPORTED"])
|
|
121
|
+
validator = EnumAttributeValidator.new('String', ["PLATFORM_NOT_SUPPORTED", "PLATFORM_LIMITATION", "TEMPLATE_REQUIRED", "INVALID_TEMPLATE_PARAMS", "INVALID_TEMPLATE_BUTTON_PARAM", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED"])
|
|
122
122
|
unless validator.valid?(code)
|
|
123
123
|
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
124
124
|
end
|
|
@@ -18,10 +18,36 @@ module Zernio
|
|
|
18
18
|
# ISO 3166-1 alpha-2 code of a country listed by GET /v1/phone-numbers/countries.
|
|
19
19
|
attr_accessor :country
|
|
20
20
|
|
|
21
|
+
# Narrow the watch to one number type. Omit to be notified when any type in the country is back.
|
|
22
|
+
attr_accessor :number_type
|
|
23
|
+
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
21
46
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
47
|
def self.attribute_map
|
|
23
48
|
{
|
|
24
|
-
:'country' => :'country'
|
|
49
|
+
:'country' => :'country',
|
|
50
|
+
:'number_type' => :'numberType'
|
|
25
51
|
}
|
|
26
52
|
end
|
|
27
53
|
|
|
@@ -38,7 +64,8 @@ module Zernio
|
|
|
38
64
|
# Attribute type mapping.
|
|
39
65
|
def self.openapi_types
|
|
40
66
|
{
|
|
41
|
-
:'country' => :'String'
|
|
67
|
+
:'country' => :'String',
|
|
68
|
+
:'number_type' => :'String'
|
|
42
69
|
}
|
|
43
70
|
end
|
|
44
71
|
|
|
@@ -69,6 +96,10 @@ module Zernio
|
|
|
69
96
|
else
|
|
70
97
|
self.country = nil
|
|
71
98
|
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'number_type')
|
|
101
|
+
self.number_type = attributes[:'number_type']
|
|
102
|
+
end
|
|
72
103
|
end
|
|
73
104
|
|
|
74
105
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -98,6 +129,8 @@ module Zernio
|
|
|
98
129
|
return false if @country.nil?
|
|
99
130
|
return false if @country.to_s.length > 2
|
|
100
131
|
return false if @country.to_s.length < 2
|
|
132
|
+
number_type_validator = EnumAttributeValidator.new('String', ["local", "mobile", "national", "toll_free"])
|
|
133
|
+
return false unless number_type_validator.valid?(@number_type)
|
|
101
134
|
true
|
|
102
135
|
end
|
|
103
136
|
|
|
@@ -119,12 +152,23 @@ module Zernio
|
|
|
119
152
|
@country = country
|
|
120
153
|
end
|
|
121
154
|
|
|
155
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
156
|
+
# @param [Object] number_type Object to be assigned
|
|
157
|
+
def number_type=(number_type)
|
|
158
|
+
validator = EnumAttributeValidator.new('String', ["local", "mobile", "national", "toll_free"])
|
|
159
|
+
unless validator.valid?(number_type)
|
|
160
|
+
fail ArgumentError, "invalid value for \"number_type\", must be one of #{validator.allowable_values}."
|
|
161
|
+
end
|
|
162
|
+
@number_type = number_type
|
|
163
|
+
end
|
|
164
|
+
|
|
122
165
|
# Checks equality by comparing each attribute.
|
|
123
166
|
# @param [Object] Object to be compared
|
|
124
167
|
def ==(o)
|
|
125
168
|
return true if self.equal?(o)
|
|
126
169
|
self.class == o.class &&
|
|
127
|
-
country == o.country
|
|
170
|
+
country == o.country &&
|
|
171
|
+
number_type == o.number_type
|
|
128
172
|
end
|
|
129
173
|
|
|
130
174
|
# @see the `==` method
|
|
@@ -136,7 +180,7 @@ module Zernio
|
|
|
136
180
|
# Calculates hash code according to all attributes.
|
|
137
181
|
# @return [Integer] Hash code
|
|
138
182
|
def hash
|
|
139
|
-
[country].hash
|
|
183
|
+
[country, number_type].hash
|
|
140
184
|
end
|
|
141
185
|
|
|
142
186
|
# Builds the object from hash
|
|
@@ -22,14 +22,40 @@ module Zernio
|
|
|
22
22
|
|
|
23
23
|
attr_accessor :country_name
|
|
24
24
|
|
|
25
|
+
# The watched number type, or null when the watch covers every type in the country.
|
|
26
|
+
attr_accessor :number_type
|
|
27
|
+
|
|
25
28
|
attr_accessor :created_at
|
|
26
29
|
|
|
30
|
+
class EnumAttributeValidator
|
|
31
|
+
attr_reader :datatype
|
|
32
|
+
attr_reader :allowable_values
|
|
33
|
+
|
|
34
|
+
def initialize(datatype, allowable_values)
|
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
|
36
|
+
case datatype.to_s
|
|
37
|
+
when /Integer/i
|
|
38
|
+
value.to_i
|
|
39
|
+
when /Float/i
|
|
40
|
+
value.to_f
|
|
41
|
+
else
|
|
42
|
+
value
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def valid?(value)
|
|
48
|
+
!value || allowable_values.include?(value)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
27
52
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
53
|
def self.attribute_map
|
|
29
54
|
{
|
|
30
55
|
:'id' => :'id',
|
|
31
56
|
:'country' => :'country',
|
|
32
57
|
:'country_name' => :'countryName',
|
|
58
|
+
:'number_type' => :'numberType',
|
|
33
59
|
:'created_at' => :'createdAt'
|
|
34
60
|
}
|
|
35
61
|
end
|
|
@@ -50,6 +76,7 @@ module Zernio
|
|
|
50
76
|
:'id' => :'String',
|
|
51
77
|
:'country' => :'String',
|
|
52
78
|
:'country_name' => :'String',
|
|
79
|
+
:'number_type' => :'String',
|
|
53
80
|
:'created_at' => :'Time'
|
|
54
81
|
}
|
|
55
82
|
end
|
|
@@ -57,6 +84,7 @@ module Zernio
|
|
|
57
84
|
# List of attributes with nullable: true
|
|
58
85
|
def self.openapi_nullable
|
|
59
86
|
Set.new([
|
|
87
|
+
:'number_type',
|
|
60
88
|
])
|
|
61
89
|
end
|
|
62
90
|
|
|
@@ -94,6 +122,12 @@ module Zernio
|
|
|
94
122
|
self.country_name = nil
|
|
95
123
|
end
|
|
96
124
|
|
|
125
|
+
if attributes.key?(:'number_type')
|
|
126
|
+
self.number_type = attributes[:'number_type']
|
|
127
|
+
else
|
|
128
|
+
self.number_type = nil
|
|
129
|
+
end
|
|
130
|
+
|
|
97
131
|
if attributes.key?(:'created_at')
|
|
98
132
|
self.created_at = attributes[:'created_at']
|
|
99
133
|
else
|
|
@@ -132,6 +166,8 @@ module Zernio
|
|
|
132
166
|
return false if @id.nil?
|
|
133
167
|
return false if @country.nil?
|
|
134
168
|
return false if @country_name.nil?
|
|
169
|
+
number_type_validator = EnumAttributeValidator.new('String', ["local", "mobile", "national", "toll_free"])
|
|
170
|
+
return false unless number_type_validator.valid?(@number_type)
|
|
135
171
|
return false if @created_at.nil?
|
|
136
172
|
true
|
|
137
173
|
end
|
|
@@ -166,6 +202,16 @@ module Zernio
|
|
|
166
202
|
@country_name = country_name
|
|
167
203
|
end
|
|
168
204
|
|
|
205
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
206
|
+
# @param [Object] number_type Object to be assigned
|
|
207
|
+
def number_type=(number_type)
|
|
208
|
+
validator = EnumAttributeValidator.new('String', ["local", "mobile", "national", "toll_free"])
|
|
209
|
+
unless validator.valid?(number_type)
|
|
210
|
+
fail ArgumentError, "invalid value for \"number_type\", must be one of #{validator.allowable_values}."
|
|
211
|
+
end
|
|
212
|
+
@number_type = number_type
|
|
213
|
+
end
|
|
214
|
+
|
|
169
215
|
# Custom attribute writer method with validation
|
|
170
216
|
# @param [Object] created_at Value to be assigned
|
|
171
217
|
def created_at=(created_at)
|
|
@@ -184,6 +230,7 @@ module Zernio
|
|
|
184
230
|
id == o.id &&
|
|
185
231
|
country == o.country &&
|
|
186
232
|
country_name == o.country_name &&
|
|
233
|
+
number_type == o.number_type &&
|
|
187
234
|
created_at == o.created_at
|
|
188
235
|
end
|
|
189
236
|
|
|
@@ -196,7 +243,7 @@ module Zernio
|
|
|
196
243
|
# Calculates hash code according to all attributes.
|
|
197
244
|
# @return [Integer] Hash code
|
|
198
245
|
def hash
|
|
199
|
-
[id, country, country_name, created_at].hash
|
|
246
|
+
[id, country, country_name, number_type, created_at].hash
|
|
200
247
|
end
|
|
201
248
|
|
|
202
249
|
# Builds the object from hash
|
|
@@ -17,7 +17,7 @@ module Zernio
|
|
|
17
17
|
class SendInboxMessage400Response < ApiModelBase
|
|
18
18
|
attr_accessor :error
|
|
19
19
|
|
|
20
|
-
# Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to.
|
|
20
|
+
# Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to; DIRECT_SEND_NOT_ELIGIBLE and DIRECT_SEND_BLOCKED mean the WhatsApp Business Account needs Meta to grant or restore Direct Send access; DIRECT_SEND_LIMITED is temporary, Meta lifts it on its own.
|
|
21
21
|
attr_accessor :code
|
|
22
22
|
|
|
23
23
|
attr_accessor :platform_error
|
|
@@ -119,7 +119,7 @@ module Zernio
|
|
|
119
119
|
# @return true if the model is valid
|
|
120
120
|
def valid?
|
|
121
121
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
122
|
-
code_validator = EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT"])
|
|
122
|
+
code_validator = EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED"])
|
|
123
123
|
return false unless code_validator.valid?(@code)
|
|
124
124
|
true
|
|
125
125
|
end
|
|
@@ -127,7 +127,7 @@ module Zernio
|
|
|
127
127
|
# Custom attribute writer method checking allowed values (enum).
|
|
128
128
|
# @param [Object] code Object to be assigned
|
|
129
129
|
def code=(code)
|
|
130
|
-
validator = EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT"])
|
|
130
|
+
validator = EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED"])
|
|
131
131
|
unless validator.valid?(code)
|
|
132
132
|
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
133
133
|
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/openapi.yaml
CHANGED
|
@@ -2724,11 +2724,15 @@ components:
|
|
|
2724
2724
|
description: 'UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.'
|
|
2725
2725
|
PhoneNumberStockWatch:
|
|
2726
2726
|
type: object
|
|
2727
|
-
required: [id, country, countryName, createdAt]
|
|
2727
|
+
required: [id, country, countryName, numberType, createdAt]
|
|
2728
2728
|
properties:
|
|
2729
2729
|
id: { type: string }
|
|
2730
2730
|
country: { type: string, description: 'ISO 3166-1 alpha-2.' }
|
|
2731
2731
|
countryName: { type: string }
|
|
2732
|
+
numberType:
|
|
2733
|
+
type: [string, "null"]
|
|
2734
|
+
enum: [local, mobile, national, toll_free, null]
|
|
2735
|
+
description: 'The watched number type, or null when the watch covers every type in the country.'
|
|
2732
2736
|
createdAt: { type: string, format: date-time }
|
|
2733
2737
|
WebhookPayloadPhoneNumberStockAvailable:
|
|
2734
2738
|
type: object
|
|
@@ -27015,14 +27019,14 @@ paths:
|
|
|
27015
27019
|
type: [string, "null"]
|
|
27016
27020
|
description: Twitter username of the recipient
|
|
27017
27021
|
'400':
|
|
27018
|
-
description: 'Validation error, platform not supported, category combined with templateName or used on a non-WhatsApp account, or the WhatsApp Business Account is not eligible for Direct Send'
|
|
27022
|
+
description: 'Validation error, platform not supported, an attachment the platform does not accept (PLATFORM_LIMITATION), template required to start a WhatsApp conversation (TEMPLATE_REQUIRED), template variables that do not match the approved definition (INVALID_TEMPLATE_PARAMS, INVALID_TEMPLATE_BUTTON_PARAM), category combined with templateName or used on a non-WhatsApp account, or the WhatsApp Business Account is not eligible for Direct Send: DIRECT_SEND_NOT_ELIGIBLE and DIRECT_SEND_BLOCKED require Meta to grant or restore Direct Send access, while DIRECT_SEND_LIMITED is temporary and lifts on its own'
|
|
27019
27023
|
content:
|
|
27020
27024
|
application/json:
|
|
27021
27025
|
schema:
|
|
27022
27026
|
type: object
|
|
27023
27027
|
properties:
|
|
27024
27028
|
error: { type: string }
|
|
27025
|
-
code: { type: string, enum: [PLATFORM_NOT_SUPPORTED] }
|
|
27029
|
+
code: { type: string, enum: [PLATFORM_NOT_SUPPORTED, PLATFORM_LIMITATION, TEMPLATE_REQUIRED, INVALID_TEMPLATE_PARAMS, INVALID_TEMPLATE_BUTTON_PARAM, DIRECT_SEND_NOT_ELIGIBLE, DIRECT_SEND_LIMITED, DIRECT_SEND_BLOCKED] }
|
|
27026
27030
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
27027
27031
|
'403':
|
|
27028
27032
|
description: Inbox addon required or profile limit reached
|
|
@@ -28247,8 +28251,8 @@ paths:
|
|
|
28247
28251
|
error: { type: string }
|
|
28248
28252
|
code:
|
|
28249
28253
|
type: string
|
|
28250
|
-
description: "Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to."
|
|
28251
|
-
enum: [PLATFORM_LIMITATION, MISSING_PARTICIPANT]
|
|
28254
|
+
description: "Stable machine-readable reason. PLATFORM_LIMITATION covers a capability the platform does not offer (e.g. Bluesky and Reddit DMs reject media); MISSING_PARTICIPANT means the stored conversation has no recipient to send to; DIRECT_SEND_NOT_ELIGIBLE and DIRECT_SEND_BLOCKED mean the WhatsApp Business Account needs Meta to grant or restore Direct Send access; DIRECT_SEND_LIMITED is temporary, Meta lifts it on its own."
|
|
28255
|
+
enum: [PLATFORM_LIMITATION, MISSING_PARTICIPANT, DIRECT_SEND_NOT_ELIGIBLE, DIRECT_SEND_LIMITED, DIRECT_SEND_BLOCKED]
|
|
28252
28256
|
platformError:
|
|
28253
28257
|
type: object
|
|
28254
28258
|
description: "Instagram/Facebook only. Meta's own diagnostic fields for the rejected send, passed through verbatim so you can tell failure classes apart and quote them to Meta. Absent when the failure did not come from Meta."
|
|
@@ -36619,9 +36623,14 @@ paths:
|
|
|
36619
36623
|
Get notified the first time an out-of-stock country has deliverable
|
|
36620
36624
|
numbers again: an email to the account holder plus the
|
|
36621
36625
|
`phone_number.stock_available` webhook. Stock is re-checked every 6h.
|
|
36622
|
-
One watch per country; a repeat request returns the
|
|
36623
|
-
(200). The watch is consumed when it fires, so re-create
|
|
36624
|
-
miss the stock. Up to 20
|
|
36626
|
+
One watch per country and number type; a repeat request returns the
|
|
36627
|
+
existing watch (200). The watch is consumed when it fires, so re-create
|
|
36628
|
+
it if you miss the stock. Up to 20 watches at once.
|
|
36629
|
+
|
|
36630
|
+
Countries and types marked `fulfilment: request` by
|
|
36631
|
+
GET /v1/phone-numbers/countries can also be watched. Those are sourced
|
|
36632
|
+
by a carrier request rather than held in stock, so a watch records
|
|
36633
|
+
interest and no date is implied.
|
|
36625
36634
|
security:
|
|
36626
36635
|
- bearerAuth: []
|
|
36627
36636
|
requestBody:
|
|
@@ -36633,6 +36642,10 @@ paths:
|
|
|
36633
36642
|
required: [country]
|
|
36634
36643
|
properties:
|
|
36635
36644
|
country: { type: string, minLength: 2, maxLength: 2, description: 'ISO 3166-1 alpha-2 code of a country listed by GET /v1/phone-numbers/countries.' }
|
|
36645
|
+
numberType:
|
|
36646
|
+
type: string
|
|
36647
|
+
enum: [local, mobile, national, toll_free]
|
|
36648
|
+
description: 'Narrow the watch to one number type. Omit to be notified when any type in the country is back.'
|
|
36636
36649
|
responses:
|
|
36637
36650
|
'201':
|
|
36638
36651
|
description: Watch created.
|
|
@@ -36641,7 +36654,7 @@ paths:
|
|
|
36641
36654
|
schema:
|
|
36642
36655
|
$ref: '#/components/schemas/PhoneNumberStockWatch'
|
|
36643
36656
|
'200':
|
|
36644
|
-
description: A watch for this country already existed; returned unchanged.
|
|
36657
|
+
description: 'A watch for this country and type already existed; returned unchanged.'
|
|
36645
36658
|
content:
|
|
36646
36659
|
application/json:
|
|
36647
36660
|
schema:
|
|
@@ -96,7 +96,7 @@ describe 'PhoneNumbersApi' do
|
|
|
96
96
|
|
|
97
97
|
# unit tests for create_phone_number_stock_watch
|
|
98
98
|
# Watch an out-of-stock country
|
|
99
|
-
# Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 countries can be watched
|
|
99
|
+
# Get notified the first time an out-of-stock country has deliverable numbers again: an email to the account holder plus the `phone_number.stock_available` webhook. Stock is re-checked every 6h. One watch per country and number type; a repeat request returns the existing watch (200). The watch is consumed when it fires, so re-create it if you miss the stock. Up to 20 watches at once. Countries and types marked `fulfilment: request` by GET /v1/phone-numbers/countries can also be watched. Those are sourced by a carrier request rather than held in stock, so a watch records interest and no date is implied.
|
|
100
100
|
# @param create_phone_number_stock_watch_request
|
|
101
101
|
# @param [Hash] opts the optional parameters
|
|
102
102
|
# @return [PhoneNumberStockWatch]
|
|
@@ -36,7 +36,7 @@ describe Zernio::CreateInboxConversation400Response do
|
|
|
36
36
|
describe 'test attribute "code"' do
|
|
37
37
|
it 'should work' do
|
|
38
38
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PLATFORM_NOT_SUPPORTED"])
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PLATFORM_NOT_SUPPORTED", "PLATFORM_LIMITATION", "TEMPLATE_REQUIRED", "INVALID_TEMPLATE_PARAMS", "INVALID_TEMPLATE_BUTTON_PARAM", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED"])
|
|
40
40
|
# validator.allowable_values.each do |value|
|
|
41
41
|
# expect { instance.code = value }.not_to raise_error
|
|
42
42
|
# end
|
|
@@ -33,4 +33,14 @@ describe Zernio::CreatePhoneNumberStockWatchRequest do
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
describe 'test attribute "number_type"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["local", "mobile", "national", "toll_free"])
|
|
40
|
+
# validator.allowable_values.each do |value|
|
|
41
|
+
# expect { instance.number_type = value }.not_to raise_error
|
|
42
|
+
# end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
36
46
|
end
|
|
@@ -45,6 +45,16 @@ describe Zernio::PhoneNumberStockWatch do
|
|
|
45
45
|
end
|
|
46
46
|
end
|
|
47
47
|
|
|
48
|
+
describe 'test attribute "number_type"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["local", "mobile", "national", "toll_free"])
|
|
52
|
+
# validator.allowable_values.each do |value|
|
|
53
|
+
# expect { instance.number_type = value }.not_to raise_error
|
|
54
|
+
# end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
48
58
|
describe 'test attribute "created_at"' do
|
|
49
59
|
it 'should work' do
|
|
50
60
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -36,7 +36,7 @@ describe Zernio::SendInboxMessage400Response do
|
|
|
36
36
|
describe 'test attribute "code"' do
|
|
37
37
|
it 'should work' do
|
|
38
38
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT"])
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["PLATFORM_LIMITATION", "MISSING_PARTICIPANT", "DIRECT_SEND_NOT_ELIGIBLE", "DIRECT_SEND_LIMITED", "DIRECT_SEND_BLOCKED"])
|
|
40
40
|
# validator.allowable_values.each do |value|
|
|
41
41
|
# expect { instance.code = value }.not_to raise_error
|
|
42
42
|
# end
|