Class: OCI::Marketplace::Models::MarketplaceMetadataPublicKeySummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb

Overview

Model that contains signed marketplace instance metadata and associated signature in JWT form

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MarketplaceMetadataPublicKeySummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :key_algorithm (String)

    The value to assign to the #key_algorithm property

  • :key_type (String)

    The value to assign to the #key_type property

  • :key_use (String)

    The value to assign to the #key_use property

  • :key_id (String)

    The value to assign to the #key_id property

  • :exponent (String)

    The value to assign to the #exponent property

  • :modulus (String)

    The value to assign to the #modulus property

  • :certificate_chain (Array<String>)

    The value to assign to the #certificate_chain property

  • :certificate_thumbprint (String)

    The value to assign to the #certificate_thumbprint property



89
90
91
92
93
94
95
96
97
98
99
100
101
102
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
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 89

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

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

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

  self.key_type = attributes[:'keyType'] if attributes[:'keyType']

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

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

  self.key_use = attributes[:'keyUse'] if attributes[:'keyUse']

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

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

  self.key_id = attributes[:'keyId'] if attributes[:'keyId']

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

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

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

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

  self.certificate_chain = attributes[:'certificateChain'] if attributes[:'certificateChain']

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

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

  self.certificate_thumbprint = attributes[:'certificateThumbprint'] if attributes[:'certificateThumbprint']

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

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

Instance Attribute Details

#certificate_chainArray<String>

[Required] chain of certificates used to sign JWT

Returns:

  • (Array<String>)


37
38
39
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 37

def certificate_chain
  @certificate_chain
end

#certificate_thumbprintString

[Required] unique identifier of associated X509 certificate

Returns:

  • (String)


41
42
43
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 41

def certificate_thumbprint
  @certificate_thumbprint
end

#exponentString

[Required] base64 encoded exponent for public key

Returns:

  • (String)


29
30
31
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 29

def exponent
  @exponent
end

#key_algorithmString

[Required] algorithm for public key (i.e. RS256)

Returns:

  • (String)


13
14
15
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 13

def key_algorithm
  @key_algorithm
end

#key_idString

[Required] unique id that maps to public certificate, directs user which certificate to use to verfiy

Returns:

  • (String)


25
26
27
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 25

def key_id
  @key_id
end

#key_typeString

[Required] key type (i.e. RSA)

Returns:

  • (String)


17
18
19
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 17

def key_type
  @key_type
end

#key_useString

[Required] how key is to be used

Returns:

  • (String)


21
22
23
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 21

def key_use
  @key_use
end

#modulusString

[Required] RSA public modulus

Returns:

  • (String)


33
34
35
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 33

def modulus
  @modulus
end

Class Method Details

.attribute_mapObject

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



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 44

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'key_algorithm': :'keyAlgorithm',
    'key_type': :'keyType',
    'key_use': :'keyUse',
    'key_id': :'keyId',
    'exponent': :'exponent',
    'modulus': :'modulus',
    'certificate_chain': :'certificateChain',
    'certificate_thumbprint': :'certificateThumbprint'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 60

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'key_algorithm': :'String',
    'key_type': :'String',
    'key_use': :'String',
    'key_id': :'String',
    'exponent': :'String',
    'modulus': :'String',
    'certificate_chain': :'Array<String>',
    'certificate_thumbprint': :'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



143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 143

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

  self.class == other.class &&
    key_algorithm == other.key_algorithm &&
    key_type == other.key_type &&
    key_use == other.key_use &&
    key_id == other.key_id &&
    exponent == other.exponent &&
    modulus == other.modulus &&
    certificate_chain == other.certificate_chain &&
    certificate_thumbprint == other.certificate_thumbprint
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



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 180

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


160
161
162
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 160

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



169
170
171
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 169

def hash
  [key_algorithm, key_type, key_use, key_id, exponent, modulus, certificate_chain, certificate_thumbprint].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 213

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



207
208
209
# File 'lib/oci/marketplace/models/marketplace_metadata_public_key_summary.rb', line 207

def to_s
  to_hash.to_s
end