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

import "encoding/json"

type DatabaseAccount_STATUS struct {
	// Id: The unique resource identifier of the ARM resource.
	Id *string `json:"id,omitempty"`

	// Identity: Identity for the resource.
	Identity *ManagedServiceIdentity_STATUS `json:"identity,omitempty"`

	// Kind: Indicates the type of database account. This can only be set at database account creation.
	Kind *DatabaseAccount_Kind_STATUS `json:"kind,omitempty"`

	// Location: The location of the resource group to which the resource belongs.
	Location *string `json:"location,omitempty"`

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

	// Properties: Properties for the database account.
	Properties *DatabaseAccountGetProperties_STATUS `json:"properties,omitempty"`
	Tags       map[string]string                    `json:"tags,omitempty"`

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

type DatabaseAccount_Kind_STATUS string

const (
	DatabaseAccount_Kind_STATUS_GlobalDocumentDB = DatabaseAccount_Kind_STATUS("GlobalDocumentDB")
	DatabaseAccount_Kind_STATUS_MongoDB          = DatabaseAccount_Kind_STATUS("MongoDB")
	DatabaseAccount_Kind_STATUS_Parse            = DatabaseAccount_Kind_STATUS("Parse")
)

// Mapping from string to DatabaseAccount_Kind_STATUS
var databaseAccount_Kind_STATUS_Values = map[string]DatabaseAccount_Kind_STATUS{
	"globaldocumentdb": DatabaseAccount_Kind_STATUS_GlobalDocumentDB,
	"mongodb":          DatabaseAccount_Kind_STATUS_MongoDB,
	"parse":            DatabaseAccount_Kind_STATUS_Parse,
}

// Properties for the database account.
type DatabaseAccountGetProperties_STATUS struct {
	// AnalyticalStorageConfiguration: Analytical storage specific properties.
	AnalyticalStorageConfiguration *AnalyticalStorageConfiguration_STATUS `json:"analyticalStorageConfiguration,omitempty"`

	// ApiProperties: API specific properties.
	ApiProperties *ApiProperties_STATUS `json:"apiProperties,omitempty"`

	// BackupPolicy: The object representing the policy for taking backups on an account.
	BackupPolicy *BackupPolicy_STATUS `json:"backupPolicy,omitempty"`

	// Capabilities: List of Cosmos DB capabilities for the account
	Capabilities []Capability_STATUS `json:"capabilities,omitempty"`

	// ConnectorOffer: The cassandra connector offer type for the Cosmos DB database C* account.
	ConnectorOffer *ConnectorOffer_STATUS `json:"connectorOffer,omitempty"`

	// ConsistencyPolicy: The consistency policy for the Cosmos DB database account.
	ConsistencyPolicy *ConsistencyPolicy_STATUS `json:"consistencyPolicy,omitempty"`

	// Cors: The CORS policy for the Cosmos DB database account.
	Cors []CorsPolicy_STATUS `json:"cors,omitempty"`

	// DatabaseAccountOfferType: The offer type for the Cosmos DB database account. Default value: Standard.
	DatabaseAccountOfferType *DatabaseAccountOfferType_STATUS `json:"databaseAccountOfferType,omitempty"`

	// DefaultIdentity: The default identity for accessing key vault used in features like customer managed keys. The default
	// identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", "SystemAssignedIdentity" and more.
	DefaultIdentity *string `json:"defaultIdentity,omitempty"`

	// DisableKeyBasedMetadataWriteAccess: Disable write operations on metadata resources (databases, containers, throughput)
	// via account keys
	DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"`

	// DocumentEndpoint: The connection endpoint for the Cosmos DB database account.
	DocumentEndpoint *string `json:"documentEndpoint,omitempty"`

	// EnableAnalyticalStorage: Flag to indicate whether to enable storage analytics.
	EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"`

	// EnableAutomaticFailover: Enables automatic failover of the write region in the rare event that the region is unavailable
	// due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the
	// failover priorities configured for the account.
	EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"`

	// EnableCassandraConnector: Enables the cassandra connector on the Cosmos DB C* account
	EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"`

	// EnableFreeTier: Flag to indicate whether Free Tier is enabled.
	EnableFreeTier *bool `json:"enableFreeTier,omitempty"`

	// EnableMultipleWriteLocations: Enables the account to write in multiple locations
	EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"`

	// FailoverPolicies: An array that contains the regions ordered by their failover priorities.
	FailoverPolicies []FailoverPolicy_STATUS `json:"failoverPolicies,omitempty"`

	// IpRules: List of IpRules.
	IpRules []IpAddressOrRange_STATUS `json:"ipRules,omitempty"`

	// IsVirtualNetworkFilterEnabled: Flag to indicate whether to enable/disable Virtual Network ACL rules.
	IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"`

	// KeyVaultKeyUri: The URI of the key vault
	KeyVaultKeyUri *string `json:"keyVaultKeyUri,omitempty"`

	// Locations: An array that contains all of the locations enabled for the Cosmos DB account.
	Locations []Location_STATUS `json:"locations,omitempty"`

	// NetworkAclBypass: Indicates what services are allowed to bypass firewall checks.
	NetworkAclBypass *NetworkAclBypass_STATUS `json:"networkAclBypass,omitempty"`

	// NetworkAclBypassResourceIds: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account.
	NetworkAclBypassResourceIds []string `json:"networkAclBypassResourceIds,omitempty"`

	// PrivateEndpointConnections: List of Private Endpoint Connections configured for the Cosmos DB account.
	PrivateEndpointConnections []PrivateEndpointConnection_STATUS `json:"privateEndpointConnections,omitempty"`
	ProvisioningState          *string                            `json:"provisioningState,omitempty"`

	// PublicNetworkAccess: Whether requests from Public Network are allowed
	PublicNetworkAccess *PublicNetworkAccess_STATUS `json:"publicNetworkAccess,omitempty"`

	// ReadLocations: An array that contains of the read locations enabled for the Cosmos DB account.
	ReadLocations []Location_STATUS `json:"readLocations,omitempty"`

	// VirtualNetworkRules: List of Virtual Network ACL rules configured for the Cosmos DB account.
	VirtualNetworkRules []VirtualNetworkRule_STATUS `json:"virtualNetworkRules,omitempty"`

	// WriteLocations: An array that contains the write location for the Cosmos DB account.
	WriteLocations []Location_STATUS `json:"writeLocations,omitempty"`
}

// Identity for the resource.
type ManagedServiceIdentity_STATUS struct {
	// PrincipalId: The principal id of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	PrincipalId *string `json:"principalId,omitempty"`

	// TenantId: The tenant id of the system assigned identity. This property will only be provided for a system assigned
	// identity.
	TenantId *string `json:"tenantId,omitempty"`

	// Type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly
	// created identity and a set of user assigned identities. The type 'None' will remove any identities from the service.
	Type *ManagedServiceIdentity_Type_STATUS `json:"type,omitempty"`

	// UserAssignedIdentities: The list of user identities associated with resource. The user identity dictionary key
	// references will be ARM resource ids in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities map[string]ManagedServiceIdentity_UserAssignedIdentities_STATUS `json:"userAssignedIdentities,omitempty"`
}

// Analytical storage specific properties.
type AnalyticalStorageConfiguration_STATUS struct {
	// SchemaType: Describes the types of schema for analytical storage.
	SchemaType *AnalyticalStorageSchemaType_STATUS `json:"schemaType,omitempty"`
}

type ApiProperties_STATUS struct {
	// ServerVersion: Describes the ServerVersion of an a MongoDB account.
	ServerVersion *ApiProperties_ServerVersion_STATUS `json:"serverVersion,omitempty"`
}

type BackupPolicy_STATUS struct {
	// Continuous: Mutually exclusive with all other properties
	Continuous *ContinuousModeBackupPolicy_STATUS `json:"continuous,omitempty"`

	// Periodic: Mutually exclusive with all other properties
	Periodic *PeriodicModeBackupPolicy_STATUS `json:"periodic,omitempty"`
}

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

	if policy.Periodic != nil {
		return json.Marshal(policy.Periodic)
	}

	return nil, nil
}

