// Code generated by Fern. DO NOT EDIT.

package management

import (
	json "encoding/json"
	fmt "fmt"
	internal "github.com/auth0/go-auth0/v2/management/internal"
	big "math/big"
	time "time"
)

var (
	createEventStreamActionRequestContentFieldName          = big.NewInt(1 << 0)
	createEventStreamActionRequestContentFieldSubscriptions = big.NewInt(1 << 1)
	createEventStreamActionRequestContentFieldDestination   = big.NewInt(1 << 2)
	createEventStreamActionRequestContentFieldStatus        = big.NewInt(1 << 3)
)

type CreateEventStreamActionRequestContent struct {
	// Name of the event stream.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// List of event types subscribed to in this stream.
	Subscriptions []*EventStreamSubscription    `json:"subscriptions,omitempty" url:"subscriptions,omitempty"`
	Destination   *EventStreamActionDestination `json:"destination" url:"destination"`
	Status        *EventStreamStatusEnum        `json:"status,omitempty" url:"status,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateEventStreamActionRequestContent) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}

func (c *CreateEventStreamActionRequestContent) GetSubscriptions() []*EventStreamSubscription {
	if c == nil || c.Subscriptions == nil {
		return nil
	}
	return c.Subscriptions
}

func (c *CreateEventStreamActionRequestContent) GetDestination() *EventStreamActionDestination {
	if c == nil {
		return nil
	}
	return c.Destination
}

func (c *CreateEventStreamActionRequestContent) GetStatus() EventStreamStatusEnum {
	if c == nil || c.Status == nil {
		return ""
	}
	return *c.Status
}

func (c *CreateEventStreamActionRequestContent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateEventStreamActionRequestContent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamActionRequestContent) SetName(name *string) {
	c.Name = name
	c.require(createEventStreamActionRequestContentFieldName)
}

// SetSubscriptions sets the Subscriptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamActionRequestContent) SetSubscriptions(subscriptions []*EventStreamSubscription) {
	c.Subscriptions = subscriptions
	c.require(createEventStreamActionRequestContentFieldSubscriptions)
}

// SetDestination sets the Destination field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamActionRequestContent) SetDestination(destination *EventStreamActionDestination) {
	c.Destination = destination
	c.require(createEventStreamActionRequestContentFieldDestination)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamActionRequestContent) SetStatus(status *EventStreamStatusEnum) {
	c.Status = status
	c.require(createEventStreamActionRequestContentFieldStatus)
}

func (c *CreateEventStreamActionRequestContent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateEventStreamActionRequestContent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateEventStreamActionRequestContent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateEventStreamActionRequestContent) MarshalJSON() ([]byte, error) {
	type embed CreateEventStreamActionRequestContent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateEventStreamActionRequestContent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createEventStreamEventBridgeRequestContentFieldName          = big.NewInt(1 << 0)
	createEventStreamEventBridgeRequestContentFieldSubscriptions = big.NewInt(1 << 1)
	createEventStreamEventBridgeRequestContentFieldDestination   = big.NewInt(1 << 2)
	createEventStreamEventBridgeRequestContentFieldStatus        = big.NewInt(1 << 3)
)

type CreateEventStreamEventBridgeRequestContent struct {
	// Name of the event stream.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// List of event types subscribed to in this stream.
	Subscriptions []*EventStreamSubscription         `json:"subscriptions,omitempty" url:"subscriptions,omitempty"`
	Destination   *EventStreamEventBridgeDestination `json:"destination" url:"destination"`
	Status        *EventStreamStatusEnum             `json:"status,omitempty" url:"status,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateEventStreamEventBridgeRequestContent) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}

func (c *CreateEventStreamEventBridgeRequestContent) GetSubscriptions() []*EventStreamSubscription {
	if c == nil || c.Subscriptions == nil {
		return nil
	}
	return c.Subscriptions
}

func (c *CreateEventStreamEventBridgeRequestContent) GetDestination() *EventStreamEventBridgeDestination {
	if c == nil {
		return nil
	}
	return c.Destination
}

func (c *CreateEventStreamEventBridgeRequestContent) GetStatus() EventStreamStatusEnum {
	if c == nil || c.Status == nil {
		return ""
	}
	return *c.Status
}

func (c *CreateEventStreamEventBridgeRequestContent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateEventStreamEventBridgeRequestContent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamEventBridgeRequestContent) SetName(name *string) {
	c.Name = name
	c.require(createEventStreamEventBridgeRequestContentFieldName)
}

// SetSubscriptions sets the Subscriptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamEventBridgeRequestContent) SetSubscriptions(subscriptions []*EventStreamSubscription) {
	c.Subscriptions = subscriptions
	c.require(createEventStreamEventBridgeRequestContentFieldSubscriptions)
}

// SetDestination sets the Destination field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamEventBridgeRequestContent) SetDestination(destination *EventStreamEventBridgeDestination) {
	c.Destination = destination
	c.require(createEventStreamEventBridgeRequestContentFieldDestination)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamEventBridgeRequestContent) SetStatus(status *EventStreamStatusEnum) {
	c.Status = status
	c.require(createEventStreamEventBridgeRequestContentFieldStatus)
}

