|
| 1 | +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +import { APIResource } from '../resource'; |
| 4 | +import * as Core from '../core'; |
| 5 | + |
| 6 | +export class Accounts extends APIResource { |
| 7 | + /** |
| 8 | + * Returns the account the API key or session is authenticated against, including |
| 9 | + * id, name, tier, and billing summary. |
| 10 | + */ |
| 11 | + me(options?: Core.RequestOptions): Core.APIPromise<AccountView> { |
| 12 | + return this._client.get('/v1/accounts/me', options); |
| 13 | + } |
| 14 | +} |
| 15 | + |
| 16 | +/** |
| 17 | + * Account information. |
| 18 | + */ |
| 19 | +export interface AccountView { |
| 20 | + /** |
| 21 | + * The account ID. |
| 22 | + */ |
| 23 | + id: string; |
| 24 | + |
| 25 | + /** |
| 26 | + * The account status. |
| 27 | + */ |
| 28 | + account_status: |
| 29 | + | 'ACCOUNT_STATUS_INVALID' |
| 30 | + | 'ACCOUNT_STATUS_ONBOARDING' |
| 31 | + | 'ACCOUNT_STATUS_ENABLED' |
| 32 | + | 'ACCOUNT_STATUS_DISABLED_BY_ADMIN' |
| 33 | + | 'ACCOUNT_STATUS_DISABLED_QUOTA_REACHED' |
| 34 | + | 'ACCOUNT_STATUS_TRIAL_CANCELLED' |
| 35 | + | 'ACCOUNT_STATUS_STRIPE_PENDING_RESOURCES' |
| 36 | + | 'UNRECOGNIZED'; |
| 37 | + |
| 38 | + /** |
| 39 | + * The account billing information. |
| 40 | + */ |
| 41 | + billing: AccountView.Billing; |
| 42 | + |
| 43 | + /** |
| 44 | + * The account creation timestamp. |
| 45 | + */ |
| 46 | + created_at: string; |
| 47 | + |
| 48 | + /** |
| 49 | + * The account name. |
| 50 | + */ |
| 51 | + name: string; |
| 52 | + |
| 53 | + /** |
| 54 | + * The account tier. |
| 55 | + */ |
| 56 | + tier: |
| 57 | + | 'ACCOUNT_TIER_INVALID' |
| 58 | + | 'ACCOUNT_TIER_BASIC' |
| 59 | + | 'ACCOUNT_TIER_PRO' |
| 60 | + | 'ACCOUNT_TIER_ENTERPRISE' |
| 61 | + | 'ACCOUNT_TIER_TRIAL' |
| 62 | + | 'UNRECOGNIZED'; |
| 63 | + |
| 64 | + /** |
| 65 | + * Deprecated: use billing.account_billing_type. |
| 66 | + */ |
| 67 | + account_billing_type?: 'STRIPE' | 'AWS_MARKETPLACE' | 'STRIPE_PROJECTS' | 'UNRECOGNIZED'; |
| 68 | + |
| 69 | + /** |
| 70 | + * Deprecated: use billing.stripe.active_subscription. |
| 71 | + */ |
| 72 | + active_subscription?: string | null; |
| 73 | + |
| 74 | + /** |
| 75 | + * Deprecated: use billing.aws.customer_identifier. |
| 76 | + */ |
| 77 | + external_billing_account_id?: string | null; |
| 78 | + |
| 79 | + /** |
| 80 | + * Deprecated: use billing.stripe.customer_id. |
| 81 | + */ |
| 82 | + stripe_customer_id?: string | null; |
| 83 | +} |
| 84 | + |
| 85 | +export namespace AccountView { |
| 86 | + /** |
| 87 | + * The account billing information. |
| 88 | + */ |
| 89 | + export interface Billing { |
| 90 | + /** |
| 91 | + * The account billing type. |
| 92 | + */ |
| 93 | + account_billing_type: 'STRIPE' | 'AWS_MARKETPLACE' | 'STRIPE_PROJECTS' | 'UNRECOGNIZED'; |
| 94 | + |
| 95 | + /** |
| 96 | + * AWS Marketplace billing information. |
| 97 | + */ |
| 98 | + aws?: Billing.Aws | null; |
| 99 | + |
| 100 | + /** |
| 101 | + * Stripe billing information. |
| 102 | + */ |
| 103 | + stripe?: Billing.Stripe | null; |
| 104 | + |
| 105 | + /** |
| 106 | + * Deprecated: use stripe.customer_id. |
| 107 | + */ |
| 108 | + stripe_customer_id?: string | null; |
| 109 | + } |
| 110 | + |
| 111 | + export namespace Billing { |
| 112 | + /** |
| 113 | + * AWS Marketplace billing information. |
| 114 | + */ |
| 115 | + export interface Aws { |
| 116 | + /** |
| 117 | + * The AWS account ID used for Marketplace billing (12-digit). |
| 118 | + */ |
| 119 | + customer_identifier?: string | null; |
| 120 | + |
| 121 | + /** |
| 122 | + * The AWS Marketplace license ARN. |
| 123 | + */ |
| 124 | + license_arn?: string | null; |
| 125 | + |
| 126 | + /** |
| 127 | + * The AWS Marketplace subscription status. |
| 128 | + */ |
| 129 | + subscription_status?: string | null; |
| 130 | + } |
| 131 | + |
| 132 | + /** |
| 133 | + * Stripe billing information. |
| 134 | + */ |
| 135 | + export interface Stripe { |
| 136 | + /** |
| 137 | + * The active Stripe subscription ID. |
| 138 | + */ |
| 139 | + active_subscription?: string | null; |
| 140 | + |
| 141 | + /** |
| 142 | + * The Stripe customer ID. |
| 143 | + */ |
| 144 | + customer_id?: string | null; |
| 145 | + } |
| 146 | + } |
| 147 | +} |
| 148 | + |
| 149 | +export declare namespace Accounts { |
| 150 | + export { type AccountView as AccountView }; |
| 151 | +} |
0 commit comments