freeclimb 4.0.4 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +91 -9
  3. data/Gemfile.lock +1 -1
  4. data/README.md +25 -4
  5. data/docs/AccountResult.md +2 -2
  6. data/docs/AccountResultAllOf.md +2 -2
  7. data/docs/AccountStatus.md +18 -0
  8. data/docs/AccountType.md +17 -0
  9. data/docs/AnsweredBy.md +17 -0
  10. data/docs/CallDirection.md +18 -0
  11. data/docs/CallResult.md +3 -3
  12. data/docs/CallResultAllOf.md +3 -3
  13. data/docs/CallStatus.md +23 -0
  14. data/docs/ConferenceResult.md +2 -2
  15. data/docs/ConferenceResultAllOf.md +2 -2
  16. data/docs/ConferenceStatus.md +19 -0
  17. data/docs/CreateConference.md +2 -2
  18. data/docs/CreateConferenceAllOf.md +2 -2
  19. data/docs/CreateConferenceRequest.md +1 -1
  20. data/docs/DefaultApi.md +5 -5
  21. data/docs/Dequeue.md +1 -1
  22. data/docs/GetSpeech.md +3 -3
  23. data/docs/GetSpeechAllOf.md +3 -3
  24. data/docs/GetSpeechReason.md +21 -0
  25. data/docs/GrammarFileBuiltIn.md +30 -0
  26. data/docs/GrammarType.md +17 -0
  27. data/docs/IfMachine.md +17 -0
  28. data/docs/Language.md +41 -0
  29. data/docs/LogLevel.md +18 -0
  30. data/docs/LogResult.md +1 -1
  31. data/docs/MachineType.md +17 -0
  32. data/docs/MessageDirection.md +17 -0
  33. data/docs/MessageResult.md +1 -1
  34. data/docs/MessageResultAllOf.md +1 -1
  35. data/docs/MessageStatus.md +26 -0
  36. data/docs/OutDial.md +1 -1
  37. data/docs/OutDialAllOf.md +1 -1
  38. data/docs/PlayBeep.md +19 -0
  39. data/docs/QueueResultStatus.md +19 -0
  40. data/docs/RecordUtteranceTermReason.md +19 -0
  41. data/docs/RequestType.md +38 -0
  42. data/docs/StartRecordCall.md +1 -1
  43. data/docs/Unpark.md +1 -1
  44. data/docs/UpdateCallRequest.md +1 -1
  45. data/docs/UpdateCallRequestStatus.md +17 -0
  46. data/docs/UpdateConferenceRequest.md +2 -2
  47. data/docs/UpdateConferenceRequestStatus.md +17 -0
  48. data/lib/freeclimb/api/default_api.rb +4 -8
  49. data/lib/freeclimb/models/account_result.rb +2 -52
  50. data/lib/freeclimb/models/account_result_all_of.rb +2 -52
  51. data/lib/freeclimb/models/account_status.rb +38 -0
  52. data/lib/freeclimb/models/account_type.rb +37 -0
  53. data/lib/freeclimb/models/answered_by.rb +37 -0
  54. data/lib/freeclimb/models/call_direction.rb +38 -0
  55. data/lib/freeclimb/models/call_result.rb +3 -43
  56. data/lib/freeclimb/models/call_result_all_of.rb +3 -43
  57. data/lib/freeclimb/models/call_status.rb +43 -0
  58. data/lib/freeclimb/models/conference_result.rb +4 -52
  59. data/lib/freeclimb/models/conference_result_all_of.rb +4 -52
  60. data/lib/freeclimb/models/conference_status.rb +39 -0
  61. data/lib/freeclimb/models/create_conference.rb +4 -3
  62. data/lib/freeclimb/models/create_conference_all_of.rb +4 -3
  63. data/lib/freeclimb/models/create_conference_request.rb +1 -36
  64. data/lib/freeclimb/models/get_speech.rb +3 -4
  65. data/lib/freeclimb/models/get_speech_all_of.rb +3 -4
  66. data/lib/freeclimb/models/get_speech_reason.rb +41 -0
  67. data/lib/freeclimb/models/grammar_file_built_in.rb +50 -0
  68. data/lib/freeclimb/models/grammar_type.rb +37 -0
  69. data/lib/freeclimb/models/if_machine.rb +37 -0
  70. data/lib/freeclimb/models/language.rb +61 -0
  71. data/lib/freeclimb/models/log_level.rb +38 -0
  72. data/lib/freeclimb/models/log_result.rb +1 -37
  73. data/lib/freeclimb/models/machine_type.rb +37 -0
  74. data/lib/freeclimb/models/message_direction.rb +37 -0
  75. data/lib/freeclimb/models/message_result.rb +1 -37
  76. data/lib/freeclimb/models/message_result_all_of.rb +1 -37
  77. data/lib/freeclimb/models/message_status.rb +46 -0
  78. data/lib/freeclimb/models/out_dial.rb +1 -2
  79. data/lib/freeclimb/models/out_dial_all_of.rb +1 -2
  80. data/lib/freeclimb/models/play_beep.rb +39 -0
  81. data/lib/freeclimb/models/queue_result_status.rb +39 -0
  82. data/lib/freeclimb/models/record_utterance_term_reason.rb +39 -0
  83. data/lib/freeclimb/models/request_type.rb +58 -0
  84. data/lib/freeclimb/models/update_call_request.rb +1 -36
  85. data/lib/freeclimb/models/update_call_request_status.rb +37 -0
  86. data/lib/freeclimb/models/update_conference_request.rb +2 -50
  87. data/lib/freeclimb/models/update_conference_request_status.rb +37 -0
  88. data/lib/freeclimb/version.rb +1 -1
  89. data/lib/freeclimb.rb +21 -0
  90. data/openapi.json +4220 -0
  91. data/spec/api/default_api_spec.rb +532 -700
  92. data/spec/configuration_spec.rb +2 -1
  93. data/spec/models/account_result_spec.rb +0 -8
  94. data/spec/models/account_status_spec.rb +43 -0
  95. data/spec/models/account_type_spec.rb +38 -0
  96. data/spec/models/answered_by_spec.rb +38 -0
  97. data/spec/models/available_number_spec.rb +6 -0
  98. data/spec/models/call_direction_spec.rb +43 -0
  99. data/spec/models/call_result_spec.rb +0 -4
  100. data/spec/models/call_status_spec.rb +68 -0
  101. data/spec/models/conference_result_spec.rb +0 -8
  102. data/spec/models/conference_status_spec.rb +48 -0
  103. data/spec/models/create_conference_request_spec.rb +0 -4
  104. data/spec/models/get_speech_reason_spec.rb +58 -0
  105. data/spec/models/grammar_file_built_in_spec.rb +103 -0
  106. data/spec/models/grammar_type_spec.rb +38 -0
  107. data/spec/models/if_machine_spec.rb +38 -0
  108. data/spec/models/incoming_number_result_spec.rb +12 -0
  109. data/spec/models/language_spec.rb +158 -0
  110. data/spec/models/log_level_spec.rb +43 -0
  111. data/spec/models/log_result_spec.rb +0 -4
  112. data/spec/models/machine_type_spec.rb +38 -0
  113. data/spec/models/message_direction_spec.rb +38 -0
  114. data/spec/models/message_result_spec.rb +0 -4
  115. data/spec/models/message_status_spec.rb +83 -0
  116. data/spec/models/play_beep_spec.rb +48 -0
  117. data/spec/models/queue_result_spec.rb +1 -1
  118. data/spec/models/queue_result_status_spec.rb +48 -0
  119. data/spec/models/record_utterance_term_reason_spec.rb +48 -0
  120. data/spec/models/request_type_spec.rb +143 -0
  121. data/spec/models/update_call_request_spec.rb +0 -4
  122. data/spec/models/update_call_request_status_spec.rb +38 -0
  123. data/spec/models/update_conference_request_spec.rb +0 -4
  124. data/spec/models/update_conference_request_status_spec.rb +38 -0
  125. metadata +138 -53