func (c *CreateEventStreamEventBridgeRequestContent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateEventStreamEventBridgeRequestContent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateEventStreamEventBridgeRequestContent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateEventStreamEventBridgeRequestContent) MarshalJSON() ([]byte, error) {
	type embed CreateEventStreamEventBridgeRequestContent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateEventStreamEventBridgeRequestContent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

type CreateEventStreamResponseContent struct {
	EventStreamWebhookResponseContent     *EventStreamWebhookResponseContent
	EventStreamEventBridgeResponseContent *EventStreamEventBridgeResponseContent
	EventStreamActionResponseContent      *EventStreamActionResponseContent

	typ string
}

func (c *CreateEventStreamResponseContent) GetEventStreamWebhookResponseContent() *EventStreamWebhookResponseContent {
	if c == nil {
		return nil
	}
	return c.EventStreamWebhookResponseContent
}

func (c *CreateEventStreamResponseContent) GetEventStreamEventBridgeResponseContent() *EventStreamEventBridgeResponseContent {
	if c == nil {
		return nil
	}
	return c.EventStreamEventBridgeResponseContent
}

func (c *CreateEventStreamResponseContent) GetEventStreamActionResponseContent() *EventStreamActionResponseContent {
	if c == nil {
		return nil
	}
	return c.EventStreamActionResponseContent
}

func (c *CreateEventStreamResponseContent) UnmarshalJSON(data []byte) error {
	valueEventStreamWebhookResponseContent := new(EventStreamWebhookResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamWebhookResponseContent); err == nil {
		c.typ = "EventStreamWebhookResponseContent"
		c.EventStreamWebhookResponseContent = valueEventStreamWebhookResponseContent
		return nil
	}
	valueEventStreamEventBridgeResponseContent := new(EventStreamEventBridgeResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamEventBridgeResponseContent); err == nil {
		c.typ = "EventStreamEventBridgeResponseContent"
		c.EventStreamEventBridgeResponseContent = valueEventStreamEventBridgeResponseContent
		return nil
	}
	valueEventStreamActionResponseContent := new(EventStreamActionResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamActionResponseContent); err == nil {
		c.typ = "EventStreamActionResponseContent"
		c.EventStreamActionResponseContent = valueEventStreamActionResponseContent
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, c)
}

func (c CreateEventStreamResponseContent) MarshalJSON() ([]byte, error) {
	if c.typ == "EventStreamWebhookResponseContent" || c.EventStreamWebhookResponseContent != nil {
		return json.Marshal(c.EventStreamWebhookResponseContent)
	}
	if c.typ == "EventStreamEventBridgeResponseContent" || c.EventStreamEventBridgeResponseContent != nil {
		return json.Marshal(c.EventStreamEventBridgeResponseContent)
	}
	if c.typ == "EventStreamActionResponseContent" || c.EventStreamActionResponseContent != nil {
		return json.Marshal(c.EventStreamActionResponseContent)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", c)
}

type CreateEventStreamResponseContentVisitor interface {
	VisitEventStreamWebhookResponseContent(*EventStreamWebhookResponseContent) error
	VisitEventStreamEventBridgeResponseContent(*EventStreamEventBridgeResponseContent) error
	VisitEventStreamActionResponseContent(*EventStreamActionResponseContent) error
}

func (c *CreateEventStreamResponseContent) Accept(visitor CreateEventStreamResponseContentVisitor) error {
	if c.typ == "EventStreamWebhookResponseContent" || c.EventStreamWebhookResponseContent != nil {
		return visitor.VisitEventStreamWebhookResponseContent(c.EventStreamWebhookResponseContent)
	}
	if c.typ == "EventStreamEventBridgeResponseContent" || c.EventStreamEventBridgeResponseContent != nil {
		return visitor.VisitEventStreamEventBridgeResponseContent(c.EventStreamEventBridgeResponseContent)
	}
	if c.typ == "EventStreamActionResponseContent" || c.EventStreamActionResponseContent != nil {
		return visitor.VisitEventStreamActionResponseContent(c.EventStreamActionResponseContent)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", c)
}

// Metadata about a specific attempt to deliver an event
var (
	createEventStreamTestEventResponseContentFieldID            = big.NewInt(1 << 0)
	createEventStreamTestEventResponseContentFieldEventStreamID = big.NewInt(1 << 1)
	createEventStreamTestEventResponseContentFieldStatus        = big.NewInt(1 << 2)
	createEventStreamTestEventResponseContentFieldEventType     = big.NewInt(1 << 3)
	createEventStreamTestEventResponseContentFieldAttempts      = big.NewInt(1 << 4)
	createEventStreamTestEventResponseContentFieldEvent         = big.NewInt(1 << 5)
)

type CreateEventStreamTestEventResponseContent struct {
	// Unique identifier for the delivery
	ID string `json:"id" url:"id"`
	// Unique identifier for the event stream.
	EventStreamID string                           `json:"event_stream_id" url:"event_stream_id"`
	Status        EventStreamDeliveryStatusEnum    `json:"status" url:"status"`
	EventType     EventStreamDeliveryEventTypeEnum `json:"event_type" url:"event_type"`
	// Results of delivery attempts
	Attempts []*EventStreamDeliveryAttempt `json:"attempts" url:"attempts"`
	Event    *EventStreamCloudEvent        `json:"event,omitempty" url:"event,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateEventStreamTestEventResponseContent) GetID() string {
	if c == nil {
		return ""
	}
	return c.ID
}

func (c *CreateEventStreamTestEventResponseContent) GetEventStreamID() string {
	if c == nil {
		return ""
	}
	return c.EventStreamID
}

func (c *CreateEventStreamTestEventResponseContent) GetEventType() EventStreamDeliveryEventTypeEnum {
	if c == nil {
		return ""
	}
	return c.EventType
}

func (c *CreateEventStreamTestEventResponseContent) GetAttempts() []*EventStreamDeliveryAttempt {
	if c == nil {
		return nil
	}
	return c.Attempts
}

func (c *CreateEventStreamTestEventResponseContent) GetEvent() EventStreamCloudEvent {
	if c == nil || c.Event == nil {
		return EventStreamCloudEvent{}
	}
	return *c.Event
}

func (c *CreateEventStreamTestEventResponseContent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateEventStreamTestEventResponseContent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamTestEventResponseContent) SetID(id string) {
	c.ID = id
	c.require(createEventStreamTestEventResponseContentFieldID)
}

// SetEventStreamID sets the EventStreamID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamTestEventResponseContent) SetEventStreamID(eventStreamID string) {
	c.EventStreamID = eventStreamID
	c.require(createEventStreamTestEventResponseContentFieldEventStreamID)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamTestEventResponseContent) SetStatus(status EventStreamDeliveryStatusEnum) {
	c.Status = status
	c.require(createEventStreamTestEventResponseContentFieldStatus)
}

// SetEventType sets the EventType field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamTestEventResponseContent) SetEventType(eventType EventStreamDeliveryEventTypeEnum) {
	c.EventType = eventType
	c.require(createEventStreamTestEventResponseContentFieldEventType)
}

// SetAttempts sets the Attempts field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamTestEventResponseContent) SetAttempts(attempts []*EventStreamDeliveryAttempt) {
	c.Attempts = attempts
	c.require(createEventStreamTestEventResponseContentFieldAttempts)
}

// SetEvent sets the Event field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamTestEventResponseContent) SetEvent(event *EventStreamCloudEvent) {
	c.Event = event
	c.require(createEventStreamTestEventResponseContentFieldEvent)
}

func (c *CreateEventStreamTestEventResponseContent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateEventStreamTestEventResponseContent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateEventStreamTestEventResponseContent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateEventStreamTestEventResponseContent) MarshalJSON() ([]byte, error) {
	type embed CreateEventStreamTestEventResponseContent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateEventStreamTestEventResponseContent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

var (
	createEventStreamWebHookRequestContentFieldName          = big.NewInt(1 << 0)
	createEventStreamWebHookRequestContentFieldSubscriptions = big.NewInt(1 << 1)
	createEventStreamWebHookRequestContentFieldDestination   = big.NewInt(1 << 2)
	createEventStreamWebHookRequestContentFieldStatus        = big.NewInt(1 << 3)
)

type CreateEventStreamWebHookRequestContent struct {
	// Name of the event stream.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// List of event types subscribed to in this stream.
	Subscriptions []*EventStreamSubscription     `json:"subscriptions,omitempty" url:"subscriptions,omitempty"`
	Destination   *EventStreamWebhookDestination `json:"destination" url:"destination"`
	Status        *EventStreamStatusEnum         `json:"status,omitempty" url:"status,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (c *CreateEventStreamWebHookRequestContent) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}

func (c *CreateEventStreamWebHookRequestContent) GetSubscriptions() []*EventStreamSubscription {
	if c == nil || c.Subscriptions == nil {
		return nil
	}
	return c.Subscriptions
}

func (c *CreateEventStreamWebHookRequestContent) GetDestination() *EventStreamWebhookDestination {
	if c == nil {
		return nil
	}
	return c.Destination
}

func (c *CreateEventStreamWebHookRequestContent) GetStatus() EventStreamStatusEnum {
	if c == nil || c.Status == nil {
		return ""
	}
	return *c.Status
}

func (c *CreateEventStreamWebHookRequestContent) GetExtraProperties() map[string]interface{} {
	return c.extraProperties
}

func (c *CreateEventStreamWebHookRequestContent) require(field *big.Int) {
	if c.explicitFields == nil {
		c.explicitFields = big.NewInt(0)
	}
	c.explicitFields.Or(c.explicitFields, field)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamWebHookRequestContent) SetName(name *string) {
	c.Name = name
	c.require(createEventStreamWebHookRequestContentFieldName)
}

// SetSubscriptions sets the Subscriptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamWebHookRequestContent) SetSubscriptions(subscriptions []*EventStreamSubscription) {
	c.Subscriptions = subscriptions
	c.require(createEventStreamWebHookRequestContentFieldSubscriptions)
}

// SetDestination sets the Destination field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamWebHookRequestContent) SetDestination(destination *EventStreamWebhookDestination) {
	c.Destination = destination
	c.require(createEventStreamWebHookRequestContentFieldDestination)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (c *CreateEventStreamWebHookRequestContent) SetStatus(status *EventStreamStatusEnum) {
	c.Status = status
	c.require(createEventStreamWebHookRequestContentFieldStatus)
}

func (c *CreateEventStreamWebHookRequestContent) UnmarshalJSON(data []byte) error {
	type unmarshaler CreateEventStreamWebHookRequestContent
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*c = CreateEventStreamWebHookRequestContent(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *c)
	if err != nil {
		return err
	}
	c.extraProperties = extraProperties
	c.rawJSON = json.RawMessage(data)
	return nil
}

func (c *CreateEventStreamWebHookRequestContent) MarshalJSON() ([]byte, error) {
	type embed CreateEventStreamWebHookRequestContent
	var marshaler = struct {
		embed
	}{
		embed: embed(*c),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (c *CreateEventStreamWebHookRequestContent) String() string {
	if len(c.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(c.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(c); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", c)
}

// Configuration specific to an action destination.
var (
	eventStreamActionConfigurationFieldActionID = big.NewInt(1 << 0)
)

type EventStreamActionConfiguration struct {
	// Action ID for the action destination.
	ActionID string `json:"action_id" url:"action_id"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamActionConfiguration) GetActionID() string {
	if e == nil {
		return ""
	}
	return e.ActionID
}

func (e *EventStreamActionConfiguration) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamActionConfiguration) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetActionID sets the ActionID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionConfiguration) SetActionID(actionID string) {
	e.ActionID = actionID
	e.require(eventStreamActionConfigurationFieldActionID)
}

func (e *EventStreamActionConfiguration) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamActionConfiguration
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamActionConfiguration(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamActionConfiguration) MarshalJSON() ([]byte, error) {
	type embed EventStreamActionConfiguration
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamActionConfiguration) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

var (
	eventStreamActionDestinationFieldType          = big.NewInt(1 << 0)
	eventStreamActionDestinationFieldConfiguration = big.NewInt(1 << 1)
)

type EventStreamActionDestination struct {
	Type          EventStreamActionDestinationTypeEnum `json:"type" url:"type"`
	Configuration *EventStreamActionConfiguration      `json:"configuration" url:"configuration"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamActionDestination) GetConfiguration() *EventStreamActionConfiguration {
	if e == nil {
		return nil
	}
	return e.Configuration
}

func (e *EventStreamActionDestination) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamActionDestination) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionDestination) SetType(type_ EventStreamActionDestinationTypeEnum) {
	e.Type = type_
	e.require(eventStreamActionDestinationFieldType)
}

// SetConfiguration sets the Configuration field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionDestination) SetConfiguration(configuration *EventStreamActionConfiguration) {
	e.Configuration = configuration
	e.require(eventStreamActionDestinationFieldConfiguration)
}

func (e *EventStreamActionDestination) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamActionDestination
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamActionDestination(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamActionDestination) MarshalJSON() ([]byte, error) {
	type embed EventStreamActionDestination
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamActionDestination) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

type EventStreamActionDestinationTypeEnum = string

var (
	eventStreamActionResponseContentFieldID            = big.NewInt(1 << 0)
	eventStreamActionResponseContentFieldName          = big.NewInt(1 << 1)
	eventStreamActionResponseContentFieldSubscriptions = big.NewInt(1 << 2)
	eventStreamActionResponseContentFieldDestination   = big.NewInt(1 << 3)
	eventStreamActionResponseContentFieldStatus        = big.NewInt(1 << 4)
	eventStreamActionResponseContentFieldCreatedAt     = big.NewInt(1 << 5)
	eventStreamActionResponseContentFieldUpdatedAt     = big.NewInt(1 << 6)
)

type EventStreamActionResponseContent struct {
	// Unique identifier for the event stream.
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// Name of the event stream.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// List of event types subscribed to in this stream.
	Subscriptions []*EventStreamSubscription    `json:"subscriptions,omitempty" url:"subscriptions,omitempty"`
	Destination   *EventStreamActionDestination `json:"destination,omitempty" url:"destination,omitempty"`
	Status        *EventStreamStatusEnum        `json:"status,omitempty" url:"status,omitempty"`
	// Timestamp when the event stream was created.
	CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"`
	// Timestamp when the event stream was last updated.
	UpdatedAt *time.Time `json:"updated_at,omitempty" url:"updated_at,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamActionResponseContent) GetID() string {
	if e == nil || e.ID == nil {
		return ""
	}
	return *e.ID
}

func (e *EventStreamActionResponseContent) GetName() string {
	if e == nil || e.Name == nil {
		return ""
	}
	return *e.Name
}

func (e *EventStreamActionResponseContent) GetSubscriptions() []*EventStreamSubscription {
	if e == nil || e.Subscriptions == nil {
		return nil
	}
	return e.Subscriptions
}

func (e *EventStreamActionResponseContent) GetDestination() EventStreamActionDestination {
	if e == nil || e.Destination == nil {
		return EventStreamActionDestination{}
	}
	return *e.Destination
}

func (e *EventStreamActionResponseContent) GetStatus() EventStreamStatusEnum {
	if e == nil || e.Status == nil {
		return ""
	}
	return *e.Status
}

func (e *EventStreamActionResponseContent) GetCreatedAt() time.Time {
	if e == nil || e.CreatedAt == nil {
		return time.Time{}
	}
	return *e.CreatedAt
}

func (e *EventStreamActionResponseContent) GetUpdatedAt() time.Time {
	if e == nil || e.UpdatedAt == nil {
		return time.Time{}
	}
	return *e.UpdatedAt
}

func (e *EventStreamActionResponseContent) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamActionResponseContent) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionResponseContent) SetID(id *string) {
	e.ID = id
	e.require(eventStreamActionResponseContentFieldID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionResponseContent) SetName(name *string) {
	e.Name = name
	e.require(eventStreamActionResponseContentFieldName)
}

// SetSubscriptions sets the Subscriptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionResponseContent) SetSubscriptions(subscriptions []*EventStreamSubscription) {
	e.Subscriptions = subscriptions
	e.require(eventStreamActionResponseContentFieldSubscriptions)
}

// SetDestination sets the Destination field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionResponseContent) SetDestination(destination *EventStreamActionDestination) {
	e.Destination = destination
	e.require(eventStreamActionResponseContentFieldDestination)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionResponseContent) SetStatus(status *EventStreamStatusEnum) {
	e.Status = status
	e.require(eventStreamActionResponseContentFieldStatus)
}

// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionResponseContent) SetCreatedAt(createdAt *time.Time) {
	e.CreatedAt = createdAt
	e.require(eventStreamActionResponseContentFieldCreatedAt)
}

// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamActionResponseContent) SetUpdatedAt(updatedAt *time.Time) {
	e.UpdatedAt = updatedAt
	e.require(eventStreamActionResponseContentFieldUpdatedAt)
}

func (e *EventStreamActionResponseContent) UnmarshalJSON(data []byte) error {
	type embed EventStreamActionResponseContent
	var unmarshaler = struct {
		embed
		CreatedAt *internal.DateTime `json:"created_at,omitempty"`
		UpdatedAt *internal.DateTime `json:"updated_at,omitempty"`
	}{
		embed: embed(*e),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*e = EventStreamActionResponseContent(unmarshaler.embed)
	e.CreatedAt = unmarshaler.CreatedAt.TimePtr()
	e.UpdatedAt = unmarshaler.UpdatedAt.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamActionResponseContent) MarshalJSON() ([]byte, error) {
	type embed EventStreamActionResponseContent
	var marshaler = struct {
		embed
		CreatedAt *internal.DateTime `json:"created_at,omitempty"`
		UpdatedAt *internal.DateTime `json:"updated_at,omitempty"`
	}{
		embed:     embed(*e),
		CreatedAt: internal.NewOptionalDateTime(e.CreatedAt),
		UpdatedAt: internal.NewOptionalDateTime(e.UpdatedAt),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamActionResponseContent) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

type EventStreamDestinationPatch struct {
	EventStreamWebhookDestination *EventStreamWebhookDestination
	EventStreamActionDestination  *EventStreamActionDestination

	typ string
}

func (e *EventStreamDestinationPatch) GetEventStreamWebhookDestination() *EventStreamWebhookDestination {
	if e == nil {
		return nil
	}
	return e.EventStreamWebhookDestination
}

func (e *EventStreamDestinationPatch) GetEventStreamActionDestination() *EventStreamActionDestination {
	if e == nil {
		return nil
	}
	return e.EventStreamActionDestination
}

func (e *EventStreamDestinationPatch) UnmarshalJSON(data []byte) error {
	valueEventStreamWebhookDestination := new(EventStreamWebhookDestination)
	if err := json.Unmarshal(data, &valueEventStreamWebhookDestination); err == nil {
		e.typ = "EventStreamWebhookDestination"
		e.EventStreamWebhookDestination = valueEventStreamWebhookDestination
		return nil
	}
	valueEventStreamActionDestination := new(EventStreamActionDestination)
	if err := json.Unmarshal(data, &valueEventStreamActionDestination); err == nil {
		e.typ = "EventStreamActionDestination"
		e.EventStreamActionDestination = valueEventStreamActionDestination
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, e)
}

func (e EventStreamDestinationPatch) MarshalJSON() ([]byte, error) {
	if e.typ == "EventStreamWebhookDestination" || e.EventStreamWebhookDestination != nil {
		return json.Marshal(e.EventStreamWebhookDestination)
	}
	if e.typ == "EventStreamActionDestination" || e.EventStreamActionDestination != nil {
		return json.Marshal(e.EventStreamActionDestination)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", e)
}

type EventStreamDestinationPatchVisitor interface {
	VisitEventStreamWebhookDestination(*EventStreamWebhookDestination) error
	VisitEventStreamActionDestination(*EventStreamActionDestination) error
}

func (e *EventStreamDestinationPatch) Accept(visitor EventStreamDestinationPatchVisitor) error {
	if e.typ == "EventStreamWebhookDestination" || e.EventStreamWebhookDestination != nil {
		return visitor.VisitEventStreamWebhookDestination(e.EventStreamWebhookDestination)
	}
	if e.typ == "EventStreamActionDestination" || e.EventStreamActionDestination != nil {
		return visitor.VisitEventStreamActionDestination(e.EventStreamActionDestination)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", e)
}

// AWS Region for EventBridge destination.
type EventStreamEventBridgeAwsRegionEnum string

const (
	EventStreamEventBridgeAwsRegionEnumAfSouth1     EventStreamEventBridgeAwsRegionEnum = "af-south-1"
	EventStreamEventBridgeAwsRegionEnumApEast1      EventStreamEventBridgeAwsRegionEnum = "ap-east-1"
	EventStreamEventBridgeAwsRegionEnumApEast2      EventStreamEventBridgeAwsRegionEnum = "ap-east-2"
	EventStreamEventBridgeAwsRegionEnumApNortheast1 EventStreamEventBridgeAwsRegionEnum = "ap-northeast-1"
	EventStreamEventBridgeAwsRegionEnumApNortheast2 EventStreamEventBridgeAwsRegionEnum = "ap-northeast-2"
	EventStreamEventBridgeAwsRegionEnumApNortheast3 EventStreamEventBridgeAwsRegionEnum = "ap-northeast-3"
	EventStreamEventBridgeAwsRegionEnumApSouth1     EventStreamEventBridgeAwsRegionEnum = "ap-south-1"
	EventStreamEventBridgeAwsRegionEnumApSouth2     EventStreamEventBridgeAwsRegionEnum = "ap-south-2"
	EventStreamEventBridgeAwsRegionEnumApSoutheast1 EventStreamEventBridgeAwsRegionEnum = "ap-southeast-1"
	EventStreamEventBridgeAwsRegionEnumApSoutheast2 EventStreamEventBridgeAwsRegionEnum = "ap-southeast-2"
	EventStreamEventBridgeAwsRegionEnumApSoutheast3 EventStreamEventBridgeAwsRegionEnum = "ap-southeast-3"
	EventStreamEventBridgeAwsRegionEnumApSoutheast4 EventStreamEventBridgeAwsRegionEnum = "ap-southeast-4"
	EventStreamEventBridgeAwsRegionEnumApSoutheast5 EventStreamEventBridgeAwsRegionEnum = "ap-southeast-5"
	EventStreamEventBridgeAwsRegionEnumApSoutheast6 EventStreamEventBridgeAwsRegionEnum = "ap-southeast-6"
	EventStreamEventBridgeAwsRegionEnumApSoutheast7 EventStreamEventBridgeAwsRegionEnum = "ap-southeast-7"
	EventStreamEventBridgeAwsRegionEnumCaCentral1   EventStreamEventBridgeAwsRegionEnum = "ca-central-1"
	EventStreamEventBridgeAwsRegionEnumCaWest1      EventStreamEventBridgeAwsRegionEnum = "ca-west-1"
	EventStreamEventBridgeAwsRegionEnumEuCentral1   EventStreamEventBridgeAwsRegionEnum = "eu-central-1"
	EventStreamEventBridgeAwsRegionEnumEuCentral2   EventStreamEventBridgeAwsRegionEnum = "eu-central-2"
	EventStreamEventBridgeAwsRegionEnumEuNorth1     EventStreamEventBridgeAwsRegionEnum = "eu-north-1"
	EventStreamEventBridgeAwsRegionEnumEuSouth1     EventStreamEventBridgeAwsRegionEnum = "eu-south-1"
	EventStreamEventBridgeAwsRegionEnumEuSouth2     EventStreamEventBridgeAwsRegionEnum = "eu-south-2"
	EventStreamEventBridgeAwsRegionEnumEuWest1      EventStreamEventBridgeAwsRegionEnum = "eu-west-1"
	EventStreamEventBridgeAwsRegionEnumEuWest2      EventStreamEventBridgeAwsRegionEnum = "eu-west-2"
	EventStreamEventBridgeAwsRegionEnumEuWest3      EventStreamEventBridgeAwsRegionEnum = "eu-west-3"
	EventStreamEventBridgeAwsRegionEnumIlCentral1   EventStreamEventBridgeAwsRegionEnum = "il-central-1"
	EventStreamEventBridgeAwsRegionEnumMeCentral1   EventStreamEventBridgeAwsRegionEnum = "me-central-1"
	EventStreamEventBridgeAwsRegionEnumMeSouth1     EventStreamEventBridgeAwsRegionEnum = "me-south-1"
	EventStreamEventBridgeAwsRegionEnumMxCentral1   EventStreamEventBridgeAwsRegionEnum = "mx-central-1"
	EventStreamEventBridgeAwsRegionEnumSaEast1      EventStreamEventBridgeAwsRegionEnum = "sa-east-1"
	EventStreamEventBridgeAwsRegionEnumUsGovEast1   EventStreamEventBridgeAwsRegionEnum = "us-gov-east-1"
	EventStreamEventBridgeAwsRegionEnumUsGovWest1   EventStreamEventBridgeAwsRegionEnum = "us-gov-west-1"
	EventStreamEventBridgeAwsRegionEnumUsEast1      EventStreamEventBridgeAwsRegionEnum = "us-east-1"
	EventStreamEventBridgeAwsRegionEnumUsEast2      EventStreamEventBridgeAwsRegionEnum = "us-east-2"
	EventStreamEventBridgeAwsRegionEnumUsWest1      EventStreamEventBridgeAwsRegionEnum = "us-west-1"
	EventStreamEventBridgeAwsRegionEnumUsWest2      EventStreamEventBridgeAwsRegionEnum = "us-west-2"
)

func NewEventStreamEventBridgeAwsRegionEnumFromString(s string) (EventStreamEventBridgeAwsRegionEnum, error) {
	switch s {
	case "af-south-1":
		return EventStreamEventBridgeAwsRegionEnumAfSouth1, nil
	case "ap-east-1":
		return EventStreamEventBridgeAwsRegionEnumApEast1, nil
	case "ap-east-2":
		return EventStreamEventBridgeAwsRegionEnumApEast2, nil
	case "ap-northeast-1":
		return EventStreamEventBridgeAwsRegionEnumApNortheast1, nil
	case "ap-northeast-2":
		return EventStreamEventBridgeAwsRegionEnumApNortheast2, nil
	case "ap-northeast-3":
		return EventStreamEventBridgeAwsRegionEnumApNortheast3, nil
	case "ap-south-1":
		return EventStreamEventBridgeAwsRegionEnumApSouth1, nil
	case "ap-south-2":
		return EventStreamEventBridgeAwsRegionEnumApSouth2, nil
	case "ap-southeast-1":
		return EventStreamEventBridgeAwsRegionEnumApSoutheast1, nil
	case "ap-southeast-2":
		return EventStreamEventBridgeAwsRegionEnumApSoutheast2, nil
	case "ap-southeast-3":
		return EventStreamEventBridgeAwsRegionEnumApSoutheast3, nil
	case "ap-southeast-4":
		return EventStreamEventBridgeAwsRegionEnumApSoutheast4, nil
	case "ap-southeast-5":
		return EventStreamEventBridgeAwsRegionEnumApSoutheast5, nil
	case "ap-southeast-6":
		return EventStreamEventBridgeAwsRegionEnumApSoutheast6, nil
	case "ap-southeast-7":
		return EventStreamEventBridgeAwsRegionEnumApSoutheast7, nil
	case "ca-central-1":
		return EventStreamEventBridgeAwsRegionEnumCaCentral1, nil
	case "ca-west-1":
		return EventStreamEventBridgeAwsRegionEnumCaWest1, nil
	case "eu-central-1":
		return EventStreamEventBridgeAwsRegionEnumEuCentral1, nil
	case "eu-central-2":
		return EventStreamEventBridgeAwsRegionEnumEuCentral2, nil
	case "eu-north-1":
		return EventStreamEventBridgeAwsRegionEnumEuNorth1, nil
	case "eu-south-1":
		return EventStreamEventBridgeAwsRegionEnumEuSouth1, nil
	case "eu-south-2":
		return EventStreamEventBridgeAwsRegionEnumEuSouth2, nil
	case "eu-west-1":
		return EventStreamEventBridgeAwsRegionEnumEuWest1, nil
	case "eu-west-2":
		return EventStreamEventBridgeAwsRegionEnumEuWest2, nil
	case "eu-west-3":
		return EventStreamEventBridgeAwsRegionEnumEuWest3, nil
	case "il-central-1":
		return EventStreamEventBridgeAwsRegionEnumIlCentral1, nil
	case "me-central-1":
		return EventStreamEventBridgeAwsRegionEnumMeCentral1, nil
	case "me-south-1":
		return EventStreamEventBridgeAwsRegionEnumMeSouth1, nil
	case "mx-central-1":
		return EventStreamEventBridgeAwsRegionEnumMxCentral1, nil
	case "sa-east-1":
		return EventStreamEventBridgeAwsRegionEnumSaEast1, nil
	case "us-gov-east-1":
		return EventStreamEventBridgeAwsRegionEnumUsGovEast1, nil
	case "us-gov-west-1":
		return EventStreamEventBridgeAwsRegionEnumUsGovWest1, nil
	case "us-east-1":
		return EventStreamEventBridgeAwsRegionEnumUsEast1, nil
	case "us-east-2":
		return EventStreamEventBridgeAwsRegionEnumUsEast2, nil
	case "us-west-1":
		return EventStreamEventBridgeAwsRegionEnumUsWest1, nil
	case "us-west-2":
		return EventStreamEventBridgeAwsRegionEnumUsWest2, nil
	}
	var t EventStreamEventBridgeAwsRegionEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (e EventStreamEventBridgeAwsRegionEnum) Ptr() *EventStreamEventBridgeAwsRegionEnum {
	return &e
}

// Configuration specific to an eventbridge destination.
var (
	eventStreamEventBridgeConfigurationFieldAwsAccountID          = big.NewInt(1 << 0)
	eventStreamEventBridgeConfigurationFieldAwsRegion             = big.NewInt(1 << 1)
	eventStreamEventBridgeConfigurationFieldAwsPartnerEventSource = big.NewInt(1 << 2)
)

type EventStreamEventBridgeConfiguration struct {
	// AWS Account ID for EventBridge destination.
	AwsAccountID string                              `json:"aws_account_id" url:"aws_account_id"`
	AwsRegion    EventStreamEventBridgeAwsRegionEnum `json:"aws_region" url:"aws_region"`
	// AWS Partner Event Source for EventBridge destination.
	AwsPartnerEventSource *string `json:"aws_partner_event_source,omitempty" url:"aws_partner_event_source,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamEventBridgeConfiguration) GetAwsAccountID() string {
	if e == nil {
		return ""
	}
	return e.AwsAccountID
}

func (e *EventStreamEventBridgeConfiguration) GetAwsRegion() EventStreamEventBridgeAwsRegionEnum {
	if e == nil {
		return ""
	}
	return e.AwsRegion
}

func (e *EventStreamEventBridgeConfiguration) GetAwsPartnerEventSource() string {
	if e == nil || e.AwsPartnerEventSource == nil {
		return ""
	}
	return *e.AwsPartnerEventSource
}

func (e *EventStreamEventBridgeConfiguration) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamEventBridgeConfiguration) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetAwsAccountID sets the AwsAccountID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeConfiguration) SetAwsAccountID(awsAccountID string) {
	e.AwsAccountID = awsAccountID
	e.require(eventStreamEventBridgeConfigurationFieldAwsAccountID)
}

// SetAwsRegion sets the AwsRegion field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeConfiguration) SetAwsRegion(awsRegion EventStreamEventBridgeAwsRegionEnum) {
	e.AwsRegion = awsRegion
	e.require(eventStreamEventBridgeConfigurationFieldAwsRegion)
}

// SetAwsPartnerEventSource sets the AwsPartnerEventSource field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeConfiguration) SetAwsPartnerEventSource(awsPartnerEventSource *string) {
	e.AwsPartnerEventSource = awsPartnerEventSource
	e.require(eventStreamEventBridgeConfigurationFieldAwsPartnerEventSource)
}

