Class: TelestreamCloud::Flip::FactoryBody

Inherits:
Object
  • Object
show all
Defined in:
lib/telestream_cloud_flip/models/factory_body.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ FactoryBody

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 131

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'aws_access_key')
    self.aws_access_key = attributes[:'aws_access_key']
  end

  if attributes.has_key?(:'aws_secret_key')
    self.aws_secret_key = attributes[:'aws_secret_key']
  end

  if attributes.has_key?(:'factory_region')
    self.factory_region = attributes[:'factory_region']
  end

  if attributes.has_key?(:'input_bucket_file_pattern')
    self.input_bucket_file_pattern = attributes[:'input_bucket_file_pattern']
  end

  if attributes.has_key?(:'input_bucket_name')
    self.input_bucket_name = attributes[:'input_bucket_name']
  end

  if attributes.has_key?(:'input_bucket_recursive')
    self.input_bucket_recursive = attributes[:'input_bucket_recursive']
  end

  if attributes.has_key?(:'input_bucket_sync_every_n_min')
    self.input_bucket_sync_every_n_min = attributes[:'input_bucket_sync_every_n_min']
  end

  if attributes.has_key?(:'input_bucket_watch')
    self.input_bucket_watch = attributes[:'input_bucket_watch']
  end

  if attributes.has_key?(:'name')
    self.name = attributes[:'name']
  end

  if attributes.has_key?(:'outputs_path_format')
    self.outputs_path_format = attributes[:'outputs_path_format']
  end

  if attributes.has_key?(:'provider_specific_settings')
    self.provider_specific_settings = attributes[:'provider_specific_settings']
  end

  if attributes.has_key?(:'acl')
    self.acl = attributes[:'acl']
  end

  if attributes.has_key?(:'output_bucket_name')
    self.output_bucket_name = attributes[:'output_bucket_name']
  end

  if attributes.has_key?(:'server_side_encryption')
    self.server_side_encryption = attributes[:'server_side_encryption']
  end

  if attributes.has_key?(:'storage_credential_attributes')
    self.storage_credential_attributes = attributes[:'storage_credential_attributes']
  end

  if attributes.has_key?(:'storage_provider')
    self.storage_provider = attributes[:'storage_provider']
  end

end

Instance Attribute Details

#aclObject

Specify if your files are public or private (private files need authorization url to access). By default this is not set.



50
51
52
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 50

def acl
  @acl
end

#aws_access_keyObject

AWS access key.



19
20
21
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 19

def aws_access_key
  @aws_access_key
end

#aws_secret_keyObject

AWS secret key.



22
23
24
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 22

def aws_secret_key
  @aws_secret_key
end

#factory_regionObject

A region where the factory is located.



25
26
27
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 25

def factory_region
  @factory_region
end

#input_bucket_file_patternObject

A pattern that will be used to locate files in the input bucket. Valid wildcards might be used.



28
29
30
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 28

def input_bucket_file_pattern
  @input_bucket_file_pattern
end

#input_bucket_nameObject

A name of an input bucket.



31
32
33
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 31

def input_bucket_name
  @input_bucket_name
end

#input_bucket_recursiveObject

Returns the value of attribute input_bucket_recursive.



33
34
35
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 33

def input_bucket_recursive
  @input_bucket_recursive
end

#input_bucket_sync_every_n_minObject

Determines how often the input bucket is synchronised.



36
37
38
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 36

def input_bucket_sync_every_n_min
  @input_bucket_sync_every_n_min
end

#input_bucket_watchObject

Determines whether the Factory should be notified about new files added to the input bucket.



39
40
41
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 39

def input_bucket_watch
  @input_bucket_watch
end

#nameObject

Name of the Factory.



42
43
44
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 42

def name
  @name
end

#output_bucket_nameObject

A bucket where processed files will be stored.



53
54
55
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 53

def output_bucket_name
  @output_bucket_name
end

#outputs_path_formatObject

