Class: OCI::MediaServices::Models::MediaAsset

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/media_services/models/media_asset.rb

Overview

Represents the metadata associated with an asset that has been either produced by or registered with Media Services.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
TYPE_ENUM =
[
  TYPE_AUDIO = 'AUDIO'.freeze,
  TYPE_VIDEO = 'VIDEO'.freeze,
  TYPE_PLAYLIST = 'PLAYLIST'.freeze,
  TYPE_IMAGE = 'IMAGE'.freeze,
  TYPE_CAPTION_FILE = 'CAPTION_FILE'.freeze,
  TYPE_UNKNOWN = 'UNKNOWN'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MediaAsset

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/oci/media_services/models/media_asset.rb', line 221

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 }

  self.id = attributes[:'id'] if attributes[:'id']

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

  raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')

  self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']

  self.source_media_workflow_id = attributes[:'sourceMediaWorkflowId'] if attributes[:'sourceMediaWorkflowId']

  raise 'You cannot provide both :sourceMediaWorkflowId and :source_media_workflow_id' if attributes.key?(:'sourceMediaWorkflowId') && attributes.key?(:'source_media_workflow_id')

  self.source_media_workflow_id = attributes[:'source_media_workflow_id'] if attributes[:'source_media_workflow_id']

  self.media_workflow_job_id = attributes[:'mediaWorkflowJobId'] if attributes[:'mediaWorkflowJobId']

  raise 'You cannot provide both :mediaWorkflowJobId and :media_workflow_job_id' if attributes.key?(:'mediaWorkflowJobId') && attributes.key?(:'media_workflow_job_id')

  self.media_workflow_job_id = attributes[:'media_workflow_job_id'] if attributes[:'media_workflow_job_id']

  self.source_media_workflow_version = attributes[:'sourceMediaWorkflowVersion'] if attributes[:'sourceMediaWorkflowVersion']

  raise 'You cannot provide both :sourceMediaWorkflowVersion and :source_media_workflow_version' if attributes.key?(:'sourceMediaWorkflowVersion') && attributes.key?(:'source_media_workflow_version')

  self.source_media_workflow_version = attributes[:'source_media_workflow_version'] if attributes[:'source_media_workflow_version']

  self.display_name = attributes[:'displayName'] if attributes[:'displayName']

  raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')

  self.display_name = attributes[:'display_name'] if attributes[:'display_name']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

  raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')

  self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']

  self.type = attributes[:'type'] if attributes[:'type']

  self.parent_media_asset_id = attributes[:'parentMediaAssetId'] if attributes[:'parentMediaAssetId']

  raise 'You cannot provide both :parentMediaAssetId and :parent_media_asset_id' if attributes.key?(:'parentMediaAssetId') && attributes.key?(:'parent_media_asset_id')

  self.parent_media_asset_id = attributes[:'parent_media_asset_id'] if attributes[:'parent_media_asset_id']

  self.master_media_asset_id = attributes[:'masterMediaAssetId'] if attributes[:'masterMediaAssetId']

  raise 'You cannot provide both :masterMediaAssetId and :master_media_asset_id' if attributes.key?(:'masterMediaAssetId') && attributes.key?(:'master_media_asset_id')

  self.master_media_asset_id = attributes[:'master_media_asset_id'] if attributes[:'master_media_asset_id']

  self.bucket_name = attributes[:'bucketName'] if attributes[:'bucketName']

  raise 'You cannot provide both :bucketName and :bucket_name' if attributes.key?(:'bucketName') && attributes.key?(:'bucket_name')

  self.bucket_name = attributes[:'bucket_name'] if attributes[:'bucket_name']

  self.namespace_name = attributes[:'namespaceName'] if attributes[:'namespaceName']

  raise 'You cannot provide both :namespaceName and :namespace_name' if attributes.key?(:'namespaceName') && attributes.key?(:'namespace_name')

  self.namespace_name = attributes[:'namespace_name'] if attributes[:'namespace_name']

  self.object_name = attributes[:'objectName'] if attributes[:'objectName']

  raise 'You cannot provide both :objectName and :object_name' if attributes.key?(:'objectName') && attributes.key?(:'object_name')

  self.object_name = attributes[:'object_name'] if attributes[:'object_name']

  self.object_etag = attributes[:'objectEtag'] if attributes[:'objectEtag']

  raise 'You cannot provide both :objectEtag and :object_etag' if attributes.key?(:'objectEtag') && attributes.key?(:'object_etag')

  self.object_etag = attributes[:'object_etag'] if attributes[:'object_etag']

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

  raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated')

  self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated']

  self.segment_range_start_index = attributes[:'segmentRangeStartIndex'] if attributes[:'segmentRangeStartIndex']

  raise 'You cannot provide both :segmentRangeStartIndex and :segment_range_start_index' if attributes.key?(:'segmentRangeStartIndex') && attributes.key?(:'segment_range_start_index')

  self.segment_range_start_index = attributes[:'segment_range_start_index'] if attributes[:'segment_range_start_index']

  self.segment_range_end_index = attributes[:'segmentRangeEndIndex'] if attributes[:'segmentRangeEndIndex']

  raise 'You cannot provide both :segmentRangeEndIndex and :segment_range_end_index' if attributes.key?(:'segmentRangeEndIndex') && attributes.key?(:'segment_range_end_index')

  self.segment_range_end_index = attributes[:'segment_range_end_index'] if attributes[:'segment_range_end_index']

  self. = attributes[:'metadata'] if attributes[:'metadata']

  self.media_asset_tags = attributes[:'mediaAssetTags'] if attributes[:'mediaAssetTags']

  raise 'You cannot provide both :mediaAssetTags and :media_asset_tags' if attributes.key?(:'mediaAssetTags') && attributes.key?(:'media_asset_tags')

  self.media_asset_tags = attributes[:'media_asset_tags'] if attributes[:'media_asset_tags']

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

  raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')

  self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')

  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']

  self.system_tags = attributes[:'systemTags'] if attributes[:'systemTags']

  raise 'You cannot provide both :systemTags and :system_tags' if attributes.key?(:'systemTags') && attributes.key?(:'system_tags')

  self.system_tags = attributes[:'system_tags'] if attributes[:'system_tags']