func (e *EventStreamEventBridgeConfiguration) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamEventBridgeConfiguration
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamEventBridgeConfiguration(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamEventBridgeConfiguration) MarshalJSON() ([]byte, error) {
	type embed EventStreamEventBridgeConfiguration
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamEventBridgeConfiguration) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

var (
	eventStreamEventBridgeDestinationFieldType          = big.NewInt(1 << 0)
	eventStreamEventBridgeDestinationFieldConfiguration = big.NewInt(1 << 1)
)

type EventStreamEventBridgeDestination struct {
	Type          EventStreamEventBridgeDestinationTypeEnum `json:"type" url:"type"`
	Configuration *EventStreamEventBridgeConfiguration      `json:"configuration" url:"configuration"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamEventBridgeDestination) GetConfiguration() *EventStreamEventBridgeConfiguration {
	if e == nil {
		return nil
	}
	return e.Configuration
}

func (e *EventStreamEventBridgeDestination) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamEventBridgeDestination) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeDestination) SetType(type_ EventStreamEventBridgeDestinationTypeEnum) {
	e.Type = type_
	e.require(eventStreamEventBridgeDestinationFieldType)
}

// SetConfiguration sets the Configuration field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeDestination) SetConfiguration(configuration *EventStreamEventBridgeConfiguration) {
	e.Configuration = configuration
	e.require(eventStreamEventBridgeDestinationFieldConfiguration)
}

func (e *EventStreamEventBridgeDestination) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamEventBridgeDestination
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamEventBridgeDestination(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamEventBridgeDestination) MarshalJSON() ([]byte, error) {
	type embed EventStreamEventBridgeDestination
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamEventBridgeDestination) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

type EventStreamEventBridgeDestinationTypeEnum = string

var (
	eventStreamEventBridgeResponseContentFieldID            = big.NewInt(1 << 0)
	eventStreamEventBridgeResponseContentFieldName          = big.NewInt(1 << 1)
	eventStreamEventBridgeResponseContentFieldSubscriptions = big.NewInt(1 << 2)
	eventStreamEventBridgeResponseContentFieldDestination   = big.NewInt(1 << 3)
	eventStreamEventBridgeResponseContentFieldStatus        = big.NewInt(1 << 4)
	eventStreamEventBridgeResponseContentFieldCreatedAt     = big.NewInt(1 << 5)
	eventStreamEventBridgeResponseContentFieldUpdatedAt     = big.NewInt(1 << 6)
)

type EventStreamEventBridgeResponseContent struct {
	// Unique identifier for the event stream.
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// Name of the event stream.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// List of event types subscribed to in this stream.
	Subscriptions []*EventStreamSubscription         `json:"subscriptions,omitempty" url:"subscriptions,omitempty"`
	Destination   *EventStreamEventBridgeDestination `json:"destination,omitempty" url:"destination,omitempty"`
	Status        *EventStreamStatusEnum             `json:"status,omitempty" url:"status,omitempty"`
	// Timestamp when the event stream was created.
	CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"`
	// Timestamp when the event stream was last updated.
	UpdatedAt *time.Time `json:"updated_at,omitempty" url:"updated_at,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamEventBridgeResponseContent) GetID() string {
	if e == nil || e.ID == nil {
		return ""
	}
	return *e.ID
}

func (e *EventStreamEventBridgeResponseContent) GetName() string {
	if e == nil || e.Name == nil {
		return ""
	}
	return *e.Name
}

func (e *EventStreamEventBridgeResponseContent) GetSubscriptions() []*EventStreamSubscription {
	if e == nil || e.Subscriptions == nil {
		return nil
	}
	return e.Subscriptions
}

func (e *EventStreamEventBridgeResponseContent) GetDestination() EventStreamEventBridgeDestination {
	if e == nil || e.Destination == nil {
		return EventStreamEventBridgeDestination{}
	}
	return *e.Destination
}

func (e *EventStreamEventBridgeResponseContent) GetStatus() EventStreamStatusEnum {
	if e == nil || e.Status == nil {
		return ""
	}
	return *e.Status
}

func (e *EventStreamEventBridgeResponseContent) GetCreatedAt() time.Time {
	if e == nil || e.CreatedAt == nil {
		return time.Time{}
	}
	return *e.CreatedAt
}

func (e *EventStreamEventBridgeResponseContent) GetUpdatedAt() time.Time {
	if e == nil || e.UpdatedAt == nil {
		return time.Time{}
	}
	return *e.UpdatedAt
}

func (e *EventStreamEventBridgeResponseContent) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamEventBridgeResponseContent) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeResponseContent) SetID(id *string) {
	e.ID = id
	e.require(eventStreamEventBridgeResponseContentFieldID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeResponseContent) SetName(name *string) {
	e.Name = name
	e.require(eventStreamEventBridgeResponseContentFieldName)
}

// SetSubscriptions sets the Subscriptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeResponseContent) SetSubscriptions(subscriptions []*EventStreamSubscription) {
	e.Subscriptions = subscriptions
	e.require(eventStreamEventBridgeResponseContentFieldSubscriptions)
}

// SetDestination sets the Destination field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeResponseContent) SetDestination(destination *EventStreamEventBridgeDestination) {
	e.Destination = destination
	e.require(eventStreamEventBridgeResponseContentFieldDestination)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeResponseContent) SetStatus(status *EventStreamStatusEnum) {
	e.Status = status
	e.require(eventStreamEventBridgeResponseContentFieldStatus)
}

// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeResponseContent) SetCreatedAt(createdAt *time.Time) {
	e.CreatedAt = createdAt
	e.require(eventStreamEventBridgeResponseContentFieldCreatedAt)
}

// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamEventBridgeResponseContent) SetUpdatedAt(updatedAt *time.Time) {
	e.UpdatedAt = updatedAt
	e.require(eventStreamEventBridgeResponseContentFieldUpdatedAt)
}

func (e *EventStreamEventBridgeResponseContent) UnmarshalJSON(data []byte) error {
	type embed EventStreamEventBridgeResponseContent
	var unmarshaler = struct {
		embed
		CreatedAt *internal.DateTime `json:"created_at,omitempty"`
		UpdatedAt *internal.DateTime `json:"updated_at,omitempty"`
	}{
		embed: embed(*e),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*e = EventStreamEventBridgeResponseContent(unmarshaler.embed)
	e.CreatedAt = unmarshaler.CreatedAt.TimePtr()
	e.UpdatedAt = unmarshaler.UpdatedAt.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamEventBridgeResponseContent) MarshalJSON() ([]byte, error) {
	type embed EventStreamEventBridgeResponseContent
	var marshaler = struct {
		embed
		CreatedAt *internal.DateTime `json:"created_at,omitempty"`
		UpdatedAt *internal.DateTime `json:"updated_at,omitempty"`
	}{
		embed:     embed(*e),
		CreatedAt: internal.NewOptionalDateTime(e.CreatedAt),
		UpdatedAt: internal.NewOptionalDateTime(e.UpdatedAt),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamEventBridgeResponseContent) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

type EventStreamResponseContent struct {
	EventStreamWebhookResponseContent     *EventStreamWebhookResponseContent
	EventStreamEventBridgeResponseContent *EventStreamEventBridgeResponseContent
	EventStreamActionResponseContent      *EventStreamActionResponseContent

	typ string
}

func (e *EventStreamResponseContent) GetEventStreamWebhookResponseContent() *EventStreamWebhookResponseContent {
	if e == nil {
		return nil
	}
	return e.EventStreamWebhookResponseContent
}

func (e *EventStreamResponseContent) GetEventStreamEventBridgeResponseContent() *EventStreamEventBridgeResponseContent {
	if e == nil {
		return nil
	}
	return e.EventStreamEventBridgeResponseContent
}

func (e *EventStreamResponseContent) GetEventStreamActionResponseContent() *EventStreamActionResponseContent {
	if e == nil {
		return nil
	}
	return e.EventStreamActionResponseContent
}

func (e *EventStreamResponseContent) UnmarshalJSON(data []byte) error {
	valueEventStreamWebhookResponseContent := new(EventStreamWebhookResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamWebhookResponseContent); err == nil {
		e.typ = "EventStreamWebhookResponseContent"
		e.EventStreamWebhookResponseContent = valueEventStreamWebhookResponseContent
		return nil
	}
	valueEventStreamEventBridgeResponseContent := new(EventStreamEventBridgeResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamEventBridgeResponseContent); err == nil {
		e.typ = "EventStreamEventBridgeResponseContent"
		e.EventStreamEventBridgeResponseContent = valueEventStreamEventBridgeResponseContent
		return nil
	}
	valueEventStreamActionResponseContent := new(EventStreamActionResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamActionResponseContent); err == nil {
		e.typ = "EventStreamActionResponseContent"
		e.EventStreamActionResponseContent = valueEventStreamActionResponseContent
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, e)
}

func (e EventStreamResponseContent) MarshalJSON() ([]byte, error) {
	if e.typ == "EventStreamWebhookResponseContent" || e.EventStreamWebhookResponseContent != nil {
		return json.Marshal(e.EventStreamWebhookResponseContent)
	}
	if e.typ == "EventStreamEventBridgeResponseContent" || e.EventStreamEventBridgeResponseContent != nil {
		return json.Marshal(e.EventStreamEventBridgeResponseContent)
	}
	if e.typ == "EventStreamActionResponseContent" || e.EventStreamActionResponseContent != nil {
		return json.Marshal(e.EventStreamActionResponseContent)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", e)
}

type EventStreamResponseContentVisitor interface {
	VisitEventStreamWebhookResponseContent(*EventStreamWebhookResponseContent) error
	VisitEventStreamEventBridgeResponseContent(*EventStreamEventBridgeResponseContent) error
	VisitEventStreamActionResponseContent(*EventStreamActionResponseContent) error
}

func (e *EventStreamResponseContent) Accept(visitor EventStreamResponseContentVisitor) error {
	if e.typ == "EventStreamWebhookResponseContent" || e.EventStreamWebhookResponseContent != nil {
		return visitor.VisitEventStreamWebhookResponseContent(e.EventStreamWebhookResponseContent)
	}
	if e.typ == "EventStreamEventBridgeResponseContent" || e.EventStreamEventBridgeResponseContent != nil {
		return visitor.VisitEventStreamEventBridgeResponseContent(e.EventStreamEventBridgeResponseContent)
	}
	if e.typ == "EventStreamActionResponseContent" || e.EventStreamActionResponseContent != nil {
		return visitor.VisitEventStreamActionResponseContent(e.EventStreamActionResponseContent)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", e)
}

// Indicates whether the event stream is actively forwarding events.
type EventStreamStatusEnum string

const (
	EventStreamStatusEnumEnabled  EventStreamStatusEnum = "enabled"
	EventStreamStatusEnumDisabled EventStreamStatusEnum = "disabled"
)

func NewEventStreamStatusEnumFromString(s string) (EventStreamStatusEnum, error) {
	switch s {
	case "enabled":
		return EventStreamStatusEnumEnabled, nil
	case "disabled":
		return EventStreamStatusEnumDisabled, nil
	}
	var t EventStreamStatusEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (e EventStreamStatusEnum) Ptr() *EventStreamStatusEnum {
	return &e
}

// Event types
var (
	eventStreamSubscriptionFieldEventType = big.NewInt(1 << 0)
)

type EventStreamSubscription struct {
	EventType *string `json:"event_type,omitempty" url:"event_type,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamSubscription) GetEventType() string {
	if e == nil || e.EventType == nil {
		return ""
	}
	return *e.EventType
}

