// 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 SignalR_Spec struct {
	// Identity: A class represent managed identities used for request and response
	Identity *ManagedIdentity `json:"identity,omitempty"`

	// Kind: The kind of the service, it can be SignalR or RawWebSockets
	Kind *ServiceKind `json:"kind,omitempty"`

	// Location: The GEO location of the resource. e.g. West US | East US | North Central US | South Central US.
	Location *string `json:"location,omitempty"`
	Name     string  `json:"name,omitempty"`

	// Properties: A class that describes the properties of the resource
	Properties *SignalRProperties `json:"properties,omitempty"`

	// Sku: The billing information of the resource.
	Sku *ResourceSku `json:"sku,omitempty"`

	// Tags: Tags of the service which is a list of key value pairs that describe the resource.
	Tags map[string]string `json:"tags,omitempty"`
}

var _ genruntime.ARMResourceSpec = &SignalR_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2021-10-01"
func (signalR SignalR_Spec) GetAPIVersion() string {
	return "2021-10-01"
}

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.SignalRService/signalR"
func (signalR *SignalR_Spec) GetType() string {
	return "Microsoft.SignalRService/signalR"
}

// A class represent managed identities used for request and response
type ManagedIdentity struct {
	// Type: Represents the identity type: systemAssigned, userAssigned, None
	Type                   *ManagedIdentityType                   `json:"type,omitempty"`
	UserAssignedIdentities map[string]UserAssignedIdentityDetails `json:"userAssignedIdentities,omitempty"`
}

// The billing information of the resource.
type ResourceSku struct {
	// Capacity: Optional, integer. The unit count of the resource. 1 by default.
	// If present, following values are allowed:
	// Free: 1
	// Standard: 1,2,5,10,20,50,100
	Capacity *int `json:"capacity,omitempty"`

	// Name: The name of the SKU. Required.
	// Allowed values: Standard_S1, Free_F1
	Name *string `json:"name,omitempty"`

	// Tier: Optional tier of this particular SKU. 'Standard' or 'Free'.
	// `Basic` is deprecated, use `Standard` instead.
	Tier *SignalRSkuTier `json:"tier,omitempty"`
}

// The kind of the service, it can be SignalR or RawWebSockets
// +kubebuilder:validation:Enum={"RawWebSockets","SignalR"}
type ServiceKind string

const (
	ServiceKind_RawWebSockets = ServiceKind("RawWebSockets")
	ServiceKind_SignalR       = ServiceKind("SignalR")
)

// Mapping from string to ServiceKind
var serviceKind_Values = map[string]ServiceKind{
	"rawwebsockets": ServiceKind_RawWebSockets,
	"signalr":       ServiceKind_SignalR,
}

// A class that describes the properties of the resource
type SignalRProperties struct {
	// Cors: Cross-Origin Resource Sharing (CORS) settings.
	Cors *SignalRCorsSettings `json:"cors,omitempty"`

	// DisableAadAuth: DisableLocalAuth
	// Enable or disable aad auth
	// When set as true, connection with AuthType=aad won't work.
	DisableAadAuth *bool `json:"disableAadAuth,omitempty"`

	// DisableLocalAuth: DisableLocalAuth
	// Enable or disable local auth with AccessKey
	// When set as true, connection with AccessKey=xxx won't work.
	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`

	// Features: List of the featureFlags.
	// FeatureFlags that are not included in the parameters for the update operation will not be modified.
	// And the response will only include featureFlags that are explicitly set.
	// When a featureFlag is not explicitly set, its globally default value will be used
	// But keep in mind, the default value doesn't mean "false". It varies in terms of different FeatureFlags.
	Features []SignalRFeature `json:"features,omitempty"`

	// NetworkACLs: Network ACLs for the resource
	NetworkACLs *SignalRNetworkACLs `json:"networkACLs,omitempty"`

	// PublicNetworkAccess: Enable or disable public network access. Default to "Enabled".
	// When it's Enabled, network ACLs still apply.
	// When it's Disabled, public network access is always disabled no matter what you set in network ACLs.
	PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"`

	// ResourceLogConfiguration: Resource log configuration of a Microsoft.SignalRService resource.
	ResourceLogConfiguration *ResourceLogConfiguration `json:"resourceLogConfiguration,omitempty"`

	// Tls: TLS settings for the resource
	Tls *SignalRTlsSettings `json:"tls,omitempty"`

	// Upstream: The settings for the Upstream when the service is in server-less mode.
	Upstream *ServerlessUpstreamSettings `json:"upstream,omitempty"`
}

