telestream_cloud_qc 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +58 -0
  4. data/Rakefile +8 -0
  5. data/docs/Alert.md +13 -0
  6. data/docs/AudioStream.md +13 -0
  7. data/docs/Container.md +9 -0
  8. data/docs/Data.md +10 -0
  9. data/docs/Data1.md +9 -0
  10. data/docs/ExtraFile.md +10 -0
  11. data/docs/Job.md +12 -0
  12. data/docs/JobData.md +9 -0
  13. data/docs/JobDetails.md +9 -0
  14. data/docs/JobDetailsResult.md +8 -0
  15. data/docs/JobsCollection.md +12 -0
  16. data/docs/Media.md +10 -0
  17. data/docs/Options.md +7 -0
  18. data/docs/Project.md +12 -0
  19. data/docs/Proxy.md +12 -0
  20. data/docs/QcApi.md +719 -0
  21. data/docs/UploadSession.md +13 -0
  22. data/docs/VideoStream.md +13 -0
  23. data/docs/VideoUploadBody.md +12 -0
  24. data/git_push.sh +55 -0
  25. data/lib/telestream_cloud_qc/api/qc_api.rb +781 -0
  26. data/lib/telestream_cloud_qc/api_client.rb +389 -0
  27. data/lib/telestream_cloud_qc/api_error.rb +38 -0
  28. data/lib/telestream_cloud_qc/configuration.rb +209 -0
  29. data/lib/telestream_cloud_qc/models/alert.rb +236 -0
  30. data/lib/telestream_cloud_qc/models/audio_stream.rb +238 -0
  31. data/lib/telestream_cloud_qc/models/container.rb +198 -0
  32. data/lib/telestream_cloud_qc/models/data.rb +208 -0
  33. data/lib/telestream_cloud_qc/models/data_1.rb +197 -0
  34. data/lib/telestream_cloud_qc/models/extra_file.rb +221 -0
  35. data/lib/telestream_cloud_qc/models/job.rb +269 -0
  36. data/lib/telestream_cloud_qc/models/job_data.rb +197 -0
  37. data/lib/telestream_cloud_qc/models/job_details.rb +199 -0
  38. data/lib/telestream_cloud_qc/models/job_details_result.rb +190 -0
  39. data/lib/telestream_cloud_qc/models/jobs_collection.rb +230 -0
  40. data/lib/telestream_cloud_qc/models/media.rb +210 -0
  41. data/lib/telestream_cloud_qc/models/options.rb +179 -0
  42. data/lib/telestream_cloud_qc/models/project.rb +262 -0
  43. data/lib/telestream_cloud_qc/models/proxy.rb +224 -0
  44. data/lib/telestream_cloud_qc/models/upload_session.rb +249 -0
  45. data/lib/telestream_cloud_qc/models/video_stream.rb +235 -0
  46. data/lib/telestream_cloud_qc/models/video_upload_body.rb +242 -0
  47. data/lib/telestream_cloud_qc/uploader.rb +244 -0
  48. data/lib/telestream_cloud_qc/version.rb +18 -0
  49. data/lib/telestream_cloud_qc.rb +64 -0
  50. data/spec/api/qc_api_spec.rb +202 -0
  51. data/spec/api_client_spec.rb +226 -0
  52. data/spec/configuration_spec.rb +42 -0
  53. data/spec/models/alert_spec.rb +72 -0
  54. data/spec/models/audio_stream_spec.rb +72 -0
  55. data/spec/models/container_spec.rb +48 -0
  56. data/spec/models/data_1_spec.rb +48 -0
  57. data/spec/models/data_spec.rb +54 -0
  58. data/spec/models/extra_file_spec.rb +54 -0
  59. data/spec/models/job_data_spec.rb +48 -0
  60. data/spec/models/job_details_result_spec.rb +42 -0
  61. data/spec/models/job_details_spec.rb +48 -0
  62. data/spec/models/job_spec.rb +74 -0
  63. data/spec/models/jobs_collection_spec.rb +66 -0
  64. data/spec/models/media_spec.rb +54 -0
  65. data/spec/models/options_spec.rb +36 -0
  66. data/spec/models/project_spec.rb +70 -0
  67. data/spec/models/proxy_spec.rb +66 -0
  68. data/spec/models/upload_session_spec.rb +72 -0
  69. data/spec/models/video_stream_spec.rb +72 -0
  70. data/spec/models/video_upload_body_spec.rb +66 -0
  71. data/spec/spec_helper.rb +111 -0
  72. data/telestream_cloud_qc.gemspec +47 -0
  73. metadata +336 -0
