freeclimb 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +82 -0
- data/README.md +238 -0
- data/Rakefile +10 -0
- data/docs/AccountRequest.md +21 -0
- data/docs/AccountResult.md +37 -0
- data/docs/AccountResultAllOf.md +29 -0
- data/docs/ApplicationList.md +31 -0
- data/docs/ApplicationListAllOf.md +17 -0
- data/docs/ApplicationRequest.md +31 -0
- data/docs/ApplicationResult.md +41 -0
- data/docs/ApplicationResultAllOf.md +33 -0
- data/docs/AvailableNumber.md +27 -0
- data/docs/AvailableNumberList.md +31 -0
- data/docs/AvailableNumberListAllOf.md +17 -0
- data/docs/BuyIncomingNumberRequest.md +23 -0
- data/docs/CallList.md +31 -0
- data/docs/CallListAllOf.md +17 -0
- data/docs/CallResult.md +53 -0
- data/docs/CallResultAllOf.md +45 -0
- data/docs/ConferenceList.md +31 -0
- data/docs/ConferenceListAllOf.md +17 -0
- data/docs/ConferenceParticipantList.md +31 -0
- data/docs/ConferenceParticipantListAllOf.md +17 -0
- data/docs/ConferenceParticipantResult.md +35 -0
- data/docs/ConferenceParticipantResultAllOf.md +27 -0
- data/docs/ConferenceResult.md +43 -0
- data/docs/ConferenceResultAllOf.md +35 -0
- data/docs/CreateConferenceRequest.md +27 -0
- data/docs/DefaultApi.md +2504 -0
- data/docs/DequeueMemberRequest.md +17 -0
- data/docs/FilterLogsRequest.md +19 -0
- data/docs/IncomingNumberList.md +31 -0
- data/docs/IncomingNumberListAllOf.md +17 -0
- data/docs/IncomingNumberRequest.md +21 -0
- data/docs/IncomingNumberResult.md +41 -0
- data/docs/IncomingNumberResultAllOf.md +33 -0
- data/docs/LogList.md +31 -0
- data/docs/LogListAllOf.md +17 -0
- data/docs/LogResult.md +29 -0
- data/docs/MakeCallRequest.md +33 -0
- data/docs/MessageRequest.md +35 -0
- data/docs/MessageRequestAllOf.md +27 -0
- data/docs/MessageResult.md +39 -0
- data/docs/MessageResultAllOf.md +31 -0
- data/docs/MessagesList.md +31 -0
- data/docs/MessagesListAllOf.md +17 -0
- data/docs/MutableResourceModel.md +23 -0
- data/docs/PaginationModel.md +29 -0
- data/docs/Percl.md +697 -0
- data/docs/QueueList.md +31 -0
- data/docs/QueueListAllOf.md +17 -0
- data/docs/QueueMember.md +25 -0
- data/docs/QueueMemberList.md +31 -0
- data/docs/QueueMemberListAllOf.md +17 -0
- data/docs/QueueRequest.md +21 -0
- data/docs/QueueResult.md +37 -0
- data/docs/QueueResultAllOf.md +29 -0
- data/docs/RecordingList.md +31 -0
- data/docs/RecordingListAllOf.md +17 -0
- data/docs/RecordingResult.md +33 -0
- data/docs/RecordingResultAllOf.md +25 -0
- data/docs/UpdateCallRequest.md +19 -0
- data/docs/UpdateConferenceParticipantRequest.md +21 -0
- data/docs/UpdateConferenceRequest.md +23 -0
- data/freeclimb.gemspec +39 -0
- data/git_push.sh +58 -0
- data/lib/freeclimb.rb +99 -0
- data/lib/freeclimb/api/default_api.rb +2845 -0
- data/lib/freeclimb/api_client.rb +386 -0
- data/lib/freeclimb/api_error.rb +57 -0
- data/lib/freeclimb/configuration.rb +248 -0
- data/lib/freeclimb/models/account_request.rb +227 -0
- data/lib/freeclimb/models/account_result.rb +349 -0
- data/lib/freeclimb/models/account_result_all_of.rb +301 -0
- data/lib/freeclimb/models/application_list.rb +286 -0
- data/lib/freeclimb/models/application_list_all_of.rb +208 -0
- data/lib/freeclimb/models/application_request.rb +277 -0
- data/lib/freeclimb/models/application_result.rb +335 -0
- data/lib/freeclimb/models/application_result_all_of.rb +287 -0
- data/lib/freeclimb/models/available_number.rb +257 -0
- data/lib/freeclimb/models/available_number_list.rb +286 -0
- data/lib/freeclimb/models/available_number_list_all_of.rb +208 -0
- data/lib/freeclimb/models/buy_incoming_number_request.rb +242 -0
- data/lib/freeclimb/models/call_list.rb +286 -0
- data/lib/freeclimb/models/call_list_all_of.rb +208 -0
- data/lib/freeclimb/models/call_result.rb +429 -0
- data/lib/freeclimb/models/call_result_all_of.rb +381 -0
- data/lib/freeclimb/models/conference_list.rb +286 -0
- data/lib/freeclimb/models/conference_list_all_of.rb +208 -0
- data/lib/freeclimb/models/conference_participant_list.rb +286 -0
- data/lib/freeclimb/models/conference_participant_list_all_of.rb +208 -0
- data/lib/freeclimb/models/conference_participant_result.rb +305 -0
- data/lib/freeclimb/models/conference_participant_result_all_of.rb +257 -0
- data/lib/freeclimb/models/conference_result.rb +391 -0
- data/lib/freeclimb/models/conference_result_all_of.rb +343 -0
- data/lib/freeclimb/models/create_conference_request.rb +293 -0
- data/lib/freeclimb/models/dequeue_member_request.rb +207 -0
- data/lib/freeclimb/models/filter_logs_request.rb +222 -0
- data/lib/freeclimb/models/incoming_number_list.rb +286 -0
- data/lib/freeclimb/models/incoming_number_list_all_of.rb +208 -0
- data/lib/freeclimb/models/incoming_number_request.rb +227 -0
- data/lib/freeclimb/models/incoming_number_result.rb +335 -0
- data/lib/freeclimb/models/incoming_number_result_all_of.rb +287 -0
- data/lib/freeclimb/models/log_list.rb +286 -0
- data/lib/freeclimb/models/log_list_all_of.rb +208 -0
- data/lib/freeclimb/models/log_result.rb +301 -0
- data/lib/freeclimb/models/make_call_request.rb +302 -0
- data/lib/freeclimb/models/message_request.rb +320 -0
- data/lib/freeclimb/models/message_request_all_of.rb +272 -0
- data/lib/freeclimb/models/message_result.rb +359 -0
- data/lib/freeclimb/models/message_result_all_of.rb +311 -0
- data/lib/freeclimb/models/messages_list.rb +287 -0
- data/lib/freeclimb/models/messages_list_all_of.rb +209 -0
- data/lib/freeclimb/models/mutable_resource_model.rb +237 -0
- data/lib/freeclimb/models/pagination_model.rb +267 -0
- data/lib/freeclimb/models/queue_list.rb +286 -0
- data/lib/freeclimb/models/queue_list_all_of.rb +208 -0
- data/lib/freeclimb/models/queue_member.rb +247 -0
- data/lib/freeclimb/models/queue_member_list.rb +286 -0
- data/lib/freeclimb/models/queue_member_list_all_of.rb +208 -0
- data/lib/freeclimb/models/queue_request.rb +227 -0
- data/lib/freeclimb/models/queue_result.rb +315 -0
- data/lib/freeclimb/models/queue_result_all_of.rb +267 -0
- data/lib/freeclimb/models/recording_list.rb +286 -0
- data/lib/freeclimb/models/recording_list_all_of.rb +208 -0
- data/lib/freeclimb/models/recording_result.rb +295 -0
- data/lib/freeclimb/models/recording_result_all_of.rb +247 -0
- data/lib/freeclimb/models/update_call_request.rb +256 -0
- data/lib/freeclimb/models/update_conference_participant_request.rb +227 -0
- data/lib/freeclimb/models/update_conference_request.rb +273 -0
- data/lib/freeclimb/version.rb +15 -0
- data/lib/percl/calls.rb +43 -0
- data/lib/percl/conference_participants.rb +40 -0
- data/lib/percl/conferences.rb +21 -0
- data/lib/percl/ivr.rb +63 -0
- data/lib/percl/jsonable.rb +23 -0
- data/lib/percl/percl.rb +29 -0
- data/lib/percl/queue_members.rb +15 -0
- data/lib/percl/recordings.rb +15 -0
- data/lib/percl/sms.rb +11 -0
- data/spec/api/default_api_spec.rb +1151 -0
- data/spec/api/web_mocks.rb +473 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +34 -0
- data/spec/models/account_request_spec.rb +33 -0
- data/spec/models/account_result_spec.rb +33 -0
- data/spec/models/application_list_spec.rb +33 -0
- data/spec/models/application_request_spec.rb +33 -0
- data/spec/models/application_result_spec.rb +33 -0
- data/spec/models/available_number_list_spec.rb +34 -0
- data/spec/models/available_number_spec.rb +33 -0
- data/spec/models/buy_incoming_number_request_spec.rb +33 -0
- data/spec/models/call_list_spec.rb +34 -0
- data/spec/models/call_result_spec.rb +34 -0
- data/spec/models/conference_list_spec.rb +33 -0
- data/spec/models/conference_participant_list_spec.rb +33 -0
- data/spec/models/conference_participant_result_spec.rb +33 -0
- data/spec/models/conference_result_spec.rb +34 -0
- data/spec/models/create_conference_request_spec.rb +34 -0
- data/spec/models/dequeue_member_request_spec.rb +34 -0
- data/spec/models/filter_logs_request_spec.rb +33 -0
- data/spec/models/incoming_number_list_spec.rb +34 -0
- data/spec/models/incoming_number_request_spec.rb +33 -0
- data/spec/models/incoming_number_result_spec.rb +34 -0
- data/spec/models/log_list_spec.rb +33 -0
- data/spec/models/log_result_spec.rb +33 -0
- data/spec/models/make_call_request_spec.rb +33 -0
- data/spec/models/message_request_spec.rb +34 -0
- data/spec/models/message_result_spec.rb +33 -0
- data/spec/models/messages_list_spec.rb +33 -0
- data/spec/models/mutable_resource_model_spec.rb +34 -0
- data/spec/models/pagination_model_spec.rb +33 -0
- data/spec/models/queue_list_spec.rb +34 -0
- data/spec/models/queue_member_list_spec.rb +33 -0
- data/spec/models/queue_member_spec.rb +34 -0
- data/spec/models/queue_request_spec.rb +34 -0
- data/spec/models/queue_result_spec.rb +33 -0
- data/spec/models/recording_list_spec.rb +33 -0
- data/spec/models/recording_result_spec.rb +33 -0
- data/spec/models/update_call_request_spec.rb +33 -0
- data/spec/models/update_conference_participant_request_spec.rb +33 -0
- data/spec/models/update_conference_request_spec.rb +33 -0
- data/spec/percl/calls_spec.rb +111 -0
- data/spec/percl/conference_participant_spec.rb +96 -0
- data/spec/percl/conference_spec.rb +46 -0
- data/spec/percl/ivr_spec.rb +155 -0
- data/spec/percl/jsonable_spec.rb +28 -0
- data/spec/percl/percl_spec.rb +31 -0
- data/spec/percl/queue_members_spec.rb +35 -0
- data/spec/percl/recordings_spec.rb +32 -0
- data/spec/percl/sms_spec.rb +29 -0
- data/spec/spec_helper.rb +114 -0
- metadata +355 -0
@@ -0,0 +1,208 @@
|
|
1
|
+
=begin
|
2
|
+
#FreeClimb API
|
3
|
+
|
4
|
+
#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.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Freeclimb
|
16
|
+
class ApplicationListAllOf
|
17
|
+
attr_accessor :applications
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'applications' => :'applications'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.openapi_types
|
28
|
+
{
|
29
|
+
:'applications' => :'Array<ApplicationResult>'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# List of attributes with nullable: true
|
34
|
+
def self.openapi_nullable
|
35
|
+
Set.new([
|
36
|
+
])
|
37
|
+
end
|
38
|
+
|
39
|
+
# Initializes the object
|
40
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
41
|
+
def initialize(attributes = {})
|
42
|
+
if (!attributes.is_a?(Hash))
|
43
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ApplicationListAllOf` initialize method"
|
44
|
+
end
|
45
|
+
|
46
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
48
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
49
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ApplicationListAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
50
|
+
end
|
51
|
+
h[k.to_sym] = v
|
52
|
+
}
|
53
|
+
|
54
|
+
if attributes.key?(:'applications')
|
55
|
+
if (value = attributes[:'applications']).is_a?(Array)
|
56
|
+
self.applications = value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
62
|
+
# @return Array for valid properties with the reasons
|
63
|
+
def list_invalid_properties
|
64
|
+
invalid_properties = Array.new
|
65
|
+
invalid_properties
|
66
|
+
end
|
67
|
+
|
68
|
+
# Check to see if the all the properties in the model are valid
|
69
|
+
# @return true if the model is valid
|
70
|
+
def valid?
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
applications == o.applications
|
80
|
+
end
|
81
|
+
|
82
|
+
# @see the `==` method
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def eql?(o)
|
85
|
+
self == o
|
86
|
+
end
|
87
|
+
|
88
|
+
# Calculates hash code according to all attributes.
|
89
|
+
# @return [Integer] Hash code
|
90
|
+
def hash
|
91
|
+
[applications].hash
|
92
|
+
end
|
93
|
+
|
94
|
+
# Builds the object from hash
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
# @return [Object] Returns the model itself
|
97
|
+
def self.build_from_hash(attributes)
|
98
|
+
new.build_from_hash(attributes)
|
99
|
+
end
|
100
|
+
|
101
|
+
# Builds the object from hash
|
102
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
103
|
+
# @return [Object] Returns the model itself
|
104
|
+
def build_from_hash(attributes)
|
105
|
+
return nil unless attributes.is_a?(Hash)
|
106
|
+
self.class.openapi_types.each_pair do |key, type|
|
107
|
+
if type =~ /\AArray<(.*)>/i
|
108
|
+
# check to ensure the input is an array given that the attribute
|
109
|
+
# is documented as an array but the input is not
|
110
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
111
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
112
|
+
end
|
113
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
114
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
115
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
116
|
+
end
|
117
|
+
|
118
|
+
self
|
119
|
+
end
|
120
|
+
|
121
|
+
# Deserializes the data based on type
|
122
|
+
# @param string type Data type
|
123
|
+
# @param string value Value to be deserialized
|
124
|
+
# @return [Object] Deserialized data
|
125
|
+
def _deserialize(type, value)
|
126
|
+
case type.to_sym
|
127
|
+
when :DateTime
|
128
|
+
DateTime.parse(value)
|
129
|
+
when :Date
|
130
|
+
Date.parse(value)
|
131
|
+
when :String
|
132
|
+
value.to_s
|
133
|
+
when :Integer
|
134
|
+
value.to_i
|
135
|
+
when :Float
|
136
|
+
value.to_f
|
137
|
+
when :Boolean
|
138
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
139
|
+
true
|
140
|
+
else
|
141
|
+
false
|
142
|
+
end
|
143
|
+
when :Object
|
144
|
+
# generic object (usually a Hash), return directly
|
145
|
+
value
|
146
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
147
|
+
inner_type = Regexp.last_match[:inner_type]
|
148
|
+
value.map { |v| _deserialize(inner_type, v) }
|
149
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
150
|
+
k_type = Regexp.last_match[:k_type]
|
151
|
+
v_type = Regexp.last_match[:v_type]
|
152
|
+
{}.tap do |hash|
|
153
|
+
value.each do |k, v|
|
154
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
else # model
|
158
|
+
Freeclimb.const_get(type).build_from_hash(value)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
# Returns the string representation of the object
|
163
|
+
# @return [String] String presentation of the object
|
164
|
+
def to_s
|
165
|
+
to_hash.to_s
|
166
|
+
end
|
167
|
+
|
168
|
+
# to_body is an alias to to_hash (backward compatibility)
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
170
|
+
def to_body
|
171
|
+
to_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
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map { |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
@@ -0,0 +1,277 @@
|
|
1
|
+
=begin
|
2
|
+
#FreeClimb API
|
3
|
+
|
4
|
+
#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.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Freeclimb
|
16
|
+
class ApplicationRequest
|
17
|
+
# A human readable description of the application, with maximum length 64 characters.
|
18
|
+
attr_accessor :_alias
|
19
|
+
|
20
|
+
# The URL that FreeClimb will request when an inbound call arrives on a phone number assigned to this application. Used only for inbound calls.
|
21
|
+
attr_accessor :voice_url
|
22
|
+
|
23
|
+
# The URL that FreeClimb will request if it times out waiting for a response from the voiceUrl. Used for inbound calls only. Note: A PerCL response is expected to control the inbound call.
|
24
|
+
attr_accessor :voice_fallback_url
|
25
|
+
|
26
|
+
# The URL that FreeClimb will request when an outbound call request is complete. Used for outbound calls only. Note: A PerCL response is expected if the outbound call is connected (status=InProgress) to control the call.
|
27
|
+
attr_accessor :call_connect_url
|
28
|
+
|
29
|
+
# The URL that FreeClimb will request to pass call status (such as call ended) to the application. Note: This is a notification only; any PerCL returned will be ignored.
|
30
|
+
attr_accessor :status_callback_url
|
31
|
+
|
32
|
+
# The URL that FreeClimb will request when a phone number assigned to this application receives an incoming SMS message. Used for inbound SMS only. Note: Any PerCL returned will be ignored.
|
33
|
+
attr_accessor :sms_url
|
34
|
+
|
35
|
+
# The URL that FreeClimb will request if it times out waiting for a response from the smsUrl. Used for inbound SMS only. Note: Any PerCL returned will be ignored.
|
36
|
+
attr_accessor :sms_fallback_url
|
37
|
+
|
38
|
+
# The requestId for this request starting with prefix \"RQ\" followed by 40 hexadecimal characters. FreeClimb logs generated while processing this request will include this requestId. If it is not provided, FreeClimb will generate a requestId and return it as a header in the response, e.g. X-Pulse-Request-Id: <requestId>
|
39
|
+
attr_accessor :request_id
|
40
|
+
|
41
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
42
|
+
def self.attribute_map
|
43
|
+
{
|
44
|
+
:'_alias' => :'alias',
|
45
|
+
:'voice_url' => :'voiceUrl',
|
46
|
+
:'voice_fallback_url' => :'voiceFallbackUrl',
|
47
|
+
:'call_connect_url' => :'callConnectUrl',
|
48
|
+
:'status_callback_url' => :'statusCallbackUrl',
|
49
|
+
:'sms_url' => :'smsUrl',
|
50
|
+
:'sms_fallback_url' => :'smsFallbackUrl',
|
51
|
+
:'request_id' => :'requestId'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Attribute type mapping.
|
56
|
+
def self.openapi_types
|
57
|
+
{
|
58
|
+
:'_alias' => :'String',
|
59
|
+
:'voice_url' => :'String',
|
60
|
+
:'voice_fallback_url' => :'String',
|
61
|
+
:'call_connect_url' => :'String',
|
62
|
+
:'status_callback_url' => :'String',
|
63
|
+
:'sms_url' => :'String',
|
64
|
+
:'sms_fallback_url' => :'String',
|
65
|
+
:'request_id' => :'String'
|
66
|
+
}
|
67
|
+
end
|
68
|
+
|
69
|
+
# List of attributes with nullable: true
|
70
|
+
def self.openapi_nullable
|
71
|
+
Set.new([
|
72
|
+
])
|
73
|
+
end
|
74
|
+
|
75
|
+
# Initializes the object
|
76
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
77
|
+
def initialize(attributes = {})
|
78
|
+
if (!attributes.is_a?(Hash))
|
79
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::ApplicationRequest` initialize method"
|
80
|
+
end
|
81
|
+
|
82
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
83
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
84
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
85
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::ApplicationRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
86
|
+
end
|
87
|
+
h[k.to_sym] = v
|
88
|
+
}
|
89
|
+
|
90
|
+
if attributes.key?(:'_alias')
|
91
|
+
self._alias = attributes[:'_alias']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'voice_url')
|
95
|
+
self.voice_url = attributes[:'voice_url']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.key?(:'voice_fallback_url')
|
99
|
+
self.voice_fallback_url = attributes[:'voice_fallback_url']
|
100
|
+
end
|
101
|
+
|
102
|
+
if attributes.key?(:'call_connect_url')
|
103
|
+
self.call_connect_url = attributes[:'call_connect_url']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'status_callback_url')
|
107
|
+
self.status_callback_url = attributes[:'status_callback_url']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'sms_url')
|
111
|
+
self.sms_url = attributes[:'sms_url']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'sms_fallback_url')
|
115
|
+
self.sms_fallback_url = attributes[:'sms_fallback_url']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'request_id')
|
119
|
+
self.request_id = attributes[:'request_id']
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
124
|
+
# @return Array for valid properties with the reasons
|
125
|
+
def list_invalid_properties
|
126
|
+
invalid_properties = Array.new
|
127
|
+
invalid_properties
|
128
|
+
end
|
129
|
+
|
130
|
+
# Check to see if the all the properties in the model are valid
|
131
|
+
# @return true if the model is valid
|
132
|
+
def valid?
|
133
|
+
true
|
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
|
+
_alias == o._alias &&
|
142
|
+
voice_url == o.voice_url &&
|
143
|
+
voice_fallback_url == o.voice_fallback_url &&
|
144
|
+
call_connect_url == o.call_connect_url &&
|
145
|
+
status_callback_url == o.status_callback_url &&
|
146
|
+
sms_url == o.sms_url &&
|
147
|
+
sms_fallback_url == o.sms_fallback_url &&
|
148
|
+
request_id == o.request_id
|
149
|
+
end
|
150
|
+
|
151
|
+
# @see the `==` method
|
152
|
+
# @param [Object] Object to be compared
|
153
|
+
def eql?(o)
|
154
|
+
self == o
|
155
|
+
end
|
156
|
+
|
157
|
+
# Calculates hash code according to all attributes.
|
158
|
+
# @return [Integer] Hash code
|
159
|
+
def hash
|
160
|
+
[_alias, voice_url, voice_fallback_url, call_connect_url, status_callback_url, sms_url, sms_fallback_url, request_id].hash
|
161
|
+
end
|
162
|
+
|
163
|
+
# Builds the object from hash
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
+
# @return [Object] Returns the model itself
|
166
|
+
def self.build_from_hash(attributes)
|
167
|
+
new.build_from_hash(attributes)
|
168
|
+
end
|
169
|
+
|
170
|
+
# Builds the object from hash
|
171
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
172
|
+
# @return [Object] Returns the model itself
|
173
|
+
def build_from_hash(attributes)
|
174
|
+
return nil unless attributes.is_a?(Hash)
|
175
|
+
self.class.openapi_types.each_pair do |key, type|
|
176
|
+
if type =~ /\AArray<(.*)>/i
|
177
|
+
# check to ensure the input is an array given that the attribute
|
178
|
+
# is documented as an array but the input is not
|
179
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
180
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
181
|
+
end
|
182
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
183
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
184
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
185
|
+
end
|
186
|
+
|
187
|
+
self
|
188
|
+
end
|
189
|
+
|
190
|
+
# Deserializes the data based on type
|
191
|
+
# @param string type Data type
|
192
|
+
# @param string value Value to be deserialized
|
193
|
+
# @return [Object] Deserialized data
|
194
|
+
def _deserialize(type, value)
|
195
|
+
case type.to_sym
|
196
|
+
when :DateTime
|
197
|
+
DateTime.parse(value)
|
198
|
+
when :Date
|
199
|
+
Date.parse(value)
|
200
|
+
when :String
|
201
|
+
value.to_s
|
202
|
+
when :Integer
|
203
|
+
value.to_i
|
204
|
+
when :Float
|
205
|
+
value.to_f
|
206
|
+
when :Boolean
|
207
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
208
|
+
true
|
209
|
+
else
|
210
|
+
false
|
211
|
+
end
|
212
|
+
when :Object
|
213
|
+
# generic object (usually a Hash), return directly
|
214
|
+
value
|
215
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
216
|
+
inner_type = Regexp.last_match[:inner_type]
|
217
|
+
value.map { |v| _deserialize(inner_type, v) }
|
218
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
219
|
+
k_type = Regexp.last_match[:k_type]
|
220
|
+
v_type = Regexp.last_match[:v_type]
|
221
|
+
{}.tap do |hash|
|
222
|
+
value.each do |k, v|
|
223
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
else # model
|
227
|
+
Freeclimb.const_get(type).build_from_hash(value)
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
# Returns the string representation of the object
|
232
|
+
# @return [String] String presentation of the object
|
233
|
+
def to_s
|
234
|
+
to_hash.to_s
|
235
|
+
end
|
236
|
+
|
237
|
+
# to_body is an alias to to_hash (backward compatibility)
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_body
|
240
|
+
to_hash
|
241
|
+
end
|
242
|
+
|
243
|
+
# Returns the object in the form of hash
|
244
|
+
# @return [Hash] Returns the object in the form of hash
|
245
|
+
def to_hash
|
246
|
+
hash = {}
|
247
|
+
self.class.attribute_map.each_pair do |attr, param|
|
248
|
+
value = self.send(attr)
|
249
|
+
if value.nil?
|
250
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
251
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
252
|
+
end
|
253
|
+
|
254
|
+
hash[param] = _to_hash(value)
|
255
|
+
end
|
256
|
+
hash
|
257
|
+
end
|
258
|
+
|
259
|
+
# Outputs non-array value in the form of hash
|
260
|
+
# For object, use to_hash. Otherwise, just return the value
|
261
|
+
# @param [Object] value Any valid value
|
262
|
+
# @return [Hash] Returns the value in the form of hash
|
263
|
+
def _to_hash(value)
|
264
|
+
if value.is_a?(Array)
|
265
|
+
value.compact.map { |v| _to_hash(v) }
|
266
|
+
elsif value.is_a?(Hash)
|
267
|
+
{}.tap do |hash|
|
268
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
269
|
+
end
|
270
|
+
elsif value.respond_to? :to_hash
|
271
|
+
value.to_hash
|
272
|
+
else
|
273
|
+
value
|
274
|
+
end
|
275
|
+
end
|
276
|
+
end
|
277
|
+
end
|