|
| 1 | +# File generated from our OpenAPI spec |
| 2 | +# frozen_string_literal: true |
| 3 | + |
| 4 | +module Stripe |
| 5 | + module V2 |
| 6 | + module Core |
| 7 | + # 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). |
| 8 | + class EventDestination < APIResource |
| 9 | + OBJECT_NAME = "v2.core.event_destination" |
| 10 | + def self.object_name |
| 11 | + "v2.core.event_destination" |
| 12 | + end |
| 13 | + |
| 14 | + class StatusDetails < Stripe::StripeObject |
| 15 | + class Disabled < Stripe::StripeObject |
| 16 | + # Reason event destination has been disabled. |
| 17 | + attr_reader :reason |
| 18 | + |
| 19 | + def self.inner_class_types |
| 20 | + @inner_class_types = {} |
| 21 | + end |
| 22 | + |
| 23 | + def self.field_remappings |
| 24 | + @field_remappings = {} |
| 25 | + end |
| 26 | + end |
| 27 | + # Details about why the event destination has been disabled. |
| 28 | + attr_reader :disabled |
| 29 | + |
| 30 | + def self.inner_class_types |
| 31 | + @inner_class_types = { disabled: Disabled } |
| 32 | + end |
| 33 | + |
| 34 | + def self.field_remappings |
| 35 | + @field_remappings = {} |
| 36 | + end |
| 37 | + end |
| 38 | + |
| 39 | + class AmazonEventbridge < Stripe::StripeObject |
| 40 | + # The AWS account ID. |
| 41 | + attr_reader :aws_account_id |
| 42 | + # The ARN of the AWS event source. |
| 43 | + attr_reader :aws_event_source_arn |
| 44 | + # The state of the AWS event source. |
| 45 | + attr_reader :aws_event_source_status |
| 46 | + |
| 47 | + def self.inner_class_types |
| 48 | + @inner_class_types = {} |
| 49 | + end |
| 50 | + |
| 51 | + def self.field_remappings |
| 52 | + @field_remappings = {} |
| 53 | + end |
| 54 | + end |
| 55 | + |
| 56 | + class WebhookEndpoint < Stripe::StripeObject |
| 57 | + # The signing secret of the webhook endpoint, only includable on creation. |
| 58 | + attr_reader :signing_secret |
| 59 | + # The URL of the webhook endpoint, includable. |
| 60 | + attr_reader :url |
| 61 | + |
| 62 | + def self.inner_class_types |
| 63 | + @inner_class_types = {} |
| 64 | + end |
| 65 | + |
| 66 | + def self.field_remappings |
| 67 | + @field_remappings = {} |
| 68 | + end |
| 69 | + end |
| 70 | + # Time at which the object was created. |
| 71 | + attr_reader :created |
| 72 | + # An optional description of what the event destination is used for. |
| 73 | + attr_reader :description |
| 74 | + # The list of events to enable for this endpoint. |
| 75 | + attr_reader :enabled_events |
| 76 | + # Payload type of events being subscribed to. |
| 77 | + attr_reader :event_payload |
| 78 | + # Where events should be routed from. |
| 79 | + attr_reader :events_from |
| 80 | + # Unique identifier for the object. |
| 81 | + attr_reader :id |
| 82 | + # Metadata. |
| 83 | + attr_reader :metadata |
| 84 | + # Event destination name. |
| 85 | + attr_reader :name |
| 86 | + # String representing the object's type. Objects of the same type share the same value of the object field. |
| 87 | + attr_reader :object |
| 88 | + # If using the snapshot event payload, the API version events are rendered as. |
| 89 | + attr_reader :snapshot_api_version |
| 90 | + # Status. It can be set to either enabled or disabled. |
| 91 | + attr_reader :status |
| 92 | + # Additional information about event destination status. |
| 93 | + attr_reader :status_details |
| 94 | + # Event destination type. |
| 95 | + attr_reader :type |
| 96 | + # Time at which the object was last updated. |
| 97 | + attr_reader :updated |
| 98 | + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. |
| 99 | + attr_reader :livemode |
| 100 | + # Amazon EventBridge configuration. |
| 101 | + attr_reader :amazon_eventbridge |
| 102 | + # Webhook endpoint configuration. |
| 103 | + attr_reader :webhook_endpoint |
| 104 | + |
| 105 | + def self.inner_class_types |
| 106 | + @inner_class_types = { |
| 107 | + status_details: StatusDetails, |
| 108 | + amazon_eventbridge: AmazonEventbridge, |
| 109 | + webhook_endpoint: WebhookEndpoint, |
| 110 | + } |
| 111 | + end |
| 112 | + |
| 113 | + def self.field_remappings |
| 114 | + @field_remappings = {} |
| 115 | + end |
| 116 | + end |
| 117 | + end |
| 118 | + end |
| 119 | +end |
0 commit comments