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

	// Properties: Properties to create and update an Azure Cosmos DB Mongo Role Definition.
	Properties *MongoRoleDefinitionResource `json:"properties,omitempty"`
}

var _ genruntime.ARMResourceSpec = &MongodbRoleDefinition_Spec{}

// GetAPIVersion returns the ARM API version of the resource. This is always "2024-08-15"
func (definition MongodbRoleDefinition_Spec) GetAPIVersion() string {
	return "2024-08-15"
}

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

// GetType returns the ARM Type of the resource. This is always "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions"
func (definition *MongodbRoleDefinition_Spec) GetType() string {
	return "Microsoft.DocumentDB/databaseAccounts/mongodbRoleDefinitions"
}

// Azure Cosmos DB Mongo Role Definition resource object.
type MongoRoleDefinitionResource struct {
	// DatabaseName: The database name for which access is being granted for this Role Definition.
	DatabaseName *string `json:"databaseName,omitempty"`

	// Privileges: A set of privileges contained by the Role Definition. This will allow application of this Role Definition on
	// the entire database account or any underlying Database / Collection. Scopes higher than Database are not enforceable as
	// privilege.
	Privileges []Privilege `json:"privileges,omitempty"`

	// RoleName: A user-friendly name for the Role Definition. Must be unique for the database account.
	RoleName *string `json:"roleName,omitempty"`

	// Roles: The set of roles inherited by this Role Definition.
	Roles []Role `json:"roles,omitempty"`

	// Type: Indicates whether the Role Definition was built-in or user created.
	Type *MongoRoleDefinitionResource_Type `json:"type,omitempty"`
}

// +kubebuilder:validation:Enum={"BuiltInRole","CustomRole"}
type MongoRoleDefinitionResource_Type string

const (
	MongoRoleDefinitionResource_Type_BuiltInRole = MongoRoleDefinitionResource_Type("BuiltInRole")
	MongoRoleDefinitionResource_Type_CustomRole  = MongoRoleDefinitionResource_Type("CustomRole")
)

// Mapping from string to MongoRoleDefinitionResource_Type
var mongoRoleDefinitionResource_Type_Values = map[string]MongoRoleDefinitionResource_Type{
	"builtinrole": MongoRoleDefinitionResource_Type_BuiltInRole,
	"customrole":  MongoRoleDefinitionResource_Type_CustomRole,
}

// The set of data plane operations permitted through this Role Definition.
type Privilege struct {
	// Actions: An array of actions that are allowed.
	Actions []string `json:"actions,omitempty"`

	// Resource: An Azure Cosmos DB Mongo DB Resource.
	Resource *Privilege_Resource `json:"resource,omitempty"`
}

// The set of roles permitted through this Role Definition.
type Role struct {
	// Db: The database name the role is applied.
	Db *string `json:"db,omitempty"`

	// Role: The role name.
	Role *string `json:"role,omitempty"`
}

type Privilege_Resource struct {
	// Collection: The collection name the role is applied.
	Collection *string `json:"collection,omitempty"`

	// Db: The database name the role is applied.
	Db *string `json:"db,omitempty"`
}