// Represents the identity type: systemAssigned, userAssigned, None
// +kubebuilder:validation:Enum={"None","SystemAssigned","UserAssigned"}
type ManagedIdentityType string

const (
	ManagedIdentityType_None           = ManagedIdentityType("None")
	ManagedIdentityType_SystemAssigned = ManagedIdentityType("SystemAssigned")
	ManagedIdentityType_UserAssigned   = ManagedIdentityType("UserAssigned")
)

// Mapping from string to ManagedIdentityType
var managedIdentityType_Values = map[string]ManagedIdentityType{
	"none":           ManagedIdentityType_None,
	"systemassigned": ManagedIdentityType_SystemAssigned,
	"userassigned":   ManagedIdentityType_UserAssigned,
}

// Resource log configuration of a Microsoft.SignalRService resource.
type ResourceLogConfiguration struct {
	// Categories: Gets or sets the list of category configurations.
	Categories []ResourceLogCategory `json:"categories,omitempty"`
}

// The settings for the Upstream when the service is in server-less mode.
type ServerlessUpstreamSettings struct {
	// Templates: Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects.
	Templates []UpstreamTemplate `json:"templates,omitempty"`
}

// Cross-Origin Resource Sharing (CORS) settings.
type SignalRCorsSettings struct {
	// AllowedOrigins: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example:
	// http://example.com:12345). Use "*" to allow all. If omitted, allow all by default.
	AllowedOrigins []string `json:"allowedOrigins,omitempty"`
}

// Feature of a resource, which controls the runtime behavior.
type SignalRFeature struct {
	// Flag: FeatureFlags is the supported features of Azure SignalR service.
	// - ServiceMode: Flag for backend server for SignalR  service. Values allowed: "Default": have your own backend server;
	// "Serverless": your application doesn't have a backend  server; "Classic": for backward compatibility. Support both
	// Default and Serverless mode but not recommended;  "PredefinedOnly": for future use.
	// - EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log  category respectively.
	// - EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category  respectively.
	// - EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will  give you live
	// traces in real time, it will be helpful when you developing your own Azure SignalR based web application  or
	// self-troubleshooting some issues. Please note that live traces are counted as outbound messages that will be charged.
	// Values allowed: "true"/"false", to enable/disable live trace feature.
	Flag *FeatureFlags `json:"flag,omitempty"`

	// Properties: Optional properties related to this feature.
	Properties map[string]string `json:"properties,omitempty"`

	// Value: Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/azure/azure-signalr/ for
	// allowed values.
	Value *string `json:"value,omitempty"`
}

// Network ACLs for the resource
type SignalRNetworkACLs struct {
	// DefaultAction: Azure Networking ACL Action.
	DefaultAction *ACLAction `json:"defaultAction,omitempty"`

	// PrivateEndpoints: ACLs for requests from private endpoints
	PrivateEndpoints []PrivateEndpointACL `json:"privateEndpoints,omitempty"`

	// PublicNetwork: Network ACL
	PublicNetwork *NetworkACL `json:"publicNetwork,omitempty"`
}

// Optional tier of this particular SKU. 'Standard' or 'Free'.
// `Basic` is deprecated, use `Standard` instead.
// +kubebuilder:validation:Enum={"Basic","Free","Premium","Standard"}
type SignalRSkuTier string

