| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._stripe_object import StripeObject |
| 4 |
from typing import ClassVar, Dict, List, Optional |
| 5 |
from typing_extensions import Literal |
| 6 |
|
| 7 |
|
| 8 |
class EventDestination(StripeObject): |
| 9 |
""" |
| 10 |
Set up an event destination to receive events from Stripe across multiple destination types, including [webhook endpoints](https://docs.stripe.com/webhooks) and [Amazon EventBridge](https://docs.stripe.com/event-destinations/eventbridge). Event destinations support receiving [thin events](https://docs.stripe.com/api/v2/events) and [snapshot events](https://docs.stripe.com/api/events). |
| 11 |
""" |
| 12 |
|
| 13 |
OBJECT_NAME: ClassVar[Literal["v2.core.event_destination"]] = ( |
| 14 |
"v2.core.event_destination" |
| 15 |
) |
| 16 |
|
| 17 |
class AmazonEventbridge(StripeObject): |
| 18 |
aws_account_id: str |
| 19 |
""" |
| 20 |
The AWS account ID. |
| 21 |
""" |
| 22 |
aws_event_source_arn: str |
| 23 |
""" |
| 24 |
The ARN of the AWS event source. |
| 25 |
""" |
| 26 |
aws_event_source_status: Literal[ |
| 27 |
"active", "deleted", "pending", "unknown" |
| 28 |
] |
| 29 |
""" |
| 30 |
The state of the AWS event source. |
| 31 |
""" |
| 32 |
|
| 33 |
class StatusDetails(StripeObject): |
| 34 |
class Disabled(StripeObject): |
| 35 |
reason: Literal["no_aws_event_source_exists", "user"] |
| 36 |
""" |
| 37 |
Reason event destination has been disabled. |
| 38 |
""" |
| 39 |
|
| 40 |
disabled: Optional[Disabled] |
| 41 |
""" |
| 42 |
Details about why the event destination has been disabled. |
| 43 |
""" |
| 44 |
_inner_class_types = {"disabled": Disabled} |
| 45 |
|
| 46 |
class WebhookEndpoint(StripeObject): |
| 47 |
signing_secret: Optional[str] |
| 48 |
""" |
| 49 |
The signing secret of the webhook endpoint, only includable on creation. |
| 50 |
""" |
| 51 |
url: Optional[str] |
| 52 |
""" |
| 53 |
The URL of the webhook endpoint, includable. |
| 54 |
""" |
| 55 |
|
| 56 |
amazon_eventbridge: Optional[AmazonEventbridge] |
| 57 |
""" |
| 58 |
Amazon EventBridge configuration. |
| 59 |
""" |
| 60 |
created: str |
| 61 |
""" |
| 62 |
Time at which the object was created. |
| 63 |
""" |
| 64 |
description: str |
| 65 |
""" |
| 66 |
An optional description of what the event destination is used for. |
| 67 |
""" |
| 68 |
enabled_events: List[str] |
| 69 |
""" |
| 70 |
The list of events to enable for this endpoint. |
| 71 |
""" |
| 72 |
event_payload: Literal["snapshot", "thin"] |
| 73 |
""" |
| 74 |
Payload type of events being subscribed to. |
| 75 |
""" |
| 76 |
events_from: Optional[List[Literal["other_accounts", "self"]]] |
| 77 |
""" |
| 78 |
Where events should be routed from. |
| 79 |
""" |
| 80 |
id: str |
| 81 |
""" |
| 82 |
Unique identifier for the object. |
| 83 |
""" |
| 84 |
livemode: bool |
| 85 |
""" |
| 86 |
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. |
| 87 |
""" |
| 88 |
metadata: Optional[Dict[str, str]] |
| 89 |
""" |
| 90 |
Metadata. |
| 91 |
""" |
| 92 |
name: str |
| 93 |
""" |
| 94 |
Event destination name. |
| 95 |
""" |
| 96 |
object: Literal["v2.core.event_destination"] |
| 97 |
""" |
| 98 |
String representing the object's type. Objects of the same type share the same value of the object field. |
| 99 |
""" |
| 100 |
snapshot_api_version: Optional[str] |
| 101 |
""" |
| 102 |
If using the snapshot event payload, the API version events are rendered as. |
| 103 |
""" |
| 104 |
status: Literal["disabled", "enabled"] |
| 105 |
""" |
| 106 |
Status. It can be set to either enabled or disabled. |
| 107 |
""" |
| 108 |
status_details: Optional[StatusDetails] |
| 109 |
""" |
| 110 |
Additional information about event destination status. |
| 111 |
""" |
| 112 |
type: Literal["amazon_eventbridge", "webhook_endpoint"] |
| 113 |
""" |
| 114 |
Event destination type. |
| 115 |
""" |
| 116 |
updated: str |
| 117 |
""" |
| 118 |
Time at which the object was last updated. |
| 119 |
""" |
| 120 |
webhook_endpoint: Optional[WebhookEndpoint] |
| 121 |
""" |
| 122 |
Webhook endpoint configuration. |
| 123 |
""" |
| 124 |
_inner_class_types = { |
| 125 |
"amazon_eventbridge": AmazonEventbridge, |
| 126 |
"status_details": StatusDetails, |
| 127 |
"webhook_endpoint": WebhookEndpoint, |
| 128 |
} |