@@ -39,37 +39,13 @@ module Freeclimb
39
39
  # A string that identifies a category or group to which the account belongs.
40
40
  attr_accessor :label
41
41
 
42
- # The type of this account. It is one of: trial or full.
43
42
  attr_accessor :type
44
43
 
45
- # The status of this account. It is one of: active, suspended, or closed.
46
44
  attr_accessor :status
47
45
 
48
46
  # The list of subresources for this account.
49
47
  attr_accessor :subresource_uris
50
48
 
51
- class EnumAttributeValidator
52
- attr_reader :datatype
53
- attr_reader :allowable_values
54
-
55
- def initialize(datatype, allowable_values)
56
- @allowable_values = allowable_values.map do |value|
57
- case datatype.to_s
58
- when /Integer/i
59
- value.to_i
60
- when /Float/i
61
- value.to_f
62
- else
63
- value
64
- end
65
- end
66
- end
67
-
68
- def valid?(value)
69
- !value || allowable_values.include?(value)
70
- end
71
- end
72
-
73
49
  # Attribute mapping from ruby-style variable name to JSON key.
74
50
  def self.attribute_map
75
51
  {
@@ -103,8 +79,8 @@ module Freeclimb
103
79
  :'api_key' => :'String',
104
80
  :'_alias' => :'String',
105
81
  :'label' => :'String',
106
- :'type' => :'String',
107
- :'status' => :'String',
82
+ :'type' => :'AccountType',
83
+ :'status' => :'AccountStatus',
108
84
  :'subresource_uris' => :'Object'
109
85
  }
