freeclimb 2.0.3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +9 -5
- data/docs/AccountResult.md +2 -2
- data/docs/AccountResultAllOf.md +2 -2
- data/docs/DefaultApi.md +46 -46
- data/docs/Hangup.md +17 -0
- data/docs/HangupAllOf.md +17 -0
- data/docs/MakeCallRequest.md +5 -3
- data/docs/RecordUtterance.md +3 -1
- data/docs/RecordUtteranceAllOf.md +3 -1
- data/docs/Redirect.md +1 -1
- data/docs/RedirectAllOf.md +1 -1
- data/docs/Reject.md +17 -0
- data/docs/RejectAllOf.md +17 -0
- data/freeclimb-2.0.3.gem +0 -0
- data/freeclimb-2.1.0.gem +0 -0
- data/freeclimb-2.1.1.gem +0 -0
- data/freeclimb-2.1.2.gem +0 -0
- data/freeclimb-2.2.0.gem +0 -0
- data/lib/freeclimb.rb +5 -0
- data/lib/freeclimb/api_client.rb +1 -1
- data/lib/freeclimb/models/account_result.rb +8 -8
- data/lib/freeclimb/models/account_result_all_of.rb +8 -8
- data/lib/freeclimb/models/hangup.rb +220 -0
- data/lib/freeclimb/models/hangup_all_of.rb +207 -0
- data/lib/freeclimb/models/make_call_request.rb +16 -11
- data/lib/freeclimb/models/record_utterance.rb +14 -4
- data/lib/freeclimb/models/record_utterance_all_of.rb +14 -4
- data/lib/freeclimb/models/redirect.rb +7 -2
- data/lib/freeclimb/models/redirect_all_of.rb +6 -1
- data/lib/freeclimb/models/reject.rb +220 -0
- data/lib/freeclimb/models/reject_all_of.rb +207 -0
- data/lib/freeclimb/utils.rb +34 -0
- data/lib/freeclimb/version.rb +1 -1
- data/spec/api/web_mocks.rb +1 -1
- data/spec/models/hangup_spec.rb +41 -0
- data/spec/models/reject_spec.rb +41 -0
- metadata +19 -2
data/docs/Hangup.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Freeclimb::Hangup
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**reason** | **String** | The user defined reason for the hangup. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the Call flows for the given application. | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'freeclimb'
|
13
|
+
|
14
|
+
instance = Freeclimb::Hangup.new(reason: nil)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
data/docs/HangupAllOf.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Freeclimb::HangupAllOf
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**reason** | **String** | The user defined reason for the hangup. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the Call flows for the given application. | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'freeclimb'
|
13
|
+
|
14
|
+
instance = Freeclimb::HangupAllOf.new(reason: nil)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
data/docs/MakeCallRequest.md
CHANGED
@@ -6,13 +6,14 @@ Name | Type | Description | Notes
|
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
7
|
**from** | **String** | Phone number to use as the caller ID. This can be: (a) The To or From number provided in FreeClimb's initial request to your app or (b) Any incoming phone number you have purchased from FreeClimb. |
|
8
8
|
**to** | **String** | Phone number to place the Call to. |
|
9
|
-
**application_id** | **String** | ID of the application FreeClimb should use to handle this phone call. FreeClimb will use the `callConnectUrl` and `statusCallbackUrl` set on the application.
|
9
|
+
**application_id** | **String** | Required if no `parentCallId` or `callConnectUrl` has been provided. ID of the application FreeClimb should use to handle this phone call. FreeClimb will use the `callConnectUrl` and `statusCallbackUrl` set on the application unless the `callConnectUrl` attribute is also provided with the request. In this case, the URL specified in that `callConnectUrl` attribute will be used as a replacement of the `callConnectUrl` originally assigned in the application. If the `callConnectUrl` is not set as either an attribute of the request or as part of the specified application, an error will be provided. The application’s voiceUrl parameter is not used for outbound calls. | [optional]
|
10
10
|
**send_digits** | **String** | String of digits to dial after connecting to the number. It can include digits `0-9`, `*`, and `#`, and allows embedding a pause between the output of individual digits. The default pause is 500 milliseconds. So, a string such as *1234#* will be played in 2 seconds because of the 4 standard pauses implied within the string. A custom pause is specified by including a positive integer wrapped in curly braces: {n}. For more information, see **sendDigits examples** below. | [optional]
|
11
11
|
**if_machine** | **String** | Specifies how FreeClimb should handle this Call if an answering machine answers it. | [optional]
|
12
12
|
**if_machine_url** | **String** | This attribute specifies a URL to which FreeClimb will make a POST request when an answering machine or a fax machine is detected. This URL is required if the ifMachine flag is set to redirect. When ifMachine is set to hangup, ifMachineUrl must not be included in the request. For more information, see **ifMachineUrl example** below. | [optional]
|
13
13
|
**timeout** | **Integer** | Number of seconds that FreeClimb should allow the phone to ring before assuming there is no answer. Default is 30 seconds. Maximum allowed ring-time is determined by the target phone's provider. Note that most providers limit ring-time to 120 seconds. | [optional]
|
14
|
-
**parent_call_id** | **String** | The ID of the parent Call in the case that this new Call is meant to be treated as a child of an existing Call. This attribute should be included when possible to reduce latency when adding child calls to Conferences containing the parent Call. A call can only be used as a parent once the call is in progress or as an inbound call that is still ringing.
|
14
|
+
**parent_call_id** | **String** | Required if no `applicationId` or `callConnectUrl` has been provided. The ID of the parent Call in the case that this new Call is meant to be treated as a child of an existing Call. This attribute should be included when possible to reduce latency when adding child calls to Conferences containing the parent Call. A call can only be used as a parent once the call is in progress or as an inbound call that is still ringing. An outbound call is considered to be in progress once the `outdialConnect` or `outdialApiConnect` webhook is invoked. An inbound call is ringing when the inbound webhook is invoked. If a `callConnectUrl` attribute is also included with the `parentCallId` in the request, this URL will be used as a replacement of the `callConnectUrl` originally assigned in the parent call. | [optional]
|
15
15
|
**privacy_mode** | **Boolean** | Activate privacy mode in order to obscure log data that can potentially expose private information. | [optional]
|
16
|
+
**call_connect_url** | **String** | The URL that FreeClimb should use to handle this phone call. If an applicationId or parentCallId have already been provided, this callConnectUrl attribute will be used as a replacement of the callConnectUrl originally assigned in the application or parent call. | [optional]
|
16
17
|
|
17
18
|
## Code Sample
|
18
19
|
|
@@ -27,7 +28,8 @@ instance = Freeclimb::MakeCallRequest.new(from: nil,
|
|
27
28
|
if_machine_url: nil,
|
28
29
|
timeout: nil,
|
29
30
|
parent_call_id: nil,
|
30
|
-
privacy_mode: nil
|
31
|
+
privacy_mode: nil,
|
32
|
+
call_connect_url: nil)
|
31
33
|
```
|
32
34
|
|
33
35
|
|
data/docs/RecordUtterance.md
CHANGED
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
|
10
10
|
**max_length_sec** | **Integer** | Maximum length for the command execution in seconds. | [optional]
|
11
11
|
**play_beep** | **Boolean** | Indicates whether to play a beep sound before the start of the recording. If set to `false`, no beep is played. | [optional]
|
12
12
|
**auto_start** | **Boolean** | If `false`, recording begins immediately after the RecordUtterance command is processed. If `true`, recording begins when audio is present and if audio begins before the `maxLengthSec` timeout. If no audio begins before `maxLengthSec`, no recording is generated. | [optional]
|
13
|
+
**privacy_mode** | **Boolean** | Parameter `privacyMode` will not log the `text` as required by PCI compliance. | [optional]
|
13
14
|
|
14
15
|
## Code Sample
|
15
16
|
|
@@ -21,7 +22,8 @@ instance = Freeclimb::RecordUtterance.new(action_url: nil,
|
|
21
22
|
finish_on_key: nil,
|
22
23
|
max_length_sec: nil,
|
23
24
|
play_beep: nil,
|
24
|
-
auto_start: nil
|
25
|
+
auto_start: nil,
|
26
|
+
privacy_mode: nil)
|
25
27
|
```
|
26
28
|
|
27
29
|
|
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
|
10
10
|
**max_length_sec** | **Integer** | Maximum length for the command execution in seconds. | [optional]
|
11
11
|
**play_beep** | **Boolean** | Indicates whether to play a beep sound before the start of the recording. If set to `false`, no beep is played. | [optional]
|
12
12
|
**auto_start** | **Boolean** | If `false`, recording begins immediately after the RecordUtterance command is processed. If `true`, recording begins when audio is present and if audio begins before the `maxLengthSec` timeout. If no audio begins before `maxLengthSec`, no recording is generated. | [optional]
|
13
|
+
**privacy_mode** | **Boolean** | Parameter `privacyMode` will not log the `text` as required by PCI compliance. | [optional]
|
13
14
|
|
14
15
|
## Code Sample
|
15
16
|
|
@@ -21,7 +22,8 @@ instance = Freeclimb::RecordUtteranceAllOf.new(action_url: nil,
|
|
21
22
|
finish_on_key: nil,
|
22
23
|
max_length_sec: nil,
|
23
24
|
play_beep: nil,
|
24
|
-
auto_start: nil
|
25
|
+
auto_start: nil,
|
26
|
+
privacy_mode: nil)
|
25
27
|
```
|
26
28
|
|
27
29
|
|
data/docs/Redirect.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
|
-
**action_url** | **String** |
|
7
|
+
**action_url** | **String** | URL to request a new PerCL script to continue with the current Call's processing. When `Redirect` invokes the `actionUrl`, an `inbound` Webhook is sent. This request therefore looks identical to the initial request (made to the `voiceUrl` of the number that was called) for an inbound Call. |
|
8
8
|
|
9
9
|
## Code Sample
|
10
10
|
|
data/docs/RedirectAllOf.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Name | Type | Description | Notes
|
6
6
|
------------ | ------------- | ------------- | -------------
|
7
|
-
**action_url** | **String** |
|
7
|
+
**action_url** | **String** | URL to request a new PerCL script to continue with the current Call's processing. When `Redirect` invokes the `actionUrl`, an `inbound` Webhook is sent. This request therefore looks identical to the initial request (made to the `voiceUrl` of the number that was called) for an inbound Call. |
|
8
8
|
|
9
9
|
## Code Sample
|
10
10
|
|
data/docs/Reject.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Freeclimb::Reject
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**reason** | **String** | Reason for the rejection. This can be any string value. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the call flows for the given application. | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'freeclimb'
|
13
|
+
|
14
|
+
instance = Freeclimb::Reject.new(reason: nil)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
data/docs/RejectAllOf.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Freeclimb::RejectAllOf
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**reason** | **String** | Reason for the rejection. This can be any string value. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the call flows for the given application. | [optional]
|
8
|
+
|
9
|
+
## Code Sample
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'freeclimb'
|
13
|
+
|
14
|
+
instance = Freeclimb::RejectAllOf.new(reason: nil)
|
15
|
+
```
|
16
|
+
|
17
|
+
|
data/freeclimb-2.0.3.gem
ADDED
Binary file
|
data/freeclimb-2.1.0.gem
CHANGED
Binary file
|
data/freeclimb-2.1.1.gem
ADDED
Binary file
|
data/freeclimb-2.1.2.gem
ADDED
Binary file
|
data/freeclimb-2.2.0.gem
ADDED
Binary file
|
data/lib/freeclimb.rb
CHANGED
@@ -15,6 +15,7 @@ require 'freeclimb/api_client'
|
|
15
15
|
require 'freeclimb/api_error'
|
16
16
|
require 'freeclimb/version'
|
17
17
|
require 'freeclimb/configuration'
|
18
|
+
require 'freeclimb/utils'
|
18
19
|
require 'freeclimb/models/percl_command'
|
19
20
|
|
20
21
|
# Models
|
@@ -55,6 +56,8 @@ require 'freeclimb/models/get_digits'
|
|
55
56
|
require 'freeclimb/models/get_digits_all_of'
|
56
57
|
require 'freeclimb/models/get_speech'
|
57
58
|
require 'freeclimb/models/get_speech_all_of'
|
59
|
+
require 'freeclimb/models/hangup'
|
60
|
+
require 'freeclimb/models/hangup_all_of'
|
58
61
|
require 'freeclimb/models/incoming_number_list'
|
59
62
|
require 'freeclimb/models/incoming_number_list_all_of'
|
60
63
|
require 'freeclimb/models/incoming_number_request'
|
@@ -98,6 +101,8 @@ require 'freeclimb/models/recording_result'
|
|
98
101
|
require 'freeclimb/models/recording_result_all_of'
|
99
102
|
require 'freeclimb/models/redirect'
|
100
103
|
require 'freeclimb/models/redirect_all_of'
|
104
|
+
require 'freeclimb/models/reject'
|
105
|
+
require 'freeclimb/models/reject_all_of'
|
101
106
|
require 'freeclimb/models/remove_from_conference'
|
102
107
|
require 'freeclimb/models/remove_from_conference_all_of'
|
103
108
|
require 'freeclimb/models/say'
|
data/lib/freeclimb/api_client.rb
CHANGED
@@ -30,7 +30,7 @@ module Freeclimb
|
|
30
30
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
31
31
|
def initialize(config = Configuration.default)
|
32
32
|
@config = config
|
33
|
-
@user_agent = "FreeClimbSDK/
|
33
|
+
@user_agent = "FreeClimbSDK/3.0.0/ruby"
|
34
34
|
@default_headers = {
|
35
35
|
'Content-Type' => 'application/json',
|
36
36
|
'User-Agent' => @user_agent
|
@@ -29,8 +29,8 @@ module Freeclimb
|
|
29
29
|
# String that uniquely identifies this account resource.
|
30
30
|
attr_accessor :account_id
|
31
31
|
|
32
|
-
# The
|
33
|
-
attr_accessor :
|
32
|
+
# The API key assigned to this account. This token must be kept a secret by the customer.
|
33
|
+
attr_accessor :api_key
|
34
34
|
|
35
35
|
# A description for this account.
|
36
36
|
attr_accessor :_alias
|
@@ -77,7 +77,7 @@ module Freeclimb
|
|
77
77
|
:'date_updated' => :'dateUpdated',
|
78
78
|
:'revision' => :'revision',
|
79
79
|
:'account_id' => :'accountId',
|
80
|
-
:'
|
80
|
+
:'api_key' => :'apiKey',
|
81
81
|
:'_alias' => :'alias',
|
82
82
|
:'label' => :'label',
|
83
83
|
:'type' => :'type',
|
@@ -94,7 +94,7 @@ module Freeclimb
|
|
94
94
|
:'date_updated' => :'String',
|
95
95
|
:'revision' => :'Integer',
|
96
96
|
:'account_id' => :'String',
|
97
|
-
:'
|
97
|
+
:'api_key' => :'String',
|
98
98
|
:'_alias' => :'String',
|
99
99
|
:'label' => :'String',
|
100
100
|
:'type' => :'String',
|
@@ -152,8 +152,8 @@ module Freeclimb
|
|
152
152
|
self.account_id = attributes[:'account_id']
|
153
153
|
end
|
154
154
|
|
155
|
-
if attributes.key?(:'
|
156
|
-
self.
|
155
|
+
if attributes.key?(:'api_key')
|
156
|
+
self.api_key = attributes[:'api_key']
|
157
157
|
end
|
158
158
|
|
159
159
|
if attributes.key?(:'_alias')
|
@@ -212,7 +212,7 @@ module Freeclimb
|
|
212
212
|
date_updated == o.date_updated &&
|
213
213
|
revision == o.revision &&
|
214
214
|
account_id == o.account_id &&
|
215
|
-
|
215
|
+
api_key == o.api_key &&
|
216
216
|
_alias == o._alias &&
|
217
217
|
label == o.label &&
|
218
218
|
type == o.type &&
|
@@ -229,7 +229,7 @@ module Freeclimb
|
|
229
229
|
# Calculates hash code according to all attributes.
|
230
230
|
# @return [Integer] Hash code
|
231
231
|
def hash
|
232
|
-
[uri, date_created, date_updated, revision, account_id,
|
232
|
+
[uri, date_created, date_updated, revision, account_id, api_key, _alias, label, type, status, subresource_uris].hash
|
233
233
|
end
|
234
234
|
|
235
235
|
# Builds the object from hash
|
@@ -17,8 +17,8 @@ module Freeclimb
|
|
17
17
|
# String that uniquely identifies this account resource.
|
18
18
|
attr_accessor :account_id
|
19
19
|
|
20
|
-
# The
|
21
|
-
attr_accessor :
|
20
|
+
# The API key assigned to this account. This token must be kept a secret by the customer.
|
21
|
+
attr_accessor :api_key
|
22
22
|
|
23
23
|
# A description for this account.
|
24
24
|
attr_accessor :_alias
|
@@ -61,7 +61,7 @@ module Freeclimb
|
|
61
61
|
def self.attribute_map
|
62
62
|
{
|
63
63
|
:'account_id' => :'accountId',
|
64
|
-
:'
|
64
|
+
:'api_key' => :'apiKey',
|
65
65
|
:'_alias' => :'alias',
|
66
66
|
:'label' => :'label',
|
67
67
|
:'type' => :'type',
|
@@ -74,7 +74,7 @@ module Freeclimb
|
|
74
74
|
def self.openapi_types
|
75
75
|
{
|
76
76
|
:'account_id' => :'String',
|
77
|
-
:'
|
77
|
+
:'api_key' => :'String',
|
78
78
|
:'_alias' => :'String',
|
79
79
|
:'label' => :'String',
|
80
80
|
:'type' => :'String',
|
@@ -108,8 +108,8 @@ module Freeclimb
|
|
108
108
|
self.account_id = attributes[:'account_id']
|
109
109
|
end
|
110
110
|
|
111
|
-
if attributes.key?(:'
|
112
|
-
self.
|
111
|
+
if attributes.key?(:'api_key')
|
112
|
+
self.api_key = attributes[:'api_key']
|
113
113
|
end
|
114
114
|
|
115
115
|
if attributes.key?(:'_alias')
|
@@ -164,7 +164,7 @@ module Freeclimb
|
|
164
164
|
return true if self.equal?(o)
|
165
165
|
self.class == o.class &&
|
166
166
|
account_id == o.account_id &&
|
167
|
-
|
167
|
+
api_key == o.api_key &&
|
168
168
|
_alias == o._alias &&
|
169
169
|
label == o.label &&
|
170
170
|
type == o.type &&
|
@@ -181,7 +181,7 @@ module Freeclimb
|
|
181
181
|
# Calculates hash code according to all attributes.
|
182
182
|
# @return [Integer] Hash code
|
183
183
|
def hash
|
184
|
-
[account_id,
|
184
|
+
[account_id, api_key, _alias, label, type, status, subresource_uris].hash
|
185
185
|
end
|
186
186
|
|
187
187
|
# Builds the object from hash
|
@@ -0,0 +1,220 @@
|
|
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
|
+
# The `Hangup` command terminates a Call. If `Hangup` is used as the first action in a PerCL response, it does not prevent FreeClimb from answering the Call and billing your account. See the `Reject` command to hang up at no charge.
|
17
|
+
class Hangup < PerclCommand
|
18
|
+
# The user defined reason for the hangup. In general, applications should use a set of enumerated values that are predefined to cover all exit points of the Call flows for the given application.
|
19
|
+
attr_accessor :reason
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'reason' => :'reason'
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
# Attribute type mapping.
|
29
|
+
def self.openapi_types
|
30
|
+
{
|
31
|
+
:'reason' => :'String'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# List of attributes with nullable: true
|
36
|
+
def self.openapi_nullable
|
37
|
+
Set.new([
|
38
|
+
])
|
39
|
+
end
|
40
|
+
|
41
|
+
# List of class defined in allOf (OpenAPI v3)
|
42
|
+
def self.openapi_all_of
|
43
|
+
[
|
44
|
+
:'HangupAllOf',
|
45
|
+
:'PerclCommand'
|
46
|
+
]
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Freeclimb::Hangup` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Freeclimb::Hangup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
# call parent's initialize
|
65
|
+
super(attributes)
|
66
|
+
|
67
|
+
if attributes.key?(:'reason')
|
68
|
+
self.reason = attributes[:'reason']
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
73
|
+
# @return Array for valid properties with the reasons
|
74
|
+
def list_invalid_properties
|
75
|
+
invalid_properties = super
|
76
|
+
invalid_properties
|
77
|
+
end
|
78
|
+
|
79
|
+
# Check to see if the all the properties in the model are valid
|
80
|
+
# @return true if the model is valid
|
81
|
+
def valid?
|
82
|
+
true && super
|
83
|
+
end
|
84
|
+
|
85
|
+
# Checks equality by comparing each attribute.
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def ==(o)
|
88
|
+
return true if self.equal?(o)
|
89
|
+
self.class == o.class &&
|
90
|
+
reason == o.reason && super(o)
|
91
|
+
end
|
92
|
+
|
93
|
+
# @see the `==` method
|
94
|
+
# @param [Object] Object to be compared
|
95
|
+
def eql?(o)
|
96
|
+
self == o
|
97
|
+
end
|
98
|
+
|
99
|
+
# Calculates hash code according to all attributes.
|
100
|
+
# @return [Integer] Hash code
|
101
|
+
def hash
|
102
|
+
[reason].hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def self.build_from_hash(attributes)
|
109
|
+
new.build_from_hash(attributes)
|
110
|
+
end
|
111
|
+
|
112
|
+
# Builds the object from hash
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
+
# @return [Object] Returns the model itself
|
115
|
+
def build_from_hash(attributes)
|
116
|
+
return nil unless attributes.is_a?(Hash)
|
117
|
+
super(attributes)
|
118
|
+
self.class.openapi_types.each_pair do |key, type|
|
119
|
+
if type =~ /\AArray<(.*)>/i
|
120
|
+
# check to ensure the input is an array given that the attribute
|
121
|
+
# is documented as an array but the input is not
|
122
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
123
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
124
|
+
end
|
125
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
126
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
127
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
128
|
+
end
|
129
|
+
|
130
|
+
self
|
131
|
+
end
|
132
|
+
|
133
|
+
# Deserializes the data based on type
|
134
|
+
# @param string type Data type
|
135
|
+
# @param string value Value to be deserialized
|
136
|
+
# @return [Object] Deserialized data
|
137
|
+
def _deserialize(type, value)
|
138
|
+
case type.to_sym
|
139
|
+
when :DateTime
|
140
|
+
DateTime.parse(value)
|
141
|
+
when :Date
|
142
|
+
Date.parse(value)
|
143
|
+
when :String
|
144
|
+
value.to_s
|
145
|
+
when :Integer
|
146
|
+
value.to_i
|
147
|
+
when :Float
|
148
|
+
value.to_f
|
149
|
+
when :Boolean
|
150
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
151
|
+
true
|
152
|
+
else
|
153
|
+
false
|
154
|
+
end
|
155
|
+
when :Object
|
156
|
+
# generic object (usually a Hash), return directly
|
157
|
+
value
|
158
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
159
|
+
inner_type = Regexp.last_match[:inner_type]
|
160
|
+
value.map { |v| _deserialize(inner_type, v) }
|
161
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
162
|
+
k_type = Regexp.last_match[:k_type]
|
163
|
+
v_type = Regexp.last_match[:v_type]
|
164
|
+
{}.tap do |hash|
|
165
|
+
value.each do |k, v|
|
166
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
else # model
|
170
|
+
Freeclimb.const_get(type).build_from_hash(value)
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# Returns the string representation of the object
|
175
|
+
# @return [String] String presentation of the object
|
176
|
+
def to_s
|
177
|
+
to_hash.to_s
|
178
|
+
end
|
179
|
+
|
180
|
+
# to_body is an alias to to_hash (backward compatibility)
|
181
|
+
# @return [Hash] Returns the object in the form of hash
|
182
|
+
def to_body
|
183
|
+
to_hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Returns the object in the form of hash
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
188
|
+
def to_hash
|
189
|
+
hash = super
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
191
|
+
value = self.send(attr)
|
192
|
+
if value.nil?
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
195
|
+
end
|
196
|
+
|
197
|
+
hash[param] = _to_hash(value)
|
198
|
+
end
|
199
|
+
hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Outputs non-array value in the form of hash
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
204
|
+
# @param [Object] value Any valid value
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
206
|
+
def _to_hash(value)
|
207
|
+
if value.is_a?(Array)
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
209
|
+
elsif value.is_a?(Hash)
|
210
|
+
{}.tap do |hash|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
212
|
+
end
|
213
|
+
elsif value.respond_to? :to_hash
|
214
|
+
value.to_hash
|
215
|
+
else
|
216
|
+
value
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|