// 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"
)

// IamPrincipalType 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 iamPrincipalType
type IamPrincipalType string

func NewIamPrincipalType(value IamPrincipalType) *IamPrincipalType {
	return &value
}

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

const (

	// IamPrincipalTypePRINCIPALTYPEUNSPECIFIED captures enum value "PRINCIPAL_TYPE_UNSPECIFIED"
	IamPrincipalTypePRINCIPALTYPEUNSPECIFIED IamPrincipalType = "PRINCIPAL_TYPE_UNSPECIFIED"

	// IamPrincipalTypePRINCIPALTYPEUSER captures enum value "PRINCIPAL_TYPE_USER"
	IamPrincipalTypePRINCIPALTYPEUSER IamPrincipalType = "PRINCIPAL_TYPE_USER"

	// IamPrincipalTypePRINCIPALTYPESERVICE captures enum value "PRINCIPAL_TYPE_SERVICE"
	IamPrincipalTypePRINCIPALTYPESERVICE IamPrincipalType = "PRINCIPAL_TYPE_SERVICE"

	// IamPrincipalTypePRINCIPALTYPEGROUP captures enum value "PRINCIPAL_TYPE_GROUP"
	IamPrincipalTypePRINCIPALTYPEGROUP IamPrincipalType = "PRINCIPAL_TYPE_GROUP"

	// IamPrincipalTypePRINCIPALTYPEINTERNALOPERATOR captures enum value "PRINCIPAL_TYPE_INTERNAL_OPERATOR"
	IamPrincipalTypePRINCIPALTYPEINTERNALOPERATOR IamPrincipalType = "PRINCIPAL_TYPE_INTERNAL_OPERATOR"
)

// for schema
var iamPrincipalTypeEnum []interface{}

func init() {
	var res []IamPrincipalType
	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 {
		iamPrincipalTypeEnum = append(iamPrincipalTypeEnum, v)
	}
}

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

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

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

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

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