Packages
stripity_stripe
3.3.1
3.3.2
3.3.1
3.2.0
3.1.1
3.1.0
3.0.0
2.17.3
2.17.2
2.17.1
2.17.0
2.16.0
2.15.1
2.15.0
2.14.1
2.14.0
2.13.0
2.12.1
2.12.0
2.11.0
2.10.0
2.9.0
2.8.0
2.7.2
2.7.1
2.7.0
2.6.0
2.5.0
2.4.0
2.3.0
2.2.3
2.2.2
2.2.1
2.2.0
2.1.0
2.0.1
2.0.0
2.0.0-alpha.11
2.0.0-alpha.10
2.0.0-alpha.9
2.0.0-alpha.8
2.0.0-alpha.7
2.0.0-alpha.6
2.0.0-alpha.5
2.0.0-alpha.4
2.0.0-alpha.3
2.0.0-alpha.2
2.0.0-alpha.1
1.6.2
1.6.1
1.6.0
1.4.0
1.3.0
1.2.0
1.1.0
0.5.0
0.4.0
0.3.0
0.2.0
A Stripe client for Elixir.
Current section
Files
Jump to
Current section
Files
lib/generated/terminal__location.ex
defmodule Stripe.Terminal.Location do
use Stripe.Entity
@moduledoc "A Location represents a grouping of readers.\n\nRelated guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations)"
(
defstruct [
:address,
:address_kana,
:address_kanji,
:configuration_overrides,
:display_name,
:display_name_kana,
:display_name_kanji,
:id,
:livemode,
:metadata,
:object,
:phone
]
@typedoc "The `terminal.location` type.\n\n * `address` \n * `address_kana` \n * `address_kanji` \n * `configuration_overrides` The ID of a configuration that will be used to customize all readers in this location.\n * `display_name` The display name of the location.\n * `display_name_kana` The Kana variation of the display name of the location.\n * `display_name_kanji` The Kanji variation of the display name of the location.\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 * `metadata` Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.\n * `object` String representing the object's type. Objects of the same type share the same value.\n * `phone` The phone number of the location.\n"
@type t :: %__MODULE__{
address: term,
address_kana: term,
address_kanji: term,
configuration_overrides: binary,
display_name: binary,
display_name_kana: binary,
display_name_kanji: binary,
id: binary,
livemode: boolean,
metadata: term,
object: binary,
phone: binary
}
)
(
@typedoc "The full address of the location."
@type address :: %{
optional(:city) => binary,
optional(:country) => binary,
optional(:line1) => binary,
optional(:line2) => binary,
optional(:postal_code) => binary,
optional(:state) => binary
}
)
(
@typedoc "The Kana variation of the full address of the location (Japan only)."
@type address_kana :: %{
optional(:city) => binary,
optional(:country) => binary,
optional(:line1) => binary,
optional(:line2) => binary,
optional(:postal_code) => binary,
optional(:state) => binary,
optional(:town) => binary
}
)
(
@typedoc "The Kanji variation of the full address of the location (Japan only)."
@type address_kanji :: %{
optional(:city) => binary,
optional(:country) => binary,
optional(:line1) => binary,
optional(:line2) => binary,
optional(:postal_code) => binary,
optional(:state) => binary,
optional(:town) => binary
}
)
(
nil
@doc "<p>Deletes a <code>Location</code> object.</p>\n\n#### Details\n\n * Method: `delete`\n * Path: `/v1/terminal/locations/{location}`\n"
(
@spec delete(location :: binary(), opts :: Keyword.t()) ::
{:ok, Stripe.DeletedTerminal.Location.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def delete(location, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/terminal/locations/{location}",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "location",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "location",
properties: [],
title: nil,
type: "string"
}
}
],
[location]
)
Stripe.Request.new_request(opts)
|> Stripe.Request.put_endpoint(path)
|> Stripe.Request.put_method(:delete)
|> Stripe.Request.make_request()
end
)
)
(
nil
@doc "<p>Returns a list of <code>Location</code> objects.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/terminal/locations`\n"
(
@spec list(
params :: %{
optional(:ending_before) => binary,
optional(:expand) => list(binary),
optional(:limit) => integer,
optional(:starting_after) => binary
},
opts :: Keyword.t()
) ::
{:ok, Stripe.List.t(Stripe.Terminal.Location.t())}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def list(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/terminal/locations", [], [])
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
@doc "<p>Retrieves a <code>Location</code> object.</p>\n\n#### Details\n\n * Method: `get`\n * Path: `/v1/terminal/locations/{location}`\n"
(
@spec retrieve(
location :: binary(),
params :: %{optional(:expand) => list(binary)},
opts :: Keyword.t()
) ::
{:ok, Stripe.Terminal.Location.t() | Stripe.DeletedTerminal.Location.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def retrieve(location, params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/terminal/locations/{location}",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "location",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "location",
properties: [],
title: nil,
type: "string"
}
}
],
[location]
)
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
@doc "<p>Creates a new <code>Location</code> object.\nFor further details, including which address fields are required in each country, see the <a href=\"/docs/terminal/fleet/locations\">Manage locations</a> guide.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/locations`\n"
(
@spec create(
params :: %{
optional(:address) => address,
optional(:address_kana) => address_kana,
optional(:address_kanji) => address_kanji,
optional(:configuration_overrides) => binary,
optional(:display_name) => binary,
optional(:display_name_kana) => binary,
optional(:display_name_kanji) => binary,
optional(:expand) => list(binary),
optional(:metadata) => %{optional(binary) => binary} | binary,
optional(:phone) => binary
},
opts :: Keyword.t()
) ::
{:ok, Stripe.Terminal.Location.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def create(params \\ %{}, opts \\ []) do
path = Stripe.OpenApi.Path.replace_path_params("/v1/terminal/locations", [], [])
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 "<p>Updates a <code>Location</code> object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.</p>\n\n#### Details\n\n * Method: `post`\n * Path: `/v1/terminal/locations/{location}`\n"
(
@spec update(
location :: binary(),
params :: %{
optional(:address) => address,
optional(:address_kana) => address_kana,
optional(:address_kanji) => address_kanji,
optional(:configuration_overrides) => binary | binary,
optional(:display_name) => binary | binary,
optional(:display_name_kana) => binary | binary,
optional(:display_name_kanji) => binary | binary,
optional(:expand) => list(binary),
optional(:metadata) => %{optional(binary) => binary} | binary,
optional(:phone) => binary | binary
},
opts :: Keyword.t()
) ::
{:ok, Stripe.Terminal.Location.t() | Stripe.DeletedTerminal.Location.t()}
| {:error, Stripe.ApiErrors.t()}
| {:error, term()}
def update(location, params \\ %{}, opts \\ []) do
path =
Stripe.OpenApi.Path.replace_path_params(
"/v1/terminal/locations/{location}",
[
%{
__struct__: OpenApiGen.Blueprint.Parameter,
in: "path",
name: "location",
required: true,
schema: %{
__struct__: OpenApiGen.Blueprint.Parameter.Schema,
any_of: [],
items: [],
name: "location",
properties: [],
title: nil,
type: "string"
}
}
],
[location]
)
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
)
)
end