From d7021f7ae5d8d01720de90d831e888ce08f08d97 Mon Sep 17 00:00:00 2001 From: Josh Smith Date: Tue, 21 Nov 2017 16:18:37 -0800 Subject: [PATCH] Format Event --- lib/stripe/core_resources/event.ex | 36 +++++++++++------------ test/stripe/core_resources/event_test.exs | 4 +-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/stripe/core_resources/event.ex b/lib/stripe/core_resources/event.ex index 66196cc2..7b5d2e62 100644 --- a/lib/stripe/core_resources/event.ex +++ b/lib/stripe/core_resources/event.ex @@ -13,26 +13,26 @@ defmodule Stripe.Event do import Stripe.Request @type event_data :: %{ - object: map, - previous_attributes: map - } + object: map, + previous_attributes: map + } @type event_request :: %{ - id: String.t | nil, - idempotency_key: String.t | nil - } + id: String.t() | nil, + idempotency_key: String.t() | nil + } @type t :: %__MODULE__{ - id: Stripe.id, - object: String.t, - api_version: String.t | nil, - created: Stripe.timestamp, - data: event_data, - livemode: boolean, - pending_webhooks: non_neg_integer, - request: event_request | nil, - type: String.t - } + id: Stripe.id(), + object: String.t(), + api_version: String.t() | nil, + created: Stripe.timestamp(), + data: event_data, + livemode: boolean, + pending_webhooks: non_neg_integer, + request: event_request | nil, + type: String.t() + } defstruct [ :id, @@ -52,7 +52,7 @@ defmodule Stripe.Event do @doc """ Retrieve an event. """ - @spec retrieve(Stripe.id | t, Stripe.options) :: {:ok, t} | {:error, Stripe.Error.t} + @spec retrieve(Stripe.id() | t, Stripe.options()) :: {:ok, t} | {:error, Stripe.Error.t()} def retrieve(id, opts \\ []) do new_request(opts) |> put_endpoint(@plural_endpoint <> "/#{get_id!(id)}") @@ -63,7 +63,7 @@ defmodule Stripe.Event do @doc """ List all events, going back up to 30 days. """ - @spec list(map, Stripe.options) :: {:ok, Stripe.List.of(t)} | {:error, Stripe.Error.t} + @spec list(map, Stripe.options()) :: {:ok, Stripe.List.of(t)} | {:error, Stripe.Error.t()} def list(params \\ %{}, opts \\ []) do new_request(opts) |> put_endpoint(@plural_endpoint) diff --git a/test/stripe/core_resources/event_test.exs b/test/stripe/core_resources/event_test.exs index 9a5c4762..7a5db9a0 100644 --- a/test/stripe/core_resources/event_test.exs +++ b/test/stripe/core_resources/event_test.exs @@ -4,14 +4,14 @@ defmodule Stripe.EventTest do describe "retrieve/2" do test "retrieves an event" do assert {:ok, %Stripe.Event{}} = Stripe.Event.retrieve("evt_123") - assert_stripe_requested :get, "/v1/events/evt_123" + assert_stripe_requested(:get, "/v1/events/evt_123") end end describe "list/2" do test "lists all events" do assert {:ok, %Stripe.List{data: [%Stripe.Event{}]}} = Stripe.Event.list() - assert_stripe_requested :get, "/v1/events" + assert_stripe_requested(:get, "/v1/events") end end end