end

Instance Attribute Details

#bucket_nameString

The name of the object storage bucket where this represented asset is located.

Returns:

  • (String)


78
79
80
# File 'lib/oci/media_services/models/media_asset.rb', line 78

def bucket_name
  @bucket_name
end

#compartment_idString

[Required] The ID of the compartment containing the MediaAsset.

Returns:

  • (String)


38
39
40
# File 'lib/oci/media_services/models/media_asset.rb', line 38

def compartment_id
  @compartment_id
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {\"foo-namespace\": {\"bar-key\": \"value\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


122
123
124
# File 'lib/oci/media_services/models/media_asset.rb', line 122

def defined_tags
  @defined_tags
end

#display_nameString

A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


54
55
56
# File 'lib/oci/media_services/models/media_asset.rb', line 54

def display_name
  @display_name
end

#freeform_tagsHash<String, String>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {\"bar-key\": \"value\"}

Returns:

  • (Hash<String, String>)


116
117
118
# File 'lib/oci/media_services/models/media_asset.rb', line 116

def freeform_tags
  @freeform_tags
end

#idString

[Required] Unique identifier that is immutable on creation.

Returns:

  • (String)


34
35
36
# File 'lib/oci/media_services/models/media_asset.rb', line 34

def id
  @id
end

#lifecycle_stateString

[Required] The current state of the MediaAsset.

Returns:

  • (String)


62
63
64
# File 'lib/oci/media_services/models/media_asset.rb', line 62

def lifecycle_state
  @lifecycle_state
end

#master_media_asset_idString

The ID of the senior most asset from which this asset is derived.

Returns:

  • (String)


74
75
76
# File 'lib/oci/media_services/models/media_asset.rb', line 74

def master_media_asset_id
  @master_media_asset_id
end

#media_asset_tagsArray<OCI::MediaServices::Models::MediaAssetTag>

List of tags for the MediaAsset.



110
111
112
# File 'lib/oci/media_services/models/media_asset.rb', line 110

def media_asset_tags
  @media_asset_tags
end

#media_workflow_job_idString

The ID of the MediaWorkflowJob used to produce this asset.

Returns:

  • (String)


46
47
48
# File 'lib/oci/media_services/models/media_asset.rb', line 46

def media_workflow_job_id
  @media_workflow_job_id
end

#metadataArray<OCI::MediaServices::Models::Metadata>

List of Metadata.



106
107
108
# File 'lib/oci/media_services/models/media_asset.rb', line 106

def 
  @metadata
end

#namespace_nameString

The object storage namespace where this asset is located.

Returns:

  • (String)


82
83
84
# File 'lib/oci/media_services/models/media_asset.rb', line 82

def namespace_name
  @namespace_name
end

#object_etagString

eTag of the underlying object storage object.

Returns:

  • (String)


90
91
92
# File 'lib/oci/media_services/models/media_asset.rb', line 90

def object_etag
  @object_etag
end

#object_nameString

The object storage object name that identifies this asset.

Returns:

  • (String)


86
87
88
# File 'lib/oci/media_services/models/media_asset.rb', line 86

def object_name
  @object_name
end

#parent_media_asset_idString

The ID of the parent asset from which this asset is derived.

Returns:

  • (String)


70
71
72
# File 'lib/oci/media_services/models/media_asset.rb', line 70

def parent_media_asset_id
  @parent_media_asset_id
end

#segment_range_end_indexInteger

The end index of video segment files.

Returns:

  • (Integer)


102
103
104
# File 'lib/oci/media_services/models/media_asset.rb', line 102

def segment_range_end_index
  @segment_range_end_index
end

#segment_range_start_indexInteger

The start index for video segment files.

Returns:

  • (Integer)


98
99
100
# File 'lib/oci/media_services/models/media_asset.rb', line 98

def segment_range_start_index
  @segment_range_start_index
end

#source_media_workflow_idString

The ID of the MediaWorkflow used to produce this asset.

Returns:

  • (String)


42
43
44
# File 'lib/oci/media_services/models/media_asset.rb', line 42

def source_media_workflow_id
  @source_media_workflow_id
end

#source_media_workflow_versionInteger

The version of the MediaWorkflow used to produce this asset.

Returns:

  • (Integer)


50
51
52
# File 'lib/oci/media_services/models/media_asset.rb', line 50

def source_media_workflow_version
  @source_media_workflow_version
end

#system_tagsHash<String, Hash<String, Object>>

Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


128
129
130
# File 'lib/oci/media_services/models/media_asset.rb', line 128

def system_tags
  @system_tags
end

#time_createdDateTime

The time when the MediaAsset was created. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


58
59
60
# File 'lib/oci/media_services/models/media_asset.rb', line 58

def time_created
  @time_created
end

#time_updatedDateTime

The time when the MediaAsset was updated. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


94
95
96
# File 'lib/oci/media_services/models/media_asset.rb', line 94

def time_updated
  @time_updated
end

#typeString

[Required] The type of the media asset.

Returns:

  • (String)


66
67
68
# File 'lib/oci/media_services/models/media_asset.rb', line 66

def type
  @type
end

Class Method Details

.attribute_mapObject

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



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
# File 'lib/oci/media_services/models/media_asset.rb', line 131

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'id',
    'compartment_id': :'compartmentId',
    'source_media_workflow_id': :'sourceMediaWorkflowId',
    'media_workflow_job_id': :'mediaWorkflowJobId',
    'source_media_workflow_version': :'sourceMediaWorkflowVersion',
    'display_name': :'displayName',
    'time_created': :'timeCreated',
    'lifecycle_state': :'lifecycleState',
    'type': :'type',
    'parent_media_asset_id': :'parentMediaAssetId',
    'master_media_asset_id': :'masterMediaAssetId',
    'bucket_name': :'bucketName',
    'namespace_name': :'namespaceName',
    'object_name': :'objectName',
    'object_etag': :'objectEtag',
    'time_updated': :'timeUpdated',
    'segment_range_start_index': :'segmentRangeStartIndex',
    'segment_range_end_index': :'segmentRangeEndIndex',
    'metadata': :'metadata',
    'media_asset_tags': :'mediaAssetTags',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'system_tags': :'systemTags'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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
# File 'lib/oci/media_services/models/media_asset.rb', line 162

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'id': :'String',
    'compartment_id': :'String',
    'source_media_workflow_id': :'String',
    'media_workflow_job_id': :'String',
    'source_media_workflow_version': :'Integer',
    'display_name': :'String',
    'time_created': :'DateTime',
    'lifecycle_state': :'String',
    'type': :'String',
    'parent_media_asset_id': :'String',
    'master_media_asset_id': :'String',
    'bucket_name': :'String',
    'namespace_name': :'String',
    'object_name': :'String',
    'object_etag': :'String',
    'time_updated': :'DateTime',
    'segment_range_start_index': :'Integer',
    'segment_range_end_index': :'Integer',
    'metadata': :'Array<OCI::MediaServices::Models::Metadata>',
    'media_asset_tags': :'Array<OCI::MediaServices::Models::MediaAssetTag>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'system_tags': :'Hash<String, Hash<String, Object>>'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/oci/media_services/models/media_asset.rb', line 387

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    id == other.id &&
    compartment_id == other.compartment_id &&
    source_media_workflow_id == other.source_media_workflow_id &&
    media_workflow_job_id == other.media_workflow_job_id &&
    source_media_workflow_version == other.source_media_workflow_version &&
    display_name == other.display_name &&
    time_created == other.time_created &&
    lifecycle_state == other.lifecycle_state &&
    type == other.type &&
    parent_media_asset_id == other.parent_media_asset_id &&
    master_media_asset_id == other.master_media_asset_id &&
    bucket_name == other.bucket_name &&
    namespace_name == other.namespace_name &&
    object_name == other.object_name &&
    object_etag == other.object_etag &&
    time_updated == other.time_updated &&
    segment_range_start_index == other.segment_range_start_index &&
    segment_range_end_index == other.segment_range_end_index &&
     == other. &&
    media_asset_tags == other.media_asset_tags &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    system_tags == other.system_tags
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



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/oci/media_services/models/media_asset.rb', line 439

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/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)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(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?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


419
420
421
# File 'lib/oci/media_services/models/media_asset.rb', line 419

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



428
429
430
# File 'lib/oci/media_services/models/media_asset.rb', line 428

def hash
  [id, compartment_id, source_media_workflow_id, media_workflow_job_id, source_media_workflow_version, display_name, time_created, lifecycle_state, type, parent_media_asset_id, master_media_asset_id, bucket_name, namespace_name, object_name, object_etag, time_updated, segment_range_start_index, segment_range_end_index, , media_asset_tags, freeform_tags, defined_tags, system_tags].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



472
473
474
475
476
477
478
479
480
481
# File 'lib/oci/media_services/models/media_asset.rb', line 472

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



466
467
468
# File 'lib/oci/media_services/models/media_asset.rb', line 466

def to_s
  to_hash.to_s
end