Skip to content

Commit

Permalink
Update services based on v1254 of Stripe OpenApi SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
diogo-braz committed Sep 13, 2024
1 parent 42970bd commit 5db45fa
Show file tree
Hide file tree
Showing 154 changed files with 30,280 additions and 7,532 deletions.
2 changes: 1 addition & 1 deletion .latest-tag-stripe-openapi-sdk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1214
v1254
423 changes: 263 additions & 160 deletions lib/generated/account.ex

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion lib/generated/account_link.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ defmodule Stripe.AccountLink do
@type t :: %__MODULE__{created: integer, expires_at: integer, object: binary, url: binary}
)

(
@typedoc "Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow."
@type collection_options :: %{
optional(:fields) => :currently_due | :eventually_due,
optional(:future_requirements) => :include | :omit
}
)

(
nil

Expand All @@ -18,6 +26,7 @@ defmodule Stripe.AccountLink do
params :: %{
optional(:account) => binary,
optional(:collect) => :currently_due | :eventually_due,
optional(:collection_options) => collection_options,
optional(:expand) => list(binary),
optional(:refresh_url) => binary,
optional(:return_url) => binary,
Expand All @@ -36,4 +45,4 @@ defmodule Stripe.AccountLink do
end
)
)
end
end
49 changes: 46 additions & 3 deletions lib/generated/account_session.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,58 @@ defmodule Stripe.AccountSession do
}
)

(
@typedoc "Configuration for the account management embedded component."
@type account_management :: %{optional(:enabled) => boolean, optional(:features) => features}
)

(
@typedoc "Configuration for the account onboarding embedded component."
@type account_onboarding :: %{optional(:enabled) => boolean, optional(:features) => map()}
@type account_onboarding :: %{optional(:enabled) => boolean, optional(:features) => features}
)

(
@typedoc "Configuration for the balances embedded component."
@type balances :: %{optional(:enabled) => boolean, optional(:features) => features}
)

(
@typedoc "Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not)."
@type components :: %{
optional(:account_management) => account_management,
optional(:account_onboarding) => account_onboarding,
optional(:balances) => balances,
optional(:documents) => documents,
optional(:notification_banner) => notification_banner,
optional(:payment_details) => payment_details,
optional(:payments) => payments,
optional(:payouts) => payouts
optional(:payouts) => payouts,
optional(:payouts_list) => payouts_list,
optional(:tax_registrations) => tax_registrations,
optional(:tax_settings) => tax_settings
}
)

(
@typedoc "Configuration for the documents embedded component."
@type documents :: %{optional(:enabled) => boolean, optional(:features) => map()}
)

(
@typedoc "The list of features enabled in the embedded component."
@type features :: %{
optional(:capture_payments) => boolean,
optional(:destination_on_behalf_of_charge_management) => boolean,
optional(:dispute_management) => boolean,
optional(:refund_management) => boolean
}
)

(
@typedoc "Configuration for the notification banner embedded component."
@type notification_banner :: %{optional(:enabled) => boolean, optional(:features) => features}
)

(
@typedoc "Configuration for the payment details embedded component."
@type payment_details :: %{optional(:enabled) => boolean, optional(:features) => features}
Expand All @@ -55,6 +83,21 @@ defmodule Stripe.AccountSession do
@type payouts :: %{optional(:enabled) => boolean, optional(:features) => features}
)

(
@typedoc "Configuration for the payouts list embedded component."
@type payouts_list :: %{optional(:enabled) => boolean, optional(:features) => map()}
)

(
@typedoc "Configuration for the tax registrations embedded component."
@type tax_registrations :: %{optional(:enabled) => boolean, optional(:features) => map()}
)

(
@typedoc "Configuration for the tax settings embedded component."
@type tax_settings :: %{optional(:enabled) => boolean, optional(:features) => map()}
)

