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

// HashicorpCloudConsulTelemetry20230414IntentionsAuthorization authorization are the authorization results of intentions between services.
// Either traffic is allowed, denied, or undefined.
//
//   - AUTHORIZATION_ALLOW_INTENTIONS: traffic is allowed because of an intention
//   - AUTHORIZATION_DENY_INTENTIONS: traffic is denied because of an intention
//   - AUTHORIZATION_ALLOW_DEFAULT: traffic is allowed because of a default acl policy
//   - AUTHORIZATION_DENY_DEFAULT: traffic is denied because of a default acl policy
//   - AUTHORIZATION_UNDEFINED_APP_AWARE: traffic is either allowed or denied based on paths in the request. We cannot tell, from the
//
// intentions/default_policy alone, whether calls will be allowed or denied. This is the case if
// HTTP is set on intention permissions: https://developer.hashicorp.com/consul/docs/connect/config-entries/service-intentions#sources-permissions-http
//
// swagger:model hashicorp.cloud.consul_telemetry_20230414.Intentions.Authorization
type HashicorpCloudConsulTelemetry20230414IntentionsAuthorization string

func NewHashicorpCloudConsulTelemetry20230414IntentionsAuthorization(value HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) *HashicorpCloudConsulTelemetry20230414IntentionsAuthorization {
	return &value
}

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

const (

	// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONUNSPECIFIED captures enum value "AUTHORIZATION_UNSPECIFIED"
	HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONUNSPECIFIED HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_UNSPECIFIED"

	// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONALLOWINTENTIONS captures enum value "AUTHORIZATION_ALLOW_INTENTIONS"
	HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONALLOWINTENTIONS HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_ALLOW_INTENTIONS"

	// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONDENYINTENTIONS captures enum value "AUTHORIZATION_DENY_INTENTIONS"
	HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONDENYINTENTIONS HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_DENY_INTENTIONS"

	// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONALLOWDEFAULT captures enum value "AUTHORIZATION_ALLOW_DEFAULT"
	HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONALLOWDEFAULT HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_ALLOW_DEFAULT"

	// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONDENYDEFAULT captures enum value "AUTHORIZATION_DENY_DEFAULT"
	HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONDENYDEFAULT HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_DENY_DEFAULT"

	// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONUNDEFINEDAPPAWARE captures enum value "AUTHORIZATION_UNDEFINED_APP_AWARE"
	HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONUNDEFINEDAPPAWARE HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_UNDEFINED_APP_AWARE"
)

// for schema
var hashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum []interface{}

func init() {
	var res []HashicorpCloudConsulTelemetry20230414IntentionsAuthorization
	if err := json.Unmarshal([]byte(`["AUTHORIZATION_UNSPECIFIED","AUTHORIZATION_ALLOW_INTENTIONS","AUTHORIZATION_DENY_INTENTIONS","AUTHORIZATION_ALLOW_DEFAULT","AUTHORIZATION_DENY_DEFAULT","AUTHORIZATION_UNDEFINED_APP_AWARE"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		hashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum = append(hashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum, v)
	}
}

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

// Validate validates this hashicorp cloud consul telemetry 20230414 intentions authorization
func (m HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this hashicorp cloud consul telemetry 20230414 intentions authorization based on context it is used
func (m HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
