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

import "github.com/Azure/azure-service-operator/v2/pkg/genruntime"

type Topic_Spec struct {
	// Location: Location of the resource.
	Location *string `json:"location,omitempty"`
	Name     string  `json:"name,omitempty"`

	// Properties: Properties of the topic.
	Properties *TopicProperties `json:"properties,omitempty"`

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

var _ genruntime.ARMResourceSpec = &Topic_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2020-06-01"
func (topic Topic_Spec) GetAPIVersion() string {
	return "2020-06-01"
}

// GetName returns the Name of the resource
func (topic *Topic_Spec) GetName() string {
	return topic.Name
}

// GetType returns the ARM Type of the resource. This is always "Microsoft.EventGrid/topics"
func (topic *Topic_Spec) GetType() string {
	return "Microsoft.EventGrid/topics"
}

// Properties of the Topic
type TopicProperties struct {
	// 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 `json:"inboundIpRules,omitempty"`

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

	// InputSchemaMapping: This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map
	// various properties of a source schema to various required properties of the EventGridEvent schema.
	InputSchemaMapping *InputSchemaMapping `json:"inputSchemaMapping,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.TopicProperties.InboundIpRules" />
	PublicNetworkAccess *TopicProperties_PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
}

// +kubebuilder:validation:Enum={"CloudEventSchemaV1_0","CustomEventSchema","EventGridSchema"}
type TopicProperties_InputSchema string

const (
	TopicProperties_InputSchema_CloudEventSchemaV1_0 = TopicProperties_InputSchema("CloudEventSchemaV1_0")
	TopicProperties_InputSchema_CustomEventSchema    = TopicProperties_InputSchema("CustomEventSchema")
	TopicProperties_InputSchema_EventGridSchema      = TopicProperties_InputSchema("EventGridSchema")
)

// Mapping from string to TopicProperties_InputSchema
var topicProperties_InputSchema_Values = map[string]TopicProperties_InputSchema{
	"cloudeventschemav1_0": TopicProperties_InputSchema_CloudEventSchemaV1_0,
	"customeventschema":    TopicProperties_InputSchema_CustomEventSchema,
	"eventgridschema":      TopicProperties_InputSchema_EventGridSchema,
}

// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type TopicProperties_PublicNetworkAccess string

const (
	TopicProperties_PublicNetworkAccess_Disabled = TopicProperties_PublicNetworkAccess("Disabled")
	TopicProperties_PublicNetworkAccess_Enabled  = TopicProperties_PublicNetworkAccess("Enabled")
)

// Mapping from string to TopicProperties_PublicNetworkAccess
var topicProperties_PublicNetworkAccess_Values = map[string]TopicProperties_PublicNetworkAccess{
	"disabled": TopicProperties_PublicNetworkAccess_Disabled,
	"enabled":  TopicProperties_PublicNetworkAccess_Enabled,
}
