Class: OCI::Dblm::Models::ImageDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/dblm/models/image_details.rb

Overview

Image details containing the subscribed image, its status, version, owner and time of creation.

Constant Summary collapse

IMAGE_STATUS_ENUM =
[
  IMAGE_STATUS_GREEN = 'GREEN'.freeze,
  IMAGE_STATUS_YELLOW = 'YELLOW'.freeze,
  IMAGE_STATUS_RED = 'RED'.freeze,
  IMAGE_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ImageDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :image_id (String)

    The value to assign to the #image_id property

  • :subscribed_image (String)

    The value to assign to the #subscribed_image property

  • :current_version (String)

    The value to assign to the #current_version property

  • :image_status (String)

    The value to assign to the #image_status property

  • :image_version (String)

    The value to assign to the #image_version property

  • :image_owner (String)

    The value to assign to the #image_owner property

  • :created_by (String)

    The value to assign to the #created_by property

  • :time_image_creation (DateTime)

    The value to assign to the #time_image_creation property

  • :up_to_date_image_version (String)

    The value to assign to the #up_to_date_image_version property



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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
# File 'lib/oci/dblm/models/image_details.rb', line 104

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.image_id = attributes[:'imageId'] if attributes[:'imageId']

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

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

  self.subscribed_image = attributes[:'subscribedImage'] if attributes[:'subscribedImage']

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

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

  self.current_version = attributes[:'currentVersion'] if attributes[:'currentVersion']

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

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

  self.image_status = attributes[:'imageStatus'] if attributes[:'imageStatus']

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

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

  self.image_version = attributes[:'imageVersion'] if attributes[:'imageVersion']

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

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

  self.image_owner = attributes[:'imageOwner'] if attributes[:'imageOwner']

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

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

  self.created_by = attributes[:'createdBy'] if attributes[:'createdBy']

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

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

  self.time_image_creation = attributes[:'timeImageCreation'] if attributes[:'timeImageCreation']

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

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

  self.up_to_date_image_version = attributes[:'upToDateImageVersion'] if attributes[:'upToDateImageVersion']

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

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

Instance Attribute Details

#created_byString

Name of the person who created the image.

Returns:

  • (String)


45
46
47
# File 'lib/oci/dblm/models/image_details.rb', line 45

def created_by
  @created_by
end

#current_versionString

Name of the image version marked as current of the image.

Returns:

  • (String)


29
30
31
# File 'lib/oci/dblm/models/image_details.rb', line 29

def current_version
  @current_version
end

#image_idString

Image identifier.

Returns:

  • (String)


21
22
23
# File 'lib/oci/dblm/models/image_details.rb', line 21

def image_id
  @image_id
end

#image_ownerString

Owner of the image.

Returns:

  • (String)


41
42
43
# File 'lib/oci/dblm/models/image_details.rb', line 41

def image_owner
  @image_owner
end

#image_statusString

Image status.

Returns:

  • (String)


33
34
35
# File 'lib/oci/dblm/models/image_details.rb', line 33

def image_status
  @image_status
end

#image_versionString

Release version of the image.

Returns:

  • (String)


37
38
39
# File 'lib/oci/dblm/models/image_details.rb', line 37

def image_version
  @image_version
end

#subscribed_imageString

Subscribed image.

Returns:

  • (String)


25
26
27
# File 'lib/oci/dblm/models/image_details.rb', line 25

def subscribed_image
  @subscribed_image
end

#time_image_creationDateTime

Date when the image was created.

Returns:

  • (DateTime)


49
50
51
# File 'lib/oci/dblm/models/image_details.rb', line 49

def time_image_creation
  @time_image_creation
end

#up_to_date_image_versionString

An image version name, that is up to date and has no recommendations.

Returns:

  • (String)


53
54
55
# File 'lib/oci/dblm/models/image_details.rb', line 53

def up_to_date_image_version
  @up_to_date_image_version
end

Class Method Details

.attribute_mapObject

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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/dblm/models/image_details.rb', line 56

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'image_id': :'imageId',
    'subscribed_image': :'subscribedImage',
    'current_version': :'currentVersion',
    'image_status': :'imageStatus',
    'image_version': :'imageVersion',
    'image_owner': :'imageOwner',
    'created_by': :'createdBy',
    'time_image_creation': :'timeImageCreation',
    'up_to_date_image_version': :'upToDateImageVersion'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/dblm/models/image_details.rb', line 73

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'image_id': :'String',
    'subscribed_image': :'String',
    'current_version': :'String',
    'image_status': :'String',
    'image_version': :'String',
    'image_owner': :'String',
    'created_by': :'String',
    'time_image_creation': :'DateTime',
    'up_to_date_image_version': :'String'
    # 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



185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/oci/dblm/models/image_details.rb', line 185

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

  self.class == other.class &&
    image_id == other.image_id &&
    subscribed_image == other.subscribed_image &&
    current_version == other.current_version &&
    image_status == other.image_status &&
    image_version == other.image_version &&
    image_owner == other.image_owner &&
    created_by == other.created_by &&
    time_image_creation == other.time_image_creation &&
    up_to_date_image_version == other.up_to_date_image_version
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



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# File 'lib/oci/dblm/models/image_details.rb', line 223

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


203
204
205
# File 'lib/oci/dblm/models/image_details.rb', line 203

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



212
213
214
# File 'lib/oci/dblm/models/image_details.rb', line 212

def hash
  [image_id, subscribed_image, current_version, image_status, image_version, image_owner, created_by, time_image_creation, up_to_date_image_version].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



256
257
258
259
260
261
262
263
264
265
# File 'lib/oci/dblm/models/image_details.rb', line 256

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



250
251
252
# File 'lib/oci/dblm/models/image_details.rb', line 250

def to_s
  to_hash.to_s
end