110
86
  end
@@ -116,8 +92,6 @@ module Freeclimb
116
92
  :'api_key',
117
93
  :'_alias',
118
94
  :'label',
119
- :'type',
120
- :'status',
121
95
  :'subresource_uris'
122
96
  ])
123
97
  end
@@ -200,33 +174,9 @@ module Freeclimb
200
174
  # Check to see if the all the properties in the model are valid
201
175
  # @return true if the model is valid
202
176
  def valid?
203
- type_validator = EnumAttributeValidator.new('String', ["trial", "full"])
204
- return false unless type_validator.valid?(@type)
205
- status_validator = EnumAttributeValidator.new('String', ["active", "suspended", "closed"])
206
- return false unless status_validator.valid?(@status)
207
177
  true
208
178
  end
209
179
 
210
- # Custom attribute writer method checking allowed values (enum).
211
- # @param [Object] type Object to be assigned
212
- def type=(type)
213
- validator = EnumAttributeValidator.new('String', ["trial", "full"])
214
- unless validator.valid?(type)
215
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
216
- end
217
- @type = type
218
- end
219
-
220
- # Custom attribute writer method checking allowed values (enum).
221
- # @param [Object] status Object to be assigned
222
- def status=(status)
223
- validator = EnumAttributeValidator.new('String', ["active", "suspended", "closed"])
224
- unless validator.valid?(status)
225
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
226
- end
227
- @status = status
228
- end
229
-
230
180
  # Checks equality by comparing each attribute.
231
181
  # @param [Object] Object to be compared
232
182
  def ==(o)
@@ -27,37 +27,13 @@ module Freeclimb
27
27
  # A string that identifies a category or group to which the account belongs.
28
28
  attr_accessor :label
29
29
 
30
- # The type of this account. It is one of: trial or full.
31
30
  attr_accessor :type
32
31
 
33
- # The status of this account. It is one of: active, suspended, or closed.
34
32
  attr_accessor :status
35
33
 
36
34
  # The list of subresources for this account.
37
35
  attr_accessor :subresource_uris
38
36
 
39
- class EnumAttributeValidator
40
- attr_reader :datatype
41
- attr_reader :allowable_values
42
-
43
- def initialize(datatype, allowable_values)
44
- @allowable_values = allowable_values.map do |value|
45
- case datatype.to_s
46
- when /Integer/i
47
- value.to_i
48
- when /Float/i
49
- value.to_f
50
- else
51
- value
52
- end
53
- end
54
- end
55
-
56
- def valid?(value)
57
- !value || allowable_values.include?(value)
58
- end
59
- end
60
-
61
37
  # Attribute mapping from ruby-style variable name to JSON key.
62
38
  def self.attribute_map
63
39
  {
@@ -83,8 +59,8 @@ module Freeclimb
83
59
  :'api_key' => :'String',
84
60
  :'_alias' => :'String',
85
61
  :'label' => :'String',
86
- :'type' => :'String',
87
- :'status' => :'String',
62
+ :'type' => :'AccountType',
63
+ :'status' => :'AccountStatus',
88
64
  :'subresource_uris' => :'Object'
89
65
  }
90
66
  end
@@ -96,8 +72,6 @@ module Freeclimb
96
72
  :'api_key',