func (e *EventStreamSubscription) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamSubscription) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetEventType sets the EventType field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamSubscription) SetEventType(eventType *string) {
	e.EventType = eventType
	e.require(eventStreamSubscriptionFieldEventType)
}

func (e *EventStreamSubscription) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamSubscription
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamSubscription(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamSubscription) MarshalJSON() ([]byte, error) {
	type embed EventStreamSubscription
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamSubscription) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

// The type of event this test event represents.
type EventStreamTestEventTypeEnum string

const (
	EventStreamTestEventTypeEnumUserCreated                    EventStreamTestEventTypeEnum = "user.created"
	EventStreamTestEventTypeEnumUserDeleted                    EventStreamTestEventTypeEnum = "user.deleted"
	EventStreamTestEventTypeEnumUserUpdated                    EventStreamTestEventTypeEnum = "user.updated"
	EventStreamTestEventTypeEnumOrganizationCreated            EventStreamTestEventTypeEnum = "organization.created"
	EventStreamTestEventTypeEnumOrganizationUpdated            EventStreamTestEventTypeEnum = "organization.updated"
	EventStreamTestEventTypeEnumOrganizationDeleted            EventStreamTestEventTypeEnum = "organization.deleted"
	EventStreamTestEventTypeEnumOrganizationMemberAdded        EventStreamTestEventTypeEnum = "organization.member.added"
	EventStreamTestEventTypeEnumOrganizationMemberDeleted      EventStreamTestEventTypeEnum = "organization.member.deleted"
	EventStreamTestEventTypeEnumOrganizationMemberRoleAssigned EventStreamTestEventTypeEnum = "organization.member.role.assigned"
	EventStreamTestEventTypeEnumOrganizationMemberRoleDeleted  EventStreamTestEventTypeEnum = "organization.member.role.deleted"
	EventStreamTestEventTypeEnumOrganizationConnectionAdded    EventStreamTestEventTypeEnum = "organization.connection.added"
	EventStreamTestEventTypeEnumOrganizationConnectionUpdated  EventStreamTestEventTypeEnum = "organization.connection.updated"
	EventStreamTestEventTypeEnumOrganizationConnectionRemoved  EventStreamTestEventTypeEnum = "organization.connection.removed"
)

