freeclimb 5.3.0 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/Gemfile.lock +1 -1
- data/README.md +18 -4
- data/docs/AvailableNumber.md +0 -4
- data/docs/BlobListResponse.md +32 -0
- data/docs/BlobResult.md +32 -0
- data/docs/CreateBlobRequest.md +22 -0
- data/docs/DefaultApi.md +449 -6
- data/docs/IncomingNumberResult.md +0 -4
- data/docs/ModifyBlobRequest.md +20 -0
- data/docs/PlatformError.md +24 -0
- data/docs/ReplaceBlobRequest.md +18 -0
- data/docs/Say.md +2 -0
- data/docs/TTSEngine.md +20 -0
- data/docs/TTSEngineName.md +18 -0
- data/lib/freeclimb/api/default_api.rb +715 -8
- data/lib/freeclimb/models/available_number.rb +1 -23
- data/lib/freeclimb/models/blob_list_response.rb +303 -0
- data/lib/freeclimb/models/blob_result.rb +332 -0
- data/lib/freeclimb/models/create_blob_request.rb +255 -0
- data/lib/freeclimb/models/incoming_number_result.rb +1 -23
- data/lib/freeclimb/models/modify_blob_request.rb +245 -0
- data/lib/freeclimb/models/platform_error.rb +244 -0
- data/lib/freeclimb/models/replace_blob_request.rb +221 -0
- data/lib/freeclimb/models/say.rb +10 -1
- data/lib/freeclimb/models/tts_engine.rb +250 -0
- data/lib/freeclimb/models/tts_engine_name.rb +36 -0
- data/lib/freeclimb/version.rb +1 -1
- data/lib/freeclimb.rb +8 -0
- data/openapi.json +894 -97
- data/spec/api/default_api_spec.rb +188 -32
- data/spec/models/account_result_spec.rb +3 -3
- data/spec/models/available_number_spec.rb +3 -98
- data/spec/models/blob_list_response_spec.rb +502 -0
- data/spec/models/blob_result_spec.rb +489 -0
- data/spec/models/call_result_spec.rb +3 -3
- data/spec/models/conference_result_spec.rb +3 -3
- data/spec/models/create_blob_request_spec.rb +273 -0
- data/spec/models/export_request_spec.rb +6 -6
- data/spec/models/export_result_spec.rb +6 -6
- data/spec/models/incoming_number_result_spec.rb +6 -102
- data/spec/models/log_result_spec.rb +3 -3
- data/spec/models/message_result_spec.rb +3 -3
- data/spec/models/modify_blob_request_spec.rb +226 -0
- data/spec/models/platform_error_spec.rb +318 -0
- data/spec/models/queue_result_spec.rb +3 -3
- data/spec/models/replace_blob_request_spec.rb +176 -0
- data/spec/models/say_spec.rb +50 -0
- data/spec/models/sms_ten_dlc_partner_campaign_spec.rb +3 -3
- data/spec/models/transcribe_utterance_spec.rb +3 -3
- data/spec/models/tts_engine_name_spec.rb +75 -0
- data/spec/models/tts_engine_spec.rb +183 -0
- data/spec/spec_helper.rb +1 -1
- metadata +26 -2
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# #FreeClimb API
|
|
2
|
+
#
|
|
3
|
+
# FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
|
|
4
|
+
#
|
|
5
|
+
# The version of the OpenAPI document: 1.0.0
|
|
6
|
+
# Contact: support@freeclimb.com
|
|
7
|
+
# Generated by: https://openapi-generator.tech
|
|
8
|
+
# OpenAPI Generator version: 7.9.0
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "date"
|
|
12
|
+
require "time"
|
|
13
|
+
|
|
14
|
+
module Freeclimb
|
|
15
|
+
class CreateBlobRequest
|
|
16
|
+
# Custom identifier for this blob that is unique for the owning account. It will be set to the blobId by default if not provided.
|
|
17
|
+
attr_accessor :_alias
|
|
18
|
+
|
|
19
|
+
# An RFC3339 timestamp with millisecond resolution. This timestamp defines the time at which this blob will delete itself. It must not be more than 48 hours in the future and will default to 9 hours in the future if not provided.
|
|
20
|
+
attr_accessor :expires_at
|
|
21
|
+
|
|
22
|
+
attr_accessor :blob
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
_alias: :alias,
|
|
28
|
+
expires_at: :expiresAt,
|
|
29
|
+
blob: :blob
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns all the JSON keys this model knows about
|
|
34
|
+
def self.acceptable_attributes
|
|
35
|
+
attribute_map.values
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Attribute type mapping.
|
|
39
|
+
def self.openapi_types
|
|
40
|
+
{
|
|
41
|
+
_alias: :String,
|
|
42
|
+
expires_at: :String,
|
|
43
|
+
blob: :Object
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# List of attributes with nullable: true
|
|
48
|
+
def self.openapi_nullable
|
|
49
|
+
Set.new([])
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Initializes the object
|
|
53
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
54
|
+
def initialize(attributes = {})
|
|
55
|
+
if !attributes.is_a?(Hash)
|
|
56
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::CreateBlobRequest` initialize method"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
+
if !self.class.attribute_map.key?(k.to_sym)
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::CreateBlobRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
63
|
+
end
|
|
64
|
+
h[k.to_sym] = v
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if attributes.key?(:_alias)
|
|
68
|
+
self._alias = attributes[:_alias]
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:expires_at)
|
|
72
|
+
self.expires_at = attributes[:expires_at]
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if attributes.key?(:blob)
|
|
76
|
+
self.blob = attributes[:blob]
|
|
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
|
+
invalid_properties = []
|
|
84
|
+
if !@_alias.nil? && @_alias.to_s.length > 64
|
|
85
|
+
invalid_properties.push('invalid value for "_alias", the character length must be smaller than or equal to 64.')
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if @blob.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "blob", blob cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
invalid_properties
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Check to see if the all the properties in the model are valid
|
|
96
|
+
# @return true if the model is valid
|
|
97
|
+
def valid?
|
|
98
|
+
if @_alias.nil?
|
|
99
|
+
false
|
|
100
|
+
else
|
|
101
|
+
list_invalid_properties.length == 0
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Custom attribute writer method with validation
|
|
106
|
+
# @param [Object] _alias Value to be assigned
|
|
107
|
+
def _alias=(_alias)
|
|
108
|
+
if !_alias.nil? && _alias.to_s.length > 64
|
|
109
|
+
fail ArgumentError, 'invalid value for "_alias", the character length must be smaller than or equal to 64.'
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
@_alias = _alias
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Checks equality by comparing each attribute.
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def ==(other)
|
|
118
|
+
return true if equal?(other)
|
|
119
|
+
self.class == other.class &&
|
|
120
|
+
_alias == other._alias &&
|
|
121
|
+
expires_at == other.expires_at &&
|
|
122
|
+
blob == other.blob
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# @see the `==` method
|
|
126
|
+
# @param [Object] Object to be compared
|
|
127
|
+
def eql?(other)
|
|
128
|
+
self == other
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Calculates hash code according to all attributes.
|
|
132
|
+
# @return [Integer] Hash code
|
|
133
|
+
def hash
|
|
134
|
+
[_alias, expires_at, blob].hash
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Builds the object from hash
|
|
138
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
139
|
+
# @return [Object] Returns the model itself
|
|
140
|
+
def self.build_from_hash(attributes)
|
|
141
|
+
new.build_from_hash(attributes)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Builds the object from hash
|
|
145
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
146
|
+
# @return [Object] Returns the model itself
|
|
147
|
+
def build_from_hash(attributes)
|
|
148
|
+
return nil unless attributes.is_a?(Hash)
|
|
149
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
150
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
151
|
+
send(:"#{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[self.class.attribute_map[key]].is_a?(Array)
|
|
156
|
+
send(:"#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
157
|
+
end
|
|
158
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
159
|
+
send(:"#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
self
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Deserializes the data based on type
|
|
167
|
+
# @param string type Data type
|
|
168
|
+
# @param string value Value to be deserialized
|
|
169
|
+
# @return [Object] Deserialized data
|
|
170
|
+
def _deserialize(type, value)
|
|
171
|
+
case type.to_sym
|
|
172
|
+
when :Time
|
|
173
|
+
Time.parse(value)
|
|
174
|
+
when :Date
|
|
175
|
+
Date.parse(value)
|
|
176
|
+
when :String
|
|
177
|
+
value.to_s
|
|
178
|
+
when :Integer
|
|
179
|
+
value.to_i
|
|
180
|
+
when :Float
|
|
181
|
+
value.to_f
|
|
182
|
+
when :Boolean
|
|
183
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
184
|
+
true
|
|
185
|
+
else
|
|
186
|
+
false
|
|
187
|
+
end
|
|
188
|
+
when :Object
|
|
189
|
+
# generic object (usually a Hash), return directly
|
|
190
|
+
value
|
|
191
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
192
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
193
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
194
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
195
|
+
k_type = Regexp.last_match[:k_type]
|
|
196
|
+
v_type = Regexp.last_match[:v_type]
|
|
197
|
+
{}.tap do |hash|
|
|
198
|
+
value.each do |k, v|
|
|
199
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
200
|
+
end
|
|
201
|
+
end
|
|
202
|
+
else # model
|
|
203
|
+
# models (e.g. Pet) or oneOf
|
|
204
|
+
klass = Freeclimb.const_get(type)
|
|
205
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
206
|
+
end
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
# Returns the string representation of the object
|
|
210
|
+
# @return [String] String presentation of the object
|
|
211
|
+
def to_s
|
|
212
|
+
to_hash.to_s
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
|
217
|
+
def to_body
|
|
218
|
+
to_hash
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Returns the object in the form of hash
|
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
|
223
|
+
def to_hash
|
|
224
|
+
hash = {}
|
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
226
|
+
value = send(attr)
|
|
227
|
+
if value.nil?
|
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
hash[param] = _to_hash(value)
|
|
233
|
+
end
|
|
234
|
+
hash
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# Outputs non-array value in the form of hash
|
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
239
|
+
# @param [Object] value Any valid value
|
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
|
241
|
+
def _to_hash(value)
|
|
242
|
+
if value.is_a?(Array)
|
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
|
244
|
+
elsif value.is_a?(Hash)
|
|
245
|
+
{}.tap do |hash|
|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
247
|
+
end
|
|
248
|
+
elsif value.respond_to? :to_hash
|
|
249
|
+
value.to_hash
|
|
250
|
+
else
|
|
251
|
+
value
|
|
252
|
+
end
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
end
|
|
@@ -51,12 +51,6 @@ module Freeclimb
|
|
|
51
51
|
# Country of this phone number.
|
|
52
52
|
attr_accessor :country
|
|
53
53
|
|
|
54
|
-
# Indicates whether the phone number can handle Calls. Typically set to true for all numbers.
|
|
55
|
-
attr_accessor :voice_enabled
|
|
56
|
-
|
|
57
|
-
# Indication of whether the phone number can handle sending and receiving SMS messages. Typically set to true for all numbers.
|
|
58
|
-
attr_accessor :sms_enabled
|
|
59
|
-
|
|
60
54
|
# The offnet field is a boolean representing whether the number is offnet registered or not. This field will be rendered only for requests to the IncomingPhone number resource.
|
|
61
55
|
attr_accessor :offnet
|
|
62
56
|
|
|
@@ -78,8 +72,6 @@ module Freeclimb
|
|
|
78
72
|
_alias: :alias,
|
|
79
73
|
region: :region,
|
|
80
74
|
country: :country,
|
|
81
|
-
voice_enabled: :voiceEnabled,
|
|
82
|
-
sms_enabled: :smsEnabled,
|
|
83
75
|
offnet: :offnet,
|
|
84
76
|
tfn: :tfn
|
|
85
77
|
}
|
|
@@ -106,8 +98,6 @@ module Freeclimb
|
|
|
106
98
|
_alias: :String,
|
|
107
99
|
region: :String,
|
|
108
100
|
country: :String,
|
|
109
|
-
voice_enabled: :Boolean,
|
|
110
|
-
sms_enabled: :Boolean,
|
|
111
101
|
offnet: :Boolean,
|
|
112
102
|
tfn: :TFN
|
|
113
103
|
}
|
|
@@ -124,8 +114,6 @@ module Freeclimb
|
|
|
124
114
|
:_alias,
|
|
125
115
|
:region,
|
|
126
116
|
:country,
|
|
127
|
-
:voice_enabled,
|
|
128
|
-
:sms_enabled,
|
|
129
117
|
:offnet
|
|
130
118
|
])
|
|
131
119
|
end
|
|
@@ -204,14 +192,6 @@ module Freeclimb
|
|
|
204
192
|
self.country = attributes[:country]
|
|
205
193
|
end
|
|
206
194
|
|
|
207
|
-
if attributes.key?(:voice_enabled)
|
|
208
|
-
self.voice_enabled = attributes[:voice_enabled]
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
if attributes.key?(:sms_enabled)
|
|
212
|
-
self.sms_enabled = attributes[:sms_enabled]
|
|
213
|
-
end
|
|
214
|
-
|
|
215
195
|
if attributes.key?(:offnet)
|
|
216
196
|
self.offnet = attributes[:offnet]
|
|
217
197
|
end
|
|
@@ -255,8 +235,6 @@ module Freeclimb
|
|
|
255
235
|
_alias == other._alias &&
|
|
256
236
|
region == other.region &&
|
|
257
237
|
country == other.country &&
|
|
258
|
-
voice_enabled == other.voice_enabled &&
|
|
259
|
-
sms_enabled == other.sms_enabled &&
|
|
260
238
|
offnet == other.offnet &&
|
|
261
239
|
tfn == other.tfn
|
|
262
240
|
end
|
|
@@ -270,7 +248,7 @@ module Freeclimb
|
|
|
270
248
|
# Calculates hash code according to all attributes.
|
|
271
249
|
# @return [Integer] Hash code
|
|
272
250
|
def hash
|
|
273
|
-
[uri, date_created, date_updated, revision, capabilities, campaign_id, phone_number_id, account_id, application_id, phone_number, _alias, region, country,
|
|
251
|
+
[uri, date_created, date_updated, revision, capabilities, campaign_id, phone_number_id, account_id, application_id, phone_number, _alias, region, country, offnet, tfn].hash
|
|
274
252
|
end
|
|
275
253
|
|
|
276
254
|
# Builds the object from hash
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# #FreeClimb API
|
|
2
|
+
#
|
|
3
|
+
# FreeClimb is a cloud-based application programming interface (API) that puts the power of the Vail platform in your hands. FreeClimb simplifies the process of creating applications that can use a full range of telephony features without requiring specialized or on-site telephony equipment. Using the FreeClimb REST API to write applications is easy! You have the option to use the language of your choice or hit the API directly. Your application can execute a command by issuing a RESTful request to the FreeClimb API. The base URL to send HTTP requests to the FreeClimb REST API is: /apiserver. FreeClimb authenticates and processes your request.
|
|
4
|
+
#
|
|
5
|
+
# The version of the OpenAPI document: 1.0.0
|
|
6
|
+
# Contact: support@freeclimb.com
|
|
7
|
+
# Generated by: https://openapi-generator.tech
|
|
8
|
+
# OpenAPI Generator version: 7.9.0
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require "date"
|
|
12
|
+
require "time"
|
|
13
|
+
|
|
14
|
+
module Freeclimb
|
|
15
|
+
class ModifyBlobRequest
|
|
16
|
+
attr_accessor :blob
|
|
17
|
+
|
|
18
|
+
# Custom identifier for this blob that is unique for the owning account. It will be set to the blobId by default if not provided.
|
|
19
|
+
attr_accessor :_alias
|
|
20
|
+
|
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
|
+
def self.attribute_map
|
|
23
|
+
{
|
|
24
|
+
blob: :blob,
|
|
25
|
+
_alias: :alias
|
|
26
|
+
}
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Returns all the JSON keys this model knows about
|
|
30
|
+
def self.acceptable_attributes
|
|
31
|
+
attribute_map.values
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Attribute type mapping.
|
|
35
|
+
def self.openapi_types
|
|
36
|
+
{
|
|
37
|
+
blob: :Object,
|
|
38
|
+
_alias: :String
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# List of attributes with nullable: true
|
|
43
|
+
def self.openapi_nullable
|
|
44
|
+
Set.new([])
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Initializes the object
|
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
49
|
+
def initialize(attributes = {})
|
|
50
|
+
if !attributes.is_a?(Hash)
|
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ModifyBlobRequest` initialize method"
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
56
|
+
if !self.class.attribute_map.key?(k.to_sym)
|
|
57
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ModifyBlobRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
58
|
+
end
|
|
59
|
+
h[k.to_sym] = v
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if attributes.key?(:blob)
|
|
63
|
+
self.blob = attributes[:blob]
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:_alias)
|
|
67
|
+
self._alias = attributes[:_alias]
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
72
|
+
# @return Array for valid properties with the reasons
|
|
73
|
+
def list_invalid_properties
|
|
74
|
+
invalid_properties = []
|
|
75
|
+
if @blob.nil?
|
|
76
|
+
invalid_properties.push('invalid value for "blob", blob cannot be nil.')
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if !@_alias.nil? && @_alias.to_s.length > 64
|
|
80
|
+
invalid_properties.push('invalid value for "_alias", the character length must be smaller than or equal to 64.')
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
invalid_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Check to see if the all the properties in the model are valid
|
|
87
|
+
# @return true if the model is valid
|
|
88
|
+
def valid?
|
|
89
|
+
if @blob.nil?
|
|
90
|
+
false
|
|
91
|
+
else
|
|
92
|
+
list_invalid_properties.length == 0
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Custom attribute writer method with validation
|
|
97
|
+
# @param [Object] _alias Value to be assigned
|
|
98
|
+
def _alias=(_alias)
|
|
99
|
+
if !_alias.nil? && _alias.to_s.length > 64
|
|
100
|
+
fail ArgumentError, 'invalid value for "_alias", the character length must be smaller than or equal to 64.'
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
@_alias = _alias
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Checks equality by comparing each attribute.
|
|
107
|
+
# @param [Object] Object to be compared
|
|
108
|
+
def ==(other)
|
|
109
|
+
return true if equal?(other)
|
|
110
|
+
self.class == other.class &&
|
|
111
|
+
blob == other.blob &&
|
|
112
|
+
_alias == other._alias
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# @see the `==` method
|
|
116
|
+
# @param [Object] Object to be compared
|
|
117
|
+
def eql?(other)
|
|
118
|
+
self == other
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Calculates hash code according to all attributes.
|
|
122
|
+
# @return [Integer] Hash code
|
|
123
|
+
def hash
|
|
124
|
+
[blob, _alias].hash
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Builds the object from hash
|
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
129
|
+
# @return [Object] Returns the model itself
|
|
130
|
+
def self.build_from_hash(attributes)
|
|
131
|
+
new.build_from_hash(attributes)
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Builds the object from hash
|
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
136
|
+
# @return [Object] Returns the model itself
|
|
137
|
+
def build_from_hash(attributes)
|
|
138
|
+
return nil unless attributes.is_a?(Hash)
|
|
139
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
140
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
141
|
+
send(:"#{key}=", nil)
|
|
142
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
143
|
+
# check to ensure the input is an array given that the attribute
|
|
144
|
+
# is documented as an array but the input is not
|
|
145
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
146
|
+
send(:"#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
147
|
+
end
|
|
148
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
149
|
+
send(:"#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
self
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
# Deserializes the data based on type
|
|
157
|
+
# @param string type Data type
|
|
158
|
+
# @param string value Value to be deserialized
|
|
159
|
+
# @return [Object] Deserialized data
|
|
160
|
+
def _deserialize(type, value)
|
|
161
|
+
case type.to_sym
|
|
162
|
+
when :Time
|
|
163
|
+
Time.parse(value)
|
|
164
|
+
when :Date
|
|
165
|
+
Date.parse(value)
|
|
166
|
+
when :String
|
|
167
|
+
value.to_s
|
|
168
|
+
when :Integer
|
|
169
|
+
value.to_i
|
|
170
|
+
when :Float
|
|
171
|
+
value.to_f
|
|
172
|
+
when :Boolean
|
|
173
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
174
|
+
true
|
|
175
|
+
else
|
|
176
|
+
false
|
|
177
|
+
end
|
|
178
|
+
when :Object
|
|
179
|
+
# generic object (usually a Hash), return directly
|
|
180
|
+
value
|
|
181
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
182
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
183
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
184
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
185
|
+
k_type = Regexp.last_match[:k_type]
|
|
186
|
+
v_type = Regexp.last_match[:v_type]
|
|
187
|
+
{}.tap do |hash|
|
|
188
|
+
value.each do |k, v|
|
|
189
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
190
|
+
end
|
|
191
|
+
end
|
|
192
|
+
else # model
|
|
193
|
+
# models (e.g. Pet) or oneOf
|
|
194
|
+
klass = Freeclimb.const_get(type)
|
|
195
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Returns the string representation of the object
|
|
200
|
+
# @return [String] String presentation of the object
|
|
201
|
+
def to_s
|
|
202
|
+
to_hash.to_s
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
|
207
|
+
def to_body
|
|
208
|
+
to_hash
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Returns the object in the form of hash
|
|
212
|
+
# @return [Hash] Returns the object in the form of hash
|
|
213
|
+
def to_hash
|
|
214
|
+
hash = {}
|
|
215
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
216
|
+
value = send(attr)
|
|
217
|
+
if value.nil?
|
|
218
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
219
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
hash[param] = _to_hash(value)
|
|
223
|
+
end
|
|
224
|
+
hash
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Outputs non-array value in the form of hash
|
|
228
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
229
|
+
# @param [Object] value Any valid value
|
|
230
|
+
# @return [Hash] Returns the value in the form of hash
|
|
231
|
+
def _to_hash(value)
|
|
232
|
+
if value.is_a?(Array)
|
|
233
|
+
value.compact.map { |v| _to_hash(v) }
|
|
234
|
+
elsif value.is_a?(Hash)
|
|
235
|
+
{}.tap do |hash|
|
|
236
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
237
|
+
end
|
|
238
|
+
elsif value.respond_to? :to_hash
|
|
239
|
+
value.to_hash
|
|
240
|
+
else
|
|
241
|
+
value
|
|
242
|
+
end
|
|
243
|
+
end
|
|
244
|
+
end
|
|
245
|
+
end
|