97
73
  :'_alias',
98
74
  :'label',
99
- :'type',
100
- :'status',
101
75
  :'subresource_uris'
102
76
  ])
103
77
  end
@@ -156,33 +130,9 @@ module Freeclimb
156
130
  # Check to see if the all the properties in the model are valid
157
131
  # @return true if the model is valid
158
132
  def valid?
159
- type_validator = EnumAttributeValidator.new('String', ["trial", "full"])
160
- return false unless type_validator.valid?(@type)
161
- status_validator = EnumAttributeValidator.new('String', ["active", "suspended", "closed"])
162
- return false unless status_validator.valid?(@status)
163
133
  true
164
134
  end
165
135
 
166
- # Custom attribute writer method checking allowed values (enum).
167
- # @param [Object] type Object to be assigned
168
- def type=(type)
169
- validator = EnumAttributeValidator.new('String', ["trial", "full"])
170
- unless validator.valid?(type)
171
- fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
172
- end
173
- @type = type
174
- end
175
-
176
- # Custom attribute writer method checking allowed values (enum).
177
- # @param [Object] status Object to be assigned
178
- def status=(status)
179
- validator = EnumAttributeValidator.new('String', ["active", "suspended", "closed"])
180
- unless validator.valid?(status)
181
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
182
- end
183
- @status = status
184
- end
185
-
186
136
  # Checks equality by comparing each attribute.
187
137
  # @param [Object] Object to be compared
188
138
  def ==(o)
@@ -0,0 +1,38 @@
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
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ class AccountStatus
18
+ CLOSED = "closed".freeze
19
+ SUSPENDED = "suspended".freeze
20
+ ACTIVE = "active".freeze
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ constantValues = AccountStatus.constants.select { |c| AccountStatus::const_get(c) == value }
34
+ raise "Invalid ENUM value #{value} for class #AccountStatus" if constantValues.empty?
35
+ value
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,37 @@
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
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ class AccountType
18
+ TRIAL = "trial".freeze
19
+ FULL = "full".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = AccountType.constants.select { |c| AccountType::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #AccountType" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,37 @@
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
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ class AnsweredBy
18
+ HUMAN = "human".freeze
19
+ MACHINE = "machine".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = AnsweredBy.constants.select { |c| AnsweredBy::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #AnsweredBy" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,38 @@
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
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ class CallDirection
18
+ INBOUND = "inbound".freeze
19
+ OUTBOUND_API = "outboundAPI".freeze
20
+ OUTBOUND_DIAL = "outboundDial".freeze
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ constantValues = CallDirection.constants.select { |c| CallDirection::const_get(c) == value }
34
+ raise "Invalid ENUM value #{value} for class #CallDirection" if constantValues.empty?
35
+ value
36
+ end
37
+ end
38
+ end
@@ -45,7 +45,6 @@ module Freeclimb
45
45
  # If the Call was inbound, this is the ID of the IncomingPhoneNumber that received the Call (DNIS). If the Call was outbound, this is the ID of the phone number from which the Call was placed (ANI).
46
46
  attr_accessor :phone_number_id
47
47
 
48
- # * `queued` – Call is ready and waiting in line before going out. * `ringing` – Call is currently ringing. * `inProgress` – Call was answered and is currently in progress. * `canceled` – Call was hung up while it was queued or ringing. * `completed` – Call was answered and has ended normally. * `busy` – Caller received a busy signal. * `failed` – Call could not be completed as dialed, most likely because the phone number was non-existent. * `noAnswer` – Call ended without being answered.
49
48
  attr_accessor :status
50
49
 
51
50
  # Start time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed.
@@ -63,37 +62,13 @@ module Freeclimb
63
62
  # Length of time that the Call was connected in seconds. Measures time between connectTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls.
64
63
  attr_accessor :connect_duration
65
64
 
66
- # Direction of the Call. `inbound` for Calls into FreeClimb, `outboundAPI` for Calls initiated via the REST API, `outboundDial` for Calls initiated by the `OutDial` PerCL command.
67
65
  attr_accessor :direction
68
66
 
69
- # If this Call was initiated with answering machine detection, either `human` or `machine`. Empty otherwise.
70
67
  attr_accessor :answered_by
71
68
 
72
69
  # The list of subresources for this Call. These include things like logs and recordings associated with the Call.
73
70
  attr_accessor :subresource_uris
74
71
 
75
- class EnumAttributeValidator
76
- attr_reader :datatype
77
- attr_reader :allowable_values
78
-
79
- def initialize(datatype, allowable_values)
80
- @allowable_values = allowable_values.map do |value|
81
- case datatype.to_s
82
- when /Integer/i
83
- value.to_i
84
- when /Float/i
85
- value.to_f
86
- else
87
- value
88
- end
89
- end
90
- end
91
-
92
- def valid?(value)
93
- !value || allowable_values.include?(value)
94
- end
95
- end
96
-
97
72
  # Attribute mapping from ruby-style variable name to JSON key.
98
73
  def self.attribute_map
99
74
  {
@@ -137,14 +112,14 @@ module Freeclimb
137
112
  :'from' => :'String',
138
113
  :'to' => :'String',
139
114
  :'phone_number_id' => :'String',
140
- :'status' => :'String',
115
+ :'status' => :'CallStatus',
141
116
  :'start_time' => :'String',
142
117
  :'connect_time' => :'String',
143
118
  :'end_time' => :'String',
144
119
  :'duration' => :'Integer',
145
120
  :'connect_duration' => :'Integer',
146
- :'direction' => :'String',
147
- :'answered_by' => :'String',
121
+ :'direction' => :'CallDirection',
122
+ :'answered_by' => :'AnsweredBy',
148
123
  :'subresource_uris' => :'Object'
149
124
  }
150
125
  end
@@ -158,14 +133,11 @@ module Freeclimb
158
133
  :'from',
159
134
  :'to',
160
135
  :'phone_number_id',
161
- :'status',
162
136
  :'start_time',
163
137
  :'connect_time',
164
138
  :'end_time',
165
139
  :'duration',
166
140
  :'connect_duration',
167
- :'direction',
168
- :'answered_by',
169
141
  :'subresource_uris'
170
142
  ])