func NewEventStreamTestEventTypeEnumFromString(s string) (EventStreamTestEventTypeEnum, error) {
	switch s {
	case "user.created":
		return EventStreamTestEventTypeEnumUserCreated, nil
	case "user.deleted":
		return EventStreamTestEventTypeEnumUserDeleted, nil
	case "user.updated":
		return EventStreamTestEventTypeEnumUserUpdated, nil
	case "organization.created":
		return EventStreamTestEventTypeEnumOrganizationCreated, nil
	case "organization.updated":
		return EventStreamTestEventTypeEnumOrganizationUpdated, nil
	case "organization.deleted":
		return EventStreamTestEventTypeEnumOrganizationDeleted, nil
	case "organization.member.added":
		return EventStreamTestEventTypeEnumOrganizationMemberAdded, nil
	case "organization.member.deleted":
		return EventStreamTestEventTypeEnumOrganizationMemberDeleted, nil
	case "organization.member.role.assigned":
		return EventStreamTestEventTypeEnumOrganizationMemberRoleAssigned, nil
	case "organization.member.role.deleted":
		return EventStreamTestEventTypeEnumOrganizationMemberRoleDeleted, nil
	case "organization.connection.added":
		return EventStreamTestEventTypeEnumOrganizationConnectionAdded, nil
	case "organization.connection.updated":
		return EventStreamTestEventTypeEnumOrganizationConnectionUpdated, nil
	case "organization.connection.removed":
		return EventStreamTestEventTypeEnumOrganizationConnectionRemoved, nil
	}
	var t EventStreamTestEventTypeEnum
	return "", fmt.Errorf("%s is not a valid %T", s, t)
}

