Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Event types #272

Merged
merged 1 commit into from
Nov 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 20 additions & 19 deletions lib/stripe/core_resources/event.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,33 @@ defmodule Stripe.Event do
Work with Stripe event objects.
You can:
- Retrieve an event
Does not yet render the `data` object.
Stripe API reference: https://stripe.com/docs/api#event
"""
use Stripe.Entity

@type event_data :: %{
object: map,
previous_attributes: map
}

@type event_request :: %{
id: String.t | nil,
idempotency_key: String.t | nil
}

@type t :: %__MODULE__{
id: Stripe.id,
object: String.t,
api_version: String.t,
created: Stripe.timestamp,
data: %{
object: map,
previous_attributes: map
},
livemode: boolean,
pending_webhooks: non_neg_integer,
request: %{
id: String.t,
idempotency_key: String.t
},
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,
Expand Down