zernio-sdk 0.0.620 → 0.0.621
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 +5 -0
- data/docs/GetWhatsAppCallingConfig200Response.md +5 -1
- data/docs/StartWhatsAppCallerIdVerification200Response.md +22 -0
- data/docs/StartWhatsAppCallerIdVerificationRequest.md +18 -0
- data/docs/VerifyWhatsAppCallerIdRequest.md +18 -0
- data/docs/WhatsAppCallingApi.md +146 -0
- data/lib/zernio-sdk/api/whats_app_calling_api.rb +144 -0
- data/lib/zernio-sdk/models/get_whats_app_calling_config200_response.rb +59 -5
- data/lib/zernio-sdk/models/start_whats_app_caller_id_verification200_response.rb +199 -0
- data/lib/zernio-sdk/models/start_whats_app_caller_id_verification_request.rb +183 -0
- data/lib/zernio-sdk/models/verify_whats_app_caller_id_request.rb +182 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +3 -0
- data/openapi.yaml +79 -0
- data/spec/api/whats_app_calling_api_spec.rb +26 -0
- data/spec/models/get_whats_app_calling_config200_response_spec.rb +16 -0
- data/spec/models/start_whats_app_caller_id_verification200_response_spec.rb +52 -0
- data/spec/models/start_whats_app_caller_id_verification_request_spec.rb +40 -0
- data/spec/models/verify_whats_app_caller_id_request_spec.rb +36 -0
- metadata +13 -1
|
@@ -0,0 +1,199 @@
|
|
|
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 StartWhatsAppCallerIdVerification200Response < ApiModelBase
|
|
18
|
+
attr_accessor :verified
|
|
19
|
+
|
|
20
|
+
attr_accessor :code_sent
|
|
21
|
+
|
|
22
|
+
attr_accessor :method
|
|
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
|
+
|
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
|
+
def self.attribute_map
|
|
48
|
+
{
|
|
49
|
+
:'verified' => :'verified',
|
|
50
|
+
:'code_sent' => :'codeSent',
|
|
51
|
+
:'method' => :'method'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns attribute mapping this model knows about
|
|
56
|
+
def self.acceptable_attribute_map
|
|
57
|
+
attribute_map
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns all the JSON keys this model knows about
|
|
61
|
+
def self.acceptable_attributes
|
|
62
|
+
acceptable_attribute_map.values
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Attribute type mapping.
|
|
66
|
+
def self.openapi_types
|
|
67
|
+
{
|
|
68
|
+
:'verified' => :'Boolean',
|
|
69
|
+
:'code_sent' => :'Boolean',
|
|
70
|
+
:'method' => :'String'
|
|
71
|
+
}
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# List of attributes with nullable: true
|
|
75
|
+
def self.openapi_nullable
|
|
76
|
+
Set.new([
|
|
77
|
+
])
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Initializes the object
|
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
|
+
def initialize(attributes = {})
|
|
83
|
+
if (!attributes.is_a?(Hash))
|
|
84
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::StartWhatsAppCallerIdVerification200Response` initialize method"
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
88
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
90
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::StartWhatsAppCallerIdVerification200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
92
|
+
end
|
|
93
|
+
h[k.to_sym] = v
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'verified')
|
|
97
|
+
self.verified = attributes[:'verified']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'code_sent')
|
|
101
|
+
self.code_sent = attributes[:'code_sent']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'method')
|
|
105
|
+
self.method = attributes[:'method']
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
110
|
+
# @return Array for valid properties with the reasons
|
|
111
|
+
def list_invalid_properties
|
|
112
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
113
|
+
invalid_properties = Array.new
|
|
114
|
+
invalid_properties
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Check to see if the all the properties in the model are valid
|
|
118
|
+
# @return true if the model is valid
|
|
119
|
+
def valid?
|
|
120
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
121
|
+
method_validator = EnumAttributeValidator.new('String', ["sms", "call"])
|
|
122
|
+
return false unless method_validator.valid?(@method)
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
127
|
+
# @param [Object] method Object to be assigned
|
|
128
|
+
def method=(method)
|
|
129
|
+
validator = EnumAttributeValidator.new('String', ["sms", "call"])
|
|
130
|
+
unless validator.valid?(method)
|
|
131
|
+
fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
|
|
132
|
+
end
|
|
133
|
+
@method = method
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Checks equality by comparing each attribute.
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def ==(o)
|
|
139
|
+
return true if self.equal?(o)
|
|
140
|
+
self.class == o.class &&
|
|
141
|
+
verified == o.verified &&
|
|
142
|
+
code_sent == o.code_sent &&
|
|
143
|
+
method == o.method
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# @see the `==` method
|
|
147
|
+
# @param [Object] Object to be compared
|
|
148
|
+
def eql?(o)
|
|
149
|
+
self == o
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Calculates hash code according to all attributes.
|
|
153
|
+
# @return [Integer] Hash code
|
|
154
|
+
def hash
|
|
155
|
+
[verified, code_sent, method].hash
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Builds the object from hash
|
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
160
|
+
# @return [Object] Returns the model itself
|
|
161
|
+
def self.build_from_hash(attributes)
|
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
|
163
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
164
|
+
transformed_hash = {}
|
|
165
|
+
openapi_types.each_pair do |key, type|
|
|
166
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
167
|
+
transformed_hash["#{key}"] = nil
|
|
168
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
169
|
+
# check to ensure the input is an array given that the attribute
|
|
170
|
+
# is documented as an array but the input is not
|
|
171
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
172
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
173
|
+
end
|
|
174
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
new(transformed_hash)
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Returns the object in the form of hash
|
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
|
183
|
+
def to_hash
|
|
184
|
+
hash = {}
|
|
185
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
186
|
+
value = self.send(attr)
|
|
187
|
+
if value.nil?
|
|
188
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
189
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
hash[param] = _to_hash(value)
|
|
193
|
+
end
|
|
194
|
+
hash
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
end
|
|
@@ -0,0 +1,183 @@
|
|
|
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 StartWhatsAppCallerIdVerificationRequest < ApiModelBase
|
|
18
|
+
attr_accessor :method
|
|
19
|
+
|
|
20
|
+
class EnumAttributeValidator
|
|
21
|
+
attr_reader :datatype
|
|
22
|
+
attr_reader :allowable_values
|
|
23
|
+
|
|
24
|
+
def initialize(datatype, allowable_values)
|
|
25
|
+
@allowable_values = allowable_values.map do |value|
|
|
26
|
+
case datatype.to_s
|
|
27
|
+
when /Integer/i
|
|
28
|
+
value.to_i
|
|
29
|
+
when /Float/i
|
|
30
|
+
value.to_f
|
|
31
|
+
else
|
|
32
|
+
value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def valid?(value)
|
|
38
|
+
!value || allowable_values.include?(value)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
43
|
+
def self.attribute_map
|
|
44
|
+
{
|
|
45
|
+
:'method' => :'method'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns attribute mapping this model knows about
|
|
50
|
+
def self.acceptable_attribute_map
|
|
51
|
+
attribute_map
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns all the JSON keys this model knows about
|
|
55
|
+
def self.acceptable_attributes
|
|
56
|
+
acceptable_attribute_map.values
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Attribute type mapping.
|
|
60
|
+
def self.openapi_types
|
|
61
|
+
{
|
|
62
|
+
:'method' => :'String'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# List of attributes with nullable: true
|
|
67
|
+
def self.openapi_nullable
|
|
68
|
+
Set.new([
|
|
69
|
+
])
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
if (!attributes.is_a?(Hash))
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::StartWhatsAppCallerIdVerificationRequest` initialize method"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::StartWhatsAppCallerIdVerificationRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
84
|
+
end
|
|
85
|
+
h[k.to_sym] = v
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'method')
|
|
89
|
+
self.method = attributes[:'method']
|
|
90
|
+
else
|
|
91
|
+
self.method = 'sms'
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
96
|
+
# @return Array for valid properties with the reasons
|
|
97
|
+
def list_invalid_properties
|
|
98
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
99
|
+
invalid_properties = Array.new
|
|
100
|
+
invalid_properties
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Check to see if the all the properties in the model are valid
|
|
104
|
+
# @return true if the model is valid
|
|
105
|
+
def valid?
|
|
106
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
107
|
+
method_validator = EnumAttributeValidator.new('String', ["sms", "call"])
|
|
108
|
+
return false unless method_validator.valid?(@method)
|
|
109
|
+
true
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
113
|
+
# @param [Object] method Object to be assigned
|
|
114
|
+
def method=(method)
|
|
115
|
+
validator = EnumAttributeValidator.new('String', ["sms", "call"])
|
|
116
|
+
unless validator.valid?(method)
|
|
117
|
+
fail ArgumentError, "invalid value for \"method\", must be one of #{validator.allowable_values}."
|
|
118
|
+
end
|
|
119
|
+
@method = method
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Checks equality by comparing each attribute.
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def ==(o)
|
|
125
|
+
return true if self.equal?(o)
|
|
126
|
+
self.class == o.class &&
|
|
127
|
+
method == o.method
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
# @see the `==` method
|
|
131
|
+
# @param [Object] Object to be compared
|
|
132
|
+
def eql?(o)
|
|
133
|
+
self == o
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Calculates hash code according to all attributes.
|
|
137
|
+
# @return [Integer] Hash code
|
|
138
|
+
def hash
|
|
139
|
+
[method].hash
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Builds the object from hash
|
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
144
|
+
# @return [Object] Returns the model itself
|
|
145
|
+
def self.build_from_hash(attributes)
|
|
146
|
+
return nil unless attributes.is_a?(Hash)
|
|
147
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
148
|
+
transformed_hash = {}
|
|
149
|
+
openapi_types.each_pair do |key, type|
|
|
150
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
151
|
+
transformed_hash["#{key}"] = nil
|
|
152
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
153
|
+
# check to ensure the input is an array given that the attribute
|
|
154
|
+
# is documented as an array but the input is not
|
|
155
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
156
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
157
|
+
end
|
|
158
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
159
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
new(transformed_hash)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# Returns the object in the form of hash
|
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
|
167
|
+
def to_hash
|
|
168
|
+
hash = {}
|
|
169
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
170
|
+
value = self.send(attr)
|
|
171
|
+
if value.nil?
|
|
172
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
173
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
hash[param] = _to_hash(value)
|
|
177
|
+
end
|
|
178
|
+
hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
end
|
|
@@ -0,0 +1,182 @@
|
|
|
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 VerifyWhatsAppCallerIdRequest < ApiModelBase
|
|
18
|
+
attr_accessor :code
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'code' => :'code'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'code' => :'String'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::VerifyWhatsAppCallerIdRequest` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::VerifyWhatsAppCallerIdRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'code')
|
|
67
|
+
self.code = attributes[:'code']
|
|
68
|
+
else
|
|
69
|
+
self.code = nil
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
74
|
+
# @return Array for valid properties with the reasons
|
|
75
|
+
def list_invalid_properties
|
|
76
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
if @code.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "code", code cannot be nil.')
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if @code.to_s.length > 10
|
|
83
|
+
invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 10.')
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
if @code.to_s.length < 4
|
|
87
|
+
invalid_properties.push('invalid value for "code", the character length must be greater than or equal to 4.')
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
invalid_properties
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Check to see if the all the properties in the model are valid
|
|
94
|
+
# @return true if the model is valid
|
|
95
|
+
def valid?
|
|
96
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
97
|
+
return false if @code.nil?
|
|
98
|
+
return false if @code.to_s.length > 10
|
|
99
|
+
return false if @code.to_s.length < 4
|
|
100
|
+
true
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Custom attribute writer method with validation
|
|
104
|
+
# @param [Object] code Value to be assigned
|
|
105
|
+
def code=(code)
|
|
106
|
+
if code.nil?
|
|
107
|
+
fail ArgumentError, 'code cannot be nil'
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if code.to_s.length > 10
|
|
111
|
+
fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 10.'
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if code.to_s.length < 4
|
|
115
|
+
fail ArgumentError, 'invalid value for "code", the character length must be greater than or equal to 4.'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@code = code
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Checks equality by comparing each attribute.
|
|
122
|
+
# @param [Object] Object to be compared
|
|
123
|
+
def ==(o)
|
|
124
|
+
return true if self.equal?(o)
|
|
125
|
+
self.class == o.class &&
|
|
126
|
+
code == o.code
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# @see the `==` method
|
|
130
|
+
# @param [Object] Object to be compared
|
|
131
|
+
def eql?(o)
|
|
132
|
+
self == o
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Calculates hash code according to all attributes.
|
|
136
|
+
# @return [Integer] Hash code
|
|
137
|
+
def hash
|
|
138
|
+
[code].hash
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Builds the object from hash
|
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
143
|
+
# @return [Object] Returns the model itself
|
|
144
|
+
def self.build_from_hash(attributes)
|
|
145
|
+
return nil unless attributes.is_a?(Hash)
|
|
146
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
147
|
+
transformed_hash = {}
|
|
148
|
+
openapi_types.each_pair do |key, type|
|
|
149
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
150
|
+
transformed_hash["#{key}"] = nil
|
|
151
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
152
|
+
# check to ensure the input is an array given that the attribute
|
|
153
|
+
# is documented as an array but the input is not
|
|
154
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
155
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
156
|
+
end
|
|
157
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
158
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
new(transformed_hash)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Returns the object in the form of hash
|
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
|
166
|
+
def to_hash
|
|
167
|
+
hash = {}
|
|
168
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
169
|
+
value = self.send(attr)
|
|
170
|
+
if value.nil?
|
|
171
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
172
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
hash[param] = _to_hash(value)
|
|
176
|
+
end
|
|
177
|
+
hash
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -1223,6 +1223,8 @@ require 'zernio-sdk/models/start_sms_registration_request'
|
|
|
1223
1223
|
require 'zernio-sdk/models/start_sms_registration_request_brand'
|
|
1224
1224
|
require 'zernio-sdk/models/start_sms_registration_request_campaign'
|
|
1225
1225
|
require 'zernio-sdk/models/start_sms_registration_request_toll_free'
|
|
1226
|
+
require 'zernio-sdk/models/start_whats_app_caller_id_verification200_response'
|
|
1227
|
+
require 'zernio-sdk/models/start_whats_app_caller_id_verification_request'
|
|
1226
1228
|
require 'zernio-sdk/models/submit_phone_number_kyc200_response'
|
|
1227
1229
|
require 'zernio-sdk/models/submit_phone_number_kyc200_response_numbers_inner'
|
|
1228
1230
|
require 'zernio-sdk/models/submit_phone_number_kyc200_response_phone_number'
|
|
@@ -1450,6 +1452,7 @@ require 'zernio-sdk/models/validate_subreddit200_response_one_of_subreddit'
|
|
|
1450
1452
|
require 'zernio-sdk/models/verification'
|
|
1451
1453
|
require 'zernio-sdk/models/verify_sms_registration_otp200_response'
|
|
1452
1454
|
require 'zernio-sdk/models/verify_sms_registration_otp_request'
|
|
1455
|
+
require 'zernio-sdk/models/verify_whats_app_caller_id_request'
|
|
1453
1456
|
require 'zernio-sdk/models/vote_reddit_thing_request'
|
|
1454
1457
|
require 'zernio-sdk/models/webhook'
|
|
1455
1458
|
require 'zernio-sdk/models/webhook_log'
|
data/openapi.yaml
CHANGED
|
@@ -25954,6 +25954,11 @@ paths:
|
|
|
25954
25954
|
callIconCountries:
|
|
25955
25955
|
type: [array, "null"]
|
|
25956
25956
|
items: { type: string, minLength: 2, maxLength: 2 }
|
|
25957
|
+
callerIdMode:
|
|
25958
|
+
type: string
|
|
25959
|
+
enum: [business, platform]
|
|
25960
|
+
description: 'Caller ID the forward-leg callee sees on tel: forwards. business = this WhatsApp number; platform = a Zernio number (customer-brought number without verified caller ID; verify via /v1/phone-numbers/{id}/whatsapp/caller-id-verification).'
|
|
25961
|
+
callerIdVerified: { type: boolean, description: 'True once the number completed caller-ID verification.' }
|
|
25957
25962
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
25958
25963
|
'404': { description: WhatsApp phone number not found for this account }
|
|
25959
25964
|
|
|
@@ -31120,7 +31125,81 @@ paths:
|
|
|
31120
31125
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
31121
31126
|
'404': { description: Phone number not found }
|
|
31122
31127
|
|
|
31128
|
+
/v1/phone-numbers/{id}/whatsapp/caller-id-verification:
|
|
31129
|
+
post:
|
|
31130
|
+
operationId: startWhatsAppCallerIdVerification
|
|
31131
|
+
tags: [WhatsApp Calling]
|
|
31132
|
+
summary: Start caller-ID verification for a customer-brought number
|
|
31133
|
+
description: |
|
|
31134
|
+
Customer-brought (BYO) WhatsApp numbers cannot present themselves as
|
|
31135
|
+
caller ID on `tel:` call forwards until verified (carrier
|
|
31136
|
+
anti-spoofing); until then forwarded calls show a Zernio number
|
|
31137
|
+
(`callerIdMode: platform` on the calling config). This sends a
|
|
31138
|
+
one-time code to the number by SMS or voice call. Re-POST to resend.
|
|
31139
|
+
Zernio-purchased numbers never need this and get a 400.
|
|
31140
|
+
security:
|
|
31141
|
+
- bearerAuth: []
|
|
31142
|
+
parameters:
|
|
31143
|
+
- { name: id, in: path, required: true, schema: { type: string }, description: "Phone number record ID (from GET /v1/phone-numbers)." }
|
|
31144
|
+
requestBody:
|
|
31145
|
+
required: false
|
|
31146
|
+
content:
|
|
31147
|
+
application/json:
|
|
31148
|
+
schema:
|
|
31149
|
+
type: object
|
|
31150
|
+
properties:
|
|
31151
|
+
method: { type: string, enum: [sms, call], default: sms }
|
|
31152
|
+
responses:
|
|
31153
|
+
'200':
|
|
31154
|
+
description: 'Code sent (or the number was already verified)'
|
|
31155
|
+
content:
|
|
31156
|
+
application/json:
|
|
31157
|
+
schema:
|
|
31158
|
+
type: object
|
|
31159
|
+
properties:
|
|
31160
|
+
verified: { type: boolean }
|
|
31161
|
+
codeSent: { type: boolean }
|
|
31162
|
+
method: { type: string, enum: [sms, call] }
|
|
31163
|
+
'400': { $ref: '#/components/responses/BadRequest' }
|
|
31164
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
31165
|
+
'404': { description: Number not found }
|
|
31166
|
+
'429': { description: 'Too many verification attempts for this number; wait before retrying' }
|
|
31123
31167
|
|
|
31168
|
+
/v1/phone-numbers/{id}/whatsapp/caller-id-verification/verify:
|
|
31169
|
+
post:
|
|
31170
|
+
operationId: verifyWhatsAppCallerId
|
|
31171
|
+
tags: [WhatsApp Calling]
|
|
31172
|
+
summary: Confirm the caller-ID verification code
|
|
31173
|
+
description: |
|
|
31174
|
+
Submits the one-time code the number received. On success, `tel:`
|
|
31175
|
+
call forwards present the business number itself as caller ID
|
|
31176
|
+
(`callerIdMode: business`).
|
|
31177
|
+
security:
|
|
31178
|
+
- bearerAuth: []
|
|
31179
|
+
parameters:
|
|
31180
|
+
- { name: id, in: path, required: true, schema: { type: string }, description: "Phone number record ID (from GET /v1/phone-numbers)." }
|
|
31181
|
+
requestBody:
|
|
31182
|
+
required: true
|
|
31183
|
+
content:
|
|
31184
|
+
application/json:
|
|
31185
|
+
schema:
|
|
31186
|
+
type: object
|
|
31187
|
+
required: [code]
|
|
31188
|
+
properties:
|
|
31189
|
+
code: { type: string, minLength: 4, maxLength: 10 }
|
|
31190
|
+
responses:
|
|
31191
|
+
'200':
|
|
31192
|
+
description: Verified
|
|
31193
|
+
content:
|
|
31194
|
+
application/json:
|
|
31195
|
+
schema:
|
|
31196
|
+
type: object
|
|
31197
|
+
properties:
|
|
31198
|
+
verified: { type: boolean }
|
|
31199
|
+
'400': { description: 'Invalid or expired code, or malformed request' }
|
|
31200
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
31201
|
+
'404': { description: Number not found }
|
|
31202
|
+
'429': { description: 'Attempt lockout from the carrier; wait a few minutes, then request a fresh code' }
|
|
31124
31203
|
|
|
31125
31204
|
/v1/whatsapp/phone-numbers/{phoneNumberId}:
|
|
31126
31205
|
get:
|