telestream_cloud_flip 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +130 -0
- data/Rakefile +8 -0
- data/docs/CanceledResponse.md +8 -0
- data/docs/CloudNotificationSettings.md +11 -0
- data/docs/CloudNotificationSettingsEvents.md +11 -0
- data/docs/CopyProfileBody.md +9 -0
- data/docs/CountResponse.md +8 -0
- data/docs/CreateEncodingBody.md +10 -0
- data/docs/CreateVideoBody.md +12 -0
- data/docs/DeletedResponse.md +8 -0
- data/docs/Encoding.md +38 -0
- data/docs/EncodingSignedUrl.md +8 -0
- data/docs/EncodingSignedUrls.md +8 -0
- data/docs/Error.md +9 -0
- data/docs/ExtraFile.md +10 -0
- data/docs/Factory.md +25 -0
- data/docs/FactoryBody.md +23 -0
- data/docs/FactoryBodyStorageCredentialAttributes.md +11 -0
- data/docs/FactorySync.md +8 -0
- data/docs/FactorySyncBody.md +8 -0
- data/docs/FlipApi.md +2179 -0
- data/docs/PaginatedEncodingsCollection.md +11 -0
- data/docs/PaginatedFactoryCollection.md +11 -0
- data/docs/PaginatedProfilesCollection.md +11 -0
- data/docs/PaginatedVideoCollection.md +11 -0
- data/docs/PaginatedWorkflowsCollection.md +11 -0
- data/docs/Profile.md +135 -0
- data/docs/ProfileBody.md +137 -0
- data/docs/ResubmitVideoBody.md +8 -0
- data/docs/RetriedResponse.md +8 -0
- data/docs/SignedVideoUrl.md +8 -0
- data/docs/UpdateEncodingBody.md +9 -0
- data/docs/UploadSession.md +13 -0
- data/docs/Video.md +31 -0
- data/docs/VideoMetadata.md +7 -0
- data/docs/VideoUploadBody.md +24 -0
- data/git_push.sh +55 -0
- data/lib/telestream_cloud_flip/api/flip_api.rb +2385 -0
- data/lib/telestream_cloud_flip/api_client.rb +389 -0
- data/lib/telestream_cloud_flip/api_error.rb +38 -0
- data/lib/telestream_cloud_flip/configuration.rb +209 -0
- data/lib/telestream_cloud_flip/models/canceled_response.rb +189 -0
- data/lib/telestream_cloud_flip/models/cloud_notification_settings.rb +237 -0
- data/lib/telestream_cloud_flip/models/cloud_notification_settings_events.rb +239 -0
- data/lib/telestream_cloud_flip/models/copy_profile_body.rb +209 -0
- data/lib/telestream_cloud_flip/models/count_response.rb +189 -0
- data/lib/telestream_cloud_flip/models/create_encoding_body.rb +214 -0
- data/lib/telestream_cloud_flip/models/create_video_body.rb +231 -0
- data/lib/telestream_cloud_flip/models/deleted_response.rb +189 -0
- data/lib/telestream_cloud_flip/models/encoding.rb +486 -0
- data/lib/telestream_cloud_flip/models/encoding_signed_url.rb +189 -0
- data/lib/telestream_cloud_flip/models/encoding_signed_urls.rb +191 -0
- data/lib/telestream_cloud_flip/models/error.rb +199 -0
- data/lib/telestream_cloud_flip/models/extra_file.rb +221 -0
- data/lib/telestream_cloud_flip/models/factory.rb +388 -0
- data/lib/telestream_cloud_flip/models/factory_body.rb +374 -0
- data/lib/telestream_cloud_flip/models/factory_body_storage_credential_attributes.rb +215 -0
- data/lib/telestream_cloud_flip/models/factory_sync.rb +222 -0
- data/lib/telestream_cloud_flip/models/factory_sync_body.rb +227 -0
- data/lib/telestream_cloud_flip/models/paginated_encodings_collection.rb +240 -0
- data/lib/telestream_cloud_flip/models/paginated_factory_collection.rb +220 -0
- data/lib/telestream_cloud_flip/models/paginated_profiles_collection.rb +220 -0
- data/lib/telestream_cloud_flip/models/paginated_video_collection.rb +220 -0
- data/lib/telestream_cloud_flip/models/paginated_workflows_collection.rb +220 -0
- data/lib/telestream_cloud_flip/models/profile.rb +1777 -0
- data/lib/telestream_cloud_flip/models/profile_body.rb +1762 -0
- data/lib/telestream_cloud_flip/models/resubmit_video_body.rb +189 -0
- data/lib/telestream_cloud_flip/models/retried_response.rb +189 -0
- data/lib/telestream_cloud_flip/models/signed_video_url.rb +189 -0
- data/lib/telestream_cloud_flip/models/update_encoding_body.rb +199 -0
- data/lib/telestream_cloud_flip/models/upload_session.rb +249 -0
- data/lib/telestream_cloud_flip/models/video.rb +418 -0
- data/lib/telestream_cloud_flip/models/video_metadata.rb +179 -0
- data/lib/telestream_cloud_flip/models/video_upload_body.rb +362 -0
- data/lib/telestream_cloud_flip/uploader.rb +244 -0
- data/lib/telestream_cloud_flip/version.rb +18 -0
- data/lib/telestream_cloud_flip.rb +79 -0
- data/spec/api/flip_api_spec.rb +550 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/canceled_response_spec.rb +42 -0
- data/spec/models/cloud_notification_settings_events_spec.rb +60 -0
- data/spec/models/cloud_notification_settings_spec.rb +60 -0
- data/spec/models/copy_profile_body_spec.rb +48 -0
- data/spec/models/count_response_spec.rb +42 -0
- data/spec/models/create_encoding_body_spec.rb +54 -0
- data/spec/models/create_video_body_spec.rb +66 -0
- data/spec/models/deleted_response_spec.rb +42 -0
- data/spec/models/encoding_signed_url_spec.rb +42 -0
- data/spec/models/encoding_signed_urls_spec.rb +42 -0
- data/spec/models/encoding_spec.rb +222 -0
- data/spec/models/error_spec.rb +48 -0
- data/spec/models/extra_file_spec.rb +54 -0
- data/spec/models/factory_body_spec.rb +136 -0
- data/spec/models/factory_body_storage_credential_attributes_spec.rb +60 -0
- data/spec/models/factory_spec.rb +148 -0
- data/spec/models/factory_sync_body_spec.rb +46 -0
- data/spec/models/factory_sync_spec.rb +46 -0
- data/spec/models/paginated_encodings_collection_spec.rb +60 -0
- data/spec/models/paginated_factory_collection_spec.rb +60 -0
- data/spec/models/paginated_profiles_collection_spec.rb +60 -0
- data/spec/models/paginated_video_collection_spec.rb +60 -0
- data/spec/models/paginated_workflows_collection_spec.rb +60 -0
- data/spec/models/profile_body_spec.rb +916 -0
- data/spec/models/profile_spec.rb +916 -0
- data/spec/models/resubmit_video_body_spec.rb +42 -0
- data/spec/models/retried_response_spec.rb +42 -0
- data/spec/models/signed_video_url_spec.rb +42 -0
- data/spec/models/update_encoding_body_spec.rb +48 -0
- data/spec/models/upload_session_spec.rb +72 -0
- data/spec/models/video_metadata_spec.rb +36 -0
- data/spec/models/video_spec.rb +180 -0
- data/spec/models/video_upload_body_spec.rb +138 -0
- data/spec/spec_helper.rb +111 -0
- data/telestream_cloud_flip.gemspec +47 -0
- metadata +396 -0
@@ -0,0 +1,189 @@
|
|
1
|
+
=begin
|
2
|
+
#Flip API
|
3
|
+
|
4
|
+
#Description
|
5
|
+
|
6
|
+
OpenAPI spec version: 3.1.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::Flip
|
16
|
+
|
17
|
+
class CanceledResponse
|
18
|
+
# Informs whether an action has been canceled successfully.
|
19
|
+
attr_accessor :canceled
|
20
|
+
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'canceled' => :'canceled'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'canceled' => :'BOOLEAN'
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Initializes the object
|
37
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
38
|
+
def initialize(attributes = {})
|
39
|
+
return unless attributes.is_a?(Hash)
|
40
|
+
|
41
|
+
# convert string to symbol for hash key
|
42
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
43
|
+
|
44
|
+
if attributes.has_key?(:'canceled')
|
45
|
+
self.canceled = attributes[:'canceled']
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
51
|
+
# @return Array for valid properties with the reasons
|
52
|
+
def list_invalid_properties
|
53
|
+
invalid_properties = Array.new
|
54
|
+
return invalid_properties
|
55
|
+
end
|
56
|
+
|
57
|
+
# Check to see if the all the properties in the model are valid
|
58
|
+
# @return true if the model is valid
|
59
|
+
def valid?
|
60
|
+
return true
|
61
|
+
end
|
62
|
+
|
63
|
+
# Checks equality by comparing each attribute.
|
64
|
+
# @param [Object] Object to be compared
|
65
|
+
def ==(o)
|
66
|
+
return true if self.equal?(o)
|
67
|
+
self.class == o.class &&
|
68
|
+
canceled == o.canceled
|
69
|
+
end
|
70
|
+
|
71
|
+
# @see the `==` method
|
72
|
+
# @param [Object] Object to be compared
|
73
|
+
def eql?(o)
|
74
|
+
self == o
|
75
|
+
end
|
76
|
+
|
77
|
+
# Calculates hash code according to all attributes.
|
78
|
+
# @return [Fixnum] Hash code
|
79
|
+
def hash
|
80
|
+
[canceled].hash
|
81
|
+
end
|
82
|
+
|
83
|
+
# Builds the object from hash
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
# @return [Object] Returns the model itself
|
86
|
+
def build_from_hash(attributes)
|
87
|
+
return nil unless attributes.is_a?(Hash)
|
88
|
+
self.class.swagger_types.each_pair do |key, type|
|
89
|
+
if type =~ /\AArray<(.*)>/i
|
90
|
+
# check to ensure the input is an array given that the the attribute
|
91
|
+
# is documented as an array but the input is not
|
92
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
93
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
94
|
+
end
|
95
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
96
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
97
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
98
|
+
end
|
99
|
+
|
100
|
+
self
|
101
|
+
end
|
102
|
+
|
103
|
+
# Deserializes the data based on type
|
104
|
+
# @param string type Data type
|
105
|
+
# @param string value Value to be deserialized
|
106
|
+
# @return [Object] Deserialized data
|
107
|
+
def _deserialize(type, value)
|
108
|
+
case type.to_sym
|
109
|
+
when :DateTime
|
110
|
+
DateTime.parse(value)
|
111
|
+
when :Date
|
112
|
+
Date.parse(value)
|
113
|
+
when :String
|
114
|
+
value.to_s
|
115
|
+
when :Integer
|
116
|
+
value.to_i
|
117
|
+
when :Float
|
118
|
+
value.to_f
|
119
|
+
when :BOOLEAN
|
120
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
121
|
+
true
|
122
|
+
else
|
123
|
+
false
|
124
|
+
end
|
125
|
+
when :Object
|
126
|
+
# generic object (usually a Hash), return directly
|
127
|
+
value
|
128
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
129
|
+
inner_type = Regexp.last_match[:inner_type]
|
130
|
+
value.map { |v| _deserialize(inner_type, v) }
|
131
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
132
|
+
k_type = Regexp.last_match[:k_type]
|
133
|
+
v_type = Regexp.last_match[:v_type]
|
134
|
+
{}.tap do |hash|
|
135
|
+
value.each do |k, v|
|
136
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
137
|
+
end
|
138
|
+
end
|
139
|
+
else # model
|
140
|
+
temp_model = TelestreamCloud::Flip.const_get(type).new
|
141
|
+
temp_model.build_from_hash(value)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# Returns the string representation of the object
|
146
|
+
# @return [String] String presentation of the object
|
147
|
+
def to_s
|
148
|
+
to_hash.to_s
|
149
|
+
end
|
150
|
+
|
151
|
+
# to_body is an alias to to_hash (backward compatibility)
|
152
|
+
# @return [Hash] Returns the object in the form of hash
|
153
|
+
def to_body
|
154
|
+
to_hash
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the object in the form of hash
|
158
|
+
# @return [Hash] Returns the object in the form of hash
|
159
|
+
def to_hash
|
160
|
+
hash = {}
|
161
|
+
self.class.attribute_map.each_pair do |attr, param|
|
162
|
+
value = self.send(attr)
|
163
|
+
next if value.nil?
|
164
|
+
hash[param] = _to_hash(value)
|
165
|
+
end
|
166
|
+
hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Outputs non-array value in the form of hash
|
170
|
+
# For object, use to_hash. Otherwise, just return the value
|
171
|
+
# @param [Object] value Any valid value
|
172
|
+
# @return [Hash] Returns the value in the form of hash
|
173
|
+
def _to_hash(value)
|
174
|
+
if value.is_a?(Array)
|
175
|
+
value.compact.map{ |v| _to_hash(v) }
|
176
|
+
elsif value.is_a?(Hash)
|
177
|
+
{}.tap do |hash|
|
178
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
179
|
+
end
|
180
|
+
elsif value.respond_to? :to_hash
|
181
|
+
value.to_hash
|
182
|
+
else
|
183
|
+
value
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
end
|
188
|
+
|
189
|
+
end
|
@@ -0,0 +1,237 @@
|
|
1
|
+
=begin
|
2
|
+
#Flip API
|
3
|
+
|
4
|
+
#Description
|
5
|
+
|
6
|
+
OpenAPI spec version: 3.1.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::Flip
|
16
|
+
|
17
|
+
class CloudNotificationSettings
|
18
|
+
# Notifications will be sent to this endpoint.
|
19
|
+
attr_accessor :url
|
20
|
+
|
21
|
+
attr_accessor :delay
|
22
|
+
|
23
|
+
# Determines whether a video payload will be included in notification messages.
|
24
|
+
attr_accessor :send_video_payload
|
25
|
+
|
26
|
+
attr_accessor :events
|
27
|
+
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'url' => :'url',
|
33
|
+
:'delay' => :'delay',
|
34
|
+
:'send_video_payload' => :'send_video_payload',
|
35
|
+
:'events' => :'events'
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.swagger_types
|
41
|
+
{
|
42
|
+
:'url' => :'String',
|
43
|
+
:'delay' => :'Integer',
|
44
|
+
:'send_video_payload' => :'BOOLEAN',
|
45
|
+
:'events' => :'CloudNotificationSettingsEvents'
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
return unless attributes.is_a?(Hash)
|
53
|
+
|
54
|
+
# convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
56
|
+
|
57
|
+
if attributes.has_key?(:'url')
|
58
|
+
self.url = attributes[:'url']
|
59
|
+
end
|
60
|
+
|
61
|
+
if attributes.has_key?(:'delay')
|
62
|
+
self.delay = attributes[:'delay']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.has_key?(:'send_video_payload')
|
66
|
+
self.send_video_payload = attributes[:'send_video_payload']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.has_key?(:'events')
|
70
|
+
self.events = attributes[:'events']
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
76
|
+
# @return Array for valid properties with the reasons
|
77
|
+
def list_invalid_properties
|
78
|
+
invalid_properties = Array.new
|
79
|
+
if @url.nil?
|
80
|
+
invalid_properties.push("invalid value for 'url', url cannot be nil.")
|
81
|
+
end
|
82
|
+
|
83
|
+
if @delay.nil?
|
84
|
+
invalid_properties.push("invalid value for 'delay', delay cannot be nil.")
|
85
|
+
end
|
86
|
+
|
87
|
+
if @send_video_payload.nil?
|
88
|
+
invalid_properties.push("invalid value for 'send_video_payload', send_video_payload cannot be nil.")
|
89
|
+
end
|
90
|
+
|
91
|
+
if @events.nil?
|
92
|
+
invalid_properties.push("invalid value for 'events', events cannot be nil.")
|
93
|
+
end
|
94
|
+
|
95
|
+
return invalid_properties
|
96
|
+
end
|
97
|
+
|
98
|
+
# Check to see if the all the properties in the model are valid
|
99
|
+
# @return true if the model is valid
|
100
|
+
def valid?
|
101
|
+
return false if @url.nil?
|
102
|
+
return false if @delay.nil?
|
103
|
+
return false if @send_video_payload.nil?
|
104
|
+
return false if @events.nil?
|
105
|
+
return true
|
106
|
+
end
|
107
|
+
|
108
|
+
# Checks equality by comparing each attribute.
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def ==(o)
|
111
|
+
return true if self.equal?(o)
|
112
|
+
self.class == o.class &&
|
113
|
+
url == o.url &&
|
114
|
+
delay == o.delay &&
|
115
|
+
send_video_payload == o.send_video_payload &&
|
116
|
+
events == o.events
|
117
|
+
end
|
118
|
+
|
119
|
+
# @see the `==` method
|
120
|
+
# @param [Object] Object to be compared
|
121
|
+
def eql?(o)
|
122
|
+
self == o
|
123
|
+
end
|
124
|
+
|
125
|
+
# Calculates hash code according to all attributes.
|
126
|
+
# @return [Fixnum] Hash code
|
127
|
+
def hash
|
128
|
+
[url, delay, send_video_payload, events].hash
|
129
|
+
end
|
130
|
+
|
131
|
+
# Builds the object from hash
|
132
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
133
|
+
# @return [Object] Returns the model itself
|
134
|
+
def build_from_hash(attributes)
|
135
|
+
return nil unless attributes.is_a?(Hash)
|
136
|
+
self.class.swagger_types.each_pair do |key, type|
|
137
|
+
if type =~ /\AArray<(.*)>/i
|
138
|
+
# check to ensure the input is an array given that the the attribute
|
139
|
+
# is documented as an array but the input is not
|
140
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
141
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
142
|
+
end
|
143
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
144
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
145
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
146
|
+
end
|
147
|
+
|
148
|
+
self
|
149
|
+
end
|
150
|
+
|
151
|
+
# Deserializes the data based on type
|
152
|
+
# @param string type Data type
|
153
|
+
# @param string value Value to be deserialized
|
154
|
+
# @return [Object] Deserialized data
|
155
|
+
def _deserialize(type, value)
|
156
|
+
case type.to_sym
|
157
|
+
when :DateTime
|
158
|
+
DateTime.parse(value)
|
159
|
+
when :Date
|
160
|
+
Date.parse(value)
|
161
|
+
when :String
|
162
|
+
value.to_s
|
163
|
+
when :Integer
|
164
|
+
value.to_i
|
165
|
+
when :Float
|
166
|
+
value.to_f
|
167
|
+
when :BOOLEAN
|
168
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
169
|
+
true
|
170
|
+
else
|
171
|
+
false
|
172
|
+
end
|
173
|
+
when :Object
|
174
|
+
# generic object (usually a Hash), return directly
|
175
|
+
value
|
176
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
177
|
+
inner_type = Regexp.last_match[:inner_type]
|
178
|
+
value.map { |v| _deserialize(inner_type, v) }
|
179
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
180
|
+
k_type = Regexp.last_match[:k_type]
|
181
|
+
v_type = Regexp.last_match[:v_type]
|
182
|
+
{}.tap do |hash|
|
183
|
+
value.each do |k, v|
|
184
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
else # model
|
188
|
+
temp_model = TelestreamCloud::Flip.const_get(type).new
|
189
|
+
temp_model.build_from_hash(value)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the string representation of the object
|
194
|
+
# @return [String] String presentation of the object
|
195
|
+
def to_s
|
196
|
+
to_hash.to_s
|
197
|
+
end
|
198
|
+
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
201
|
+
def to_body
|
202
|
+
to_hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Returns the object in the form of hash
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
207
|
+
def to_hash
|
208
|
+
hash = {}
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
210
|
+
value = self.send(attr)
|
211
|
+
next if value.nil?
|
212
|
+
hash[param] = _to_hash(value)
|
213
|
+
end
|
214
|
+
hash
|
215
|
+
end
|
216
|
+
|
217
|
+
# Outputs non-array value in the form of hash
|
218
|
+
# For object, use to_hash. Otherwise, just return the value
|
219
|
+
# @param [Object] value Any valid value
|
220
|
+
# @return [Hash] Returns the value in the form of hash
|
221
|
+
def _to_hash(value)
|
222
|
+
if value.is_a?(Array)
|
223
|
+
value.compact.map{ |v| _to_hash(v) }
|
224
|
+
elsif value.is_a?(Hash)
|
225
|
+
{}.tap do |hash|
|
226
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
227
|
+
end
|
228
|
+
elsif value.respond_to? :to_hash
|
229
|
+
value.to_hash
|
230
|
+
else
|
231
|
+
value
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
@@ -0,0 +1,239 @@
|
|
1
|
+
=begin
|
2
|
+
#Flip API
|
3
|
+
|
4
|
+
#Description
|
5
|
+
|
6
|
+
OpenAPI spec version: 3.1.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::Flip
|
16
|
+
|
17
|
+
class CloudNotificationSettingsEvents
|
18
|
+
# If set to `true`, a notification will be sent after an encoding becomes complete.
|
19
|
+
attr_accessor :encoding_completed
|
20
|
+
|
21
|
+
# If set to `true`, a notification will be sent after an encoding's progess changes.
|
22
|
+
attr_accessor :encoding_progress
|
23
|
+
|
24
|
+
# If set to `true`, a notification will be sent after a video is created.
|
25
|
+
attr_accessor :video_created
|
26
|
+
|
27
|
+
# If set to `true`, a notification will be sent after a video is encoded.
|
28
|
+
attr_accessor :video_encoded
|
29
|
+
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'encoding_completed' => :'encoding_completed',
|
35
|
+
:'encoding_progress' => :'encoding_progress',
|
36
|
+
:'video_created' => :'video_created',
|
37
|
+
:'video_encoded' => :'video_encoded'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Attribute type mapping.
|
42
|
+
def self.swagger_types
|
43
|
+
{
|
44
|
+
:'encoding_completed' => :'BOOLEAN',
|
45
|
+
:'encoding_progress' => :'BOOLEAN',
|
46
|
+
:'video_created' => :'BOOLEAN',
|
47
|
+
:'video_encoded' => :'BOOLEAN'
|
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?(:'encoding_completed')
|
60
|
+
self.encoding_completed = attributes[:'encoding_completed']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.has_key?(:'encoding_progress')
|
64
|
+
self.encoding_progress = attributes[:'encoding_progress']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'video_created')
|
68
|
+
self.video_created = attributes[:'video_created']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'video_encoded')
|
72
|
+
self.video_encoded = attributes[:'video_encoded']
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
78
|
+
# @return Array for valid properties with the reasons
|
79
|
+
def list_invalid_properties
|
80
|
+
invalid_properties = Array.new
|
81
|
+
if @encoding_completed.nil?
|
82
|
+
invalid_properties.push("invalid value for 'encoding_completed', encoding_completed cannot be nil.")
|
83
|
+
end
|
84
|
+
|
85
|
+
if @encoding_progress.nil?
|
86
|
+
invalid_properties.push("invalid value for 'encoding_progress', encoding_progress cannot be nil.")
|
87
|
+
end
|
88
|
+
|
89
|
+
if @video_created.nil?
|
90
|
+
invalid_properties.push("invalid value for 'video_created', video_created cannot be nil.")
|
91
|
+
end
|
92
|
+
|
93
|
+
if @video_encoded.nil?
|
94
|
+
invalid_properties.push("invalid value for 'video_encoded', video_encoded cannot be nil.")
|
95
|
+
end
|
96
|
+
|
97
|
+
return invalid_properties
|
98
|
+
end
|
99
|
+
|
100
|
+
# Check to see if the all the properties in the model are valid
|
101
|
+
# @return true if the model is valid
|
102
|
+
def valid?
|
103
|
+
return false if @encoding_completed.nil?
|
104
|
+
return false if @encoding_progress.nil?
|
105
|
+
return false if @video_created.nil?
|
106
|
+
return false if @video_encoded.nil?
|
107
|
+
return true
|
108
|
+
end
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def ==(o)
|
113
|
+
return true if self.equal?(o)
|
114
|
+
self.class == o.class &&
|
115
|
+
encoding_completed == o.encoding_completed &&
|
116
|
+
encoding_progress == o.encoding_progress &&
|
117
|
+
video_created == o.video_created &&
|
118
|
+
video_encoded == o.video_encoded
|
119
|
+
end
|
120
|
+
|
121
|
+
# @see the `==` method
|
122
|
+
# @param [Object] Object to be compared
|
123
|
+
def eql?(o)
|
124
|
+
self == o
|
125
|
+
end
|
126
|
+
|
127
|
+
# Calculates hash code according to all attributes.
|
128
|
+
# @return [Fixnum] Hash code
|
129
|
+
def hash
|
130
|
+
[encoding_completed, encoding_progress, video_created, video_encoded].hash
|
131
|
+
end
|
132
|
+
|
133
|
+
# Builds the object from hash
|
134
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
135
|
+
# @return [Object] Returns the model itself
|
136
|
+
def build_from_hash(attributes)
|
137
|
+
return nil unless attributes.is_a?(Hash)
|
138
|
+
self.class.swagger_types.each_pair do |key, type|
|
139
|
+
if type =~ /\AArray<(.*)>/i
|
140
|
+
# check to ensure the input is an array given that the the attribute
|
141
|
+
# is documented as an array but the input is not
|
142
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
143
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
144
|
+
end
|
145
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
146
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
147
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
148
|
+
end
|
149
|
+
|
150
|
+
self
|
151
|
+
end
|
152
|
+
|
153
|
+
# Deserializes the data based on type
|
154
|
+
# @param string type Data type
|
155
|
+
# @param string value Value to be deserialized
|
156
|
+
# @return [Object] Deserialized data
|
157
|
+
def _deserialize(type, value)
|
158
|
+
case type.to_sym
|
159
|
+
when :DateTime
|
160
|
+
DateTime.parse(value)
|
161
|
+
when :Date
|
162
|
+
Date.parse(value)
|
163
|
+
when :String
|
164
|
+
value.to_s
|
165
|
+
when :Integer
|
166
|
+
value.to_i
|
167
|
+
when :Float
|
168
|
+
value.to_f
|
169
|
+
when :BOOLEAN
|
170
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
171
|
+
true
|
172
|
+
else
|
173
|
+
false
|
174
|
+
end
|
175
|
+
when :Object
|
176
|
+
# generic object (usually a Hash), return directly
|
177
|
+
value
|
178
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
179
|
+
inner_type = Regexp.last_match[:inner_type]
|
180
|
+
value.map { |v| _deserialize(inner_type, v) }
|
181
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
182
|
+
k_type = Regexp.last_match[:k_type]
|
183
|
+
v_type = Regexp.last_match[:v_type]
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each do |k, v|
|
186
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
else # model
|
190
|
+
temp_model = TelestreamCloud::Flip.const_get(type).new
|
191
|
+
temp_model.build_from_hash(value)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
# Returns the string representation of the object
|
196
|
+
# @return [String] String presentation of the object
|
197
|
+
def to_s
|
198
|
+
to_hash.to_s
|
199
|
+
end
|
200
|
+
|
201
|
+
# to_body is an alias to to_hash (backward compatibility)
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_body
|
204
|
+
to_hash
|
205
|
+
end
|
206
|
+
|
207
|
+
# Returns the object in the form of hash
|
208
|
+
# @return [Hash] Returns the object in the form of hash
|
209
|
+
def to_hash
|
210
|
+
hash = {}
|
211
|
+
self.class.attribute_map.each_pair do |attr, param|
|
212
|
+
value = self.send(attr)
|
213
|
+
next if value.nil?
|
214
|
+
hash[param] = _to_hash(value)
|
215
|
+
end
|
216
|
+
hash
|
217
|
+
end
|
218
|
+
|
219
|
+
# Outputs non-array value in the form of hash
|
220
|
+
# For object, use to_hash. Otherwise, just return the value
|
221
|
+
# @param [Object] value Any valid value
|
222
|
+
# @return [Hash] Returns the value in the form of hash
|
223
|
+
def _to_hash(value)
|
224
|
+
if value.is_a?(Array)
|
225
|
+
value.compact.map{ |v| _to_hash(v) }
|
226
|
+
elsif value.is_a?(Hash)
|
227
|
+
{}.tap do |hash|
|
228
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
229
|
+
end
|
230
|
+
elsif value.respond_to? :to_hash
|
231
|
+
value.to_hash
|
232
|
+
else
|
233
|
+
value
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|