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
The DNS Alternative Names to be included in the CSR certificate (in a comma-separated list).
-
#certificate_type ⇒ Object
The certificateType to be included 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 commonName 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).
-
#dep ⇒ Object
The department to be included in the CSR certificate.
-
#description ⇒ Object
Description of the object.
-
#email_addresses ⇒ Object
The email addresses Alternative Names to be included in the CSR certificate (in a comma-separated list).
-
#generate_key ⇒ Object
Generate a new csr key.
-
#ip_addresses ⇒ Object
The ip addresses Alternative Names to be included in the CSR certificate (in a comma-separated list).
-
#json ⇒ Object
Set output format to JSON.
-
#metadata ⇒ Object
Deprecated - use description.
-
#name ⇒ Object
Key name in akeyless.
-
#org ⇒ Object
The organization to be included in the CSR certificate.
-
#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
The URI Subject Alternative Names to be included in the CSR certificate (in a comma-separated list).
Class Method Summary collapse
-
.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.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from 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
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 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 |
# File 'lib/akeyless/models/generate_csr.rb', line 142 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'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'critical') self.critical = attributes[:'critical'] end if attributes.key?(:'dep') self.dep = attributes[:'dep'] end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'email_addresses') self.email_addresses = attributes[:'email_addresses'] end if attributes.key?(:'generate_key') self.generate_key = attributes[:'generate_key'] 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?(:'metadata') self. = attributes[:'metadata'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'org') self.org = attributes[:'org'] 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
The DNS Alternative Names to be included in the CSR certificate (in a comma-separated list)
21 22 23 |
# File 'lib/akeyless/models/generate_csr.rb', line 21 def alt_names @alt_names end |
#certificate_type ⇒ Object
The certificateType to be included 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 commonName 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 |
#dep ⇒ Object
The department to be included in the CSR certificate
39 40 41 |
# File 'lib/akeyless/models/generate_csr.rb', line 39 def dep @dep end |
#description ⇒ Object
Description of the object
42 43 44 |
# File 'lib/akeyless/models/generate_csr.rb', line 42 def description @description end |
#email_addresses ⇒ Object
The email addresses Alternative Names to be included in the CSR certificate (in a comma-separated list)
45 46 47 |
# File 'lib/akeyless/models/generate_csr.rb', line 45 def email_addresses @email_addresses end |
#generate_key ⇒ Object
Generate a new csr key
48 49 50 |
# File 'lib/akeyless/models/generate_csr.rb', line 48 def generate_key @generate_key end |
#ip_addresses ⇒ Object
The ip addresses Alternative Names to be included in the CSR certificate (in a comma-separated list)
51 52 53 |
# File 'lib/akeyless/models/generate_csr.rb', line 51 def ip_addresses @ip_addresses end |
#json ⇒ Object
Set output format to JSON
54 55 56 |
# File 'lib/akeyless/models/generate_csr.rb', line 54 def json @json end |
#metadata ⇒ Object
Deprecated - use description
57 58 59 |
# File 'lib/akeyless/models/generate_csr.rb', line 57 def @metadata end |
#name ⇒ Object
Key name in akeyless
60 61 62 |
# File 'lib/akeyless/models/generate_csr.rb', line 60 def name @name end |
#org ⇒ Object
The organization to be included in the CSR certificate
63 64 65 |
# File 'lib/akeyless/models/generate_csr.rb', line 63 def org @org end |
#state ⇒ Object
The state to be included in the CSR certificate
66 67 68 |
# File 'lib/akeyless/models/generate_csr.rb', line 66 def state @state end |
#token ⇒ Object
Authentication token (see /auth and /configure)
69 70 71 |
# File 'lib/akeyless/models/generate_csr.rb', line 69 def token @token end |
#uid_token ⇒ Object
The universal identity token, Required only for universal_identity authentication
72 73 74 |
# File 'lib/akeyless/models/generate_csr.rb', line 72 def uid_token @uid_token end |
#uri_sans ⇒ Object
The URI Subject Alternative Names to be included in the CSR certificate (in a comma-separated list)
75 76 77 |
# File 'lib/akeyless/models/generate_csr.rb', line 75 def uri_sans @uri_sans end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
104 105 106 |
# File 'lib/akeyless/models/generate_csr.rb', line 104 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/akeyless/models/generate_csr.rb', line 78 def self.attribute_map { :'alg' => :'alg', :'alt_names' => :'alt-names', :'certificate_type' => :'certificate-type', :'city' => :'city', :'common_name' => :'common-name', :'country' => :'country', :'critical' => :'critical', :'dep' => :'dep', :'description' => :'description', :'email_addresses' => :'email-addresses', :'generate_key' => :'generate-key', :'ip_addresses' => :'ip-addresses', :'json' => :'json', :'metadata' => :'metadata', :'name' => :'name', :'org' => :'org', :'state' => :'state', :'token' => :'token', :'uid_token' => :'uid-token', :'uri_sans' => :'uri-sans' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
303 304 305 |
# File 'lib/akeyless/models/generate_csr.rb', line 303 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
135 136 137 138 |
# File 'lib/akeyless/models/generate_csr.rb', line 135 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/akeyless/models/generate_csr.rb', line 109 def self.openapi_types { :'alg' => :'String', :'alt_names' => :'String', :'certificate_type' => :'String', :'city' => :'String', :'common_name' => :'String', :'country' => :'String', :'critical' => :'Boolean', :'dep' => :'String', :'description' => :'String', :'email_addresses' => :'String', :'generate_key' => :'Boolean', :'ip_addresses' => :'String', :'json' => :'Boolean', :'metadata' => :'String', :'name' => :'String', :'org' => :'String', :'state' => :'String', :'token' => :'String', :'uid_token' => :'String', :'uri_sans' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/akeyless/models/generate_csr.rb', line 263 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 && dep == o.dep && description == o.description && email_addresses == o.email_addresses && generate_key == o.generate_key && ip_addresses == o.ip_addresses && json == o.json && == o. && name == o.name && org == o.org && state == o.state && token == o.token && uid_token == o.uid_token && uri_sans == o.uri_sans end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 |
# File 'lib/akeyless/models/generate_csr.rb', line 334 def _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_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
405 406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/akeyless/models/generate_csr.rb', line 405 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File 'lib/akeyless/models/generate_csr.rb', line 310 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
290 291 292 |
# File 'lib/akeyless/models/generate_csr.rb', line 290 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
296 297 298 |
# File 'lib/akeyless/models/generate_csr.rb', line 296 def hash [alg, alt_names, certificate_type, city, common_name, country, critical, dep, description, email_addresses, generate_key, ip_addresses, json, , name, org, state, token, uid_token, uri_sans].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/akeyless/models/generate_csr.rb', line 240 def list_invalid_properties invalid_properties = Array.new if @common_name.nil? invalid_properties.push('invalid value for "common_name", common_name 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)
381 382 383 |
# File 'lib/akeyless/models/generate_csr.rb', line 381 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
387 388 389 390 391 392 393 394 395 396 397 398 399 |
# File 'lib/akeyless/models/generate_csr.rb', line 387 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
375 376 377 |
# File 'lib/akeyless/models/generate_csr.rb', line 375 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
255 256 257 258 259 |
# File 'lib/akeyless/models/generate_csr.rb', line 255 def valid? return false if @common_name.nil? return false if @name.nil? true end |