(
nil

Expand All @@ -80,4 +123,4 @@ defmodule Stripe.AccountSession do
end
)
)
end
end
2 changes: 1 addition & 1 deletion lib/generated/api_errors.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ defmodule Stripe.ApiErrors do
type: binary
}
)
end
end
100 changes: 50 additions & 50 deletions lib/generated/apple_pay_domain.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,37 @@ defmodule Stripe.ApplePayDomain do
(
nil

@doc "<p>List apple pay domains.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/apple_pay/domains`\n"
@doc "<p>Delete an apple pay domain.</p>\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/apple_pay/domains/{domain}`\n"
(
@spec list(
params :: %{
optional(:domain_name) => binary,
optional(:ending_before) => binary,
optional(:expand) => list(binary),
optional(:limit) => integer,
optional(:starting_after) => binary
},
opts :: Keyword.t()
) ::
{:ok, Stripe.List.t(Stripe.ApplePayDomain.t())}
@spec delete(domain :: binary(), opts :: Keyword.t()) ::
{:ok, Stripe.DeletedApplePayDomain.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def list(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/apple_pay/domains", [], [])
def delete(domain, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/apple_pay/domains/{domain}",
[
%OpenApiGen.Blueprint.Parameter{
in: "path",
name: "domain",
required: true,
schema: %OpenApiGen.Blueprint.Parameter.Schema{
name: "domain",
title: nil,
type: "string",
items: [],
properties: [],
any_of: []
}
}
],
[domain]
)

Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:get)
|> Stripe.Request.put_method(:delete)
|> Stripe.Request.make_request()
end
)
Expand All @@ -47,20 +56,28 @@ defmodule Stripe.ApplePayDomain do
(
nil

@doc "<p>Create an apple pay domain.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/apple_pay/domains`\n"
@doc "<p>List apple pay domains.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/apple_pay/domains`\n"
(
@spec create(
params :: %{optional(:domain_name) => binary, optional(:expand) => list(binary)},
@spec list(
params :: %{
optional(:domain_name) => binary,
optional(:ending_before) => binary,
optional(:expand) => list(binary),
optional(:limit) => integer,
optional(:starting_after) => binary
},
opts :: Keyword.t()
) ::
{:ok, Stripe.ApplePayDomain.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
def create(params \\ %{}, opts \\ []) do
{:ok, Stripe.List.t(Stripe.ApplePayDomain.t())}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def list(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/apple_pay/domains", [], [])

Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:post)
|> Stripe.Request.put_method(:get)
|> Stripe.Request.make_request()
end
)
Expand Down Expand Up @@ -111,39 +128,22 @@ defmodule Stripe.ApplePayDomain do
(
nil

@doc "<p>Delete an apple pay domain.</p>\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/apple_pay/domains/{domain}`\n"
@doc "<p>Create an apple pay domain.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/apple_pay/domains`\n"
(
@spec delete(domain :: binary(), opts :: Keyword.t()) ::
{:ok, Stripe.DeletedApplePayDomain.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def delete(domain, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/apple_pay/domains/{domain}",
[
%OpenApiGen.Blueprint.Parameter{
in: "path",
name: "domain",
required: true,
schema: %OpenApiGen.Blueprint.Parameter.Schema{
name: "domain",
title: nil,
type: "string",
items: [],
properties: [],
any_of: []
}
}
],
[domain]
)
@spec create(
params :: %{optional(:domain_name) => binary, optional(:expand) => list(binary)},
opts :: Keyword.t()
) ::
{:ok, Stripe.ApplePayDomain.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}
def create(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/apple_pay/domains", [], [])

Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_method(:delete)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:post)
|> Stripe.Request.make_request()
end
)
)
end
end
6 changes: 4 additions & 2 deletions lib/generated/application_fee.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ defmodule Stripe.ApplicationFee do
:charge,
:created,
:currency,
:fee_source,
:id,
:livemode,
:object,
Expand All @@ -19,7 +20,7 @@ defmodule Stripe.ApplicationFee do
:refunds
]

@typedoc "The `application_fee` type.\n\n * `account` ID of the Stripe account this fee was taken from.\n * `amount` Amount earned, in cents (or local equivalent).\n * `amount_refunded` Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued)\n * `application` ID of the Connect application that earned the fee.\n * `balance_transaction` Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds).\n * `charge` ID of the charge that the application fee was taken from.\n * `created` Time at which the object was created. Measured in seconds since the Unix epoch.\n * `currency` Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).\n * `id` Unique identifier for the object.\n * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.\n * `object` String representing the object's type. Objects of the same type share the same value.\n * `originating_transaction` ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter.\n * `refunded` Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false.\n * `refunds` A list of refunds that have been applied to the fee.\n"
@typedoc "The `application_fee` type.\n\n * `account` ID of the Stripe account this fee was taken from.\n * `amount` Amount earned, in cents (or local equivalent).\n * `amount_refunded` Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued)\n * `application` ID of the Connect application that earned the fee.\n * `balance_transaction` Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds).\n * `charge` ID of the charge that the application fee was taken from.\n * `created` Time at which the object was created. Measured in seconds since the Unix epoch.\n * `currency` Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).\n * `fee_source` Polymorphic source of the application fee. Includes the ID of the object the application fee was created from.\n * `id` Unique identifier for the object.\n * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.\n * `object` String representing the object's type. Objects of the same type share the same value.\n * `originating_transaction` ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter.\n * `refunded` Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false.\n * `refunds` A list of refunds that have been applied to the fee.\n"
@type t :: %__MODULE__{
account: binary | Stripe.Account.t(),
amount: integer,
Expand All @@ -29,6 +30,7 @@ defmodule Stripe.ApplicationFee do
charge: binary | Stripe.Charge.t(),
created: integer,
currency: binary,
fee_source: term | nil,
id: binary,
livemode: boolean,
object: binary,
Expand Down Expand Up @@ -120,4 +122,4 @@ defmodule Stripe.ApplicationFee do
end
)
)
end
end
62 changes: 31 additions & 31 deletions lib/generated/apps__secret.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,36 @@ defmodule Stripe.Apps.Secret do
@type scope :: %{optional(:type) => :account | :user, optional(:user) => binary}
)

(
nil

@doc "<p>List all secrets stored on the given scope.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/apps/secrets`\n"
(
@spec list(
params :: %{
optional(:ending_before) => binary,
optional(:expand) => list(binary),
optional(:limit) => integer,
optional(:scope) => scope,
optional(:starting_after) => binary
},
opts :: Keyword.t()
) ::
{:ok, Stripe.List.t(Stripe.Apps.Secret.t())}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def list(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/apps/secrets", [], [])

Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:get)
|> Stripe.Request.make_request()
end
)
)

(
nil

Expand Down Expand Up @@ -100,34 +130,4 @@ defmodule Stripe.Apps.Secret do
end
)
)

(
nil

@doc "<p>List all secrets stored on the given scope.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/apps/secrets`\n"
(
@spec list(
params :: %{
optional(:ending_before) => binary,
optional(:expand) => list(binary),
optional(:limit) => integer,
optional(:scope) => scope,
optional(:starting_after) => binary
},
opts :: Keyword.t()
) ::
{:ok, Stripe.List.t(Stripe.Apps.Secret.t())}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def list(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/apps/secrets", [], [])

Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_params(params)
|> Stripe.Request.put_method(:get)
|> Stripe.Request.make_request()
end
)
)
end
end
4 changes: 2 additions & 2 deletions lib/generated/balance.ex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defmodule Stripe.Balance do
:pending
]

@typedoc "The `balance` type.\n\n * `available` Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property.\n * `connect_reserved` Funds held due to negative balances on connected Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property.\n * `instant_available` Funds that you can pay out using Instant Payouts.\n * `issuing` \n * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.\n * `object` String representing the object's type. Objects of the same type share the same value.\n * `pending` Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property.\n"
@typedoc "The `balance` type.\n\n * `available` Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property.\n * `connect_reserved` Funds held due to negative balances on connected accounts where [account.controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property.\n * `instant_available` Funds that you can pay out using Instant Payouts.\n * `issuing` \n * `livemode` Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.\n * `object` String representing the object's type. Objects of the same type share the same value.\n * `pending` Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property.\n"
@type t :: %__MODULE__{
available: term,
connect_reserved: term,
Expand Down Expand Up @@ -43,4 +43,4 @@ defmodule Stripe.Balance do
end
)
)
end
end
2 changes: 1 addition & 1 deletion lib/generated/balance_transaction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@ defmodule Stripe.BalanceTransaction do
end
)
)
end
end
Loading

0 comments on commit 5db45fa

Please sign in to comment.