// 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 Route_Spec struct {
	Name string `json:"name,omitempty"`

	// Properties: The JSON object that contains the properties of the Routes to create.
	Properties *RouteProperties `json:"properties,omitempty"`
}

var _ genruntime.ARMResourceSpec = &Route_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2023-05-01"
func (route Route_Spec) GetAPIVersion() string {
	return "2023-05-01"
}

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.Cdn/profiles/afdEndpoints/routes"
func (route *Route_Spec) GetType() string {
	return "Microsoft.Cdn/profiles/afdEndpoints/routes"
}

// The JSON object that contains the properties of the Routes to create.
type RouteProperties struct {
	// CacheConfiguration: The caching configuration for this route. To disable caching, do not provide a cacheConfiguration
	// object.
	CacheConfiguration *AfdRouteCacheConfiguration `json:"cacheConfiguration,omitempty"`

	// CustomDomains: Domains referenced by this endpoint.
	CustomDomains []ActivatedResourceReference `json:"customDomains,omitempty"`

	// EnabledState: Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'
	EnabledState *RouteProperties_EnabledState `json:"enabledState,omitempty"`

	// ForwardingProtocol: Protocol this rule will use when forwarding traffic to backends.
	ForwardingProtocol *RouteProperties_ForwardingProtocol `json:"forwardingProtocol,omitempty"`

	// HttpsRedirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way to set up
	// this rule and it will be the first rule that gets executed.
	HttpsRedirect *RouteProperties_HttpsRedirect `json:"httpsRedirect,omitempty"`

	// LinkToDefaultDomain: whether this route will be linked to the default endpoint domain.
	LinkToDefaultDomain *RouteProperties_LinkToDefaultDomain `json:"linkToDefaultDomain,omitempty"`

	// OriginGroup: A reference to the origin group.
	OriginGroup *ResourceReference `json:"originGroup,omitempty"`

	// OriginPath: A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g.
	// contoso.cloudapp.net/originpath.
	OriginPath *string `json:"originPath,omitempty"`

	// PatternsToMatch: The route patterns of the rule.
	PatternsToMatch []string `json:"patternsToMatch,omitempty"`

	// RuleSets: rule sets referenced by this endpoint.
	RuleSets []ResourceReference `json:"ruleSets,omitempty"`

	// SupportedProtocols: List of supported protocols for this route.
	SupportedProtocols []AFDEndpointProtocols `json:"supportedProtocols,omitempty"`
}

// Reference to another resource along with its state.
type ActivatedResourceReference struct {
	// Id: Resource ID.
	Id *string `json:"id,omitempty"`
}

// Supported protocols for the customer's endpoint.
// +kubebuilder:validation:Enum={"Http","Https"}
type AFDEndpointProtocols string

const (
	AFDEndpointProtocols_Http  = AFDEndpointProtocols("Http")
	AFDEndpointProtocols_Https = AFDEndpointProtocols("Https")
)

// Mapping from string to AFDEndpointProtocols
var aFDEndpointProtocols_Values = map[string]AFDEndpointProtocols{
	"http":  AFDEndpointProtocols_Http,
	"https": AFDEndpointProtocols_Https,
}

// Caching settings for a caching-type route. To disable caching, do not provide a cacheConfiguration object.
type AfdRouteCacheConfiguration struct {
	// CompressionSettings: compression settings.
	CompressionSettings *CompressionSettings `json:"compressionSettings,omitempty"`

	// QueryParameters: query parameters to include or exclude (comma separated).
	QueryParameters *string `json:"queryParameters,omitempty"`

	// QueryStringCachingBehavior: Defines how Frontdoor caches requests that include query strings. You can ignore any query
	// strings when caching, ignore specific query strings, cache every request with a unique URL, or cache specific query
	// strings.
	QueryStringCachingBehavior *AfdRouteCacheConfiguration_QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"`
}

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

const (
	RouteProperties_EnabledState_Disabled = RouteProperties_EnabledState("Disabled")
	RouteProperties_EnabledState_Enabled  = RouteProperties_EnabledState("Enabled")
)

// Mapping from string to RouteProperties_EnabledState
var routeProperties_EnabledState_Values = map[string]RouteProperties_EnabledState{
	"disabled": RouteProperties_EnabledState_Disabled,
	"enabled":  RouteProperties_EnabledState_Enabled,
}

