// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package arm

import "encoding/json"

// EventGrid Domain.
type Domain_STATUS struct {
	// Id: Fully qualified identifier of the resource.
	Id *string `json:"id,omitempty"`

	// Location: Location of the resource.
	Location *string `json:"location,omitempty"`

	// Name: Name of the resource.
	Name *string `json:"name,omitempty"`

	// Properties: Properties of the domain.
	Properties *DomainProperties_STATUS `json:"properties,omitempty"`

	// SystemData: The system metadata relating to Domain resource.
	SystemData *SystemData_STATUS `json:"systemData,omitempty"`

	// Tags: Tags of the resource.
	Tags map[string]string `json:"tags,omitempty"`

	// Type: Type of the resource.
	Type *string `json:"type,omitempty"`
}

// Properties of the Domain.
type DomainProperties_STATUS struct {
	// Endpoint: Endpoint for the domain.
	Endpoint *string `json:"endpoint,omitempty"`

	// InboundIpRules: This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered
	// only if PublicNetworkAccess is enabled.
	InboundIpRules []InboundIpRule_STATUS `json:"inboundIpRules,omitempty"`

	// InputSchema: This determines the format that Event Grid should expect for incoming events published to the domain.
	InputSchema *DomainProperties_InputSchema_STATUS `json:"inputSchema,omitempty"`

	// InputSchemaMapping: Information about the InputSchemaMapping which specified the info about mapping event payload.
	InputSchemaMapping *InputSchemaMapping_STATUS `json:"inputSchemaMapping,omitempty"`

	// MetricResourceId: Metric resource id for the domain.
	MetricResourceId *string `json:"metricResourceId,omitempty"`

	// PrivateEndpointConnections: List of private endpoint connections.
	PrivateEndpointConnections []PrivateEndpointConnection_STATUS_Domain_SubResourceEmbedded `json:"privateEndpointConnections,omitempty"`

	// ProvisioningState: Provisioning state of the domain.
	ProvisioningState *DomainProperties_ProvisioningState_STATUS `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: This determines if traffic is allowed over public network. By default it is enabled.
	// You can further restrict to specific IPs by configuring <seealso
	// cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainProperties.InboundIpRules" />
	PublicNetworkAccess *DomainProperties_PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`
}

