diff --git a/lib/generated/account.ex b/lib/generated/account.ex index 5c0b56c8..b97b1e1e 100644 --- a/lib/generated/account.ex +++ b/lib/generated/account.ex @@ -91,7 +91,7 @@ defmodule Stripe.Account do ) ( - @typedoc "The Kanji variation of the the individual's primary address (Japan only)." + @typedoc "The Kanji variation of the company's primary address (Japan only)." @type address_kanji :: %{ optional(:city) => binary, optional(:country) => binary, @@ -216,8 +216,8 @@ defmodule Stripe.Account do ) ( - @typedoc "Settings specific to the account's use of the Card Issuing product." - @type card_issuing :: %{optional(:tos_acceptance) => tos_acceptance} + @typedoc "The card_issuing capability." + @type card_issuing :: %{optional(:requested) => boolean} ) ( @@ -570,11 +570,12 @@ defmodule Stripe.Account do ) ( - @typedoc "Details on the account's acceptance of the Stripe Treasury Services Agreement." + @typedoc "Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance)." @type tos_acceptance :: %{ optional(:date) => integer, optional(:ip) => binary, - optional(:user_agent) => binary | binary + optional(:service_agreement) => binary, + optional(:user_agent) => binary } ) @@ -584,8 +585,8 @@ defmodule Stripe.Account do ) ( - @typedoc "The treasury capability." - @type treasury :: %{optional(:requested) => boolean} + @typedoc "Settings specific to the account's Treasury FinancialAccounts." + @type treasury :: %{optional(:tos_acceptance) => tos_acceptance} ) ( @@ -611,9 +612,9 @@ defmodule Stripe.Account do @doc "

Retrieves the details of an account.

\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/account`\n" ( - @spec retrieve(params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t()) :: + @spec show(params :: %{optional(:expand) => list(binary)}, opts :: Keyword.t()) :: {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def retrieve(params \\ %{}, opts \\ []) do + def show(params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params("/v1/account", [], []) Stripe.Request.new_request(opts) @@ -625,6 +626,47 @@ defmodule Stripe.Account do ) ) + ( + nil + + @doc "

Retrieves the details of an account.

\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/accounts/{account}`\n" + ( + @spec retrieve( + account :: binary(), + params :: %{optional(:expand) => list(binary)}, + opts :: Keyword.t() + ) :: {:ok, Stripe.Account.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} + def retrieve(account, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/accounts/{account}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "account", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "account", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [account] + ) + + 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 @@ -922,4 +964,4 @@ defmodule Stripe.Account do end ) ) -end +end \ No newline at end of file diff --git a/lib/generated/bank_account.ex b/lib/generated/bank_account.ex index c21396d4..a0ae2114 100644 --- a/lib/generated/bank_account.ex +++ b/lib/generated/bank_account.ex @@ -61,6 +61,18 @@ defmodule Stripe.BankAccount do } ) + ( + @typedoc "One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check." + @type bank_account_ownership_verification :: %{optional(:files) => list(binary)} + ) + + ( + @typedoc "Documents that may be submitted to satisfy various informational requests." + @type documents :: %{ + optional(:bank_account_ownership_verification) => bank_account_ownership_verification + } + ) + ( @typedoc nil @type owner :: %{ @@ -76,7 +88,7 @@ defmodule Stripe.BankAccount do @doc "

Update a specified source for a given customer.

\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customers/{customer}/sources/{id}`\n" ( - @spec update( + @spec update_source( customer :: binary(), id :: binary(), params :: %{ @@ -100,7 +112,7 @@ defmodule Stripe.BankAccount do {:ok, Stripe.Card.t() | Stripe.BankAccount.t() | Stripe.Source.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(customer, id, params \\ %{}, opts \\ []) do + def update_source(customer, id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/customers/{customer}/sources/{id}", @@ -149,7 +161,7 @@ defmodule Stripe.BankAccount do @doc "

Delete a specified source for a given customer.

\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/customers/{customer}/sources/{id}`\n" ( - @spec delete( + @spec delete_source( customer :: binary(), id :: binary(), params :: %{optional(:expand) => list(binary)}, @@ -158,7 +170,7 @@ defmodule Stripe.BankAccount do {:ok, Stripe.PaymentSource.t() | Stripe.DeletedPaymentSource.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(customer, id, params \\ %{}, opts \\ []) do + def delete_source(customer, id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/customers/{customer}/sources/{id}", @@ -256,4 +268,131 @@ defmodule Stripe.BankAccount do end ) ) -end + + ( + nil + + @doc "

Updates the metadata, account holder name, account holder type of a bank account belonging to a Custom account, and optionally sets it as the default for its currency. Other bank account details are not editable by design.

\n\n

You can re-enable a disabled bank account by performing an update call without providing any arguments or changes.

\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" + ( + @spec update_external_account( + account :: binary(), + id :: binary(), + params :: %{ + optional(:account_holder_name) => binary, + optional(:account_holder_type) => :company | :individual, + optional(:account_type) => :checking | :futsu | :savings | :toza, + optional(:address_city) => binary, + optional(:address_country) => binary, + optional(:address_line1) => binary, + optional(:address_line2) => binary, + optional(:address_state) => binary, + optional(:address_zip) => binary, + optional(:default_for_currency) => boolean, + optional(:documents) => documents, + optional(:exp_month) => binary, + optional(:exp_year) => binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:name) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.ExternalAccount.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def update_external_account(account, id, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/accounts/{account}/external_accounts/{id}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "account", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "account", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + }, + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "id", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "id", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [account, id] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) + |> Stripe.Request.make_request() + end + ) + ) + + ( + nil + + @doc "

Delete a specified external account for a given account.

\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" + ( + @spec delete_external_account(account :: binary(), id :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedExternalAccount.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def delete_external_account(account, id, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/accounts/{account}/external_accounts/{id}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "account", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "account", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + }, + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "id", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "id", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [account, id] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_method(:delete) + |> Stripe.Request.make_request() + end + ) + ) +end \ No newline at end of file diff --git a/lib/generated/card.ex b/lib/generated/card.ex index 48af0228..0d22154b 100644 --- a/lib/generated/card.ex +++ b/lib/generated/card.ex @@ -85,6 +85,18 @@ defmodule Stripe.Card do } ) + ( + @typedoc "One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check." + @type bank_account_ownership_verification :: %{optional(:files) => list(binary)} + ) + + ( + @typedoc "Documents that may be submitted to satisfy various informational requests." + @type documents :: %{ + optional(:bank_account_ownership_verification) => bank_account_ownership_verification + } + ) + ( @typedoc nil @type owner :: %{ @@ -100,7 +112,7 @@ defmodule Stripe.Card do @doc "

Update a specified source for a given customer.

\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/customers/{customer}/sources/{id}`\n" ( - @spec update( + @spec update_source( customer :: binary(), id :: binary(), params :: %{ @@ -124,7 +136,7 @@ defmodule Stripe.Card do {:ok, Stripe.Card.t() | Stripe.BankAccount.t() | Stripe.Source.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def update(customer, id, params \\ %{}, opts \\ []) do + def update_source(customer, id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/customers/{customer}/sources/{id}", @@ -173,7 +185,7 @@ defmodule Stripe.Card do @doc "

Delete a specified source for a given customer.

\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/customers/{customer}/sources/{id}`\n" ( - @spec delete( + @spec delete_source( customer :: binary(), id :: binary(), params :: %{optional(:expand) => list(binary)}, @@ -182,7 +194,7 @@ defmodule Stripe.Card do {:ok, Stripe.PaymentSource.t() | Stripe.DeletedPaymentSource.t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()} - def delete(customer, id, params \\ %{}, opts \\ []) do + def delete_source(customer, id, params \\ %{}, opts \\ []) do path = Stripe.OpenApi.Path.replace_path_params( "/v1/customers/{customer}/sources/{id}", @@ -225,4 +237,131 @@ defmodule Stripe.Card do end ) ) -end + + ( + nil + + @doc "

Updates the metadata, account holder name, account holder type of a bank account belonging to a Custom account, and optionally sets it as the default for its currency. Other bank account details are not editable by design.

\n\n

You can re-enable a disabled bank account by performing an update call without providing any arguments or changes.

\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" + ( + @spec update_external_account( + account :: binary(), + id :: binary(), + params :: %{ + optional(:account_holder_name) => binary, + optional(:account_holder_type) => :company | :individual, + optional(:account_type) => :checking | :futsu | :savings | :toza, + optional(:address_city) => binary, + optional(:address_country) => binary, + optional(:address_line1) => binary, + optional(:address_line2) => binary, + optional(:address_state) => binary, + optional(:address_zip) => binary, + optional(:default_for_currency) => boolean, + optional(:documents) => documents, + optional(:exp_month) => binary, + optional(:exp_year) => binary, + optional(:expand) => list(binary), + optional(:metadata) => %{optional(binary) => binary} | binary, + optional(:name) => binary + }, + opts :: Keyword.t() + ) :: + {:ok, Stripe.ExternalAccount.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def update_external_account(account, id, params \\ %{}, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/accounts/{account}/external_accounts/{id}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "account", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "account", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + }, + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "id", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "id", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [account, id] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_params(params) + |> Stripe.Request.put_method(:post) + |> Stripe.Request.make_request() + end + ) + ) + + ( + nil + + @doc "

Delete a specified external account for a given account.

\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/accounts/{account}/external_accounts/{id}`\n" + ( + @spec delete_external_account(account :: binary(), id :: binary(), opts :: Keyword.t()) :: + {:ok, Stripe.DeletedExternalAccount.t()} + | {:error, Stripe.ApiErrors.t()} + | {:error, term()} + def delete_external_account(account, id, opts \\ []) do + path = + Stripe.OpenApi.Path.replace_path_params( + "/v1/accounts/{account}/external_accounts/{id}", + [ + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "account", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "account", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + }, + %OpenApiGen.Blueprint.Parameter{ + in: "path", + name: "id", + required: true, + schema: %OpenApiGen.Blueprint.Parameter.Schema{ + name: "id", + title: nil, + type: "string", + items: [], + properties: [], + any_of: [] + } + } + ], + [account, id] + ) + + Stripe.Request.new_request(opts) + |> Stripe.Request.put_endpoint(path) + |> Stripe.Request.put_method(:delete) + |> Stripe.Request.make_request() + end + ) + ) +end \ No newline at end of file