zernio-sdk 0.0.783 → 0.0.784

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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -0
  3. data/docs/CreatePhoneNumberStockWatchRequest.md +18 -0
  4. data/docs/ListPhoneNumberStockWatches200Response.md +18 -0
  5. data/docs/PhoneNumberStockWatch.md +24 -0
  6. data/docs/PhoneNumbersApi.md +203 -0
  7. data/docs/WebhookEventsApi.md +69 -0
  8. data/docs/WebhookPayloadPhoneNumberStockAvailable.md +24 -0
  9. data/docs/WebhookPayloadPhoneNumberStockAvailableStock.md +20 -0
  10. data/docs/WebhookPayloadPhoneNumberStockAvailableStockTypesInner.md +20 -0
  11. data/lib/zernio-sdk/api/phone_numbers_api.rb +184 -0
  12. data/lib/zernio-sdk/api/webhook_events_api.rb +66 -0
  13. data/lib/zernio-sdk/models/create_phone_number_stock_watch_request.rb +183 -0
  14. data/lib/zernio-sdk/models/list_phone_number_stock_watches200_response.rb +149 -0
  15. data/lib/zernio-sdk/models/phone_number_stock_watch.rb +243 -0
  16. data/lib/zernio-sdk/models/webhook_payload_phone_number_stock_available.rb +269 -0
  17. data/lib/zernio-sdk/models/webhook_payload_phone_number_stock_available_stock.rb +194 -0
  18. data/lib/zernio-sdk/models/webhook_payload_phone_number_stock_available_stock_types_inner.rb +192 -0
  19. data/lib/zernio-sdk/version.rb +1 -1
  20. data/lib/zernio-sdk.rb +6 -0
  21. data/openapi.yaml +146 -4
  22. data/spec/api/phone_numbers_api_spec.rb +33 -0
  23. data/spec/models/create_phone_number_stock_watch_request_spec.rb +36 -0
  24. data/spec/models/create_webhook_settings_request_spec.rb +1 -1
  25. data/spec/models/list_phone_number_stock_watches200_response_spec.rb +36 -0
  26. data/spec/models/phone_number_stock_watch_spec.rb +54 -0
  27. data/spec/models/update_webhook_settings_request_spec.rb +1 -1
  28. data/spec/models/webhook_payload_phone_number_stock_available_spec.rb +58 -0
  29. data/spec/models/webhook_payload_phone_number_stock_available_stock_spec.rb +42 -0
  30. data/spec/models/webhook_payload_phone_number_stock_available_stock_types_inner_spec.rb +42 -0
  31. data/spec/models/webhook_spec.rb +1 -1
  32. metadata +25 -1