// Metadata pertaining to creation and last modification of the resource.
type SystemData_STATUS struct {
	// CreatedAt: The timestamp of resource creation (UTC).
	CreatedAt *string `json:"createdAt,omitempty"`

	// CreatedBy: The identity that created the resource.
	CreatedBy *string `json:"createdBy,omitempty"`

	// CreatedByType: The type of identity that created the resource.
	CreatedByType *SystemData_CreatedByType_STATUS `json:"createdByType,omitempty"`

	// LastModifiedAt: The timestamp of resource last modification (UTC)
	LastModifiedAt *string `json:"lastModifiedAt,omitempty"`

	// LastModifiedBy: The identity that last modified the resource.
	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`

	// LastModifiedByType: The type of identity that last modified the resource.
	LastModifiedByType *SystemData_LastModifiedByType_STATUS `json:"lastModifiedByType,omitempty"`
}

type DomainProperties_InputSchema_STATUS string

const (
	DomainProperties_InputSchema_STATUS_CloudEventSchemaV1_0 = DomainProperties_InputSchema_STATUS("CloudEventSchemaV1_0")
	DomainProperties_InputSchema_STATUS_CustomEventSchema    = DomainProperties_InputSchema_STATUS("CustomEventSchema")
	DomainProperties_InputSchema_STATUS_EventGridSchema      = DomainProperties_InputSchema_STATUS("EventGridSchema")
)

// Mapping from string to DomainProperties_InputSchema_STATUS
var domainProperties_InputSchema_STATUS_Values = map[string]DomainProperties_InputSchema_STATUS{
	"cloudeventschemav1_0": DomainProperties_InputSchema_STATUS_CloudEventSchemaV1_0,
	"customeventschema":    DomainProperties_InputSchema_STATUS_CustomEventSchema,
	"eventgridschema":      DomainProperties_InputSchema_STATUS_EventGridSchema,
}

type DomainProperties_ProvisioningState_STATUS string

const (
	DomainProperties_ProvisioningState_STATUS_Canceled  = DomainProperties_ProvisioningState_STATUS("Canceled")
	DomainProperties_ProvisioningState_STATUS_Creating  = DomainProperties_ProvisioningState_STATUS("Creating")
	DomainProperties_ProvisioningState_STATUS_Deleting  = DomainProperties_ProvisioningState_STATUS("Deleting")
	DomainProperties_ProvisioningState_STATUS_Failed    = DomainProperties_ProvisioningState_STATUS("Failed")
	DomainProperties_ProvisioningState_STATUS_Succeeded = DomainProperties_ProvisioningState_STATUS("Succeeded")
	DomainProperties_ProvisioningState_STATUS_Updating  = DomainProperties_ProvisioningState_STATUS("Updating")
)

// Mapping from string to DomainProperties_ProvisioningState_STATUS
var domainProperties_ProvisioningState_STATUS_Values = map[string]DomainProperties_ProvisioningState_STATUS{
	"canceled":  DomainProperties_ProvisioningState_STATUS_Canceled,
	"creating":  DomainProperties_ProvisioningState_STATUS_Creating,
	"deleting":  DomainProperties_ProvisioningState_STATUS_Deleting,
	"failed":    DomainProperties_ProvisioningState_STATUS_Failed,
	"succeeded": DomainProperties_ProvisioningState_STATUS_Succeeded,
	"updating":  DomainProperties_ProvisioningState_STATUS_Updating,
}

type DomainProperties_PublicNetworkAccess_STATUS string

const (
	DomainProperties_PublicNetworkAccess_STATUS_Disabled = DomainProperties_PublicNetworkAccess_STATUS("Disabled")
	DomainProperties_PublicNetworkAccess_STATUS_Enabled  = DomainProperties_PublicNetworkAccess_STATUS("Enabled")
)

// Mapping from string to DomainProperties_PublicNetworkAccess_STATUS
var domainProperties_PublicNetworkAccess_STATUS_Values = map[string]DomainProperties_PublicNetworkAccess_STATUS{
	"disabled": DomainProperties_PublicNetworkAccess_STATUS_Disabled,
	"enabled":  DomainProperties_PublicNetworkAccess_STATUS_Enabled,
}

type InboundIpRule_STATUS struct {
	// Action: Action to perform based on the match or no match of the IpMask.
	Action *InboundIpRule_Action_STATUS `json:"action,omitempty"`

	// IpMask: IP Address in CIDR notation e.g., 10.0.0.0/8.
	IpMask *string `json:"ipMask,omitempty"`
}

type InputSchemaMapping_STATUS struct {
	// Json: Mutually exclusive with all other properties
	Json *JsonInputSchemaMapping_STATUS `json:"json,omitempty"`
}

// MarshalJSON defers JSON marshaling to the first non-nil property, because InputSchemaMapping_STATUS represents a discriminated union (JSON OneOf)
func (mapping InputSchemaMapping_STATUS) MarshalJSON() ([]byte, error) {
	if mapping.Json != nil {
		return json.Marshal(mapping.Json)
	}

	return nil, nil
}

// UnmarshalJSON unmarshals the InputSchemaMapping_STATUS
func (mapping *InputSchemaMapping_STATUS) UnmarshalJSON(data []byte) error {
	var rawJson map[string]interface{}
	err := json.Unmarshal(data, &rawJson)
	if err != nil {
		return err
	}
	discriminator := rawJson["inputSchemaMappingType"]
	if discriminator == "Json" {
		mapping.Json = &JsonInputSchemaMapping_STATUS{}
		return json.Unmarshal(data, mapping.Json)
	}

	// No error
	return nil
}

type PrivateEndpointConnection_STATUS_Domain_SubResourceEmbedded struct {
	// Id: Fully qualified identifier of the resource.
	Id *string `json:"id,omitempty"`
}

type SystemData_CreatedByType_STATUS string

const (
	SystemData_CreatedByType_STATUS_Application     = SystemData_CreatedByType_STATUS("Application")
	SystemData_CreatedByType_STATUS_Key             = SystemData_CreatedByType_STATUS("Key")
	SystemData_CreatedByType_STATUS_ManagedIdentity = SystemData_CreatedByType_STATUS("ManagedIdentity")
	SystemData_CreatedByType_STATUS_User            = SystemData_CreatedByType_STATUS("User")
)

// Mapping from string to SystemData_CreatedByType_STATUS
var systemData_CreatedByType_STATUS_Values = map[string]SystemData_CreatedByType_STATUS{
	"application":     SystemData_CreatedByType_STATUS_Application,
	"key":             SystemData_CreatedByType_STATUS_Key,
	"managedidentity": SystemData_CreatedByType_STATUS_ManagedIdentity,
	"user":            SystemData_CreatedByType_STATUS_User,
}

type SystemData_LastModifiedByType_STATUS string

const (
	SystemData_LastModifiedByType_STATUS_Application     = SystemData_LastModifiedByType_STATUS("Application")
	SystemData_LastModifiedByType_STATUS_Key             = SystemData_LastModifiedByType_STATUS("Key")
	SystemData_LastModifiedByType_STATUS_ManagedIdentity = SystemData_LastModifiedByType_STATUS("ManagedIdentity")
	SystemData_LastModifiedByType_STATUS_User            = SystemData_LastModifiedByType_STATUS("User")
)

// Mapping from string to SystemData_LastModifiedByType_STATUS
var systemData_LastModifiedByType_STATUS_Values = map[string]SystemData_LastModifiedByType_STATUS{
	"application":     SystemData_LastModifiedByType_STATUS_Application,
	"key":             SystemData_LastModifiedByType_STATUS_Key,
	"managedidentity": SystemData_LastModifiedByType_STATUS_ManagedIdentity,
	"user":            SystemData_LastModifiedByType_STATUS_User,
}

type InboundIpRule_Action_STATUS string

const InboundIpRule_Action_STATUS_Allow = InboundIpRule_Action_STATUS("Allow")

// Mapping from string to InboundIpRule_Action_STATUS
var inboundIpRule_Action_STATUS_Values = map[string]InboundIpRule_Action_STATUS{
	"allow": InboundIpRule_Action_STATUS_Allow,
}

type JsonInputSchemaMapping_STATUS struct {
	// InputSchemaMappingType: Type of the custom mapping
	InputSchemaMappingType JsonInputSchemaMapping_InputSchemaMappingType_STATUS `json:"inputSchemaMappingType,omitempty"`

	// Properties: JSON Properties of the input schema mapping
	Properties *JsonInputSchemaMappingProperties_STATUS `json:"properties,omitempty"`
}

type JsonInputSchemaMapping_InputSchemaMappingType_STATUS string

const JsonInputSchemaMapping_InputSchemaMappingType_STATUS_Json = JsonInputSchemaMapping_InputSchemaMappingType_STATUS("Json")

// Mapping from string to JsonInputSchemaMapping_InputSchemaMappingType_STATUS
var jsonInputSchemaMapping_InputSchemaMappingType_STATUS_Values = map[string]JsonInputSchemaMapping_InputSchemaMappingType_STATUS{
	"json": JsonInputSchemaMapping_InputSchemaMappingType_STATUS_Json,
}

// This can be used to map properties of a source schema (or default values, for certain supported properties) to
// properties of the EventGridEvent schema.
type JsonInputSchemaMappingProperties_STATUS struct {
	// DataVersion: The mapping information for the DataVersion property of the Event Grid Event.
	DataVersion *JsonFieldWithDefault_STATUS `json:"dataVersion,omitempty"`

	// EventTime: The mapping information for the EventTime property of the Event Grid Event.
	EventTime *JsonField_STATUS `json:"eventTime,omitempty"`

	// EventType: The mapping information for the EventType property of the Event Grid Event.
	EventType *JsonFieldWithDefault_STATUS `json:"eventType,omitempty"`

	// Id: The mapping information for the Id property of the Event Grid Event.
	Id *JsonField_STATUS `json:"id,omitempty"`

	// Subject: The mapping information for the Subject property of the Event Grid Event.
	Subject *JsonFieldWithDefault_STATUS `json:"subject,omitempty"`

	// Topic: The mapping information for the Topic property of the Event Grid Event.
	Topic *JsonField_STATUS `json:"topic,omitempty"`
}

// This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema.
// This is currently used in the mappings for the 'id', 'topic' and 'eventtime' properties. This represents a field in the
// input event schema.
type JsonField_STATUS struct {
	// SourceField: Name of a field in the input event schema that's to be used as the source of a mapping.
	SourceField *string `json:"sourceField,omitempty"`
}

// This is used to express the source of an input schema mapping for a single target field
// in the Event Grid Event schema.
// This is currently used in the mappings for the 'subject',
// 'eventtype' and 'dataversion' properties. This represents a
// field in the input event schema
// along with a default value to be used, and at least one of these two properties should
// be provided.
type JsonFieldWithDefault_STATUS struct {
	// DefaultValue: The default value to be used for mapping when a SourceField is not provided or if there's no property with
	// the specified name in the published JSON event payload.
	DefaultValue *string `json:"defaultValue,omitempty"`

	// SourceField: Name of a field in the input event schema that's to be used as the source of a mapping.
	SourceField *string `json:"sourceField,omitempty"`
}