171
143
  end
@@ -280,21 +252,9 @@ module Freeclimb
280
252
  # Check to see if the all the properties in the model are valid
281
253
  # @return true if the model is valid
282
254
  def valid?
283
- status_validator = EnumAttributeValidator.new('String', ["queued", "ringing", "inProgress", "canceled", "completed", "busy", "failed", "noAnswer"])
284
- return false unless status_validator.valid?(@status)
285
255
  true
286
256
  end
287
257
 
288
- # Custom attribute writer method checking allowed values (enum).
289
- # @param [Object] status Object to be assigned
290
- def status=(status)
291
- validator = EnumAttributeValidator.new('String', ["queued", "ringing", "inProgress", "canceled", "completed", "busy", "failed", "noAnswer"])
292
- unless validator.valid?(status)
293
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
294
- end
295
- @status = status
296
- end
297
-
298
258
  # Checks equality by comparing each attribute.
299
259
  # @param [Object] Object to be compared
300
260
  def ==(o)
@@ -33,7 +33,6 @@ module Freeclimb
33
33
  # If the Call was inbound, this is the ID of the IncomingPhoneNumber that received the Call (DNIS). If the Call was outbound, this is the ID of the phone number from which the Call was placed (ANI).
34
34
  attr_accessor :phone_number_id
35
35
 
36
- # * `queued` – Call is ready and waiting in line before going out. * `ringing` – Call is currently ringing. * `inProgress` – Call was answered and is currently in progress. * `canceled` – Call was hung up while it was queued or ringing. * `completed` – Call was answered and has ended normally. * `busy` – Caller received a busy signal. * `failed` – Call could not be completed as dialed, most likely because the phone number was non-existent. * `noAnswer` – Call ended without being answered.
37
36
  attr_accessor :status
38
37
 
39
38
  # Start time of the Call (GMT) in RFC 1123 format (e.g., Mon, 15 Jun 2009 20:45:30 GMT). Empty if the Call has not yet been dialed.
@@ -51,37 +50,13 @@ module Freeclimb
51
50
  # Length of time that the Call was connected in seconds. Measures time between connectTime and endTime. This value is empty for busy, failed, unanswered or ongoing Calls.
52
51
  attr_accessor :connect_duration
53
52
 
54
- # Direction of the Call. `inbound` for Calls into FreeClimb, `outboundAPI` for Calls initiated via the REST API, `outboundDial` for Calls initiated by the `OutDial` PerCL command.
55
53
  attr_accessor :direction
