Class: OCI::CertificatesManagement::Models::CertificateSubject
- Inherits:
-
Object
- Object
- OCI::CertificatesManagement::Models::CertificateSubject
- Defined in:
- lib/oci/certificates_management/models/certificate_subject.rb
Overview
The subject of the certificate, which is a distinguished name that identifies the entity that owns the public key in the certificate.
Instance Attribute Summary collapse
-
#common_name ⇒ String
[Required] Common name or fully-qualified domain name (RDN CN).
-
#country ⇒ String
Country name (RDN C).
-
#distinguished_name_qualifier ⇒ String
Distinguished name qualifier(RDN DNQ).
-
#domain_component ⇒ String
Domain component (RDN DC).
-
#generation_qualifier ⇒ String
Personal generational qualifier (for example, Sr., Jr. 3rd, or IV).
-
#given_name ⇒ String
Personal given name (RDN G or GN).
-
#initials ⇒ String
Personal initials.
-
#locality_name ⇒ String
Locality (RDN L).
-
#organization ⇒ String
Organization (RDN O).
-
#organizational_unit ⇒ String
Organizational unit (RDN OU).
-
#pseudonym ⇒ String
Subject pseudonym.
-
#serial_number ⇒ String
Unique subject identifier, which is not the same as the certificate serial number (RDN SERIALNUMBER).
-
#state_or_province_name ⇒ String
State or province name (RDN ST or S).
-
#street ⇒ String
Street address (RDN STREET).
-
#surname ⇒ String
Personal surname (RDN SN).
-
#title ⇒ String
Title (RDN T or TITLE).
-
#user_id ⇒ String
User ID (RDN UID).
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ CertificateSubject
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ CertificateSubject
Initializes the object
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 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 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 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 153 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.common_name = attributes[:'commonName'] if attributes[:'commonName'] raise 'You cannot provide both :commonName and :common_name' if attributes.key?(:'commonName') && attributes.key?(:'common_name') self.common_name = attributes[:'common_name'] if attributes[:'common_name'] self.country = attributes[:'country'] if attributes[:'country'] self.country = "null" if country.nil? && !attributes.key?(:'country') # rubocop:disable Style/StringLiterals self.domain_component = attributes[:'domainComponent'] if attributes[:'domainComponent'] self.domain_component = "null" if domain_component.nil? && !attributes.key?(:'domainComponent') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :domainComponent and :domain_component' if attributes.key?(:'domainComponent') && attributes.key?(:'domain_component') self.domain_component = attributes[:'domain_component'] if attributes[:'domain_component'] self.domain_component = "null" if domain_component.nil? && !attributes.key?(:'domainComponent') && !attributes.key?(:'domain_component') # rubocop:disable Style/StringLiterals self.distinguished_name_qualifier = attributes[:'distinguishedNameQualifier'] if attributes[:'distinguishedNameQualifier'] self.distinguished_name_qualifier = "null" if distinguished_name_qualifier.nil? && !attributes.key?(:'distinguishedNameQualifier') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :distinguishedNameQualifier and :distinguished_name_qualifier' if attributes.key?(:'distinguishedNameQualifier') && attributes.key?(:'distinguished_name_qualifier') self.distinguished_name_qualifier = attributes[:'distinguished_name_qualifier'] if attributes[:'distinguished_name_qualifier'] self.distinguished_name_qualifier = "null" if distinguished_name_qualifier.nil? && !attributes.key?(:'distinguishedNameQualifier') && !attributes.key?(:'distinguished_name_qualifier') # rubocop:disable Style/StringLiterals self.generation_qualifier = attributes[:'generationQualifier'] if attributes[:'generationQualifier'] self.generation_qualifier = "null" if generation_qualifier.nil? && !attributes.key?(:'generationQualifier') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :generationQualifier and :generation_qualifier' if attributes.key?(:'generationQualifier') && attributes.key?(:'generation_qualifier') self.generation_qualifier = attributes[:'generation_qualifier'] if attributes[:'generation_qualifier'] self.generation_qualifier = "null" if generation_qualifier.nil? && !attributes.key?(:'generationQualifier') && !attributes.key?(:'generation_qualifier') # rubocop:disable Style/StringLiterals self.given_name = attributes[:'givenName'] if attributes[:'givenName'] self.given_name = "null" if given_name.nil? && !attributes.key?(:'givenName') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :givenName and :given_name' if attributes.key?(:'givenName') && attributes.key?(:'given_name') self.given_name = attributes[:'given_name'] if attributes[:'given_name'] self.given_name = "null" if given_name.nil? && !attributes.key?(:'givenName') && !attributes.key?(:'given_name') # rubocop:disable Style/StringLiterals self.initials = attributes[:'initials'] if attributes[:'initials'] self.initials = "null" if initials.nil? && !attributes.key?(:'initials') # rubocop:disable Style/StringLiterals self.locality_name = attributes[:'localityName'] if attributes[:'localityName'] self.locality_name = "null" if locality_name.nil? && !attributes.key?(:'localityName') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :localityName and :locality_name' if attributes.key?(:'localityName') && attributes.key?(:'locality_name') self.locality_name = attributes[:'locality_name'] if attributes[:'locality_name'] self.locality_name = "null" if locality_name.nil? && !attributes.key?(:'localityName') && !attributes.key?(:'locality_name') # rubocop:disable Style/StringLiterals self.organization = attributes[:'organization'] if attributes[:'organization'] self.organization = "null" if organization.nil? && !attributes.key?(:'organization') # rubocop:disable Style/StringLiterals self.organizational_unit = attributes[:'organizationalUnit'] if attributes[:'organizationalUnit'] self.organizational_unit = "null" if organizational_unit.nil? && !attributes.key?(:'organizationalUnit') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :organizationalUnit and :organizational_unit' if attributes.key?(:'organizationalUnit') && attributes.key?(:'organizational_unit') self.organizational_unit = attributes[:'organizational_unit'] if attributes[:'organizational_unit'] self.organizational_unit = "null" if organizational_unit.nil? && !attributes.key?(:'organizationalUnit') && !attributes.key?(:'organizational_unit') # rubocop:disable Style/StringLiterals self.pseudonym = attributes[:'pseudonym'] if attributes[:'pseudonym'] self.pseudonym = "null" if pseudonym.nil? && !attributes.key?(:'pseudonym') # rubocop:disable Style/StringLiterals self.serial_number = attributes[:'serialNumber'] if attributes[:'serialNumber'] self.serial_number = "null" if serial_number.nil? && !attributes.key?(:'serialNumber') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :serialNumber and :serial_number' if attributes.key?(:'serialNumber') && attributes.key?(:'serial_number') self.serial_number = attributes[:'serial_number'] if attributes[:'serial_number'] self.serial_number = "null" if serial_number.nil? && !attributes.key?(:'serialNumber') && !attributes.key?(:'serial_number') # rubocop:disable Style/StringLiterals self.state_or_province_name = attributes[:'stateOrProvinceName'] if attributes[:'stateOrProvinceName'] self.state_or_province_name = "null" if state_or_province_name.nil? && !attributes.key?(:'stateOrProvinceName') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :stateOrProvinceName and :state_or_province_name' if attributes.key?(:'stateOrProvinceName') && attributes.key?(:'state_or_province_name') self.state_or_province_name = attributes[:'state_or_province_name'] if attributes[:'state_or_province_name'] self.state_or_province_name = "null" if state_or_province_name.nil? && !attributes.key?(:'stateOrProvinceName') && !attributes.key?(:'state_or_province_name') # rubocop:disable Style/StringLiterals self.street = attributes[:'street'] if attributes[:'street'] self.street = "null" if street.nil? && !attributes.key?(:'street') # rubocop:disable Style/StringLiterals self.surname = attributes[:'surname'] if attributes[:'surname'] self.surname = "null" if surname.nil? && !attributes.key?(:'surname') # rubocop:disable Style/StringLiterals self.title = attributes[:'title'] if attributes[:'title'] self.title = "null" if title.nil? && !attributes.key?(:'title') # rubocop:disable Style/StringLiterals self.user_id = attributes[:'userId'] if attributes[:'userId'] self.user_id = "null" if user_id.nil? && !attributes.key?(:'userId') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :userId and :user_id' if attributes.key?(:'userId') && attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] if attributes[:'user_id'] self.user_id = "null" if user_id.nil? && !attributes.key?(:'userId') && !attributes.key?(:'user_id') # rubocop:disable Style/StringLiterals end |
Instance Attribute Details
#common_name ⇒ String
[Required] Common name or fully-qualified domain name (RDN CN).
14 15 16 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 14 def common_name @common_name end |
#country ⇒ String
Country name (RDN C).
18 19 20 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 18 def country @country end |
#distinguished_name_qualifier ⇒ String
Distinguished name qualifier(RDN DNQ).
26 27 28 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 26 def distinguished_name_qualifier @distinguished_name_qualifier end |
#domain_component ⇒ String
Domain component (RDN DC).
22 23 24 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 22 def domain_component @domain_component end |
#generation_qualifier ⇒ String
Personal generational qualifier (for example, Sr., Jr. 3rd, or IV).
30 31 32 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 30 def generation_qualifier @generation_qualifier end |
#given_name ⇒ String
Personal given name (RDN G or GN).
34 35 36 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 34 def given_name @given_name end |
#initials ⇒ String
Personal initials.
38 39 40 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 38 def initials @initials end |
#locality_name ⇒ String
Locality (RDN L).
42 43 44 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 42 def locality_name @locality_name end |
#organization ⇒ String
Organization (RDN O).
46 47 48 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 46 def organization @organization end |
#organizational_unit ⇒ String
Organizational unit (RDN OU).
50 51 52 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 50 def organizational_unit @organizational_unit end |
#pseudonym ⇒ String
Subject pseudonym.
54 55 56 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 54 def pseudonym @pseudonym end |
#serial_number ⇒ String
Unique subject identifier, which is not the same as the certificate serial number (RDN SERIALNUMBER).
58 59 60 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 58 def serial_number @serial_number end |
#state_or_province_name ⇒ String
State or province name (RDN ST or S).
62 63 64 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 62 def state_or_province_name @state_or_province_name end |
#street ⇒ String
Street address (RDN STREET).
66 67 68 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 66 def street @street end |
#surname ⇒ String
Personal surname (RDN SN).
70 71 72 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 70 def surname @surname end |
#title ⇒ String
Title (RDN T or TITLE).
74 75 76 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 74 def title @title end |
#user_id ⇒ String
User ID (RDN UID).
78 79 80 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 78 def user_id @user_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 81 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'common_name': :'commonName', 'country': :'country', 'domain_component': :'domainComponent', 'distinguished_name_qualifier': :'distinguishedNameQualifier', 'generation_qualifier': :'generationQualifier', 'given_name': :'givenName', 'initials': :'initials', 'locality_name': :'localityName', 'organization': :'organization', 'organizational_unit': :'organizationalUnit', 'pseudonym': :'pseudonym', 'serial_number': :'serialNumber', 'state_or_province_name': :'stateOrProvinceName', 'street': :'street', 'surname': :'surname', 'title': :'title', 'user_id': :'userId' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 106 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'common_name': :'String', 'country': :'String', 'domain_component': :'String', 'distinguished_name_qualifier': :'String', 'generation_qualifier': :'String', 'given_name': :'String', 'initials': :'String', 'locality_name': :'String', 'organization': :'String', 'organizational_unit': :'String', 'pseudonym': :'String', 'serial_number': :'String', 'state_or_province_name': :'String', 'street': :'String', 'surname': :'String', 'title': :'String', 'user_id': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 266 def ==(other) return true if equal?(other) self.class == other.class && common_name == other.common_name && country == other.country && domain_component == other.domain_component && distinguished_name_qualifier == other.distinguished_name_qualifier && generation_qualifier == other.generation_qualifier && given_name == other.given_name && initials == other.initials && locality_name == other.locality_name && organization == other.organization && organizational_unit == other.organizational_unit && pseudonym == other.pseudonym && serial_number == other.serial_number && state_or_province_name == other.state_or_province_name && street == other.street && surname == other.surname && title == other.title && user_id == other.user_id end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 312 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
292 293 294 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 292 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
301 302 303 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 301 def hash [common_name, country, domain_component, distinguished_name_qualifier, generation_qualifier, given_name, initials, locality_name, organization, organizational_unit, pseudonym, serial_number, state_or_province_name, street, surname, title, user_id].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
345 346 347 348 349 350 351 352 353 354 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 345 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_s ⇒ String
Returns the string representation of the object
339 340 341 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 339 def to_s to_hash.to_s end |