func (e EventStreamTestEventTypeEnum) Ptr() *EventStreamTestEventTypeEnum {
	return &e
}

type EventStreamWebhookAuthorizationResponse struct {
	EventStreamWebhookBasicAuth  *EventStreamWebhookBasicAuth
	EventStreamWebhookBearerAuth *EventStreamWebhookBearerAuth

	typ string
}

func (e *EventStreamWebhookAuthorizationResponse) GetEventStreamWebhookBasicAuth() *EventStreamWebhookBasicAuth {
	if e == nil {
		return nil
	}
	return e.EventStreamWebhookBasicAuth
}

func (e *EventStreamWebhookAuthorizationResponse) GetEventStreamWebhookBearerAuth() *EventStreamWebhookBearerAuth {
	if e == nil {
		return nil
	}
	return e.EventStreamWebhookBearerAuth
}

func (e *EventStreamWebhookAuthorizationResponse) UnmarshalJSON(data []byte) error {
	valueEventStreamWebhookBasicAuth := new(EventStreamWebhookBasicAuth)
	if err := json.Unmarshal(data, &valueEventStreamWebhookBasicAuth); err == nil {
		e.typ = "EventStreamWebhookBasicAuth"
		e.EventStreamWebhookBasicAuth = valueEventStreamWebhookBasicAuth
		return nil
	}
	valueEventStreamWebhookBearerAuth := new(EventStreamWebhookBearerAuth)
	if err := json.Unmarshal(data, &valueEventStreamWebhookBearerAuth); err == nil {
		e.typ = "EventStreamWebhookBearerAuth"
		e.EventStreamWebhookBearerAuth = valueEventStreamWebhookBearerAuth
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, e)
}

func (e EventStreamWebhookAuthorizationResponse) MarshalJSON() ([]byte, error) {
	if e.typ == "EventStreamWebhookBasicAuth" || e.EventStreamWebhookBasicAuth != nil {
		return json.Marshal(e.EventStreamWebhookBasicAuth)
	}
	if e.typ == "EventStreamWebhookBearerAuth" || e.EventStreamWebhookBearerAuth != nil {
		return json.Marshal(e.EventStreamWebhookBearerAuth)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", e)
}

type EventStreamWebhookAuthorizationResponseVisitor interface {
	VisitEventStreamWebhookBasicAuth(*EventStreamWebhookBasicAuth) error
	VisitEventStreamWebhookBearerAuth(*EventStreamWebhookBearerAuth) error
}

func (e *EventStreamWebhookAuthorizationResponse) Accept(visitor EventStreamWebhookAuthorizationResponseVisitor) error {
	if e.typ == "EventStreamWebhookBasicAuth" || e.EventStreamWebhookBasicAuth != nil {
		return visitor.VisitEventStreamWebhookBasicAuth(e.EventStreamWebhookBasicAuth)
	}
	if e.typ == "EventStreamWebhookBearerAuth" || e.EventStreamWebhookBearerAuth != nil {
		return visitor.VisitEventStreamWebhookBearerAuth(e.EventStreamWebhookBearerAuth)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", e)
}

// Basic Authorization for HTTP requests (e.g., 'Basic credentials').
var (
	eventStreamWebhookBasicAuthFieldMethod   = big.NewInt(1 << 0)
	eventStreamWebhookBasicAuthFieldUsername = big.NewInt(1 << 1)
)

type EventStreamWebhookBasicAuth struct {
	Method EventStreamWebhookBasicAuthMethodEnum `json:"method" url:"method"`
	// Username
	Username string `json:"username" url:"username"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamWebhookBasicAuth) GetUsername() string {
	if e == nil {
		return ""
	}
	return e.Username
}

func (e *EventStreamWebhookBasicAuth) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamWebhookBasicAuth) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetMethod sets the Method field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookBasicAuth) SetMethod(method EventStreamWebhookBasicAuthMethodEnum) {
	e.Method = method
	e.require(eventStreamWebhookBasicAuthFieldMethod)
}

// SetUsername sets the Username field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookBasicAuth) SetUsername(username string) {
	e.Username = username
	e.require(eventStreamWebhookBasicAuthFieldUsername)
}

func (e *EventStreamWebhookBasicAuth) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamWebhookBasicAuth
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamWebhookBasicAuth(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamWebhookBasicAuth) MarshalJSON() ([]byte, error) {
	type embed EventStreamWebhookBasicAuth
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamWebhookBasicAuth) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

// Type of authorization.
type EventStreamWebhookBasicAuthMethodEnum = string

// Bearer Authorization for HTTP requests (e.g., 'Bearer token').
var (
	eventStreamWebhookBearerAuthFieldMethod = big.NewInt(1 << 0)
)

type EventStreamWebhookBearerAuth struct {
	Method EventStreamWebhookBearerAuthMethodEnum `json:"method" url:"method"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamWebhookBearerAuth) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamWebhookBearerAuth) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetMethod sets the Method field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookBearerAuth) SetMethod(method EventStreamWebhookBearerAuthMethodEnum) {
	e.Method = method
	e.require(eventStreamWebhookBearerAuthFieldMethod)
}

func (e *EventStreamWebhookBearerAuth) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamWebhookBearerAuth
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamWebhookBearerAuth(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamWebhookBearerAuth) MarshalJSON() ([]byte, error) {
	type embed EventStreamWebhookBearerAuth
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamWebhookBearerAuth) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

// Type of authorization.
type EventStreamWebhookBearerAuthMethodEnum = string

// Configuration specific to a webhook destination.
var (
	eventStreamWebhookConfigurationFieldWebhookEndpoint      = big.NewInt(1 << 0)
	eventStreamWebhookConfigurationFieldWebhookAuthorization = big.NewInt(1 << 1)
)

type EventStreamWebhookConfiguration struct {
	// Target HTTP endpoint URL.
	WebhookEndpoint      string                                   `json:"webhook_endpoint" url:"webhook_endpoint"`
	WebhookAuthorization *EventStreamWebhookAuthorizationResponse `json:"webhook_authorization" url:"webhook_authorization"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamWebhookConfiguration) GetWebhookEndpoint() string {
	if e == nil {
		return ""
	}
	return e.WebhookEndpoint
}

func (e *EventStreamWebhookConfiguration) GetWebhookAuthorization() *EventStreamWebhookAuthorizationResponse {
	if e == nil {
		return nil
	}
	return e.WebhookAuthorization
}

func (e *EventStreamWebhookConfiguration) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamWebhookConfiguration) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetWebhookEndpoint sets the WebhookEndpoint field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookConfiguration) SetWebhookEndpoint(webhookEndpoint string) {
	e.WebhookEndpoint = webhookEndpoint
	e.require(eventStreamWebhookConfigurationFieldWebhookEndpoint)
}

// SetWebhookAuthorization sets the WebhookAuthorization field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookConfiguration) SetWebhookAuthorization(webhookAuthorization *EventStreamWebhookAuthorizationResponse) {
	e.WebhookAuthorization = webhookAuthorization
	e.require(eventStreamWebhookConfigurationFieldWebhookAuthorization)
}

func (e *EventStreamWebhookConfiguration) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamWebhookConfiguration
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamWebhookConfiguration(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamWebhookConfiguration) MarshalJSON() ([]byte, error) {
	type embed EventStreamWebhookConfiguration
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamWebhookConfiguration) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

var (
	eventStreamWebhookDestinationFieldType          = big.NewInt(1 << 0)
	eventStreamWebhookDestinationFieldConfiguration = big.NewInt(1 << 1)
)

type EventStreamWebhookDestination struct {
	Type          EventStreamWebhookDestinationTypeEnum `json:"type" url:"type"`
	Configuration *EventStreamWebhookConfiguration      `json:"configuration" url:"configuration"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamWebhookDestination) GetConfiguration() *EventStreamWebhookConfiguration {
	if e == nil {
		return nil
	}
	return e.Configuration
}

