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
152 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 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 152 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).
13 14 15 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 13 def common_name @common_name end |
#country ⇒ String
Country name (RDN C).
17 18 19 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 17 def country @country end |
#distinguished_name_qualifier ⇒ String
Distinguished name qualifier(RDN DNQ).
25 26 27 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 25 def distinguished_name_qualifier @distinguished_name_qualifier end |
#domain_component ⇒ String
Domain component (RDN DC).
21 22 23 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 21 def domain_component @domain_component end |
#generation_qualifier ⇒ String
Personal generational qualifier (for example, Sr., Jr. 3rd, or IV).
29 30 31 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 29 def generation_qualifier @generation_qualifier end |
#given_name ⇒ String
Personal given name (RDN G or GN).
33 34 35 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 33 def given_name @given_name end |
#initials ⇒ String
Personal initials.
37 38 39 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 37 def initials @initials end |
#locality_name ⇒ String
Locality (RDN L).
41 42 43 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 41 def locality_name @locality_name end |
#organization ⇒ String
Organization (RDN O).
45 46 47 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 45 def organization @organization end |
#organizational_unit ⇒ String
Organizational unit (RDN OU).
49 50 51 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 49 def organizational_unit @organizational_unit end |
#pseudonym ⇒ String
Subject pseudonym.
53 54 55 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 53 def pseudonym @pseudonym end |
#serial_number ⇒ String
Unique subject identifier, which is not the same as the certificate serial number (RDN SERIALNUMBER).
57 58 59 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 57 def serial_number @serial_number end |
#state_or_province_name ⇒ String
State or province name (RDN ST or S).
61 62 63 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 61 def state_or_province_name @state_or_province_name end |
#street ⇒ String
Street address (RDN STREET).
65 66 67 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 65 def street @street end |
#surname ⇒ String
Personal surname (RDN SN).
69 70 71 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 69 def surname @surname end |
#title ⇒ String
Title (RDN T or TITLE).
73 74 75 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 73 def title @title end |
#user_id ⇒ String
User ID (RDN UID).
77 78 79 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 77 def user_id @user_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 80 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.
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 105 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.
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 265 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
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 311 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
291 292 293 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 291 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
300 301 302 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 300 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
344 345 346 347 348 349 350 351 352 353 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 344 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
338 339 340 |
# File 'lib/oci/certificates_management/models/certificate_subject.rb', line 338 def to_s to_hash.to_s end |