// UnmarshalJSON unmarshals the BackupPolicy_STATUS
func (policy *BackupPolicy_STATUS) UnmarshalJSON(data []byte) error {
	var rawJson map[string]interface{}
	err := json.Unmarshal(data, &rawJson)
	if err != nil {
		return err
	}
	discriminator := rawJson["type"]
	if discriminator == "Continuous" {
		policy.Continuous = &ContinuousModeBackupPolicy_STATUS{}
		return json.Unmarshal(data, policy.Continuous)
	}
	if discriminator == "Periodic" {
		policy.Periodic = &PeriodicModeBackupPolicy_STATUS{}
		return json.Unmarshal(data, policy.Periodic)
	}

	// No error
	return nil
}

// Cosmos DB capability object
type Capability_STATUS struct {
	// Name: Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include
	// "EnableTable" and "EnableGremlin".
	Name *string `json:"name,omitempty"`
}

// The cassandra connector offer type for the Cosmos DB C* database account.
type ConnectorOffer_STATUS string

const ConnectorOffer_STATUS_Small = ConnectorOffer_STATUS("Small")

// Mapping from string to ConnectorOffer_STATUS
var connectorOffer_STATUS_Values = map[string]ConnectorOffer_STATUS{
	"small": ConnectorOffer_STATUS_Small,
}