Specify the directory where the output files should be stored. By default it is not set. More info [here](cloud.telestream.net/docs#path-format—know-how).



45
46
47
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 45

def outputs_path_format
  @outputs_path_format
end

#provider_specific_settingsObject

Returns the value of attribute provider_specific_settings.



47
48
49
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 47

def provider_specific_settings
  @provider_specific_settings
end

#server_side_encryptionObject

Specify if you want to use multi-factor server-side 256-bit AES-256 data encryption with Amazon S3-managed encryption keys (SSE-S3). Each object is encrypted using a unique key which as an additional safeguard is encrypted itself with a master key that S3 regularly rotates. By default this is not set.



56
57
58
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 56

def server_side_encryption
  @server_side_encryption
end

#storage_credential_attributesObject

Returns the value of attribute storage_credential_attributes.



58
59
60
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 58

def storage_credential_attributes
  @storage_credential_attributes
end

#storage_providerObject

Specifies which storage provider the factory should use. Available options: S3: 0, Google Cloud Storage: 1, FTP storage: 2, Google Cloud Interoperability Storage: 5, Flip storage: 7, FASP storage: 8, Azure Blob Storage: 9



61
62
63
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 61

def storage_provider
  @storage_provider
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 86

def self.attribute_map
  {
    :'aws_access_key' => :'aws_access_key',
    :'aws_secret_key' => :'aws_secret_key',
    :'factory_region' => :'factory_region',
    :'input_bucket_file_pattern' => :'input_bucket_file_pattern',
    :'input_bucket_name' => :'input_bucket_name',
    :'input_bucket_recursive' => :'input_bucket_recursive',
    :'input_bucket_sync_every_n_min' => :'input_bucket_sync_every_n_min',
    :'input_bucket_watch' => :'input_bucket_watch',
    :'name' => :'name',
    :'outputs_path_format' => :'outputs_path_format',
    :'provider_specific_settings' => :'provider_specific_settings',
    :'acl' => :'acl',
    :'output_bucket_name' => :'output_bucket_name',
    :'server_side_encryption' => :'server_side_encryption',
    :'storage_credential_attributes' => :'storage_credential_attributes',
    :'storage_provider' => :'storage_provider'
  }
end

.swagger_typesObject

Attribute type mapping.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 108

def self.swagger_types
  {
    :'aws_access_key' => :'String',
    :'aws_secret_key' => :'String',
    :'factory_region' => :'String',
    :'input_bucket_file_pattern' => :'String',
    :'input_bucket_name' => :'String',
    :'input_bucket_recursive' => :'BOOLEAN',
    :'input_bucket_sync_every_n_min' => :'Integer',
    :'input_bucket_watch' => :'BOOLEAN',
    :'name' => :'String',
    :'outputs_path_format' => :'String',
    :'provider_specific_settings' => :'Object',
    :'acl' => :'String',
    :'output_bucket_name' => :'String',
    :'server_side_encryption' => :'BOOLEAN',
    :'storage_credential_attributes' => :'FactoryBodyStorageCredentialAttributes',
    :'storage_provider' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 235

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      aws_access_key == o.aws_access_key &&
      aws_secret_key == o.aws_secret_key &&
      factory_region == o.factory_region &&
      input_bucket_file_pattern == o.input_bucket_file_pattern &&
      input_bucket_name == o.input_bucket_name &&
      input_bucket_recursive == o.input_bucket_recursive &&
      input_bucket_sync_every_n_min == o.input_bucket_sync_every_n_min &&
      input_bucket_watch == o.input_bucket_watch &&
      name == o.name &&
      outputs_path_format == o.outputs_path_format &&
      provider_specific_settings == o.provider_specific_settings &&
      acl == o.acl &&
      output_bucket_name == o.output_bucket_name &&
      server_side_encryption == o.server_side_encryption &&
      storage_credential_attributes == o.storage_credential_attributes &&
      storage_provider == o.storage_provider
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 292

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :BOOLEAN
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    temp_model = TelestreamCloud::Flip.const_get(type).new
    temp_model.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



358
359
360
361
362
363
364
365
366
367
368
369
370
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 358

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map{ |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 271

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


258
259
260
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 258

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



264
265
266
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 264

def hash
  [aws_access_key, aws_secret_key, factory_region, input_bucket_file_pattern, input_bucket_name, input_bucket_recursive, input_bucket_sync_every_n_min, input_bucket_watch, name, outputs_path_format, provider_specific_settings, acl, output_bucket_name, server_side_encryption, storage_credential_attributes, storage_provider].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



205
206
207
208
209
210
211
212
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 205

def list_invalid_properties
  invalid_properties = Array.new
  if @name.nil?
    invalid_properties.push("invalid value for 'name', name cannot be nil.")
  end

  return invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



338
339
340
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 338

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



344
345
346
347
348
349
350
351
352
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 344

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



332
333
334
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 332

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



216
217
218
219
220
221
# File 'lib/telestream_cloud_flip/models/factory_body.rb', line 216

def valid?
  return false if @name.nil?
  acl_validator = EnumAttributeValidator.new('String', ["public", "private"])
  return false unless acl_validator.valid?(@acl)
  return true
end