Class: Akeyless::GenerateCsr
- Inherits:
-
Object
- Object
- Akeyless::GenerateCsr
- Defined in:
- lib/akeyless/models/generate_csr.rb
Instance Attribute Summary collapse
-
#alg ⇒ Object
Returns the value of attribute alg.
-
#alt_names ⇒ Object
A comma-separated list of dns alternative names.
-
#certificate_type ⇒ Object
A comma-separated list of certificate types to include in the CSR certificate (ssl-client/ssl-server/certificate-signing).
-
#city ⇒ Object
The city to be included in the CSR certificate.
-
#common_name ⇒ Object
The common name to be included in the CSR certificate.
-
#country ⇒ Object
The country to be included in the CSR certificate.
-
#critical ⇒ Object
Add critical to the key usage extension (will be false if not added).
-
#customer_frg_id ⇒ Object
The customer fragment ID that will be used to create the key (if empty, the key will be created independently of a customer fragment).
-
#dep ⇒ Object
The department to be included in the CSR certificate.
-
#email_addresses ⇒ Object
A comma-separated list of email addresses alternative names.
-
#export_private_key ⇒ Object
The flag to indicate if the private key should be exported.
-
#ext_key_usage ⇒ Object
A comma-separated list of extended key usages to include in the CSR certificate.
-
#generate_key ⇒ Object
Generate a new classic key for the csr.
-
#hash_algorithm ⇒ Object
Specifies the hash algorithm used for the encryption key's operations, available options: SHA256, SHA384, SHA512.
-
#ip_addresses ⇒ Object
A comma-separated list of ip addresses alternative names.
-
#json ⇒ Object
Set output format to JSON.
-
#key_type ⇒ Object
The type of the key to generate (classic-key/dfc).
-
#key_usage ⇒ Object
A comma-separated list of key usages to include in the CSR certificate.
-
#name ⇒ Object
The key name.
-
#org ⇒ Object
The organization to be included in the CSR certificate.
-
#split_level ⇒ Object
The number of fragments that the item will be split into (not includes customer fragment).
-
#state ⇒ Object
The state to be included in the CSR certificate.
-
#token ⇒ Object
Authentication token (see
/authand/configure). -
#uid_token ⇒ Object
The universal identity token, Required only for universal_identity authentication.
-
#uri_sans ⇒ Object
A comma-separated list of uri alternative names.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ GenerateCsr
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ GenerateCsr
Initializes the object
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 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/akeyless/models/generate_csr.rb', line 167 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Akeyless::GenerateCsr` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Akeyless::GenerateCsr`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'alg') self.alg = attributes[:'alg'] end if attributes.key?(:'alt_names') self.alt_names = attributes[:'alt_names'] end if attributes.key?(:'certificate_type') self.certificate_type = attributes[:'certificate_type'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'common_name') self.common_name = attributes[:'common_name'] else self.common_name = nil end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'critical') self.critical = attributes[:'critical'] end if attributes.key?(:'customer_frg_id') self.customer_frg_id = attributes[:'customer_frg_id'] end if attributes.key?(:'dep') self.dep = attributes[:'dep'] end if attributes.key?(:'email_addresses') self.email_addresses = attributes[:'email_addresses'] end if attributes.key?(:'export_private_key') self.export_private_key = attributes[:'export_private_key'] else self.export_private_key = false end if attributes.key?(:'ext_key_usage') self.ext_key_usage = attributes[:'ext_key_usage'] end if attributes.key?(:'generate_key') self.generate_key = attributes[:'generate_key'] end if attributes.key?(:'hash_algorithm') self.hash_algorithm = attributes[:'hash_algorithm'] else self.hash_algorithm = 'SHA256' end if attributes.key?(:'ip_addresses') self.ip_addresses = attributes[:'ip_addresses'] end if attributes.key?(:'json') self.json = attributes[:'json'] else self.json = false end if attributes.key?(:'key_type') self.key_type = attributes[:'key_type'] else self.key_type = 'classic-key' end if attributes.key?(:'key_usage') self.key_usage = attributes[:'key_usage'] end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'org') self.org = attributes[:'org'] end if attributes.key?(:'split_level') self.split_level = attributes[:'split_level'] else self.split_level = 3 end if attributes.key?(:'state') self.state = attributes[:'state'] end if attributes.key?(:'token') self.token = attributes[:'token'] end if attributes.key?(:'uid_token') self.uid_token = attributes[:'uid_token'] end if attributes.key?(:'uri_sans') self.uri_sans = attributes[:'uri_sans'] end end |
Instance Attribute Details
#alg ⇒ Object
Returns the value of attribute alg.
18 19 20 |
# File 'lib/akeyless/models/generate_csr.rb', line 18 def alg @alg end |
#alt_names ⇒ Object
A comma-separated list of dns alternative names
21 22 23 |
# File 'lib/akeyless/models/generate_csr.rb', line 21 def alt_names @alt_names end |
#certificate_type ⇒ Object
A comma-separated list of certificate types to include in the CSR certificate (ssl-client/ssl-server/certificate-signing)
24 25 26 |
# File 'lib/akeyless/models/generate_csr.rb', line 24 def certificate_type @certificate_type end |
#city ⇒ Object
The city to be included in the CSR certificate
27 28 29 |
# File 'lib/akeyless/models/generate_csr.rb', line 27 def city @city end |
#common_name ⇒ Object
The common name to be included in the CSR certificate
30 31 32 |
# File 'lib/akeyless/models/generate_csr.rb', line 30 def common_name @common_name end |
#country ⇒ Object
The country to be included in the CSR certificate
33 34 35 |
# File 'lib/akeyless/models/generate_csr.rb', line 33 def country @country end |
#critical ⇒ Object
Add critical to the key usage extension (will be false if not added)
36 37 38 |
# File 'lib/akeyless/models/generate_csr.rb', line 36 def critical @critical end |
#customer_frg_id ⇒ Object
The customer fragment ID that will be used to create the key (if empty, the key will be created independently of a customer fragment)
39 40 41 |
# File 'lib/akeyless/models/generate_csr.rb', line 39 def customer_frg_id @customer_frg_id end |
#dep ⇒ Object
The department to be included in the CSR certificate
42 43 44 |
# File 'lib/akeyless/models/generate_csr.rb', line 42 def dep @dep end |
#email_addresses ⇒ Object
A comma-separated list of email addresses alternative names
45 46 47 |
# File 'lib/akeyless/models/generate_csr.rb', line 45 def email_addresses @email_addresses end |
#export_private_key ⇒ Object
The flag to indicate if the private key should be exported
48 49 50 |
# File 'lib/akeyless/models/generate_csr.rb', line 48 def export_private_key @export_private_key end |
#ext_key_usage ⇒ Object
A comma-separated list of extended key usages to include in the CSR certificate
51 52 53 |
# File 'lib/akeyless/models/generate_csr.rb', line 51 def ext_key_usage @ext_key_usage end |
#generate_key ⇒ Object
Generate a new classic key for the csr
54 55 56 |
# File 'lib/akeyless/models/generate_csr.rb', line 54 def generate_key @generate_key end |
#hash_algorithm ⇒ Object
Specifies the hash algorithm used for the encryption key's operations, available options: SHA256, SHA384, SHA512
57 58 59 |
# File 'lib/akeyless/models/generate_csr.rb', line 57 def hash_algorithm @hash_algorithm end |
#ip_addresses ⇒ Object
A comma-separated list of ip addresses alternative names
60 61 62 |
# File 'lib/akeyless/models/generate_csr.rb', line 60 def ip_addresses @ip_addresses end |
#json ⇒ Object
Set output format to JSON
63 64 65 |
# File 'lib/akeyless/models/generate_csr.rb', line 63 def json @json end |
#key_type ⇒ Object
The type of the key to generate (classic-key/dfc)
66 67 68 |
# File 'lib/akeyless/models/generate_csr.rb', line 66 def key_type @key_type end |
#key_usage ⇒ Object
A comma-separated list of key usages to include in the CSR certificate
69 70 71 |
# File 'lib/akeyless/models/generate_csr.rb', line 69 def key_usage @key_usage end |
#name ⇒ Object
The key name
72 73 74 |
# File 'lib/akeyless/models/generate_csr.rb', line 72 def name @name end |
#org ⇒ Object
The organization to be included in the CSR certificate
75 76 77 |
# File 'lib/akeyless/models/generate_csr.rb', line 75 def org @org end |
#split_level ⇒ Object
The number of fragments that the item will be split into (not includes customer fragment)
78 79 80 |
# File 'lib/akeyless/models/generate_csr.rb', line 78 def split_level @split_level end |
#state ⇒ Object
The state to be included in the CSR certificate
81 82 83 |
# File 'lib/akeyless/models/generate_csr.rb', line 81 def state @state end |
#token ⇒ Object
Authentication token (see /auth and /configure)
84 85 86 |
# File 'lib/akeyless/models/generate_csr.rb', line 84 def token @token end |
#uid_token ⇒ Object
The universal identity token, Required only for universal_identity authentication
87 88 89 |
# File 'lib/akeyless/models/generate_csr.rb', line 87 def uid_token @uid_token end |
#uri_sans ⇒ Object
A comma-separated list of uri alternative names
90 91 92 |
# File 'lib/akeyless/models/generate_csr.rb', line 90 def uri_sans @uri_sans end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/akeyless/models/generate_csr.rb', line 396 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Akeyless.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
124 125 126 |
# File 'lib/akeyless/models/generate_csr.rb', line 124 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 |
# File 'lib/akeyless/models/generate_csr.rb', line 93 def self.attribute_map { :'alg' => :'alg', :'alt_names' => :'alt-names', :'certificate_type' => :'certificate-type', :'city' => :'city', :'common_name' => :'common-name', :'country' => :'country', :'critical' => :'critical', :'customer_frg_id' => :'customer-frg-id', :'dep' => :'dep', :'email_addresses' => :'email-addresses', :'export_private_key' => :'export-private-key', :'ext_key_usage' => :'ext-key-usage', :'generate_key' => :'generate-key', :'hash_algorithm' => :'hash-algorithm', :'ip_addresses' => :'ip-addresses', :'json' => :'json', :'key_type' => :'key-type', :'key_usage' => :'key-usage', :'name' => :'name', :'org' => :'org', :'split_level' => :'split-level', :'state' => :'state', :'token' => :'token', :'uid_token' => :'uid-token', :'uri_sans' => :'uri-sans' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
# File 'lib/akeyless/models/generate_csr.rb', line 372 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
160 161 162 163 |
# File 'lib/akeyless/models/generate_csr.rb', line 160 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/akeyless/models/generate_csr.rb', line 129 def self.openapi_types { :'alg' => :'String', :'alt_names' => :'String', :'certificate_type' => :'String', :'city' => :'String', :'common_name' => :'String', :'country' => :'String', :'critical' => :'Boolean', :'customer_frg_id' => :'String', :'dep' => :'String', :'email_addresses' => :'String', :'export_private_key' => :'Boolean', :'ext_key_usage' => :'String', :'generate_key' => :'Boolean', :'hash_algorithm' => :'String', :'ip_addresses' => :'String', :'json' => :'Boolean', :'key_type' => :'String', :'key_usage' => :'String', :'name' => :'String', :'org' => :'String', :'split_level' => :'Integer', :'state' => :'String', :'token' => :'String', :'uid_token' => :'String', :'uri_sans' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/akeyless/models/generate_csr.rb', line 327 def ==(o) return true if self.equal?(o) self.class == o.class && alg == o.alg && alt_names == o.alt_names && certificate_type == o.certificate_type && city == o.city && common_name == o.common_name && country == o.country && critical == o.critical && customer_frg_id == o.customer_frg_id && dep == o.dep && email_addresses == o.email_addresses && export_private_key == o.export_private_key && ext_key_usage == o.ext_key_usage && generate_key == o.generate_key && hash_algorithm == o.hash_algorithm && ip_addresses == o.ip_addresses && json == o.json && key_type == o.key_type && key_usage == o.key_usage && name == o.name && org == o.org && split_level == o.split_level && state == o.state && token == o.token && uid_token == o.uid_token && uri_sans == o.uri_sans end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
467 468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/akeyless/models/generate_csr.rb', line 467 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
359 360 361 |
# File 'lib/akeyless/models/generate_csr.rb', line 359 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
365 366 367 |
# File 'lib/akeyless/models/generate_csr.rb', line 365 def hash [alg, alt_names, certificate_type, city, common_name, country, critical, customer_frg_id, dep, email_addresses, export_private_key, ext_key_usage, generate_key, hash_algorithm, ip_addresses, json, key_type, key_usage, name, org, split_level, state, token, uid_token, uri_sans].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/akeyless/models/generate_csr.rb', line 297 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @common_name.nil? invalid_properties.push('invalid value for "common_name", common_name cannot be nil.') end if @key_type.nil? invalid_properties.push('invalid value for "key_type", key_type cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
443 444 445 |
# File 'lib/akeyless/models/generate_csr.rb', line 443 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/akeyless/models/generate_csr.rb', line 449 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
437 438 439 |
# File 'lib/akeyless/models/generate_csr.rb', line 437 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
317 318 319 320 321 322 323 |
# File 'lib/akeyless/models/generate_csr.rb', line 317 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @common_name.nil? return false if @key_type.nil? return false if @name.nil? true end |