// The consistency policy for the Cosmos DB database account.
type ConsistencyPolicy_STATUS struct {
	// DefaultConsistencyLevel: The default consistency level and configuration settings of the Cosmos DB account.
	DefaultConsistencyLevel *ConsistencyPolicy_DefaultConsistencyLevel_STATUS `json:"defaultConsistencyLevel,omitempty"`

	// MaxIntervalInSeconds: When used with the Bounded Staleness consistency level, this value represents the time amount of
	// staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is
	// set to 'BoundedStaleness'.
	MaxIntervalInSeconds *int `json:"maxIntervalInSeconds,omitempty"`

	// MaxStalenessPrefix: When used with the Bounded Staleness consistency level, this value represents the number of stale
	// requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set
	// to 'BoundedStaleness'.
	MaxStalenessPrefix *int `json:"maxStalenessPrefix,omitempty"`
}

// The CORS policy for the Cosmos DB database account.
type CorsPolicy_STATUS struct {
	// AllowedHeaders: The request headers that the origin domain may specify on the CORS request.
	AllowedHeaders *string `json:"allowedHeaders,omitempty"`

	// AllowedMethods: The methods (HTTP request verbs) that the origin domain may use for a CORS request.
	AllowedMethods *string `json:"allowedMethods,omitempty"`

	// AllowedOrigins: The origin domains that are permitted to make a request against the service via CORS.
	AllowedOrigins *string `json:"allowedOrigins,omitempty"`

	// ExposedHeaders: The response headers that may be sent in the response to the CORS request and exposed by the browser to
	// the request issuer.
	ExposedHeaders *string `json:"exposedHeaders,omitempty"`

	// MaxAgeInSeconds: The maximum amount time that a browser should cache the preflight OPTIONS request.
	MaxAgeInSeconds *int `json:"maxAgeInSeconds,omitempty"`
}

// The offer type for the Cosmos DB database account.
type DatabaseAccountOfferType_STATUS string

const DatabaseAccountOfferType_STATUS_Standard = DatabaseAccountOfferType_STATUS("Standard")

// Mapping from string to DatabaseAccountOfferType_STATUS
var databaseAccountOfferType_STATUS_Values = map[string]DatabaseAccountOfferType_STATUS{
	"standard": DatabaseAccountOfferType_STATUS_Standard,
}

// The failover policy for a given region of a database account.
type FailoverPolicy_STATUS struct {
	// FailoverPriority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum
	// value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the
	// regions in which the database account exists.
	FailoverPriority *int `json:"failoverPriority,omitempty"`

	// Id: The unique identifier of the region in which the database account replicates to. Example:
	// &lt;accountName&gt;-&lt;locationName&gt;.
	Id *string `json:"id,omitempty"`

	// LocationName: The name of the region in which the database account exists.
	LocationName *string `json:"locationName,omitempty"`
}

// IpAddressOrRange object
type IpAddressOrRange_STATUS struct {
	// IpAddressOrRange: A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be
	// well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12,
	// 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245”
	// or “23.40.210.0/8”.
	IpAddressOrRange *string `json:"ipAddressOrRange,omitempty"`
}

