Class: Infrawrench::BillingNamespace
- Inherits:
-
Object
- Object
- Infrawrench::BillingNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.billing
Instance Attribute Summary collapse
-
#capacity ⇒ BillingCapacityNamespace
readonly
client.billing.capacity.
Instance Method Summary collapse
-
#checkout(org_id: nil, request_options: nil) ⇒ Hash
Start a Stripe Checkout session.
-
#initialize(transport) ⇒ BillingNamespace
constructor
private
A new instance of BillingNamespace.
-
#portal(org_id: nil, request_options: nil) ⇒ Hash
Get a Stripe customer portal URL.
-
#status(org_id: nil, request_options: nil) ⇒ Hash
Get the org's billing status (complimentary flag + subscription or
null).
Constructor Details
#initialize(transport) ⇒ BillingNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of BillingNamespace.
1822 1823 1824 1825 |
# File 'lib/infrawrench/client.rb', line 1822 def initialize(transport) @transport = transport @capacity = BillingCapacityNamespace.new(@transport) end |
Instance Attribute Details
#capacity ⇒ BillingCapacityNamespace (readonly)
Returns client.billing.capacity.
1818 1819 1820 |
# File 'lib/infrawrench/client.rb', line 1818 def capacity @capacity end |
Instance Method Details
#checkout(org_id: nil, request_options: nil) ⇒ Hash
Start a Stripe Checkout session
Rejected with 400 for complimentary organizations — they are never billed.
Requires permission: billing:write.
POST /api/org/orgId/billing/checkout
Raises on 400: Bad request
Raises on 500: Server error
1844 1845 1846 1847 1848 1849 1850 1851 |
# File 'lib/infrawrench/client.rb', line 1844 def checkout(org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/billing/checkout", path_params: { "orgId" => org_id }, request_options: ) end |
#portal(org_id: nil, request_options: nil) ⇒ Hash
Get a Stripe customer portal URL
Requires permission: billing:write.
POST /api/org/orgId/billing/portal
Raises on 404: Not found
1866 1867 1868 1869 1870 1871 1872 1873 |
# File 'lib/infrawrench/client.rb', line 1866 def portal(org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/billing/portal", path_params: { "orgId" => org_id }, request_options: ) end |
#status(org_id: nil, request_options: nil) ⇒ Hash
Get the org's billing status (complimentary flag + subscription or null)
Requires permission: billing:read.
GET /api/org/orgId/billing/status
1886 1887 1888 1889 1890 1891 1892 1893 |
# File 'lib/infrawrench/client.rb', line 1886 def status(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/billing/status", path_params: { "orgId" => org_id }, request_options: ) end |