@@ -0,0 +1,192 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ class WebhookPayloadPhoneNumberStockAvailableStockTypesInner < ApiModelBase
18
+ # local, mobile, national or toll_free.
19
+ attr_accessor :number_type
20
+
21
+ # Deliverable numbers at sweep time; first come, first served.
22
+ attr_accessor :available_count
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'number_type' => :'numberType',
28
+ :'available_count' => :'availableCount'
29
+ }
30
+ end
31
+
32
+ # Returns attribute mapping this model knows about
33
+ def self.acceptable_attribute_map
34
+ attribute_map
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ acceptable_attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'number_type' => :'String',
46
+ :'available_count' => :'Integer'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WebhookPayloadPhoneNumberStockAvailableStockTypesInner` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ acceptable_attribute_map = self.class.acceptable_attribute_map
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!acceptable_attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WebhookPayloadPhoneNumberStockAvailableStockTypesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'number_type')
73
+ self.number_type = attributes[:'number_type']
74
+ else
75
+ self.number_type = nil
76
+ end
77
+
78
+ if attributes.key?(:'available_count')
79
+ self.available_count = attributes[:'available_count']
80
+ else
81
+ self.available_count = nil
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
89
+ invalid_properties = Array.new
90
+ if @number_type.nil?
91
+ invalid_properties.push('invalid value for "number_type", number_type cannot be nil.')
92
+ end
93
+
94
+ if @available_count.nil?
95
+ invalid_properties.push('invalid value for "available_count", available_count cannot be nil.')
96
+ end
97
+
98
+ invalid_properties
99
+ end
100
+
101
+ # Check to see if the all the properties in the model are valid
102
+ # @return true if the model is valid
103
+ def valid?
104
+ warn '[DEPRECATED] the `valid?` method is obsolete'
105
+ return false if @number_type.nil?
106
+ return false if @available_count.nil?
107
+ true
108
+ end
109
+
110
+ # Custom attribute writer method with validation
111
+ # @param [Object] number_type Value to be assigned
112
+ def number_type=(number_type)
113
+ if number_type.nil?
114
+ fail ArgumentError, 'number_type cannot be nil'
115
+ end
116
+
117
+ @number_type = number_type
118
+ end
119
+
120
+ # Custom attribute writer method with validation
121
+ # @param [Object] available_count Value to be assigned
122
+ def available_count=(available_count)
123
+ if available_count.nil?
124
+ fail ArgumentError, 'available_count cannot be nil'
125
+ end
126
+
127
+ @available_count = available_count
128
+ end
129
+
130
+ # Checks equality by comparing each attribute.
131
+ # @param [Object] Object to be compared
132
+ def ==(o)
133
+ return true if self.equal?(o)
134
+ self.class == o.class &&
135
+ number_type == o.number_type &&
136
+ available_count == o.available_count
137
+ end
138
+
139
+ # @see the `==` method
140
+ # @param [Object] Object to be compared
141
+ def eql?(o)
142
+ self == o
143
+ end
144
+
145
+ # Calculates hash code according to all attributes.
146
+ # @return [Integer] Hash code
147
+ def hash
148
+ [number_type, available_count].hash
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def self.build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ attributes = attributes.transform_keys(&:to_sym)
157
+ transformed_hash = {}
158
+ openapi_types.each_pair do |key, type|
159
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = nil
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[attribute_map[key]].is_a?(Array)
165
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
166
+ end
167
+ elsif !attributes[attribute_map[key]].nil?
168
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
169
+ end
170
+ end
171
+ new(transformed_hash)
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ if value.nil?
181
+ is_nullable = self.class.openapi_nullable.include?(attr)
182
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
183
+ end
184
+
185
+ hash[param] = _to_hash(value)
186
+ end
187
+ hash
188
+ end
189
+
190
+ end
191
+
192
+ end
@@ -11,5 +11,5 @@ Generator version: 7.19.0
11
11
  =end
12
12
 
13
13
  module Zernio
14
- VERSION = '0.0.783'
14
+ VERSION = '0.0.784'
15
15
  end
data/lib/zernio-sdk.rb CHANGED
@@ -278,6 +278,7 @@ require 'zernio-sdk/models/create_phone_number_port_in201_response_orders_inner'
278
278
  require 'zernio-sdk/models/create_phone_number_port_in_request'
279
279
  require 'zernio-sdk/models/create_phone_number_port_in_request_end_user'
280
280
  require 'zernio-sdk/models/create_phone_number_port_in_request_requirements_inner'
281
+ require 'zernio-sdk/models/create_phone_number_stock_watch_request'
281
282
  require 'zernio-sdk/models/create_pinterest_board201_response'
282
283
  require 'zernio-sdk/models/create_pinterest_board201_response_board'
283
284
  require 'zernio-sdk/models/create_pinterest_board_request'
@@ -1005,6 +1006,7 @@ require 'zernio-sdk/models/list_phone_number_countries200_response_countries_inn
1005
1006
  require 'zernio-sdk/models/list_phone_number_countries200_response_countries_inner_types_inner'
1006
1007
  require 'zernio-sdk/models/list_phone_number_port_ins200_response'
1007
1008
  require 'zernio-sdk/models/list_phone_number_port_ins200_response_orders_inner'
1009
+ require 'zernio-sdk/models/list_phone_number_stock_watches200_response'
1008
1010
  require 'zernio-sdk/models/list_phone_numbers200_response'
1009
1011
  require 'zernio-sdk/models/list_phone_numbers200_response_connected_inner'
1010
1012
  require 'zernio-sdk/models/list_phone_numbers200_response_numbers_inner'
@@ -1107,6 +1109,7 @@ require 'zernio-sdk/models/on_whats_app_number_verification_required_request'
1107
1109
  require 'zernio-sdk/models/pagination'
1108
1110
  require 'zernio-sdk/models/pause_workflow200_response'
1109
1111
  require 'zernio-sdk/models/pending'
1112
+ require 'zernio-sdk/models/phone_number_stock_watch'
1110
1113
  require 'zernio-sdk/models/pin_discord_message200_response'
1111
1114
  require 'zernio-sdk/models/pinterest_platform_data'
1112
1115
  require 'zernio-sdk/models/platform_analytics'
@@ -1670,6 +1673,9 @@ require 'zernio-sdk/models/webhook_payload_message_sent_message'
1670
1673
  require 'zernio-sdk/models/webhook_payload_message_sent_message_attachments_inner'
1671
1674
  require 'zernio-sdk/models/webhook_payload_message_sent_message_sender'
1672
1675
  require 'zernio-sdk/models/webhook_payload_message_sent_metadata'
1676
+ require 'zernio-sdk/models/webhook_payload_phone_number_stock_available'
1677
+ require 'zernio-sdk/models/webhook_payload_phone_number_stock_available_stock'
1678
+ require 'zernio-sdk/models/webhook_payload_phone_number_stock_available_stock_types_inner'
1673
1679
  require 'zernio-sdk/models/webhook_payload_post'
1674
1680
  require 'zernio-sdk/models/webhook_payload_post_platform'
1675
1681
  require 'zernio-sdk/models/webhook_payload_post_platform_account'
data/openapi.yaml CHANGED
@@ -182,6 +182,7 @@ x-documentation:
182
182
  - `call.failed` - A call failed with a hard error before or during bridging
183
183
  - `call.permission_request` - A WhatsApp user accepted or rejected your call-permission request
184
184
  - `whatsapp.automatic_event` - Meta's automatic event identification detected a lead or purchase in a Click-to-WhatsApp conversation. Branch on `eventName` (`LeadSubmitted` | `Purchase`); carries the `ctwa_clid` Conversions API match key
185
+ - `phone_number.stock_available` - An out-of-stock country you watch (POST /v1/phone-numbers/stock-watches) has deliverable numbers again. Fires once per watch, then the watch is consumed. Carries the deliverable count per number type at sweep time (first come, first served).
185
186
  - `whatsapp.number.kyc_submitted` - An end customer completed a hosted KYC share link; the number entered regulatory review under your account
186
187
  - `whatsapp.number.activated` - A provisioned WhatsApp number finished setup and is ready to connect
187
188
  - `whatsapp.number.declined` - A regulated number order was declined in review; nothing activates and nothing is billed
@@ -430,7 +431,7 @@ tags:
430
431
  - name: Webhooks
431
432
  description: |
432
433
  Configure webhooks for real-time notifications. Webhooks can be created from the dashboard (Settings → Webhooks) or via this API.
433
- Events: post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed, webhook.test.
434
+ Events: post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, phone_number.stock_available, verification.approved, verification.failed, webhook.test.
434
435
  Security: optional HMAC-SHA256 signature in X-Zernio-Signature header. Configure a secret key to enable verification. Custom headers supported.
435
436
 
436
437
  Resource groups. Every event belongs to one group: post.* to publishing, message.*, reaction.*, conversation.*, call.* and whatsapp.automatic_event to messages, comment.* and review.* to engagement, lead.* to contacts, ad.* to ads, account.*, whatsapp.template.* and whatsapp.account.* to accounts, whatsapp.number.* and verification.* to telephony, webhook.test to webhooks. Two independent controls use that mapping. (1) A restricted (zrk_) API key can only subscribe to, test-fire, redeliver, or read delivery logs for events in the groups it holds, so it can never create a subscription broader than itself. (2) Each subscription carries its own `disabledResourceGroups` denylist: events in a disabled group are dropped before delivery to that endpoint, on live delivery and on every replay path, no matter which key or session created the subscription. Changing that denylist applies to every event emitted after the change; events already queued when it landed can still be delivered for up to five minutes after they were enqueued, because the delivery worker trusts a five-minute enqueue-time snapshot before re-checking. Absent or empty on a subscription means it receives everything it subscribes to, which is the behavior of every subscription created before the field existed.
@@ -2430,7 +2431,7 @@ components:
2430
2431
  type: array
2431
2432
  items:
2432
2433
  type: string
2433
- enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
2434
+ enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, phone_number.stock_available, verification.approved, verification.failed]
2434
2435
  description: Events subscribed to
2435
2436
  isActive:
2436
2437
  type: boolean
@@ -2692,6 +2693,45 @@ components:
2692
2693
  type: string
2693
2694
  format: date-time
2694
2695
  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.'
2696
+ PhoneNumberStockWatch:
2697
+ type: object
2698
+ required: [id, country, countryName, createdAt]
2699
+ properties:
2700
+ id: { type: string }
2701
+ country: { type: string, description: 'ISO 3166-1 alpha-2.' }
2702
+ countryName: { type: string }
2703
+ createdAt: { type: string, format: date-time }
2704
+ WebhookPayloadPhoneNumberStockAvailable:
2705
+ type: object
2706
+ description: Webhook payload for phone_number.stock_available events
2707
+ required: [id, event, stock, timestamp]
2708
+ properties:
2709
+ id:
2710
+ type: string
2711
+ description: Stable webhook event ID
2712
+ event:
2713
+ type: string
2714
+ enum: [phone_number.stock_available]
2715
+ stock:
2716
+ type: object
2717
+ required: [country, types]
2718
+ properties:
2719
+ country:
2720
+ type: string
2721
+ description: 'ISO 3166-1 alpha-2 country code of the watched country.'
2722
+ types:
2723
+ type: array
2724
+ description: 'Number types deliverable at sweep time. Only types with stock are listed.'
2725
+ items:
2726
+ type: object
2727
+ required: [numberType, availableCount]
2728
+ properties:
2729
+ numberType: { type: string, description: 'local, mobile, national or toll_free.' }
2730
+ availableCount: { type: integer, description: 'Deliverable numbers at sweep time; first come, first served.' }
2731
+ timestamp:
2732
+ type: string
2733
+ format: date-time
2734
+ 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.'
2695
2735
  WebhookPayloadAccountDisconnected:
2696
2736
  type: object
2697
2737
  description: Webhook payload for account disconnected events
@@ -10166,6 +10206,26 @@ webhooks:
10166
10206
  responses:
10167
10207
  '200':
10168
10208
  description: Webhook received successfully
10209
+ phone_number.stock_available:
10210
+ post:
10211
+ operationId: onPhoneNumberStockAvailable
10212
+ summary: Phone-number stock available event
10213
+ description: |
10214
+ Fired by the stock sweep (every 6h) the first time a country you watch
10215
+ via POST /v1/phone-numbers/stock-watches has deliverable numbers again.
10216
+ The watch is consumed, so the event fires once per watch; the stock
10217
+ counts are a snapshot and numbers are sold first come, first served.
10218
+ Buy with POST /v1/phone-numbers/purchase.
10219
+ tags: [Webhook Events]
10220
+ requestBody:
10221
+ required: true
10222
+ content:
10223
+ application/json:
10224
+ schema:
10225
+ $ref: '#/components/schemas/WebhookPayloadPhoneNumberStockAvailable'
10226
+ responses:
10227
+ '200':
10228
+ description: Webhook received successfully
10169
10229
  verification.approved:
10170
10230
  post:
10171
10231
  operationId: onVerificationApproved
@@ -25030,7 +25090,7 @@ paths:
25030
25090
  minItems: 1
25031
25091
  items:
25032
25092
  type: string
25033
- enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
25093
+ enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, phone_number.stock_available, verification.approved, verification.failed]
25034
25094
  description: Events to subscribe to (at least one required)
25035
25095
  isActive:
25036
25096
  type: boolean
@@ -25149,7 +25209,7 @@ paths:
25149
25209
  minItems: 1
25150
25210
  items:
25151
25211
  type: string
25152
- enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, verification.approved, verification.failed]
25212
+ enum: [post.scheduled, post.published, post.failed, post.partial, post.cancelled, post.recycled, post.platform.published, post.platform.failed, post.platform.deleted, post.tiktok.url_resolved, post.external.created, post.external.updated, post.external.deleted, account.connected, account.disconnected, account.ads.initial_sync_completed, message.received, conversation.started, call.received, call.ended, call.failed, call.permission_request, message.sent, message.edited, message.deleted, message.delivered, message.read, message.failed, reaction.received, referral.received, comment.received, review.new, review.updated, lead.received, ad.status_changed, whatsapp.template.status_updated, whatsapp.template.category_updated, whatsapp.account.name_status_updated, whatsapp.automatic_event, whatsapp.number.activated, whatsapp.number.declined, whatsapp.number.action_required, whatsapp.number.verification_required, whatsapp.number.suspended, whatsapp.number.reactivated, whatsapp.number.released, whatsapp.number.kyc_submitted, phone_number.stock_available, verification.approved, verification.failed]
25153
25213
  description: Events to subscribe to. Must contain at least one event if provided.
25154
25214
  isActive:
25155
25215
  type: boolean
@@ -35208,6 +35268,88 @@ paths:
35208
35268
  '401': { $ref: '#/components/responses/Unauthorized' }
35209
35269
  '404': { description: Number not found }
35210
35270
 
35271
+ /v1/phone-numbers/stock-watches:
35272
+ post:
35273
+ x-resource-group: "telephony"
35274
+ operationId: createPhoneNumberStockWatch
35275
+ tags: [Phone Numbers]
35276
+ summary: Watch an out-of-stock country
35277
+ description: |
35278
+ Get notified the first time an out-of-stock country has deliverable
35279
+ numbers again: an email to the account holder plus the
35280
+ `phone_number.stock_available` webhook. Stock is re-checked every 6h.
35281
+ One watch per country; a repeat request returns the existing watch
35282
+ (200). The watch is consumed when it fires, so re-create it if you
35283
+ miss the stock. Up to 20 countries can be watched at once.
35284
+ security:
35285
+ - bearerAuth: []
35286
+ requestBody:
35287
+ required: true
35288
+ content:
35289
+ application/json:
35290
+ schema:
35291
+ type: object
35292
+ required: [country]
35293
+ properties:
35294
+ country: { type: string, minLength: 2, maxLength: 2, description: 'ISO 3166-1 alpha-2 code of a country listed by GET /v1/phone-numbers/countries.' }
35295
+ responses:
35296
+ '201':
35297
+ description: Watch created.
35298
+ content:
35299
+ application/json:
35300
+ schema:
35301
+ $ref: '#/components/schemas/PhoneNumberStockWatch'
35302
+ '200':
35303
+ description: A watch for this country already existed; returned unchanged.
35304
+ content:
35305
+ application/json:
35306
+ schema:
35307
+ $ref: '#/components/schemas/PhoneNumberStockWatch'
35308
+ '400': { $ref: '#/components/responses/BadRequest' }
35309
+ '401': { $ref: '#/components/responses/Unauthorized' }
35310
+ '409': { description: 'The country is in stock right now (buy instead of watching), or the 20-country watch limit is reached (code invalid_resource_state).' }
35311
+ get:
35312
+ x-resource-group: "telephony"
35313
+ operationId: listPhoneNumberStockWatches
35314
+ tags: [Phone Numbers]
35315
+ summary: List stock watches
35316
+ security:
35317
+ - bearerAuth: []
35318
+ responses:
35319
+ '200':
35320
+ description: The caller's active watches, oldest first.
35321
+ content:
35322
+ application/json:
35323
+ schema:
35324
+ type: object
35325
+ properties:
35326
+ watches:
35327
+ type: array
35328
+ items:
35329
+ $ref: '#/components/schemas/PhoneNumberStockWatch'
35330
+ '401': { $ref: '#/components/responses/Unauthorized' }
35331
+ /v1/phone-numbers/stock-watches/{id}:
35332
+ delete:
35333
+ x-resource-group: "telephony"
35334
+ operationId: deletePhoneNumberStockWatch
35335
+ tags: [Phone Numbers]
35336
+ summary: Stop watching a country
35337
+ security:
35338
+ - bearerAuth: []
35339
+ parameters:
35340
+ - { name: id, in: path, required: true, schema: { type: string } }
35341
+ responses:
35342
+ '200':
35343
+ description: Watch deleted.
35344
+ content:
35345
+ application/json:
35346
+ schema:
35347
+ type: object
35348
+ properties:
35349
+ deleted: { type: boolean }
35350
+ '400': { $ref: '#/components/responses/BadRequest' }
35351
+ '401': { $ref: '#/components/responses/Unauthorized' }
35352
+ '404': { description: 'Stock watch not found (code stock_watch_not_found).' }
35211
35353
  /v1/phone-numbers/sip-trunks:
35212
35354
  post:
35213
35355
  x-resource-group: "telephony"
@@ -94,6 +94,29 @@ describe 'PhoneNumbersApi' do
94
94
  end
95
95
  end
96
96
 
97
+ # unit tests for create_phone_number_stock_watch
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 &#x60;phone_number.stock_available&#x60; 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 at once.
100
+ # @param create_phone_number_stock_watch_request
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [PhoneNumberStockWatch]
103
+ describe 'create_phone_number_stock_watch test' do
104
+ it 'should work' do
105
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
106
+ end
107
+ end
108
+
109
+ # unit tests for delete_phone_number_stock_watch
110
+ # Stop watching a country
111
+ # @param id
112
+ # @param [Hash] opts the optional parameters
113
+ # @return [DeleteSmsSenderId200Response]
114
+ describe 'delete_phone_number_stock_watch test' do
115
+ it 'should work' do
116
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
117
+ end
118
+ end
119
+
97
120
  # unit tests for get_phone_number
98
121
  # Get phone number
99
122
  # Retrieve the current status of a purchased phone number. Poll this to track Meta pre-verification (US sync path) and, for regulated (Tier 3/4) numbers, the async lifecycle: pending_regulatory → active (or regulatory_declined). When a regulated number has an Onfido ID step, &#x60;onfidoVerificationUrl&#x60; appears here once the order is placed — forward it to the end user. (Or subscribe to the whatsapp.number.* webhooks instead of polling.)
@@ -178,6 +201,16 @@ describe 'PhoneNumbersApi' do
178
201
  end
179
202
  end
180
203
 
204
+ # unit tests for list_phone_number_stock_watches
205
+ # List stock watches
206
+ # @param [Hash] opts the optional parameters
207
+ # @return [ListPhoneNumberStockWatches200Response]
208
+ describe 'list_phone_number_stock_watches test' do
209
+ it 'should work' do
210
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
211
+ end
212
+ end
213
+
181
214
  # unit tests for list_phone_numbers
182
215
  # List phone numbers
183
216
  # List all phone numbers purchased by the authenticated user. By default, released numbers are excluded. Connected (bring-your-own) WhatsApp numbers are returned in the separate &#x60;connected&#x60; array; they are not billed and have no provisioning lifecycle.
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::CreatePhoneNumberStockWatchRequest
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::CreatePhoneNumberStockWatchRequest do
21
+ #let(:instance) { Zernio::CreatePhoneNumberStockWatchRequest.new }
22
+
23
+ describe 'test an instance of CreatePhoneNumberStockWatchRequest' do
24
+ it 'should create an instance of CreatePhoneNumberStockWatchRequest' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::CreatePhoneNumberStockWatchRequest)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "country"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end
@@ -48,7 +48,7 @@ describe Zernio::CreateWebhookSettingsRequest do
48
48
  describe 'test attribute "events"' do
49
49
  it 'should work' do
50
50
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.account.name_status_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
51
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.account.name_status_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "phone_number.stock_available", "verification.approved", "verification.failed"])
52
52
  # validator.allowable_values.each do |value|
53
53
  # expect { instance.events = value }.not_to raise_error
54
54
  # end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::ListPhoneNumberStockWatches200Response
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::ListPhoneNumberStockWatches200Response do
21
+ #let(:instance) { Zernio::ListPhoneNumberStockWatches200Response.new }
22
+
23
+ describe 'test an instance of ListPhoneNumberStockWatches200Response' do
24
+ it 'should create an instance of ListPhoneNumberStockWatches200Response' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::ListPhoneNumberStockWatches200Response)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "watches"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ end
@@ -0,0 +1,54 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
5
+
6
+ The version of the OpenAPI document: 1.0.4
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+ require 'date'
16
+
17
+ # Unit tests for Zernio::PhoneNumberStockWatch
18
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
+ # Please update as you see appropriate
20
+ describe Zernio::PhoneNumberStockWatch do
21
+ #let(:instance) { Zernio::PhoneNumberStockWatch.new }
22
+
23
+ describe 'test an instance of PhoneNumberStockWatch' do
24
+ it 'should create an instance of PhoneNumberStockWatch' do
25
+ # uncomment below to test the instance creation
26
+ #expect(instance).to be_instance_of(Zernio::PhoneNumberStockWatch)
27
+ end
28
+ end
29
+
30
+ describe 'test attribute "id"' do
31
+ it 'should work' do
32
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
33
+ end
34
+ end
35
+
36
+ describe 'test attribute "country"' do
37
+ it 'should work' do
38
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
39
+ end
40
+ end
41
+
42
+ describe 'test attribute "country_name"' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
45
+ end
46
+ end
47
+
48
+ describe 'test attribute "created_at"' do
49
+ it 'should work' do
50
+ # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
51
+ end
52
+ end
53
+
54
+ end
@@ -54,7 +54,7 @@ describe Zernio::UpdateWebhookSettingsRequest do
54
54
  describe 'test attribute "events"' do
55
55
  it 'should work' do
56
56
  # assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
57
- # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.account.name_status_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "verification.approved", "verification.failed"])
57
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('Array<String>', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "post.platform.published", "post.platform.failed", "post.platform.deleted", "post.tiktok.url_resolved", "post.external.created", "post.external.updated", "post.external.deleted", "account.connected", "account.disconnected", "account.ads.initial_sync_completed", "message.received", "conversation.started", "call.received", "call.ended", "call.failed", "call.permission_request", "message.sent", "message.edited", "message.deleted", "message.delivered", "message.read", "message.failed", "reaction.received", "referral.received", "comment.received", "review.new", "review.updated", "lead.received", "ad.status_changed", "whatsapp.template.status_updated", "whatsapp.template.category_updated", "whatsapp.account.name_status_updated", "whatsapp.automatic_event", "whatsapp.number.activated", "whatsapp.number.declined", "whatsapp.number.action_required", "whatsapp.number.verification_required", "whatsapp.number.suspended", "whatsapp.number.reactivated", "whatsapp.number.released", "whatsapp.number.kyc_submitted", "phone_number.stock_available", "verification.approved", "verification.failed"])
58
58
  # validator.allowable_values.each do |value|
59
59
  # expect { instance.events = value }.not_to raise_error
60
60
  # end