// A region in which the Azure Cosmos DB database account is deployed.
type Location_STATUS struct {
	// DocumentEndpoint: The connection endpoint for the specific region. Example:
	// https://&lt;accountName&gt;-&lt;locationName&gt;.documents.azure.com:443/
	DocumentEndpoint *string `json:"documentEndpoint,omitempty"`

	// FailoverPriority: The failover priority of the region. A failover priority of 0 indicates a write region. The maximum
	// value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the
	// regions in which the database account exists.
	FailoverPriority *int `json:"failoverPriority,omitempty"`

	// Id: The unique identifier of the region within the database account. Example: &lt;accountName&gt;-&lt;locationName&gt;.
	Id *string `json:"id,omitempty"`

	// IsZoneRedundant: Flag to indicate whether or not this region is an AvailabilityZone region
	IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"`

	// LocationName: The name of the region.
	LocationName      *string `json:"locationName,omitempty"`
	ProvisioningState *string `json:"provisioningState,omitempty"`
}

type ManagedServiceIdentity_Type_STATUS string

const (
	ManagedServiceIdentity_Type_STATUS_None                       = ManagedServiceIdentity_Type_STATUS("None")
	ManagedServiceIdentity_Type_STATUS_SystemAssigned             = ManagedServiceIdentity_Type_STATUS("SystemAssigned")
	ManagedServiceIdentity_Type_STATUS_SystemAssignedUserAssigned = ManagedServiceIdentity_Type_STATUS("SystemAssigned,UserAssigned")
	ManagedServiceIdentity_Type_STATUS_UserAssigned               = ManagedServiceIdentity_Type_STATUS("UserAssigned")
)

// Mapping from string to ManagedServiceIdentity_Type_STATUS
var managedServiceIdentity_Type_STATUS_Values = map[string]ManagedServiceIdentity_Type_STATUS{
	"none":                        ManagedServiceIdentity_Type_STATUS_None,
	"systemassigned":              ManagedServiceIdentity_Type_STATUS_SystemAssigned,
	"systemassigned,userassigned": ManagedServiceIdentity_Type_STATUS_SystemAssignedUserAssigned,
	"userassigned":                ManagedServiceIdentity_Type_STATUS_UserAssigned,
}

type ManagedServiceIdentity_UserAssignedIdentities_STATUS struct {
	// ClientId: The client id of user assigned identity.
	ClientId *string `json:"clientId,omitempty"`

	// PrincipalId: The principal id of user assigned identity.
	PrincipalId *string `json:"principalId,omitempty"`
}

// Indicates what services are allowed to bypass firewall checks.
type NetworkAclBypass_STATUS string

const (
	NetworkAclBypass_STATUS_AzureServices = NetworkAclBypass_STATUS("AzureServices")
	NetworkAclBypass_STATUS_None          = NetworkAclBypass_STATUS("None")
)

// Mapping from string to NetworkAclBypass_STATUS
var networkAclBypass_STATUS_Values = map[string]NetworkAclBypass_STATUS{
	"azureservices": NetworkAclBypass_STATUS_AzureServices,
	"none":          NetworkAclBypass_STATUS_None,
}

// A private endpoint connection
type PrivateEndpointConnection_STATUS struct {
	// Id: Fully qualified resource ID for the resource. Ex -
	// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	Id *string `json:"id,omitempty"`
}

// Whether requests from Public Network are allowed
type PublicNetworkAccess_STATUS string

const (
	PublicNetworkAccess_STATUS_Disabled = PublicNetworkAccess_STATUS("Disabled")
	PublicNetworkAccess_STATUS_Enabled  = PublicNetworkAccess_STATUS("Enabled")
)

// Mapping from string to PublicNetworkAccess_STATUS
var publicNetworkAccess_STATUS_Values = map[string]PublicNetworkAccess_STATUS{
	"disabled": PublicNetworkAccess_STATUS_Disabled,
	"enabled":  PublicNetworkAccess_STATUS_Enabled,
}

// Virtual Network ACL Rule object
type VirtualNetworkRule_STATUS struct {
	// Id: Resource ID of a subnet, for example:
	// /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
	Id *string `json:"id,omitempty"`

	// IgnoreMissingVNetServiceEndpoint: Create firewall rule before the virtual network has vnet service endpoint enabled.
	IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"`
}

// Describes the types of schema for analytical storage.
type AnalyticalStorageSchemaType_STATUS string

const (
	AnalyticalStorageSchemaType_STATUS_FullFidelity = AnalyticalStorageSchemaType_STATUS("FullFidelity")
	AnalyticalStorageSchemaType_STATUS_WellDefined  = AnalyticalStorageSchemaType_STATUS("WellDefined")
)