func (e *EventStreamWebhookDestination) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamWebhookDestination) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetType sets the Type field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookDestination) SetType(type_ EventStreamWebhookDestinationTypeEnum) {
	e.Type = type_
	e.require(eventStreamWebhookDestinationFieldType)
}

// SetConfiguration sets the Configuration field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookDestination) SetConfiguration(configuration *EventStreamWebhookConfiguration) {
	e.Configuration = configuration
	e.require(eventStreamWebhookDestinationFieldConfiguration)
}

func (e *EventStreamWebhookDestination) UnmarshalJSON(data []byte) error {
	type unmarshaler EventStreamWebhookDestination
	var value unmarshaler
	if err := json.Unmarshal(data, &value); err != nil {
		return err
	}
	*e = EventStreamWebhookDestination(value)
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamWebhookDestination) MarshalJSON() ([]byte, error) {
	type embed EventStreamWebhookDestination
	var marshaler = struct {
		embed
	}{
		embed: embed(*e),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamWebhookDestination) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

type EventStreamWebhookDestinationTypeEnum = string

var (
	eventStreamWebhookResponseContentFieldID            = big.NewInt(1 << 0)
	eventStreamWebhookResponseContentFieldName          = big.NewInt(1 << 1)
	eventStreamWebhookResponseContentFieldSubscriptions = big.NewInt(1 << 2)
	eventStreamWebhookResponseContentFieldDestination   = big.NewInt(1 << 3)
	eventStreamWebhookResponseContentFieldStatus        = big.NewInt(1 << 4)
	eventStreamWebhookResponseContentFieldCreatedAt     = big.NewInt(1 << 5)
	eventStreamWebhookResponseContentFieldUpdatedAt     = big.NewInt(1 << 6)
)

type EventStreamWebhookResponseContent struct {
	// Unique identifier for the event stream.
	ID *string `json:"id,omitempty" url:"id,omitempty"`
	// Name of the event stream.
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// List of event types subscribed to in this stream.
	Subscriptions []*EventStreamSubscription     `json:"subscriptions,omitempty" url:"subscriptions,omitempty"`
	Destination   *EventStreamWebhookDestination `json:"destination,omitempty" url:"destination,omitempty"`
	Status        *EventStreamStatusEnum         `json:"status,omitempty" url:"status,omitempty"`
	// Timestamp when the event stream was created.
	CreatedAt *time.Time `json:"created_at,omitempty" url:"created_at,omitempty"`
	// Timestamp when the event stream was last updated.
	UpdatedAt *time.Time `json:"updated_at,omitempty" url:"updated_at,omitempty"`

	// Private bitmask of fields set to an explicit value and therefore not to be omitted
	explicitFields *big.Int `json:"-" url:"-"`

	extraProperties map[string]interface{}
	rawJSON         json.RawMessage
}

func (e *EventStreamWebhookResponseContent) GetID() string {
	if e == nil || e.ID == nil {
		return ""
	}
	return *e.ID
}

func (e *EventStreamWebhookResponseContent) GetName() string {
	if e == nil || e.Name == nil {
		return ""
	}
	return *e.Name
}

func (e *EventStreamWebhookResponseContent) GetSubscriptions() []*EventStreamSubscription {
	if e == nil || e.Subscriptions == nil {
		return nil
	}
	return e.Subscriptions
}

func (e *EventStreamWebhookResponseContent) GetDestination() EventStreamWebhookDestination {
	if e == nil || e.Destination == nil {
		return EventStreamWebhookDestination{}
	}
	return *e.Destination
}

func (e *EventStreamWebhookResponseContent) GetStatus() EventStreamStatusEnum {
	if e == nil || e.Status == nil {
		return ""
	}
	return *e.Status
}

func (e *EventStreamWebhookResponseContent) GetCreatedAt() time.Time {
	if e == nil || e.CreatedAt == nil {
		return time.Time{}
	}
	return *e.CreatedAt
}

func (e *EventStreamWebhookResponseContent) GetUpdatedAt() time.Time {
	if e == nil || e.UpdatedAt == nil {
		return time.Time{}
	}
	return *e.UpdatedAt
}

func (e *EventStreamWebhookResponseContent) GetExtraProperties() map[string]interface{} {
	return e.extraProperties
}

func (e *EventStreamWebhookResponseContent) require(field *big.Int) {
	if e.explicitFields == nil {
		e.explicitFields = big.NewInt(0)
	}
	e.explicitFields.Or(e.explicitFields, field)
}

// SetID sets the ID field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookResponseContent) SetID(id *string) {
	e.ID = id
	e.require(eventStreamWebhookResponseContentFieldID)
}

// SetName sets the Name field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookResponseContent) SetName(name *string) {
	e.Name = name
	e.require(eventStreamWebhookResponseContentFieldName)
}

// SetSubscriptions sets the Subscriptions field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookResponseContent) SetSubscriptions(subscriptions []*EventStreamSubscription) {
	e.Subscriptions = subscriptions
	e.require(eventStreamWebhookResponseContentFieldSubscriptions)
}

// SetDestination sets the Destination field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookResponseContent) SetDestination(destination *EventStreamWebhookDestination) {
	e.Destination = destination
	e.require(eventStreamWebhookResponseContentFieldDestination)
}

// SetStatus sets the Status field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookResponseContent) SetStatus(status *EventStreamStatusEnum) {
	e.Status = status
	e.require(eventStreamWebhookResponseContentFieldStatus)
}

// SetCreatedAt sets the CreatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookResponseContent) SetCreatedAt(createdAt *time.Time) {
	e.CreatedAt = createdAt
	e.require(eventStreamWebhookResponseContentFieldCreatedAt)
}

// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional;
// this prevents an empty or null value for this field from being omitted during serialization.
func (e *EventStreamWebhookResponseContent) SetUpdatedAt(updatedAt *time.Time) {
	e.UpdatedAt = updatedAt
	e.require(eventStreamWebhookResponseContentFieldUpdatedAt)
}

func (e *EventStreamWebhookResponseContent) UnmarshalJSON(data []byte) error {
	type embed EventStreamWebhookResponseContent
	var unmarshaler = struct {
		embed
		CreatedAt *internal.DateTime `json:"created_at,omitempty"`
		UpdatedAt *internal.DateTime `json:"updated_at,omitempty"`
	}{
		embed: embed(*e),
	}
	if err := json.Unmarshal(data, &unmarshaler); err != nil {
		return err
	}
	*e = EventStreamWebhookResponseContent(unmarshaler.embed)
	e.CreatedAt = unmarshaler.CreatedAt.TimePtr()
	e.UpdatedAt = unmarshaler.UpdatedAt.TimePtr()
	extraProperties, err := internal.ExtractExtraProperties(data, *e)
	if err != nil {
		return err
	}
	e.extraProperties = extraProperties
	e.rawJSON = json.RawMessage(data)
	return nil
}

func (e *EventStreamWebhookResponseContent) MarshalJSON() ([]byte, error) {
	type embed EventStreamWebhookResponseContent
	var marshaler = struct {
		embed
		CreatedAt *internal.DateTime `json:"created_at,omitempty"`
		UpdatedAt *internal.DateTime `json:"updated_at,omitempty"`
	}{
		embed:     embed(*e),
		CreatedAt: internal.NewOptionalDateTime(e.CreatedAt),
		UpdatedAt: internal.NewOptionalDateTime(e.UpdatedAt),
	}
	explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields)
	return json.Marshal(explicitMarshaler)
}

func (e *EventStreamWebhookResponseContent) String() string {
	if len(e.rawJSON) > 0 {
		if value, err := internal.StringifyJSON(e.rawJSON); err == nil {
			return value
		}
	}
	if value, err := internal.StringifyJSON(e); err == nil {
		return value
	}
	return fmt.Sprintf("%#v", e)
}

type GetEventStreamResponseContent struct {
	EventStreamWebhookResponseContent     *EventStreamWebhookResponseContent
	EventStreamEventBridgeResponseContent *EventStreamEventBridgeResponseContent
	EventStreamActionResponseContent      *EventStreamActionResponseContent

	typ string
}

func (g *GetEventStreamResponseContent) GetEventStreamWebhookResponseContent() *EventStreamWebhookResponseContent {
	if g == nil {
		return nil
	}
	return g.EventStreamWebhookResponseContent
}

func (g *GetEventStreamResponseContent) GetEventStreamEventBridgeResponseContent() *EventStreamEventBridgeResponseContent {
	if g == nil {
		return nil
	}
	return g.EventStreamEventBridgeResponseContent
}

func (g *GetEventStreamResponseContent) GetEventStreamActionResponseContent() *EventStreamActionResponseContent {
	if g == nil {
		return nil
	}
	return g.EventStreamActionResponseContent
}

func (g *GetEventStreamResponseContent) UnmarshalJSON(data []byte) error {
	valueEventStreamWebhookResponseContent := new(EventStreamWebhookResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamWebhookResponseContent); err == nil {
		g.typ = "EventStreamWebhookResponseContent"
		g.EventStreamWebhookResponseContent = valueEventStreamWebhookResponseContent
		return nil
	}
	valueEventStreamEventBridgeResponseContent := new(EventStreamEventBridgeResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamEventBridgeResponseContent); err == nil {
		g.typ = "EventStreamEventBridgeResponseContent"
		g.EventStreamEventBridgeResponseContent = valueEventStreamEventBridgeResponseContent
		return nil
	}
	valueEventStreamActionResponseContent := new(EventStreamActionResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamActionResponseContent); err == nil {
		g.typ = "EventStreamActionResponseContent"
		g.EventStreamActionResponseContent = valueEventStreamActionResponseContent
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, g)
}