const (
	SignalRSkuTier_Basic    = SignalRSkuTier("Basic")
	SignalRSkuTier_Free     = SignalRSkuTier("Free")
	SignalRSkuTier_Premium  = SignalRSkuTier("Premium")
	SignalRSkuTier_Standard = SignalRSkuTier("Standard")
)

// Mapping from string to SignalRSkuTier
var signalRSkuTier_Values = map[string]SignalRSkuTier{
	"basic":    SignalRSkuTier_Basic,
	"free":     SignalRSkuTier_Free,
	"premium":  SignalRSkuTier_Premium,
	"standard": SignalRSkuTier_Standard,
}

// TLS settings for the resource
type SignalRTlsSettings struct {
	// ClientCertEnabled: Request client certificate during TLS handshake if enabled
	ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"`
}

// Information about the user assigned identity for the resource
type UserAssignedIdentityDetails struct {
}

// Azure Networking ACL Action.
// +kubebuilder:validation:Enum={"Allow","Deny"}
type ACLAction string

const (
	ACLAction_Allow = ACLAction("Allow")
	ACLAction_Deny  = ACLAction("Deny")
)

// Mapping from string to ACLAction
var aCLAction_Values = map[string]ACLAction{
	"allow": ACLAction_Allow,
	"deny":  ACLAction_Deny,
}

// FeatureFlags is the supported features of Azure SignalR service.
// - ServiceMode: Flag for backend server for SignalR
// service. Values allowed: "Default": have your own backend server; "Serverless": your application doesn't have a backend
// server; "Classic": for backward compatibility. Support both Default and Serverless mode but not recommended;
// "PredefinedOnly": for future use.
// - EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log
// category respectively.
// - EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category
// respectively.
// - EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will
// give you live traces in real time, it will be helpful when you developing your own Azure SignalR based web application
// or self-troubleshooting some issues. Please note that live traces are counted as outbound messages that will be charged.
// Values allowed: "true"/"false", to enable/disable live trace feature.
// +kubebuilder:validation:Enum={"EnableConnectivityLogs","EnableLiveTrace","EnableMessagingLogs","ServiceMode"}
type FeatureFlags string

const (
	FeatureFlags_EnableConnectivityLogs = FeatureFlags("EnableConnectivityLogs")
	FeatureFlags_EnableLiveTrace        = FeatureFlags("EnableLiveTrace")
	FeatureFlags_EnableMessagingLogs    = FeatureFlags("EnableMessagingLogs")
	FeatureFlags_ServiceMode            = FeatureFlags("ServiceMode")
)

// Mapping from string to FeatureFlags
var featureFlags_Values = map[string]FeatureFlags{
	"enableconnectivitylogs": FeatureFlags_EnableConnectivityLogs,
	"enablelivetrace":        FeatureFlags_EnableLiveTrace,
	"enablemessaginglogs":    FeatureFlags_EnableMessagingLogs,
	"servicemode":            FeatureFlags_ServiceMode,
}

// Network ACL
type NetworkACL struct {
	// Allow: Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI.
	Allow []SignalRRequestType `json:"allow,omitempty"`

	// Deny: Denied request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI.
	Deny []SignalRRequestType `json:"deny,omitempty"`
}

// ACL for a private endpoint
type PrivateEndpointACL struct {
	// Allow: Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI.
	Allow []SignalRRequestType `json:"allow,omitempty"`

	// Deny: Denied request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI.
	Deny []SignalRRequestType `json:"deny,omitempty"`

	// Name: Name of the private endpoint connection
	Name *string `json:"name,omitempty"`
}

// Resource log category configuration of a Microsoft.SignalRService resource.
type ResourceLogCategory struct {
	// Enabled: Indicates whether or the resource log category is enabled.
	// Available values: true, false.
	// Case insensitive.
	Enabled *string `json:"enabled,omitempty"`

	// Name: Gets or sets the resource log category's name.
	// Available values: ConnectivityLogs, MessagingLogs.
	// Case insensitive.
	Name *string `json:"name,omitempty"`
}