// Mapping from string to AnalyticalStorageSchemaType_STATUS
var analyticalStorageSchemaType_STATUS_Values = map[string]AnalyticalStorageSchemaType_STATUS{
	"fullfidelity": AnalyticalStorageSchemaType_STATUS_FullFidelity,
	"welldefined":  AnalyticalStorageSchemaType_STATUS_WellDefined,
}

type ApiProperties_ServerVersion_STATUS string

const (
	ApiProperties_ServerVersion_STATUS_32 = ApiProperties_ServerVersion_STATUS("3.2")
	ApiProperties_ServerVersion_STATUS_36 = ApiProperties_ServerVersion_STATUS("3.6")
	ApiProperties_ServerVersion_STATUS_40 = ApiProperties_ServerVersion_STATUS("4.0")
)

// Mapping from string to ApiProperties_ServerVersion_STATUS
var apiProperties_ServerVersion_STATUS_Values = map[string]ApiProperties_ServerVersion_STATUS{
	"3.2": ApiProperties_ServerVersion_STATUS_32,
	"3.6": ApiProperties_ServerVersion_STATUS_36,
	"4.0": ApiProperties_ServerVersion_STATUS_40,
}

type ConsistencyPolicy_DefaultConsistencyLevel_STATUS string

const (
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_BoundedStaleness = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("BoundedStaleness")
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_ConsistentPrefix = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("ConsistentPrefix")
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Eventual         = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("Eventual")
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Session          = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("Session")
	ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Strong           = ConsistencyPolicy_DefaultConsistencyLevel_STATUS("Strong")
)

// Mapping from string to ConsistencyPolicy_DefaultConsistencyLevel_STATUS
var consistencyPolicy_DefaultConsistencyLevel_STATUS_Values = map[string]ConsistencyPolicy_DefaultConsistencyLevel_STATUS{
	"boundedstaleness": ConsistencyPolicy_DefaultConsistencyLevel_STATUS_BoundedStaleness,
	"consistentprefix": ConsistencyPolicy_DefaultConsistencyLevel_STATUS_ConsistentPrefix,
	"eventual":         ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Eventual,
	"session":          ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Session,
	"strong":           ConsistencyPolicy_DefaultConsistencyLevel_STATUS_Strong,
}

type ContinuousModeBackupPolicy_STATUS struct {
	Type ContinuousModeBackupPolicy_Type_STATUS `json:"type,omitempty"`
}

type PeriodicModeBackupPolicy_STATUS struct {
	// PeriodicModeProperties: Configuration values for periodic mode backup
	PeriodicModeProperties *PeriodicModeProperties_STATUS       `json:"periodicModeProperties,omitempty"`
	Type                   PeriodicModeBackupPolicy_Type_STATUS `json:"type,omitempty"`
}

type ContinuousModeBackupPolicy_Type_STATUS string

const ContinuousModeBackupPolicy_Type_STATUS_Continuous = ContinuousModeBackupPolicy_Type_STATUS("Continuous")

// Mapping from string to ContinuousModeBackupPolicy_Type_STATUS
var continuousModeBackupPolicy_Type_STATUS_Values = map[string]ContinuousModeBackupPolicy_Type_STATUS{
	"continuous": ContinuousModeBackupPolicy_Type_STATUS_Continuous,
}

type PeriodicModeBackupPolicy_Type_STATUS string

const PeriodicModeBackupPolicy_Type_STATUS_Periodic = PeriodicModeBackupPolicy_Type_STATUS("Periodic")

// Mapping from string to PeriodicModeBackupPolicy_Type_STATUS
var periodicModeBackupPolicy_Type_STATUS_Values = map[string]PeriodicModeBackupPolicy_Type_STATUS{
	"periodic": PeriodicModeBackupPolicy_Type_STATUS_Periodic,
}

// Configuration values for periodic mode backup
type PeriodicModeProperties_STATUS struct {
	// BackupIntervalInMinutes: An integer representing the interval in minutes between two backups
	BackupIntervalInMinutes *int `json:"backupIntervalInMinutes,omitempty"`

	// BackupRetentionIntervalInHours: An integer representing the time (in hours) that each backup is retained
	BackupRetentionIntervalInHours *int `json:"backupRetentionIntervalInHours,omitempty"`
}
