Class: OCI::ContainerEngine::Models::ClusterMetadata

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/container_engine/models/cluster_metadata.rb

Overview

The properties that define meta data for a cluster.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ClusterMetadata

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



103
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
164
165
166
167
168
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 103

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

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

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

  self.created_by_work_request_id = attributes[:'createdByWorkRequestId'] if attributes[:'createdByWorkRequestId']

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

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

  self.time_deleted = attributes[:'timeDeleted'] if attributes[:'timeDeleted']

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

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

  self.deleted_by_user_id = attributes[:'deletedByUserId'] if attributes[:'deletedByUserId']

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

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

  self.deleted_by_work_request_id = attributes[:'deletedByWorkRequestId'] if attributes[:'deletedByWorkRequestId']

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

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

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

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

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

  self.updated_by_work_request_id = attributes[:'updatedByWorkRequestId'] if attributes[:'updatedByWorkRequestId']

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

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

  self.time_credential_expiration = attributes[:'timeCredentialExpiration'] if attributes[:'timeCredentialExpiration']

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

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

Instance Attribute Details

#created_by_user_idString

The user who created the cluster.

Returns:

  • (String)


17
18
19
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 17

def created_by_user_id
  @created_by_user_id
end

#created_by_work_request_idString

The OCID of the work request which created the cluster.

Returns:

  • (String)


21
22
23
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 21

def created_by_work_request_id
  @created_by_work_request_id
end

#deleted_by_user_idString

The user who deleted the cluster.

Returns:

  • (String)


29
30
31
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 29

def deleted_by_user_id
  @deleted_by_user_id
end

#deleted_by_work_request_idString

The OCID of the work request which deleted the cluster.

Returns:

  • (String)


33
34
35
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 33

def deleted_by_work_request_id
  @deleted_by_work_request_id
end

#time_createdDateTime

The time the cluster was created.

Returns:

  • (DateTime)


13
14
15
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 13

def time_created
  @time_created
end

#time_credential_expirationDateTime

The time until which the cluster credential is valid.

Returns:

  • (DateTime)


49
50
51
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 49

def time_credential_expiration
  @time_credential_expiration
end

#time_deletedDateTime

The time the cluster was deleted.

Returns:

  • (DateTime)


25
26
27
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 25

def time_deleted
  @time_deleted
end

#time_updatedDateTime

The time the cluster was updated.

Returns:

  • (DateTime)


37
38
39
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 37

def time_updated
  @time_updated
end

#updated_by_user_idString

The user who updated the cluster.

Returns:

  • (String)


41
42
43
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 41

def updated_by_user_id
  @updated_by_user_id
end

#updated_by_work_request_idString

The OCID of the work request which updated the cluster.

Returns:

  • (String)


45
46
47
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 45

def updated_by_work_request_id
  @updated_by_work_request_id
end

Class Method Details

.attribute_mapObject

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



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 52

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'time_created': :'timeCreated',
    'created_by_user_id': :'createdByUserId',
    'created_by_work_request_id': :'createdByWorkRequestId',
    'time_deleted': :'timeDeleted',
    'deleted_by_user_id': :'deletedByUserId',
    'deleted_by_work_request_id': :'deletedByWorkRequestId',
    'time_updated': :'timeUpdated',
    'updated_by_user_id': :'updatedByUserId',
    'updated_by_work_request_id': :'updatedByWorkRequestId',
    'time_credential_expiration': :'timeCredentialExpiration'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 70

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'time_created': :'DateTime',
    'created_by_user_id': :'String',
    'created_by_work_request_id': :'String',
    'time_deleted': :'DateTime',
    'deleted_by_user_id': :'String',
    'deleted_by_work_request_id': :'String',
    'time_updated': :'DateTime',
    'updated_by_user_id': :'String',
    'updated_by_work_request_id': :'String',
    'time_credential_expiration': :'DateTime'
    # 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



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 177

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

  self.class == other.class &&
    time_created == other.time_created &&
    created_by_user_id == other.created_by_user_id &&
    created_by_work_request_id == other.created_by_work_request_id &&
    time_deleted == other.time_deleted &&
    deleted_by_user_id == other.deleted_by_user_id &&
    deleted_by_work_request_id == other.deleted_by_work_request_id &&
    time_updated == other.time_updated &&
    updated_by_user_id == other.updated_by_user_id &&
    updated_by_work_request_id == other.updated_by_work_request_id &&
    time_credential_expiration == other.time_credential_expiration
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



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 216

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


196
197
198
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 196

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



205
206
207
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 205

def hash
  [time_created, created_by_user_id, created_by_work_request_id, time_deleted, deleted_by_user_id, deleted_by_work_request_id, time_updated, updated_by_user_id, updated_by_work_request_id, time_credential_expiration].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



249
250
251
252
253
254
255
256
257
258
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 249

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



243
244
245
# File 'lib/oci/container_engine/models/cluster_metadata.rb', line 243

def to_s
  to_hash.to_s
end