// Upstream template item settings. It defines the Upstream URL of the incoming requests.
// The template defines the pattern
// of the event, the hub or the category of the incoming request that matches current URL template.
type UpstreamTemplate struct {
	// Auth: Upstream auth settings. If not set, no auth is used for upstream messages.
	Auth *UpstreamAuthSettings `json:"auth,omitempty"`

	// CategoryPattern: Gets or sets the matching pattern for category names. If not set, it matches any category.
	// There are 3 kind of patterns supported:
	// 1. "*", it to matches any category name
	// 2. Combine multiple categories with ",", for example "connections,messages", it matches category "connections" and
	// "messages"
	// 3. The single category name, for example, "connections", it matches the category "connections"
	CategoryPattern *string `json:"categoryPattern,omitempty"`

	// EventPattern: Gets or sets the matching pattern for event names. If not set, it matches any event.
	// There are 3 kind of patterns supported:
	// 1. "*", it to matches any event name
	// 2. Combine multiple events with ",", for example "connect,disconnect", it matches event "connect" and "disconnect"
	// 3. The single event name, for example, "connect", it matches "connect"
	EventPattern *string `json:"eventPattern,omitempty"`

	// HubPattern: Gets or sets the matching pattern for hub names. If not set, it matches any hub.
	// There are 3 kind of patterns supported:
	// 1. "*", it to matches any hub name
	// 2. Combine multiple hubs with ",", for example "hub1,hub2", it matches "hub1" and "hub2"
	// 3. The single hub name, for example, "hub1", it matches "hub1"
	HubPattern *string `json:"hubPattern,omitempty"`

	// UrlTemplate: Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} {event}
	// inside the template, the value of the Upstream URL is dynamically calculated when the client request comes in.
	// For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client request from hub `chat`
	// connects, it will first POST to this URL: `http://example.com/chat/api/connect`.
	UrlTemplate *string `json:"urlTemplate,omitempty"`
}

// The incoming request type to the service
// +kubebuilder:validation:Enum={"ClientConnection","RESTAPI","ServerConnection","Trace"}
type SignalRRequestType string

const (
	SignalRRequestType_ClientConnection = SignalRRequestType("ClientConnection")
	SignalRRequestType_RESTAPI          = SignalRRequestType("RESTAPI")
	SignalRRequestType_ServerConnection = SignalRRequestType("ServerConnection")
	SignalRRequestType_Trace            = SignalRRequestType("Trace")
)

// Mapping from string to SignalRRequestType
var signalRRequestType_Values = map[string]SignalRRequestType{
	"clientconnection": SignalRRequestType_ClientConnection,
	"restapi":          SignalRRequestType_RESTAPI,
	"serverconnection": SignalRRequestType_ServerConnection,
	"trace":            SignalRRequestType_Trace,
}

// Upstream auth settings. If not set, no auth is used for upstream messages.
type UpstreamAuthSettings struct {
	// ManagedIdentity: Managed identity settings for upstream.
	ManagedIdentity *ManagedIdentitySettings `json:"managedIdentity,omitempty"`

	// Type: Upstream auth type enum.
	Type *UpstreamAuthType `json:"type,omitempty"`
}

// Managed identity settings for upstream.
type ManagedIdentitySettings struct {
	// Resource: The Resource indicating the App ID URI of the target resource.
	// It also appears in the aud (audience) claim of the issued token.
	Resource *string `json:"resource,omitempty"`
}

// Upstream auth type enum.
// +kubebuilder:validation:Enum={"ManagedIdentity","None"}
type UpstreamAuthType string

const (
	UpstreamAuthType_ManagedIdentity = UpstreamAuthType("ManagedIdentity")
	UpstreamAuthType_None            = UpstreamAuthType("None")
)

// Mapping from string to UpstreamAuthType
var upstreamAuthType_Values = map[string]UpstreamAuthType{
	"managedidentity": UpstreamAuthType_ManagedIdentity,
	"none":            UpstreamAuthType_None,
}