@@ -0,0 +1,179 @@
1
+ =begin
2
+ #Qc API
3
+
4
+ #QC API
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: cloudsupport@telestream.net
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TelestreamCloud::Qc
16
+ # JSON with specific options
17
+ class Options
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.swagger_types
27
+ {
28
+ }
29
+ end
30
+
31
+ # Initializes the object
32
+ # @param [Hash] attributes Model attributes in the form of hash
33
+ def initialize(attributes = {})
34
+ return unless attributes.is_a?(Hash)
35
+
36
+ # convert string to symbol for hash key
37
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
38
+
39
+ end
40
+
41
+ # Show invalid properties with the reasons. Usually used together with valid?
42
+ # @return Array for valid properties with the reasons
43
+ def list_invalid_properties
44
+ invalid_properties = Array.new
45
+ return invalid_properties
46
+ end
47
+
48
+ # Check to see if the all the properties in the model are valid
49
+ # @return true if the model is valid
50
+ def valid?
51
+ return true
52
+ end
53
+
54
+ # Checks equality by comparing each attribute.
55
+ # @param [Object] Object to be compared
56
+ def ==(o)
57
+ return true if self.equal?(o)
58
+ self.class == o.class
59
+ end
60
+
61
+ # @see the `==` method
62
+ # @param [Object] Object to be compared
63
+ def eql?(o)
64
+ self == o
65
+ end
66
+
67
+ # Calculates hash code according to all attributes.
68
+ # @return [Fixnum] Hash code
69
+ def hash
70
+ [].hash
71
+ end
72
+
73
+ # Builds the object from hash
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ # @return [Object] Returns the model itself
76
+ def build_from_hash(attributes)
77
+ return nil unless attributes.is_a?(Hash)
78
+ self.class.swagger_types.each_pair do |key, type|
79
+ if type =~ /\AArray<(.*)>/i
80
+ # check to ensure the input is an array given that the the attribute
81
+ # is documented as an array but the input is not
82
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
83
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
84
+ end
85
+ elsif !attributes[self.class.attribute_map[key]].nil?
86
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
87
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
88
+ end
89
+
90
+ self
91
+ end
92
+
93
+ # Deserializes the data based on type
94
+ # @param string type Data type
95
+ # @param string value Value to be deserialized
96
+ # @return [Object] Deserialized data
97
+ def _deserialize(type, value)
98
+ case type.to_sym
99
+ when :DateTime
100
+ DateTime.parse(value)
101
+ when :Date
102
+ Date.parse(value)
103
+ when :String
104
+ value.to_s
105
+ when :Integer
106
+ value.to_i
107
+ when :Float
108
+ value.to_f
109
+ when :BOOLEAN
110
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
111
+ true
112
+ else
113
+ false
114
+ end
115
+ when :Object
116
+ # generic object (usually a Hash), return directly
117
+ value
118
+ when /\AArray<(?<inner_type>.+)>\z/
119
+ inner_type = Regexp.last_match[:inner_type]
120
+ value.map { |v| _deserialize(inner_type, v) }
121
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
122
+ k_type = Regexp.last_match[:k_type]
123
+ v_type = Regexp.last_match[:v_type]
124
+ {}.tap do |hash|
125
+ value.each do |k, v|
126
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
127
+ end
128
+ end
129
+ else # model
130
+ temp_model = TelestreamCloud::Qc.const_get(type).new
131
+ temp_model.build_from_hash(value)
132
+ end
133
+ end
134
+
135
+ # Returns the string representation of the object
136
+ # @return [String] String presentation of the object
137
+ def to_s
138
+ to_hash.to_s
139
+ end
140
+
141
+ # to_body is an alias to to_hash (backward compatibility)
142
+ # @return [Hash] Returns the object in the form of hash
143
+ def to_body
144
+ to_hash
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ next if value.nil?
154
+ hash[param] = _to_hash(value)
155
+ end
156
+ hash
157
+ end
158
+
159
+ # Outputs non-array value in the form of hash
160
+ # For object, use to_hash. Otherwise, just return the value
161
+ # @param [Object] value Any valid value
162
+ # @return [Hash] Returns the value in the form of hash
163
+ def _to_hash(value)
164
+ if value.is_a?(Array)
165
+ value.compact.map{ |v| _to_hash(v) }
166
+ elsif value.is_a?(Hash)
167
+ {}.tap do |hash|
168
+ value.each { |k, v| hash[k] = _to_hash(v) }
169
+ end
170
+ elsif value.respond_to? :to_hash
171
+ value.to_hash
172
+ else
173
+ value
174
+ end
175
+ end
176
+
177
+ end
178
+
179
+ end
@@ -0,0 +1,262 @@
1
+ =begin
2
+ #Qc API
3
+
4
+ #QC API
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: cloudsupport@telestream.net
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TelestreamCloud::Qc
16
+
17
+ class Project
18
+ # A unique identifier of a Project.
19
+ attr_accessor :id
20
+
21
+ # Human-readable identifier of a Project.
22
+ attr_accessor :name
23
+
24
+ # Project status.
25
+ attr_accessor :status
26
+
27
+ # Name of QC template.
28
+ attr_accessor :template
29
+
30
+ # JSON with specific options
31
+ attr_accessor :options
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'id' => :'id',
59
+ :'name' => :'name',
60
+ :'status' => :'status',
61
+ :'template' => :'template',
62
+ :'options' => :'options'
63
+ }
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.swagger_types
68
+ {
69
+ :'id' => :'String',
70
+ :'name' => :'String',
71
+ :'status' => :'String',
72
+ :'template' => :'String',
73
+ :'options' => :'String'
74
+ }
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ return unless attributes.is_a?(Hash)
81
+
82
+ # convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
84
+
85
+ if attributes.has_key?(:'id')
86
+ self.id = attributes[:'id']
87
+ end
88
+
89
+ if attributes.has_key?(:'name')
90
+ self.name = attributes[:'name']
91
+ end
92
+
93
+ if attributes.has_key?(:'status')
94
+ self.status = attributes[:'status']
95
+ end
96
+
97
+ if attributes.has_key?(:'template')
98
+ self.template = attributes[:'template']
99
+ end
100
+
101
+ if attributes.has_key?(:'options')
102
+ self.options = attributes[:'options']
103
+ end
104
+
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ invalid_properties = Array.new
111
+ return invalid_properties
112
+ end
113
+
114
+ # Check to see if the all the properties in the model are valid
115
+ # @return true if the model is valid
116
+ def valid?
117
+ status_validator = EnumAttributeValidator.new('String', ["active", "pending", "archived", "suspended"])
118
+ return false unless status_validator.valid?(@status)
119
+ return true
120
+ end
121
+
122
+ # Custom attribute writer method checking allowed values (enum).
123
+ # @param [Object] status Object to be assigned
124
+ def status=(status)
125
+ validator = EnumAttributeValidator.new('String', ["active", "pending", "archived", "suspended"])
126
+ unless validator.valid?(status)
127
+ fail ArgumentError, "invalid value for 'status', must be one of #{validator.allowable_values}."
128
+ end
129
+ @status = status
130
+ end
131
+
132
+ # Checks equality by comparing each attribute.
133
+ # @param [Object] Object to be compared
134
+ def ==(o)
135
+ return true if self.equal?(o)
136
+ self.class == o.class &&
137
+ id == o.id &&
138
+ name == o.name &&
139
+ status == o.status &&
140
+ template == o.template &&
141
+ options == o.options
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Fixnum] Hash code
152
+ def hash
153
+ [id, name, status, template, options].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ self.class.swagger_types.each_pair do |key, type|
162
+ if type =~ /\AArray<(.*)>/i
163
+ # check to ensure the input is an array given that the the attribute
164
+ # is documented as an array but the input is not
165
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
166
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
167
+ end
168
+ elsif !attributes[self.class.attribute_map[key]].nil?
169
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
170
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
171
+ end
172
+
173
+ self
174
+ end
175
+
176
+ # Deserializes the data based on type
177
+ # @param string type Data type
178
+ # @param string value Value to be deserialized
179
+ # @return [Object] Deserialized data
180
+ def _deserialize(type, value)
181
+ case type.to_sym
182
+ when :DateTime
183
+ DateTime.parse(value)
184
+ when :Date
185
+ Date.parse(value)
186
+ when :String
187
+ value.to_s
188
+ when :Integer
189
+ value.to_i
190
+ when :Float
191
+ value.to_f
192
+ when :BOOLEAN
193
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
194
+ true
195
+ else
196
+ false
197
+ end
198
+ when :Object
199
+ # generic object (usually a Hash), return directly
200
+ value
201
+ when /\AArray<(?<inner_type>.+)>\z/
202
+ inner_type = Regexp.last_match[:inner_type]
203
+ value.map { |v| _deserialize(inner_type, v) }
204
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
205
+ k_type = Regexp.last_match[:k_type]
206
+ v_type = Regexp.last_match[:v_type]
207
+ {}.tap do |hash|
208
+ value.each do |k, v|
209
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
210
+ end
211
+ end
212
+ else # model
213
+ temp_model = TelestreamCloud::Qc.const_get(type).new
214
+ temp_model.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ next if value.nil?
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ # Outputs non-array value in the form of hash
243
+ # For object, use to_hash. Otherwise, just return the value
244
+ # @param [Object] value Any valid value
245
+ # @return [Hash] Returns the value in the form of hash
246
+ def _to_hash(value)
247
+ if value.is_a?(Array)
248
+ value.compact.map{ |v| _to_hash(v) }
249
+ elsif value.is_a?(Hash)
250
+ {}.tap do |hash|
251
+ value.each { |k, v| hash[k] = _to_hash(v) }
252
+ end
253
+ elsif value.respond_to? :to_hash
254
+ value.to_hash
255
+ else
256
+ value
257
+ end
258
+ end
259
+
260
+ end
261
+
262
+ end
@@ -0,0 +1,224 @@
1
+ =begin
2
+ #Qc API
3
+
4
+ #QC API
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: cloudsupport@telestream.net
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.3.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TelestreamCloud::Qc
16
+
17
+ class Proxy
18
+ attr_accessor :status
19
+
20
+ attr_accessor :progress
21
+
22
+ attr_accessor :url
23
+
24
+ attr_accessor :id
25
+
26
+ attr_accessor :updated_at
27
+
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'status' => :'status',
33
+ :'progress' => :'progress',
34
+ :'url' => :'url',
35
+ :'id' => :'id',
36
+ :'updated_at' => :'updated_at'
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ :'status' => :'String',
44
+ :'progress' => :'Integer',
45
+ :'url' => :'String',
46
+ :'id' => :'String',
47
+ :'updated_at' => :'String'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
58
+
59
+ if attributes.has_key?(:'status')
60
+ self.status = attributes[:'status']
61
+ end
62
+
63
+ if attributes.has_key?(:'progress')
64
+ self.progress = attributes[:'progress']
65
+ end
66
+
67
+ if attributes.has_key?(:'url')
68
+ self.url = attributes[:'url']
69
+ end
70
+
71
+ if attributes.has_key?(:'id')
72
+ self.id = attributes[:'id']
73
+ end
74
+
75
+ if attributes.has_key?(:'updated_at')
76
+ self.updated_at = attributes[:'updated_at']
77
+ end
78
+
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ return invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ return true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ status == o.status &&
100
+ progress == o.progress &&
101
+ url == o.url &&
102
+ id == o.id &&
103
+ updated_at == o.updated_at
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [status, progress, url, id, updated_at].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = TelestreamCloud::Qc.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map{ |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+
224
+ end