Class: Acme::Client::Resources::Order
- Inherits:
-
Object
- Object
- Acme::Client::Resources::Order
- Defined in:
- lib/acme/client/resources/order.rb
Instance Attribute Summary collapse
-
#authorization_urls ⇒ Object
readonly
Returns the value of attribute authorization_urls.
-
#certificate_url ⇒ Object
readonly
Returns the value of attribute certificate_url.
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
-
#expires ⇒ Object
readonly
Returns the value of attribute expires.
-
#finalize_url ⇒ Object
readonly
Returns the value of attribute finalize_url.
-
#identifiers ⇒ Object
readonly
Returns the value of attribute identifiers.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #authorizations ⇒ Object
- #certificate(force_chain: nil) ⇒ Object
- #finalize(csr:) ⇒ Object
-
#initialize(client, **arguments) ⇒ Order
constructor
A new instance of Order.
- #reload ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(client, **arguments) ⇒ Order
Returns a new instance of Order.
6 7 8 9 |
# File 'lib/acme/client/resources/order.rb', line 6 def initialize(client, **arguments) @client = client assign_attributes(**arguments) end |
Instance Attribute Details
#authorization_urls ⇒ Object (readonly)
Returns the value of attribute authorization_urls.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def end |
#certificate_url ⇒ Object (readonly)
Returns the value of attribute certificate_url.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def certificate_url @certificate_url end |
#contact ⇒ Object (readonly)
Returns the value of attribute contact.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def contact @contact end |
#expires ⇒ Object (readonly)
Returns the value of attribute expires.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def expires @expires end |
#finalize_url ⇒ Object (readonly)
Returns the value of attribute finalize_url.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def finalize_url @finalize_url end |
#identifiers ⇒ Object (readonly)
Returns the value of attribute identifiers.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def identifiers @identifiers end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def profile @profile end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/acme/client/resources/order.rb', line 4 def url @url end |
Instance Method Details
#authorizations ⇒ Object
20 21 22 23 24 |
# File 'lib/acme/client/resources/order.rb', line 20 def .map do || @client.(url: ) end end |
#certificate(force_chain: nil) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/acme/client/resources/order.rb', line 31 def certificate(force_chain: nil) if certificate_url @client.certificate(url: certificate_url, force_chain: force_chain) else raise Acme::Client::Error::CertificateNotReady, 'No certificate_url to collect the order' end end |
#finalize(csr:) ⇒ Object
26 27 28 29 |
# File 'lib/acme/client/resources/order.rb', line 26 def finalize(csr:) assign_attributes(**@client.finalize(url: finalize_url, csr: csr).to_h) true end |
#reload ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/acme/client/resources/order.rb', line 11 def reload if url.nil? raise Acme::Client::Error::OrderNotReloadable, 'Finalized orders are not reloadable for this CA' end assign_attributes(**@client.order(url: url).to_h) true end |
#to_h ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/acme/client/resources/order.rb', line 39 def to_h { url: url, status: status, expires: expires, finalize_url: finalize_url, authorization_urls: , identifiers: identifiers, certificate_url: certificate_url, profile: profile } end |