late-sdk 0.0.609 → 0.0.611
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/README.md +4 -0
- data/docs/PurchasePhoneNumber200ResponseOneOf1PhoneNumber.md +3 -1
- data/docs/PurchasePhoneNumber200ResponseOneOf2.md +3 -1
- data/docs/PurchasePhoneNumberRequest.md +2 -2
- data/docs/PurchaseWhatsAppPhoneNumber200Response.md +51 -0
- data/docs/PurchaseWhatsAppPhoneNumber200ResponseOneOf.md +20 -0
- data/docs/PurchaseWhatsAppPhoneNumber200ResponseOneOf1.md +22 -0
- data/docs/PurchaseWhatsAppPhoneNumber200ResponseOneOfPhoneNumber.md +30 -0
- data/docs/WhatsAppPhoneNumbersApi.md +4 -4
- data/lib/zernio-sdk/api/whats_app_phone_numbers_api.rb +3 -3
- data/lib/zernio-sdk/models/purchase_phone_number200_response_one_of1_phone_number.rb +14 -4
- data/lib/zernio-sdk/models/purchase_phone_number200_response_one_of2.rb +14 -4
- data/lib/zernio-sdk/models/purchase_phone_number_request.rb +2 -2
- data/lib/zernio-sdk/models/purchase_whats_app_phone_number200_response.rb +105 -0
- data/lib/zernio-sdk/models/purchase_whats_app_phone_number200_response_one_of.rb +157 -0
- data/lib/zernio-sdk/models/purchase_whats_app_phone_number200_response_one_of1.rb +200 -0
- data/lib/zernio-sdk/models/purchase_whats_app_phone_number200_response_one_of_phone_number.rb +201 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +4 -0
- data/openapi.yaml +14 -6
- data/spec/api/whats_app_phone_numbers_api_spec.rb +1 -1
- data/spec/models/purchase_phone_number200_response_one_of1_phone_number_spec.rb +6 -0
- data/spec/models/purchase_phone_number200_response_one_of2_spec.rb +6 -0
- data/spec/models/purchase_whats_app_phone_number200_response_one_of1_spec.rb +52 -0
- data/spec/models/purchase_whats_app_phone_number200_response_one_of_phone_number_spec.rb +72 -0
- data/spec/models/purchase_whats_app_phone_number200_response_one_of_spec.rb +42 -0
- data/spec/models/purchase_whats_app_phone_number200_response_spec.rb +32 -0
- data/zernio-sdk-0.0.611.gem +0 -0
- metadata +18 -2
- data/zernio-sdk-0.0.609.gem +0 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
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
|
+
# Phone number provisioned inline (subsequent numbers)
|
|
18
|
+
class PurchaseWhatsAppPhoneNumber200ResponseOneOf < ApiModelBase
|
|
19
|
+
attr_accessor :message
|
|
20
|
+
|
|
21
|
+
attr_accessor :phone_number
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'message' => :'message',
|
|
27
|
+
:'phone_number' => :'phoneNumber'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'message' => :'String',
|
|
45
|
+
:'phone_number' => :'PurchaseWhatsAppPhoneNumber200ResponseOneOfPhoneNumber'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Initializes the object
|
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
|
+
def initialize(attributes = {})
|
|
58
|
+
if (!attributes.is_a?(Hash))
|
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::PurchaseWhatsAppPhoneNumber200ResponseOneOf` initialize method"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::PurchaseWhatsAppPhoneNumber200ResponseOneOf`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'message')
|
|
72
|
+
self.message = attributes[:'message']
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if attributes.key?(:'phone_number')
|
|
76
|
+
self.phone_number = attributes[:'phone_number']
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
81
|
+
# @return Array for valid properties with the reasons
|
|
82
|
+
def list_invalid_properties
|
|
83
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
84
|
+
invalid_properties = Array.new
|
|
85
|
+
invalid_properties
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Check to see if the all the properties in the model are valid
|
|
89
|
+
# @return true if the model is valid
|
|
90
|
+
def valid?
|
|
91
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
92
|
+
true
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Checks equality by comparing each attribute.
|
|
96
|
+
# @param [Object] Object to be compared
|
|
97
|
+
def ==(o)
|
|
98
|
+
return true if self.equal?(o)
|
|
99
|
+
self.class == o.class &&
|
|
100
|
+
message == o.message &&
|
|
101
|
+
phone_number == o.phone_number
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @see the `==` method
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def eql?(o)
|
|
107
|
+
self == o
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Calculates hash code according to all attributes.
|
|
111
|
+
# @return [Integer] Hash code
|
|
112
|
+
def hash
|
|
113
|
+
[message, phone_number].hash
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Builds the object from hash
|
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
118
|
+
# @return [Object] Returns the model itself
|
|
119
|
+
def self.build_from_hash(attributes)
|
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
|
121
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
122
|
+
transformed_hash = {}
|
|
123
|
+
openapi_types.each_pair do |key, type|
|
|
124
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
125
|
+
transformed_hash["#{key}"] = nil
|
|
126
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
127
|
+
# check to ensure the input is an array given that the attribute
|
|
128
|
+
# is documented as an array but the input is not
|
|
129
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
130
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
131
|
+
end
|
|
132
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
133
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
new(transformed_hash)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Returns the object in the form of hash
|
|
140
|
+
# @return [Hash] Returns the object in the form of hash
|
|
141
|
+
def to_hash
|
|
142
|
+
hash = {}
|
|
143
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
144
|
+
value = self.send(attr)
|
|
145
|
+
if value.nil?
|
|
146
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
147
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
hash[param] = _to_hash(value)
|
|
151
|
+
end
|
|
152
|
+
hash
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
end
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
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
|
+
# A number was already purchased under the supplied purchaseIntentId; no new number was provisioned.
|
|
18
|
+
class PurchaseWhatsAppPhoneNumber200ResponseOneOf1 < ApiModelBase
|
|
19
|
+
attr_accessor :status
|
|
20
|
+
|
|
21
|
+
attr_accessor :number_id
|
|
22
|
+
|
|
23
|
+
attr_accessor :phone_number
|
|
24
|
+
|
|
25
|
+
class EnumAttributeValidator
|
|
26
|
+
attr_reader :datatype
|
|
27
|
+
attr_reader :allowable_values
|
|
28
|
+
|
|
29
|
+
def initialize(datatype, allowable_values)
|
|
30
|
+
@allowable_values = allowable_values.map do |value|
|
|
31
|
+
case datatype.to_s
|
|
32
|
+
when /Integer/i
|
|
33
|
+
value.to_i
|
|
34
|
+
when /Float/i
|
|
35
|
+
value.to_f
|
|
36
|
+
else
|
|
37
|
+
value
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def valid?(value)
|
|
43
|
+
!value || allowable_values.include?(value)
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
48
|
+
def self.attribute_map
|
|
49
|
+
{
|
|
50
|
+
:'status' => :'status',
|
|
51
|
+
:'number_id' => :'numberId',
|
|
52
|
+
:'phone_number' => :'phoneNumber'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Returns attribute mapping this model knows about
|
|
57
|
+
def self.acceptable_attribute_map
|
|
58
|
+
attribute_map
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns all the JSON keys this model knows about
|
|
62
|
+
def self.acceptable_attributes
|
|
63
|
+
acceptable_attribute_map.values
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Attribute type mapping.
|
|
67
|
+
def self.openapi_types
|
|
68
|
+
{
|
|
69
|
+
:'status' => :'String',
|
|
70
|
+
:'number_id' => :'String',
|
|
71
|
+
:'phone_number' => :'String'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# List of attributes with nullable: true
|
|
76
|
+
def self.openapi_nullable
|
|
77
|
+
Set.new([
|
|
78
|
+
])
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Initializes the object
|
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
83
|
+
def initialize(attributes = {})
|
|
84
|
+
if (!attributes.is_a?(Hash))
|
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::PurchaseWhatsAppPhoneNumber200ResponseOneOf1` initialize method"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::PurchaseWhatsAppPhoneNumber200ResponseOneOf1`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
93
|
+
end
|
|
94
|
+
h[k.to_sym] = v
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'status')
|
|
98
|
+
self.status = attributes[:'status']
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'number_id')
|
|
102
|
+
self.number_id = attributes[:'number_id']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'phone_number')
|
|
106
|
+
self.phone_number = attributes[:'phone_number']
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
111
|
+
# @return Array for valid properties with the reasons
|
|
112
|
+
def list_invalid_properties
|
|
113
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
114
|
+
invalid_properties = Array.new
|
|
115
|
+
invalid_properties
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Check to see if the all the properties in the model are valid
|
|
119
|
+
# @return true if the model is valid
|
|
120
|
+
def valid?
|
|
121
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
122
|
+
status_validator = EnumAttributeValidator.new('String', ["already_purchased"])
|
|
123
|
+
return false unless status_validator.valid?(@status)
|
|
124
|
+
true
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
128
|
+
# @param [Object] status Object to be assigned
|
|
129
|
+
def status=(status)
|
|
130
|
+
validator = EnumAttributeValidator.new('String', ["already_purchased"])
|
|
131
|
+
unless validator.valid?(status)
|
|
132
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
|
133
|
+
end
|
|
134
|
+
@status = status
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Checks equality by comparing each attribute.
|
|
138
|
+
# @param [Object] Object to be compared
|
|
139
|
+
def ==(o)
|
|
140
|
+
return true if self.equal?(o)
|
|
141
|
+
self.class == o.class &&
|
|
142
|
+
status == o.status &&
|
|
143
|
+
number_id == o.number_id &&
|
|
144
|
+
phone_number == o.phone_number
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# @see the `==` method
|
|
148
|
+
# @param [Object] Object to be compared
|
|
149
|
+
def eql?(o)
|
|
150
|
+
self == o
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# Calculates hash code according to all attributes.
|
|
154
|
+
# @return [Integer] Hash code
|
|
155
|
+
def hash
|
|
156
|
+
[status, number_id, phone_number].hash
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Builds the object from hash
|
|
160
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
161
|
+
# @return [Object] Returns the model itself
|
|
162
|
+
def self.build_from_hash(attributes)
|
|
163
|
+
return nil unless attributes.is_a?(Hash)
|
|
164
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
165
|
+
transformed_hash = {}
|
|
166
|
+
openapi_types.each_pair do |key, type|
|
|
167
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
168
|
+
transformed_hash["#{key}"] = nil
|
|
169
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
170
|
+
# check to ensure the input is an array given that the attribute
|
|
171
|
+
# is documented as an array but the input is not
|
|
172
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
173
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
174
|
+
end
|
|
175
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
176
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
new(transformed_hash)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Returns the object in the form of hash
|
|
183
|
+
# @return [Hash] Returns the object in the form of hash
|
|
184
|
+
def to_hash
|
|
185
|
+
hash = {}
|
|
186
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
187
|
+
value = self.send(attr)
|
|
188
|
+
if value.nil?
|
|
189
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
190
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
hash[param] = _to_hash(value)
|
|
194
|
+
end
|
|
195
|
+
hash
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
end
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
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 PurchaseWhatsAppPhoneNumber200ResponseOneOfPhoneNumber < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
attr_accessor :phone_number
|
|
21
|
+
|
|
22
|
+
attr_accessor :status
|
|
23
|
+
|
|
24
|
+
attr_accessor :country
|
|
25
|
+
|
|
26
|
+
attr_accessor :provisioned_at
|
|
27
|
+
|
|
28
|
+
attr_accessor :meta_preverified_id
|
|
29
|
+
|
|
30
|
+
attr_accessor :meta_verification_status
|
|
31
|
+
|
|
32
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
|
+
def self.attribute_map
|
|
34
|
+
{
|
|
35
|
+
:'id' => :'id',
|
|
36
|
+
:'phone_number' => :'phoneNumber',
|
|
37
|
+
:'status' => :'status',
|
|
38
|
+
:'country' => :'country',
|
|
39
|
+
:'provisioned_at' => :'provisionedAt',
|
|
40
|
+
:'meta_preverified_id' => :'metaPreverifiedId',
|
|
41
|
+
:'meta_verification_status' => :'metaVerificationStatus'
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns all the JSON keys this model knows about
|
|
51
|
+
def self.acceptable_attributes
|
|
52
|
+
acceptable_attribute_map.values
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Attribute type mapping.
|
|
56
|
+
def self.openapi_types
|
|
57
|
+
{
|
|
58
|
+
:'id' => :'String',
|
|
59
|
+
:'phone_number' => :'String',
|
|
60
|
+
:'status' => :'String',
|
|
61
|
+
:'country' => :'String',
|
|
62
|
+
:'provisioned_at' => :'Time',
|
|
63
|
+
:'meta_preverified_id' => :'String',
|
|
64
|
+
:'meta_verification_status' => :'String'
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# List of attributes with nullable: true
|
|
69
|
+
def self.openapi_nullable
|
|
70
|
+
Set.new([
|
|
71
|
+
])
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# Initializes the object
|
|
75
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
76
|
+
def initialize(attributes = {})
|
|
77
|
+
if (!attributes.is_a?(Hash))
|
|
78
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::PurchaseWhatsAppPhoneNumber200ResponseOneOfPhoneNumber` initialize method"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
82
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
83
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
84
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
85
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::PurchaseWhatsAppPhoneNumber200ResponseOneOfPhoneNumber`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
86
|
+
end
|
|
87
|
+
h[k.to_sym] = v
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'id')
|
|
91
|
+
self.id = attributes[:'id']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'phone_number')
|
|
95
|
+
self.phone_number = attributes[:'phone_number']
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'status')
|
|
99
|
+
self.status = attributes[:'status']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'country')
|
|
103
|
+
self.country = attributes[:'country']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'provisioned_at')
|
|
107
|
+
self.provisioned_at = attributes[:'provisioned_at']
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'meta_preverified_id')
|
|
111
|
+
self.meta_preverified_id = attributes[:'meta_preverified_id']
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'meta_verification_status')
|
|
115
|
+
self.meta_verification_status = attributes[:'meta_verification_status']
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
120
|
+
# @return Array for valid properties with the reasons
|
|
121
|
+
def list_invalid_properties
|
|
122
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
123
|
+
invalid_properties = Array.new
|
|
124
|
+
invalid_properties
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Check to see if the all the properties in the model are valid
|
|
128
|
+
# @return true if the model is valid
|
|
129
|
+
def valid?
|
|
130
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
131
|
+
true
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Checks equality by comparing each attribute.
|
|
135
|
+
# @param [Object] Object to be compared
|
|
136
|
+
def ==(o)
|
|
137
|
+
return true if self.equal?(o)
|
|
138
|
+
self.class == o.class &&
|
|
139
|
+
id == o.id &&
|
|
140
|
+
phone_number == o.phone_number &&
|
|
141
|
+
status == o.status &&
|
|
142
|
+
country == o.country &&
|
|
143
|
+
provisioned_at == o.provisioned_at &&
|
|
144
|
+
meta_preverified_id == o.meta_preverified_id &&
|
|
145
|
+
meta_verification_status == o.meta_verification_status
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# @see the `==` method
|
|
149
|
+
# @param [Object] Object to be compared
|
|
150
|
+
def eql?(o)
|
|
151
|
+
self == o
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Calculates hash code according to all attributes.
|
|
155
|
+
# @return [Integer] Hash code
|
|
156
|
+
def hash
|
|
157
|
+
[id, phone_number, status, country, provisioned_at, meta_preverified_id, meta_verification_status].hash
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Builds the object from hash
|
|
161
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
162
|
+
# @return [Object] Returns the model itself
|
|
163
|
+
def self.build_from_hash(attributes)
|
|
164
|
+
return nil unless attributes.is_a?(Hash)
|
|
165
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
166
|
+
transformed_hash = {}
|
|
167
|
+
openapi_types.each_pair do |key, type|
|
|
168
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = nil
|
|
170
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
171
|
+
# check to ensure the input is an array given that the attribute
|
|
172
|
+
# is documented as an array but the input is not
|
|
173
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
174
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
175
|
+
end
|
|
176
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
177
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
new(transformed_hash)
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Returns the object in the form of hash
|
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
|
185
|
+
def to_hash
|
|
186
|
+
hash = {}
|
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
188
|
+
value = self.send(attr)
|
|
189
|
+
if value.nil?
|
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
hash[param] = _to_hash(value)
|
|
195
|
+
end
|
|
196
|
+
hash
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -1014,6 +1014,10 @@ require 'zernio-sdk/models/purchase_phone_number200_response_one_of2'
|
|
|
1014
1014
|
require 'zernio-sdk/models/purchase_phone_number202_response'
|
|
1015
1015
|
require 'zernio-sdk/models/purchase_phone_number409_response'
|
|
1016
1016
|
require 'zernio-sdk/models/purchase_phone_number_request'
|
|
1017
|
+
require 'zernio-sdk/models/purchase_whats_app_phone_number200_response'
|
|
1018
|
+
require 'zernio-sdk/models/purchase_whats_app_phone_number200_response_one_of'
|
|
1019
|
+
require 'zernio-sdk/models/purchase_whats_app_phone_number200_response_one_of1'
|
|
1020
|
+
require 'zernio-sdk/models/purchase_whats_app_phone_number200_response_one_of_phone_number'
|
|
1017
1021
|
require 'zernio-sdk/models/purchase_whats_app_phone_number_request'
|
|
1018
1022
|
require 'zernio-sdk/models/query_ad_insights200_response'
|
|
1019
1023
|
require 'zernio-sdk/models/query_ad_insights200_response_paging'
|
data/openapi.yaml
CHANGED
|
@@ -15,10 +15,10 @@ info:
|
|
|
15
15
|
url: https://zernio.com/icon.png?v=3
|
|
16
16
|
x-long-description: |
|
|
17
17
|
Zernio is the social media API that replaces 16 integrations. Schedule posts, retrieve analytics,
|
|
18
|
-
manage DMs, comments, and reviews across Twitter/X, Instagram,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
manage DMs, comments, and reviews across Twitter/X, Instagram, TikTok, LinkedIn, Facebook,
|
|
19
|
+
YouTube, Threads, Reddit, Pinterest, Bluesky, Telegram, Google Business, Snapchat, Discord,
|
|
20
|
+
and Slack, all from a single REST API. Run paid ads on Meta (Facebook + Instagram), Google, TikTok,
|
|
21
|
+
LinkedIn, Pinterest, X, and OpenAI from the same account.
|
|
22
22
|
|
|
23
23
|
Key features: Unified posting to 16 platforms, ads management on 7 ad networks (via /v1/ads), aggregated analytics, unified inbox (DMs, comments, reviews), webhooks, OAuth connect, queue scheduling, and white-label support for agencies managing unlimited accounts.
|
|
24
24
|
|
|
@@ -28246,7 +28246,12 @@ paths:
|
|
|
28246
28246
|
properties:
|
|
28247
28247
|
profileId:
|
|
28248
28248
|
type: string
|
|
28249
|
-
description:
|
|
28249
|
+
description: >
|
|
28250
|
+
Preferred profile for the number. One number = one
|
|
28251
|
+
profile, so when the requested profile already holds a
|
|
28252
|
+
number the API assigns the next free profile instead (or
|
|
28253
|
+
creates one) and returns the actual assignment in
|
|
28254
|
+
`profileId` on the response.
|
|
28250
28255
|
country:
|
|
28251
28256
|
type: string
|
|
28252
28257
|
description: >
|
|
@@ -28317,7 +28322,8 @@ paths:
|
|
|
28317
28322
|
Optional idempotency key. Send the same value when retrying
|
|
28318
28323
|
a purchase: if a number was already bought under this key,
|
|
28319
28324
|
the API returns { status: "already_purchased", numberId,
|
|
28320
|
-
phoneNumber } instead of provisioning a second
|
|
28325
|
+
phoneNumber, profileId } instead of provisioning a second
|
|
28326
|
+
number.
|
|
28321
28327
|
Generate a fresh key for each genuinely new purchase.
|
|
28322
28328
|
allowMultiple:
|
|
28323
28329
|
type: boolean
|
|
@@ -28357,6 +28363,7 @@ paths:
|
|
|
28357
28363
|
provisionedAt: { type: string, format: date-time }
|
|
28358
28364
|
metaPreverifiedId: { type: string }
|
|
28359
28365
|
metaVerificationStatus: { type: string }
|
|
28366
|
+
profileId: { type: string, description: 'The profile the number was actually assigned to.' }
|
|
28360
28367
|
- type: object
|
|
28361
28368
|
description: >
|
|
28362
28369
|
A number was already purchased under the supplied
|
|
@@ -28365,6 +28372,7 @@ paths:
|
|
|
28365
28372
|
status: { type: string, enum: [already_purchased] }
|
|
28366
28373
|
numberId: { type: string }
|
|
28367
28374
|
phoneNumber: { type: string }
|
|
28375
|
+
profileId: { type: string, description: 'The profile the number was actually assigned to.' }
|
|
28368
28376
|
'400': { description: "Plan limit reached, profileId required, or country not available" }
|
|
28369
28377
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
28370
28378
|
'403': { description: A paid plan is required }
|
|
@@ -136,7 +136,7 @@ describe 'WhatsAppPhoneNumbersApi' do
|
|
|
136
136
|
# Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New integrations should use that path. Payment-first: you do not pick a specific number, the system provisions one and auto-assigns it. With usage-based billing active and a payment method on file, the number provisions inline and bills per month on your usage-based invoice (there is no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`; a regulated country returns `202` with `status: \"kyc_required\"` and a `kycUrl`. Requires usage-based billing (the Usage plan). The maximum number of phone numbers is determined by the user's plan.
|
|
137
137
|
# @param purchase_whats_app_phone_number_request
|
|
138
138
|
# @param [Hash] opts the optional parameters
|
|
139
|
-
# @return [
|
|
139
|
+
# @return [PurchaseWhatsAppPhoneNumber200Response]
|
|
140
140
|
describe 'purchase_whats_app_phone_number test' do
|
|
141
141
|
it 'should work' do
|
|
142
142
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -69,4 +69,10 @@ describe Zernio::PurchasePhoneNumber200ResponseOneOf1PhoneNumber do
|
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
+
describe 'test attribute "profile_id"' do
|
|
73
|
+
it 'should work' do
|
|
74
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
72
78
|
end
|
|
@@ -49,4 +49,10 @@ describe Zernio::PurchasePhoneNumber200ResponseOneOf2 do
|
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
describe 'test attribute "profile_id"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
52
58
|
end
|