56
54
 
57
- # If this Call was initiated with answering machine detection, either `human` or `machine`. Empty otherwise.
58
55
  attr_accessor :answered_by
59
56
 
60
57
  # The list of subresources for this Call. These include things like logs and recordings associated with the Call.
61
58
  attr_accessor :subresource_uris
62
59
 
63
- class EnumAttributeValidator
64
- attr_reader :datatype
65
- attr_reader :allowable_values
66
-
67
- def initialize(datatype, allowable_values)
68
- @allowable_values = allowable_values.map do |value|
69
- case datatype.to_s
70
- when /Integer/i
71
- value.to_i
72
- when /Float/i
73
- value.to_f
74
- else
75
- value
76
- end
77
- end
78
- end
79
-
80
- def valid?(value)
81
- !value || allowable_values.include?(value)
82
- end
83
- end
84
-
85
60
  # Attribute mapping from ruby-style variable name to JSON key.
86
61
  def self.attribute_map
87
62
  {
@@ -117,14 +92,14 @@ module Freeclimb
117
92
  :'from' => :'String',
118
93
  :'to' => :'String',
119
94
  :'phone_number_id' => :'String',
120
- :'status' => :'String',
95
+ :'status' => :'CallStatus',
121
96
  :'start_time' => :'String',
122
97
  :'connect_time' => :'String',
123
98
  :'end_time' => :'String',
124
99
  :'duration' => :'Integer',
125
100
  :'connect_duration' => :'Integer',
126
- :'direction' => :'String',
127
- :'answered_by' => :'String',
101
+ :'direction' => :'CallDirection',
102
+ :'answered_by' => :'AnsweredBy',
128
103
  :'subresource_uris' => :'Object'
129
104
  }
130
105
  end
@@ -138,14 +113,11 @@ module Freeclimb
138
113
  :'from',
139
114
  :'to',
140
115
  :'phone_number_id',
141
- :'status',
142
116
  :'start_time',
143
117
  :'connect_time',
144
118
  :'end_time',
145
119
  :'duration',
146
120
  :'connect_duration',
147
- :'direction',
148
- :'answered_by',
149
121
  :'subresource_uris'
150
122
  ])
151
123
  end
@@ -236,21 +208,9 @@ module Freeclimb
236
208
  # Check to see if the all the properties in the model are valid
237
209
  # @return true if the model is valid
238
210
  def valid?
239
- status_validator = EnumAttributeValidator.new('String', ["queued", "ringing", "inProgress", "canceled", "completed", "busy", "failed", "noAnswer"])
240
- return false unless status_validator.valid?(@status)
241
211
  true
242
212
  end
243
213
 
244
- # Custom attribute writer method checking allowed values (enum).
245
- # @param [Object] status Object to be assigned
246
- def status=(status)
247
- validator = EnumAttributeValidator.new('String', ["queued", "ringing", "inProgress", "canceled", "completed", "busy", "failed", "noAnswer"])
248
- unless validator.valid?(status)
249
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
250
- end
251
- @status = status
252
- end
253
-
254
214
  # Checks equality by comparing each attribute.
255
215
  # @param [Object] Object to be compared
256
216
  def ==(o)
@@ -0,0 +1,43 @@
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
+ Contact: support@freeclimb.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.4.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Freeclimb
17
+ class CallStatus
18
+ QUEUED = "queued".freeze
19
+ RINGING = "ringing".freeze
20
+ IN_PROGRESS = "inProgress".freeze
21
+ CANCELED = "canceled".freeze
22
+ COMPLETED = "completed".freeze
23
+ FAILED = "failed".freeze
24
+ BUSY = "busy".freeze
25
+ NO_ANSWER = "noAnswer".freeze
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def self.build_from_hash(value)
31
+ new.build_from_hash(value)
32
+ end
33
+
34
+ # Builds the enum from string
35
+ # @param [String] The enum value in the form of the string
36
+ # @return [String] The enum value
37
+ def build_from_hash(value)
38
+ constantValues = CallStatus.constants.select { |c| CallStatus::const_get(c) == value }
39
+ raise "Invalid ENUM value #{value} for class #CallStatus" if constantValues.empty?
40
+ value
41
+ end
42
+ end
43
+ end