// +kubebuilder:validation:Enum={"HttpOnly","HttpsOnly","MatchRequest"}
type RouteProperties_ForwardingProtocol string

const (
	RouteProperties_ForwardingProtocol_HttpOnly     = RouteProperties_ForwardingProtocol("HttpOnly")
	RouteProperties_ForwardingProtocol_HttpsOnly    = RouteProperties_ForwardingProtocol("HttpsOnly")
	RouteProperties_ForwardingProtocol_MatchRequest = RouteProperties_ForwardingProtocol("MatchRequest")
)

// Mapping from string to RouteProperties_ForwardingProtocol
var routeProperties_ForwardingProtocol_Values = map[string]RouteProperties_ForwardingProtocol{
	"httponly":     RouteProperties_ForwardingProtocol_HttpOnly,
	"httpsonly":    RouteProperties_ForwardingProtocol_HttpsOnly,
	"matchrequest": RouteProperties_ForwardingProtocol_MatchRequest,
}

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

const (
	RouteProperties_HttpsRedirect_Disabled = RouteProperties_HttpsRedirect("Disabled")
	RouteProperties_HttpsRedirect_Enabled  = RouteProperties_HttpsRedirect("Enabled")
)

// Mapping from string to RouteProperties_HttpsRedirect
var routeProperties_HttpsRedirect_Values = map[string]RouteProperties_HttpsRedirect{
	"disabled": RouteProperties_HttpsRedirect_Disabled,
	"enabled":  RouteProperties_HttpsRedirect_Enabled,
}

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

const (
	RouteProperties_LinkToDefaultDomain_Disabled = RouteProperties_LinkToDefaultDomain("Disabled")
	RouteProperties_LinkToDefaultDomain_Enabled  = RouteProperties_LinkToDefaultDomain("Enabled")
)

// Mapping from string to RouteProperties_LinkToDefaultDomain
var routeProperties_LinkToDefaultDomain_Values = map[string]RouteProperties_LinkToDefaultDomain{
	"disabled": RouteProperties_LinkToDefaultDomain_Disabled,
	"enabled":  RouteProperties_LinkToDefaultDomain_Enabled,
}

// +kubebuilder:validation:Enum={"IgnoreQueryString","IgnoreSpecifiedQueryStrings","IncludeSpecifiedQueryStrings","UseQueryString"}
type AfdRouteCacheConfiguration_QueryStringCachingBehavior string

const (
	AfdRouteCacheConfiguration_QueryStringCachingBehavior_IgnoreQueryString            = AfdRouteCacheConfiguration_QueryStringCachingBehavior("IgnoreQueryString")
	AfdRouteCacheConfiguration_QueryStringCachingBehavior_IgnoreSpecifiedQueryStrings  = AfdRouteCacheConfiguration_QueryStringCachingBehavior("IgnoreSpecifiedQueryStrings")
	AfdRouteCacheConfiguration_QueryStringCachingBehavior_IncludeSpecifiedQueryStrings = AfdRouteCacheConfiguration_QueryStringCachingBehavior("IncludeSpecifiedQueryStrings")
	AfdRouteCacheConfiguration_QueryStringCachingBehavior_UseQueryString               = AfdRouteCacheConfiguration_QueryStringCachingBehavior("UseQueryString")
)

// Mapping from string to AfdRouteCacheConfiguration_QueryStringCachingBehavior
var afdRouteCacheConfiguration_QueryStringCachingBehavior_Values = map[string]AfdRouteCacheConfiguration_QueryStringCachingBehavior{
	"ignorequerystring":            AfdRouteCacheConfiguration_QueryStringCachingBehavior_IgnoreQueryString,
	"ignorespecifiedquerystrings":  AfdRouteCacheConfiguration_QueryStringCachingBehavior_IgnoreSpecifiedQueryStrings,
	"includespecifiedquerystrings": AfdRouteCacheConfiguration_QueryStringCachingBehavior_IncludeSpecifiedQueryStrings,
	"usequerystring":               AfdRouteCacheConfiguration_QueryStringCachingBehavior_UseQueryString,
}

// settings for compression.
type CompressionSettings struct {
	// ContentTypesToCompress: List of content types on which compression applies. The value should be a valid MIME type.
	ContentTypesToCompress []string `json:"contentTypesToCompress,omitempty"`

	// IsCompressionEnabled: Indicates whether content compression is enabled on AzureFrontDoor. Default value is false. If
	// compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be
	// compressed on AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB.
	IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"`
}