func (g GetEventStreamResponseContent) MarshalJSON() ([]byte, error) {
	if g.typ == "EventStreamWebhookResponseContent" || g.EventStreamWebhookResponseContent != nil {
		return json.Marshal(g.EventStreamWebhookResponseContent)
	}
	if g.typ == "EventStreamEventBridgeResponseContent" || g.EventStreamEventBridgeResponseContent != nil {
		return json.Marshal(g.EventStreamEventBridgeResponseContent)
	}
	if g.typ == "EventStreamActionResponseContent" || g.EventStreamActionResponseContent != nil {
		return json.Marshal(g.EventStreamActionResponseContent)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", g)
}

type GetEventStreamResponseContentVisitor interface {
	VisitEventStreamWebhookResponseContent(*EventStreamWebhookResponseContent) error
	VisitEventStreamEventBridgeResponseContent(*EventStreamEventBridgeResponseContent) error
	VisitEventStreamActionResponseContent(*EventStreamActionResponseContent) error
}

func (g *GetEventStreamResponseContent) Accept(visitor GetEventStreamResponseContentVisitor) error {
	if g.typ == "EventStreamWebhookResponseContent" || g.EventStreamWebhookResponseContent != nil {
		return visitor.VisitEventStreamWebhookResponseContent(g.EventStreamWebhookResponseContent)
	}
	if g.typ == "EventStreamEventBridgeResponseContent" || g.EventStreamEventBridgeResponseContent != nil {
		return visitor.VisitEventStreamEventBridgeResponseContent(g.EventStreamEventBridgeResponseContent)
	}
	if g.typ == "EventStreamActionResponseContent" || g.EventStreamActionResponseContent != nil {
		return visitor.VisitEventStreamActionResponseContent(g.EventStreamActionResponseContent)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", g)
}

// The raw payload of the test event.
type TestEventDataContent = map[string]interface{}

type UpdateEventStreamResponseContent struct {
	EventStreamWebhookResponseContent     *EventStreamWebhookResponseContent
	EventStreamEventBridgeResponseContent *EventStreamEventBridgeResponseContent
	EventStreamActionResponseContent      *EventStreamActionResponseContent

	typ string
}

func (u *UpdateEventStreamResponseContent) GetEventStreamWebhookResponseContent() *EventStreamWebhookResponseContent {
	if u == nil {
		return nil
	}
	return u.EventStreamWebhookResponseContent
}

func (u *UpdateEventStreamResponseContent) GetEventStreamEventBridgeResponseContent() *EventStreamEventBridgeResponseContent {
	if u == nil {
		return nil
	}
	return u.EventStreamEventBridgeResponseContent
}

func (u *UpdateEventStreamResponseContent) GetEventStreamActionResponseContent() *EventStreamActionResponseContent {
	if u == nil {
		return nil
	}
	return u.EventStreamActionResponseContent
}

func (u *UpdateEventStreamResponseContent) UnmarshalJSON(data []byte) error {
	valueEventStreamWebhookResponseContent := new(EventStreamWebhookResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamWebhookResponseContent); err == nil {
		u.typ = "EventStreamWebhookResponseContent"
		u.EventStreamWebhookResponseContent = valueEventStreamWebhookResponseContent
		return nil
	}
	valueEventStreamEventBridgeResponseContent := new(EventStreamEventBridgeResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamEventBridgeResponseContent); err == nil {
		u.typ = "EventStreamEventBridgeResponseContent"
		u.EventStreamEventBridgeResponseContent = valueEventStreamEventBridgeResponseContent
		return nil
	}
	valueEventStreamActionResponseContent := new(EventStreamActionResponseContent)
	if err := json.Unmarshal(data, &valueEventStreamActionResponseContent); err == nil {
		u.typ = "EventStreamActionResponseContent"
		u.EventStreamActionResponseContent = valueEventStreamActionResponseContent
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, u)
}

func (u UpdateEventStreamResponseContent) MarshalJSON() ([]byte, error) {
	if u.typ == "EventStreamWebhookResponseContent" || u.EventStreamWebhookResponseContent != nil {
		return json.Marshal(u.EventStreamWebhookResponseContent)
	}
	if u.typ == "EventStreamEventBridgeResponseContent" || u.EventStreamEventBridgeResponseContent != nil {
		return json.Marshal(u.EventStreamEventBridgeResponseContent)
	}
	if u.typ == "EventStreamActionResponseContent" || u.EventStreamActionResponseContent != nil {
		return json.Marshal(u.EventStreamActionResponseContent)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", u)
}

type UpdateEventStreamResponseContentVisitor interface {
	VisitEventStreamWebhookResponseContent(*EventStreamWebhookResponseContent) error
	VisitEventStreamEventBridgeResponseContent(*EventStreamEventBridgeResponseContent) error
	VisitEventStreamActionResponseContent(*EventStreamActionResponseContent) error
}

func (u *UpdateEventStreamResponseContent) Accept(visitor UpdateEventStreamResponseContentVisitor) error {
	if u.typ == "EventStreamWebhookResponseContent" || u.EventStreamWebhookResponseContent != nil {
		return visitor.VisitEventStreamWebhookResponseContent(u.EventStreamWebhookResponseContent)
	}
	if u.typ == "EventStreamEventBridgeResponseContent" || u.EventStreamEventBridgeResponseContent != nil {
		return visitor.VisitEventStreamEventBridgeResponseContent(u.EventStreamEventBridgeResponseContent)
	}
	if u.typ == "EventStreamActionResponseContent" || u.EventStreamActionResponseContent != nil {
		return visitor.VisitEventStreamActionResponseContent(u.EventStreamActionResponseContent)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", u)
}

type EventStreamsCreateRequest struct {
	CreateEventStreamWebHookRequestContent     *CreateEventStreamWebHookRequestContent
	CreateEventStreamEventBridgeRequestContent *CreateEventStreamEventBridgeRequestContent
	CreateEventStreamActionRequestContent      *CreateEventStreamActionRequestContent

	typ string
}

func (e *EventStreamsCreateRequest) GetCreateEventStreamWebHookRequestContent() *CreateEventStreamWebHookRequestContent {
	if e == nil {
		return nil
	}
	return e.CreateEventStreamWebHookRequestContent
}

func (e *EventStreamsCreateRequest) GetCreateEventStreamEventBridgeRequestContent() *CreateEventStreamEventBridgeRequestContent {
	if e == nil {
		return nil
	}
	return e.CreateEventStreamEventBridgeRequestContent
}

func (e *EventStreamsCreateRequest) GetCreateEventStreamActionRequestContent() *CreateEventStreamActionRequestContent {
	if e == nil {
		return nil
	}
	return e.CreateEventStreamActionRequestContent
}

func (e *EventStreamsCreateRequest) UnmarshalJSON(data []byte) error {
	valueCreateEventStreamWebHookRequestContent := new(CreateEventStreamWebHookRequestContent)
	if err := json.Unmarshal(data, &valueCreateEventStreamWebHookRequestContent); err == nil {
		e.typ = "CreateEventStreamWebHookRequestContent"
		e.CreateEventStreamWebHookRequestContent = valueCreateEventStreamWebHookRequestContent
		return nil
	}
	valueCreateEventStreamEventBridgeRequestContent := new(CreateEventStreamEventBridgeRequestContent)
	if err := json.Unmarshal(data, &valueCreateEventStreamEventBridgeRequestContent); err == nil {
		e.typ = "CreateEventStreamEventBridgeRequestContent"
		e.CreateEventStreamEventBridgeRequestContent = valueCreateEventStreamEventBridgeRequestContent
		return nil
	}
	valueCreateEventStreamActionRequestContent := new(CreateEventStreamActionRequestContent)
	if err := json.Unmarshal(data, &valueCreateEventStreamActionRequestContent); err == nil {
		e.typ = "CreateEventStreamActionRequestContent"
		e.CreateEventStreamActionRequestContent = valueCreateEventStreamActionRequestContent
		return nil
	}
	return fmt.Errorf("%s cannot be deserialized as a %T", data, e)
}

func (e EventStreamsCreateRequest) MarshalJSON() ([]byte, error) {
	if e.typ == "CreateEventStreamWebHookRequestContent" || e.CreateEventStreamWebHookRequestContent != nil {
		return json.Marshal(e.CreateEventStreamWebHookRequestContent)
	}
	if e.typ == "CreateEventStreamEventBridgeRequestContent" || e.CreateEventStreamEventBridgeRequestContent != nil {
		return json.Marshal(e.CreateEventStreamEventBridgeRequestContent)
	}
	if e.typ == "CreateEventStreamActionRequestContent" || e.CreateEventStreamActionRequestContent != nil {
		return json.Marshal(e.CreateEventStreamActionRequestContent)
	}
	return nil, fmt.Errorf("type %T does not include a non-empty union type", e)
}

type EventStreamsCreateRequestVisitor interface {
	VisitCreateEventStreamWebHookRequestContent(*CreateEventStreamWebHookRequestContent) error
	VisitCreateEventStreamEventBridgeRequestContent(*CreateEventStreamEventBridgeRequestContent) error
	VisitCreateEventStreamActionRequestContent(*CreateEventStreamActionRequestContent) error
}

func (e *EventStreamsCreateRequest) Accept(visitor EventStreamsCreateRequestVisitor) error {
	if e.typ == "CreateEventStreamWebHookRequestContent" || e.CreateEventStreamWebHookRequestContent != nil {
		return visitor.VisitCreateEventStreamWebHookRequestContent(e.CreateEventStreamWebHookRequestContent)
	}
	if e.typ == "CreateEventStreamEventBridgeRequestContent" || e.CreateEventStreamEventBridgeRequestContent != nil {
		return visitor.VisitCreateEventStreamEventBridgeRequestContent(e.CreateEventStreamEventBridgeRequestContent)
	}
	if e.typ == "CreateEventStreamActionRequestContent" || e.CreateEventStreamActionRequestContent != nil {
		return visitor.VisitCreateEventStreamActionRequestContent(e.CreateEventStreamActionRequestContent)
	}
	return fmt.Errorf("type %T does not include a non-empty union type", e)
}
