// Code generated by go-swagger; DO NOT EDIT.

package models

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"encoding/json"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/validate"
)

// HashicorpCloudIamPrincipalType PrincipalType represents the possible types of principals.
//
//   - PRINCIPAL_TYPE_UNSPECIFIED: PRINCIPAL_TYPE_UNSPECIFIED is the default value.
//   - PRINCIPAL_TYPE_USER: PRINCIPAL_TYPE_USER is the user principal type.
//   - PRINCIPAL_TYPE_SERVICE: PRINCIPAL_TYPE_SERVICE is the service principal type.
//   - PRINCIPAL_TYPE_GROUP: PRINCIPAL_TYPE_GROUP is the group principal type.
//   - PRINCIPAL_TYPE_INTERNAL_OPERATOR: PRINCIPAL_TYPE_INTERNAL_OPERATOR is the internal operator principal type.
//
// swagger:model hashicorp.cloud.iam.PrincipalType
type HashicorpCloudIamPrincipalType string

func NewHashicorpCloudIamPrincipalType(value HashicorpCloudIamPrincipalType) *HashicorpCloudIamPrincipalType {
	return &value
}

// Pointer returns a pointer to a freshly-allocated HashicorpCloudIamPrincipalType.
func (m HashicorpCloudIamPrincipalType) Pointer() *HashicorpCloudIamPrincipalType {
	return &m
}

const (

	// HashicorpCloudIamPrincipalTypePRINCIPALTYPEUNSPECIFIED captures enum value "PRINCIPAL_TYPE_UNSPECIFIED"
	HashicorpCloudIamPrincipalTypePRINCIPALTYPEUNSPECIFIED HashicorpCloudIamPrincipalType = "PRINCIPAL_TYPE_UNSPECIFIED"

	// HashicorpCloudIamPrincipalTypePRINCIPALTYPEUSER captures enum value "PRINCIPAL_TYPE_USER"
	HashicorpCloudIamPrincipalTypePRINCIPALTYPEUSER HashicorpCloudIamPrincipalType = "PRINCIPAL_TYPE_USER"

	// HashicorpCloudIamPrincipalTypePRINCIPALTYPESERVICE captures enum value "PRINCIPAL_TYPE_SERVICE"
	HashicorpCloudIamPrincipalTypePRINCIPALTYPESERVICE HashicorpCloudIamPrincipalType = "PRINCIPAL_TYPE_SERVICE"

	// HashicorpCloudIamPrincipalTypePRINCIPALTYPEGROUP captures enum value "PRINCIPAL_TYPE_GROUP"
	HashicorpCloudIamPrincipalTypePRINCIPALTYPEGROUP HashicorpCloudIamPrincipalType = "PRINCIPAL_TYPE_GROUP"

	// HashicorpCloudIamPrincipalTypePRINCIPALTYPEINTERNALOPERATOR captures enum value "PRINCIPAL_TYPE_INTERNAL_OPERATOR"
	HashicorpCloudIamPrincipalTypePRINCIPALTYPEINTERNALOPERATOR HashicorpCloudIamPrincipalType = "PRINCIPAL_TYPE_INTERNAL_OPERATOR"
)

// for schema
var hashicorpCloudIamPrincipalTypeEnum []interface{}

func init() {
	var res []HashicorpCloudIamPrincipalType
	if err := json.Unmarshal([]byte(`["PRINCIPAL_TYPE_UNSPECIFIED","PRINCIPAL_TYPE_USER","PRINCIPAL_TYPE_SERVICE","PRINCIPAL_TYPE_GROUP","PRINCIPAL_TYPE_INTERNAL_OPERATOR"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		hashicorpCloudIamPrincipalTypeEnum = append(hashicorpCloudIamPrincipalTypeEnum, v)
	}
}

func (m HashicorpCloudIamPrincipalType) validateHashicorpCloudIamPrincipalTypeEnum(path, location string, value HashicorpCloudIamPrincipalType) error {
	if err := validate.EnumCase(path, location, value, hashicorpCloudIamPrincipalTypeEnum, true); err != nil {
		return err
	}
	return nil
}

// Validate validates this hashicorp cloud iam principal type
func (m HashicorpCloudIamPrincipalType) Validate(formats strfmt.Registry) error {
	var res []error

	// value enum
	if err := m.validateHashicorpCloudIamPrincipalTypeEnum("", "body", m); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

// ContextValidate validates this hashicorp cloud iam principal type based on context it is used
func (m HashicorpCloudIamPrincipalType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
