Class: Files::Certificate
- Inherits:
-
Object
- Object
- Files::Certificate
- Defined in:
- lib/files.com/models/certificate.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
-
.activate(id, params = {}, options = {}) ⇒ Object
Activate SSL Certificate.
- .all(params = {}, options = {}) ⇒ Object
-
.create(params = {}, options = {}) ⇒ Object
Parameters: name (required) - string - Internal name of the SSL certificate.
-
.deactivate(id, params = {}, options = {}) ⇒ Object
Deactivate SSL Certificate.
- .delete(id, params = {}, options = {}) ⇒ Object
- .destroy(id, params = {}, options = {}) ⇒ Object
-
.find(id, params = {}, options = {}) ⇒ Object
Parameters: id (required) - integer - Certificate ID.
- .get(id, params = {}, options = {}) ⇒ Object
-
.list(params = {}, options = {}) ⇒ Object
Parameters: page - integer - Current page number.
-
.update(id, params = {}, options = {}) ⇒ Object
Parameters: name - string - Internal certificate name.
Instance Method Summary collapse
-
#activate(params = {}) ⇒ Object
Activate SSL Certificate.
-
#brick_managed ⇒ Object
boolean - Is this certificate automatically managed and renewed by Files.com?.
- #brick_managed=(value) ⇒ Object
-
#certificate ⇒ Object
string - Full text of SSL certificate.
- #certificate=(value) ⇒ Object
-
#certificate_city_or_locale ⇒ Object
string - City or locale.
- #certificate_city_or_locale=(value) ⇒ Object
-
#certificate_company_name ⇒ Object
string - Company name.
- #certificate_company_name=(value) ⇒ Object
-
#certificate_country ⇒ Object
string - Country.
- #certificate_country=(value) ⇒ Object
-
#certificate_domain ⇒ Object
string - Domain for certificate.
- #certificate_domain=(value) ⇒ Object
-
#certificate_email_address ⇒ Object
string - Email address for the certificate owner.
- #certificate_email_address=(value) ⇒ Object
-
#certificate_state_or_province ⇒ Object
string - State or province.
- #certificate_state_or_province=(value) ⇒ Object
-
#created_at ⇒ Object
date-time - Certificate created at.
-
#csr_ou1 ⇒ Object
string - Department name or organization unit 1.
- #csr_ou1=(value) ⇒ Object
-
#csr_ou2 ⇒ Object
string - Department name or organization unit 2.
- #csr_ou2=(value) ⇒ Object
-
#csr_ou3 ⇒ Object
string - Department name or organization unit 3.
- #csr_ou3=(value) ⇒ Object
-
#deactivate(params = {}) ⇒ Object
Deactivate SSL Certificate.
- #delete(params = {}) ⇒ Object
- #destroy(params = {}) ⇒ Object
-
#display_status ⇒ Object
string - Certificate status.
- #display_status=(value) ⇒ Object
-
#domains ⇒ Object
array - Domains on this certificate other than files.com domains.
- #domains=(value) ⇒ Object
-
#expires_at ⇒ Object
date-time - Certificate expiration date/time.
- #expires_at=(value) ⇒ Object
-
#id ⇒ Object
int64 - Certificate ID.
- #id=(value) ⇒ Object
-
#initialize(attributes = {}, options = {}) ⇒ Certificate
constructor
A new instance of Certificate.
-
#intermediates ⇒ Object
string - Intermediate certificates.
- #intermediates=(value) ⇒ Object
-
#ip_addresses ⇒ Object
array - A list of IP addresses associated with this SSL Certificate.
- #ip_addresses=(value) ⇒ Object
-
#issuer ⇒ Object
string - X509 issuer.
- #issuer=(value) ⇒ Object
-
#key_type ⇒ Object
string - Type of key.
- #key_type=(value) ⇒ Object
-
#key_type_confirm_given ⇒ Object
string - Confirms the key type.
- #key_type_confirm_given=(value) ⇒ Object
-
#name ⇒ Object
string - Descriptive name of certificate.
- #name=(value) ⇒ Object
-
#password ⇒ Object
string - Certificate password.
- #password=(value) ⇒ Object
-
#private_key ⇒ Object
string - Certificate private key.
- #private_key=(value) ⇒ Object
-
#request ⇒ Object
string - Certificate signing request text.
- #request=(value) ⇒ Object
- #save ⇒ Object
-
#status ⇒ Object
string - Certificate status (Request Generated, New, Active, Active/Expired, Expired, or Available).
- #status=(value) ⇒ Object
-
#subject ⇒ Object
string - X509 Subject name.
- #subject=(value) ⇒ Object
-
#update(params = {}) ⇒ Object
Parameters: name - string - Internal certificate name.
-
#updated_at ⇒ Object
date-time - Certificated last updated at.
Constructor Details
#initialize(attributes = {}, options = {}) ⇒ Certificate
Returns a new instance of Certificate.
7 8 9 10 |
# File 'lib/files.com/models/certificate.rb', line 7 def initialize(attributes = {}, = {}) @attributes = attributes || {} @options = || {} end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/files.com/models/certificate.rb', line 5 def attributes @attributes end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/files.com/models/certificate.rb', line 5 def @options end |
Class Method Details
.activate(id, params = {}, options = {}) ⇒ Object
Activate SSL Certificate
Parameters:
replace_cert - string - Leave blank, set to `any` or `new_ips`.
410 411 412 413 414 415 416 417 418 419 |
# File 'lib/files.com/models/certificate.rb', line 410 def self.activate(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise InvalidParameterError.new("Bad parameter: replace_cert must be an String") if params.dig(:replace_cert) and !params.dig(:replace_cert).is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) response, = Api.send_request("/certificates/#{params[:id]}/activate", :post, params, ) response.data end |
.all(params = {}, options = {}) ⇒ Object
335 336 337 |
# File 'lib/files.com/models/certificate.rb', line 335 def self.all(params = {}, = {}) list(params, ) end |
.create(params = {}, options = {}) ⇒ Object
Parameters:
name (required) - string - Internal name of the SSL certificate.
certificate_domain - string - Domain for certificate.
certificate_country - string - Country.
certificate_state_or_province - string - State or province.
certificate_city_or_locale - string - City or locale.
certificate_company_name - string - Company name.
csr_ou1 - string - Department name or organization unit 1
csr_ou2 - string - Department name or organization unit 2
csr_ou3 - string - Department name or organization unit 3
certificate_email_address - string - Email address for the certificate owner.
key_type - string - Any supported key type. Defaults to `RSA-4096`.
key_type_confirm_given - string - Confirms the key type.
certificate - string - The certificate. PEM or PKCS7 formats accepted.
private_key - string - Certificate private key.
password - string - Certificate password.
intermediates - string - Intermediate certificates. PEM or PKCS7 formats accepted.
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 |
# File 'lib/files.com/models/certificate.rb', line 372 def self.create(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate_domain must be an String") if params.dig(:certificate_domain) and !params.dig(:certificate_domain).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate_country must be an String") if params.dig(:certificate_country) and !params.dig(:certificate_country).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate_state_or_province must be an String") if params.dig(:certificate_state_or_province) and !params.dig(:certificate_state_or_province).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate_city_or_locale must be an String") if params.dig(:certificate_city_or_locale) and !params.dig(:certificate_city_or_locale).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate_company_name must be an String") if params.dig(:certificate_company_name) and !params.dig(:certificate_company_name).is_a?(String) raise InvalidParameterError.new("Bad parameter: csr_ou1 must be an String") if params.dig(:csr_ou1) and !params.dig(:csr_ou1).is_a?(String) raise InvalidParameterError.new("Bad parameter: csr_ou2 must be an String") if params.dig(:csr_ou2) and !params.dig(:csr_ou2).is_a?(String) raise InvalidParameterError.new("Bad parameter: csr_ou3 must be an String") if params.dig(:csr_ou3) and !params.dig(:csr_ou3).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate_email_address must be an String") if params.dig(:certificate_email_address) and !params.dig(:certificate_email_address).is_a?(String) raise InvalidParameterError.new("Bad parameter: key_type must be an String") if params.dig(:key_type) and !params.dig(:key_type).is_a?(String) raise InvalidParameterError.new("Bad parameter: key_type_confirm_given must be an String") if params.dig(:key_type_confirm_given) and !params.dig(:key_type_confirm_given).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate must be an String") if params.dig(:certificate) and !params.dig(:certificate).is_a?(String) raise InvalidParameterError.new("Bad parameter: private_key must be an String") if params.dig(:private_key) and !params.dig(:private_key).is_a?(String) raise InvalidParameterError.new("Bad parameter: password must be an String") if params.dig(:password) and !params.dig(:password).is_a?(String) raise InvalidParameterError.new("Bad parameter: intermediates must be an String") if params.dig(:intermediates) and !params.dig(:intermediates).is_a?(String) raise MissingParameterError.new("Parameter missing: name") unless params.dig(:name) response, = Api.send_request("/certificates", :post, params, ) Certificate.new(response.data, ) end |
.deactivate(id, params = {}, options = {}) ⇒ Object
Deactivate SSL Certificate
396 397 398 399 400 401 402 403 404 |
# File 'lib/files.com/models/certificate.rb', line 396 def self.deactivate(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) response, = Api.send_request("/certificates/#{params[:id]}/deactivate", :post, params, ) response.data end |
.delete(id, params = {}, options = {}) ⇒ Object
438 439 440 441 442 443 444 445 446 |
# File 'lib/files.com/models/certificate.rb', line 438 def self.delete(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) response, = Api.send_request("/certificates/#{params[:id]}", :delete, params, ) response.data end |
.destroy(id, params = {}, options = {}) ⇒ Object
448 449 450 |
# File 'lib/files.com/models/certificate.rb', line 448 def self.destroy(id, params = {}, = {}) delete(id, params, ) end |
.find(id, params = {}, options = {}) ⇒ Object
Parameters:
id (required) - integer - Certificate ID.
341 342 343 344 345 346 347 348 349 |
# File 'lib/files.com/models/certificate.rb', line 341 def self.find(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) response, = Api.send_request("/certificates/#{params[:id]}", :get, params, ) Certificate.new(response.data, ) end |
.get(id, params = {}, options = {}) ⇒ Object
351 352 353 |
# File 'lib/files.com/models/certificate.rb', line 351 def self.get(id, params = {}, = {}) find(id, params, ) end |
.list(params = {}, options = {}) ⇒ Object
Parameters:
page - integer - Current page number.
per_page - integer - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
action - string - Deprecated: If set to `count` returns a count of matching records rather than the records themselves.
326 327 328 329 330 331 332 333 |
# File 'lib/files.com/models/certificate.rb', line 326 def self.list(params = {}, = {}) raise InvalidParameterError.new("Bad parameter: page must be an Integer") if params.dig(:page) and !params.dig(:page).is_a?(Integer) raise InvalidParameterError.new("Bad parameter: per_page must be an Integer") if params.dig(:per_page) and !params.dig(:per_page).is_a?(Integer) raise InvalidParameterError.new("Bad parameter: action must be an String") if params.dig(:action) and !params.dig(:action).is_a?(String) response, = Api.send_request("/certificates", :get, params, ) response.data.map { |object| Certificate.new(object, ) } end |
.update(id, params = {}, options = {}) ⇒ Object
Parameters:
name - string - Internal certificate name.
intermediates - string - Any intermediate certificates. PEM or PKCS7 formats accepted.
certificate - string - The certificate. PEM or PKCS7 formats accepted.
425 426 427 428 429 430 431 432 433 434 435 436 |
# File 'lib/files.com/models/certificate.rb', line 425 def self.update(id, params = {}, = {}) params ||= {} params[:id] = id raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String) raise InvalidParameterError.new("Bad parameter: intermediates must be an String") if params.dig(:intermediates) and !params.dig(:intermediates).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate must be an String") if params.dig(:certificate) and !params.dig(:certificate).is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) response, = Api.send_request("/certificates/#{params[:id]}", :patch, params, ) Certificate.new(response.data, ) end |
Instance Method Details
#activate(params = {}) ⇒ Object
Activate SSL Certificate
Parameters:
replace_cert - string - Leave blank, set to `any` or `new_ips`.
271 272 273 274 275 276 277 278 279 280 |
# File 'lib/files.com/models/certificate.rb', line 271 def activate(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise InvalidParameterError.new("Bad parameter: replace_cert must be an String") if params.dig(:replace_cert) and !params.dig(:replace_cert).is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) Api.send_request("/certificates/#{@attributes[:id]}/activate", :post, params, @options) end |
#brick_managed ⇒ Object
boolean - Is this certificate automatically managed and renewed by Files.com?
63 64 65 |
# File 'lib/files.com/models/certificate.rb', line 63 def brick_managed @attributes[:brick_managed] end |
#brick_managed=(value) ⇒ Object
67 68 69 |
# File 'lib/files.com/models/certificate.rb', line 67 def brick_managed=(value) @attributes[:brick_managed] = value end |
#certificate ⇒ Object
string - Full text of SSL certificate
22 23 24 |
# File 'lib/files.com/models/certificate.rb', line 22 def certificate @attributes[:certificate] end |
#certificate=(value) ⇒ Object
26 27 28 |
# File 'lib/files.com/models/certificate.rb', line 26 def certificate=(value) @attributes[:certificate] = value end |
#certificate_city_or_locale ⇒ Object
string - City or locale.
176 177 178 |
# File 'lib/files.com/models/certificate.rb', line 176 def certificate_city_or_locale @attributes[:certificate_city_or_locale] end |
#certificate_city_or_locale=(value) ⇒ Object
180 181 182 |
# File 'lib/files.com/models/certificate.rb', line 180 def certificate_city_or_locale=(value) @attributes[:certificate_city_or_locale] = value end |
#certificate_company_name ⇒ Object
string - Company name.
185 186 187 |
# File 'lib/files.com/models/certificate.rb', line 185 def certificate_company_name @attributes[:certificate_company_name] end |
#certificate_company_name=(value) ⇒ Object
189 190 191 |
# File 'lib/files.com/models/certificate.rb', line 189 def certificate_company_name=(value) @attributes[:certificate_company_name] = value end |
#certificate_country ⇒ Object
string - Country.
158 159 160 |
# File 'lib/files.com/models/certificate.rb', line 158 def certificate_country @attributes[:certificate_country] end |
#certificate_country=(value) ⇒ Object
162 163 164 |
# File 'lib/files.com/models/certificate.rb', line 162 def certificate_country=(value) @attributes[:certificate_country] = value end |
#certificate_domain ⇒ Object
string - Domain for certificate.
149 150 151 |
# File 'lib/files.com/models/certificate.rb', line 149 def certificate_domain @attributes[:certificate_domain] end |
#certificate_domain=(value) ⇒ Object
153 154 155 |
# File 'lib/files.com/models/certificate.rb', line 153 def certificate_domain=(value) @attributes[:certificate_domain] = value end |
#certificate_email_address ⇒ Object
string - Email address for the certificate owner.
221 222 223 |
# File 'lib/files.com/models/certificate.rb', line 221 def certificate_email_address @attributes[:certificate_email_address] end |
#certificate_email_address=(value) ⇒ Object
225 226 227 |
# File 'lib/files.com/models/certificate.rb', line 225 def certificate_email_address=(value) @attributes[:certificate_email_address] = value end |
#certificate_state_or_province ⇒ Object
string - State or province.
167 168 169 |
# File 'lib/files.com/models/certificate.rb', line 167 def certificate_state_or_province @attributes[:certificate_state_or_province] end |
#certificate_state_or_province=(value) ⇒ Object
171 172 173 |
# File 'lib/files.com/models/certificate.rb', line 171 def certificate_state_or_province=(value) @attributes[:certificate_state_or_province] = value end |
#created_at ⇒ Object
date-time - Certificate created at
31 32 33 |
# File 'lib/files.com/models/certificate.rb', line 31 def created_at @attributes[:created_at] end |
#csr_ou1 ⇒ Object
string - Department name or organization unit 1
194 195 196 |
# File 'lib/files.com/models/certificate.rb', line 194 def csr_ou1 @attributes[:csr_ou1] end |
#csr_ou1=(value) ⇒ Object
198 199 200 |
# File 'lib/files.com/models/certificate.rb', line 198 def csr_ou1=(value) @attributes[:csr_ou1] = value end |
#csr_ou2 ⇒ Object
string - Department name or organization unit 2
203 204 205 |
# File 'lib/files.com/models/certificate.rb', line 203 def csr_ou2 @attributes[:csr_ou2] end |
#csr_ou2=(value) ⇒ Object
207 208 209 |
# File 'lib/files.com/models/certificate.rb', line 207 def csr_ou2=(value) @attributes[:csr_ou2] = value end |
#csr_ou3 ⇒ Object
string - Department name or organization unit 3
212 213 214 |
# File 'lib/files.com/models/certificate.rb', line 212 def csr_ou3 @attributes[:csr_ou3] end |
#csr_ou3=(value) ⇒ Object
216 217 218 |
# File 'lib/files.com/models/certificate.rb', line 216 def csr_ou3=(value) @attributes[:csr_ou3] = value end |
#deactivate(params = {}) ⇒ Object
Deactivate SSL Certificate
257 258 259 260 261 262 263 264 265 |
# File 'lib/files.com/models/certificate.rb', line 257 def deactivate(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) Api.send_request("/certificates/#{@attributes[:id]}/deactivate", :post, params, @options) end |
#delete(params = {}) ⇒ Object
299 300 301 302 303 304 305 306 307 |
# File 'lib/files.com/models/certificate.rb', line 299 def delete(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) Api.send_request("/certificates/#{@attributes[:id]}", :delete, params, @options) end |
#destroy(params = {}) ⇒ Object
309 310 311 |
# File 'lib/files.com/models/certificate.rb', line 309 def destroy(params = {}) delete(params) end |
#display_status ⇒ Object
string - Certificate status. (One of ‘Request Generated`, `New`, `Active`, `Active/Expired`, `Expired`, or `Available`)
36 37 38 |
# File 'lib/files.com/models/certificate.rb', line 36 def display_status @attributes[:display_status] end |
#display_status=(value) ⇒ Object
40 41 42 |
# File 'lib/files.com/models/certificate.rb', line 40 def display_status=(value) @attributes[:display_status] = value end |
#domains ⇒ Object
array - Domains on this certificate other than files.com domains
45 46 47 |
# File 'lib/files.com/models/certificate.rb', line 45 def domains @attributes[:domains] end |
#domains=(value) ⇒ Object
49 50 51 |
# File 'lib/files.com/models/certificate.rb', line 49 def domains=(value) @attributes[:domains] = value end |
#expires_at ⇒ Object
date-time - Certificate expiration date/time
54 55 56 |
# File 'lib/files.com/models/certificate.rb', line 54 def expires_at @attributes[:expires_at] end |
#expires_at=(value) ⇒ Object
58 59 60 |
# File 'lib/files.com/models/certificate.rb', line 58 def expires_at=(value) @attributes[:expires_at] = value end |
#id ⇒ Object
int64 - Certificate ID
13 14 15 |
# File 'lib/files.com/models/certificate.rb', line 13 def id @attributes[:id] end |
#id=(value) ⇒ Object
17 18 19 |
# File 'lib/files.com/models/certificate.rb', line 17 def id=(value) @attributes[:id] = value end |
#intermediates ⇒ Object
string - Intermediate certificates
72 73 74 |
# File 'lib/files.com/models/certificate.rb', line 72 def intermediates @attributes[:intermediates] end |
#intermediates=(value) ⇒ Object
76 77 78 |
# File 'lib/files.com/models/certificate.rb', line 76 def intermediates=(value) @attributes[:intermediates] = value end |
#ip_addresses ⇒ Object
array - A list of IP addresses associated with this SSL Certificate
81 82 83 |
# File 'lib/files.com/models/certificate.rb', line 81 def ip_addresses @attributes[:ip_addresses] end |
#ip_addresses=(value) ⇒ Object
85 86 87 |
# File 'lib/files.com/models/certificate.rb', line 85 def ip_addresses=(value) @attributes[:ip_addresses] = value end |
#issuer ⇒ Object
string - X509 issuer
90 91 92 |
# File 'lib/files.com/models/certificate.rb', line 90 def issuer @attributes[:issuer] end |
#issuer=(value) ⇒ Object
94 95 96 |
# File 'lib/files.com/models/certificate.rb', line 94 def issuer=(value) @attributes[:issuer] = value end |
#key_type ⇒ Object
string - Type of key
108 109 110 |
# File 'lib/files.com/models/certificate.rb', line 108 def key_type @attributes[:key_type] end |
#key_type=(value) ⇒ Object
112 113 114 |
# File 'lib/files.com/models/certificate.rb', line 112 def key_type=(value) @attributes[:key_type] = value end |
#key_type_confirm_given ⇒ Object
string - Confirms the key type.
230 231 232 |
# File 'lib/files.com/models/certificate.rb', line 230 def key_type_confirm_given @attributes[:key_type_confirm_given] end |
#key_type_confirm_given=(value) ⇒ Object
234 235 236 |
# File 'lib/files.com/models/certificate.rb', line 234 def key_type_confirm_given=(value) @attributes[:key_type_confirm_given] = value end |
#name ⇒ Object
string - Descriptive name of certificate
99 100 101 |
# File 'lib/files.com/models/certificate.rb', line 99 def name @attributes[:name] end |
#name=(value) ⇒ Object
103 104 105 |
# File 'lib/files.com/models/certificate.rb', line 103 def name=(value) @attributes[:name] = value end |
#password ⇒ Object
string - Certificate password.
248 249 250 |
# File 'lib/files.com/models/certificate.rb', line 248 def password @attributes[:password] end |
#password=(value) ⇒ Object
252 253 254 |
# File 'lib/files.com/models/certificate.rb', line 252 def password=(value) @attributes[:password] = value end |
#private_key ⇒ Object
string - Certificate private key.
239 240 241 |
# File 'lib/files.com/models/certificate.rb', line 239 def private_key @attributes[:private_key] end |
#private_key=(value) ⇒ Object
243 244 245 |
# File 'lib/files.com/models/certificate.rb', line 243 def private_key=(value) @attributes[:private_key] = value end |
#request ⇒ Object
string - Certificate signing request text
117 118 119 |
# File 'lib/files.com/models/certificate.rb', line 117 def request @attributes[:request] end |
#request=(value) ⇒ Object
121 122 123 |
# File 'lib/files.com/models/certificate.rb', line 121 def request=(value) @attributes[:request] = value end |
#save ⇒ Object
313 314 315 316 317 318 319 320 |
# File 'lib/files.com/models/certificate.rb', line 313 def save if @attributes[:id] update(@attributes) else new_obj = Certificate.create(@attributes, @options) @attributes = new_obj.attributes end end |
#status ⇒ Object
string - Certificate status (Request Generated, New, Active, Active/Expired, Expired, or Available)
126 127 128 |
# File 'lib/files.com/models/certificate.rb', line 126 def status @attributes[:status] end |
#status=(value) ⇒ Object
130 131 132 |
# File 'lib/files.com/models/certificate.rb', line 130 def status=(value) @attributes[:status] = value end |
#subject ⇒ Object
string - X509 Subject name
135 136 137 |
# File 'lib/files.com/models/certificate.rb', line 135 def subject @attributes[:subject] end |
#subject=(value) ⇒ Object
139 140 141 |
# File 'lib/files.com/models/certificate.rb', line 139 def subject=(value) @attributes[:subject] = value end |
#update(params = {}) ⇒ Object
Parameters:
name - string - Internal certificate name.
intermediates - string - Any intermediate certificates. PEM or PKCS7 formats accepted.
certificate - string - The certificate. PEM or PKCS7 formats accepted.
286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/files.com/models/certificate.rb', line 286 def update(params = {}) params ||= {} params[:id] = @attributes[:id] raise MissingParameterError.new("Current object doesn't have a id") unless @attributes[:id] raise InvalidParameterError.new("Bad parameter: id must be an Integer") if params.dig(:id) and !params.dig(:id).is_a?(Integer) raise InvalidParameterError.new("Bad parameter: name must be an String") if params.dig(:name) and !params.dig(:name).is_a?(String) raise InvalidParameterError.new("Bad parameter: intermediates must be an String") if params.dig(:intermediates) and !params.dig(:intermediates).is_a?(String) raise InvalidParameterError.new("Bad parameter: certificate must be an String") if params.dig(:certificate) and !params.dig(:certificate).is_a?(String) raise MissingParameterError.new("Parameter missing: id") unless params.dig(:id) Api.send_request("/certificates/#{@attributes[:id]}", :patch, params, @options) end |
#updated_at ⇒ Object
date-time - Certificated last updated at
144 145 146 |
# File 'lib/files.com/models/certificate.rb', line 144 def updated_at @attributes[:updated_at] end |