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

// V1alpha1CredentialStatusPurpose The purpose of the status entry
//
// - CREDENTIAL_STATUS_PURPOSE_UNSPECIFIED: Unspecified status purpose
//   - CREDENTIAL_STATUS_PURPOSE_REVOCATION: Used to cancel the validity of a verifiable credential.
//
// This status is not reversible.
//
// swagger:model v1alpha1CredentialStatusPurpose
type V1alpha1CredentialStatusPurpose string

func NewV1alpha1CredentialStatusPurpose(value V1alpha1CredentialStatusPurpose) *V1alpha1CredentialStatusPurpose {
	return &value
}

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

const (

	// V1alpha1CredentialStatusPurposeCREDENTIALSTATUSPURPOSEUNSPECIFIED captures enum value "CREDENTIAL_STATUS_PURPOSE_UNSPECIFIED"
	V1alpha1CredentialStatusPurposeCREDENTIALSTATUSPURPOSEUNSPECIFIED V1alpha1CredentialStatusPurpose = "CREDENTIAL_STATUS_PURPOSE_UNSPECIFIED"

	// V1alpha1CredentialStatusPurposeCREDENTIALSTATUSPURPOSEREVOCATION captures enum value "CREDENTIAL_STATUS_PURPOSE_REVOCATION"
	V1alpha1CredentialStatusPurposeCREDENTIALSTATUSPURPOSEREVOCATION V1alpha1CredentialStatusPurpose = "CREDENTIAL_STATUS_PURPOSE_REVOCATION"
)

// for schema
var v1alpha1CredentialStatusPurposeEnum []any

func init() {
	var res []V1alpha1CredentialStatusPurpose
	if err := json.Unmarshal([]byte(`["CREDENTIAL_STATUS_PURPOSE_UNSPECIFIED","CREDENTIAL_STATUS_PURPOSE_REVOCATION"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		v1alpha1CredentialStatusPurposeEnum = append(v1alpha1CredentialStatusPurposeEnum, v)
	}
}

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

// Validate validates this v1alpha1 credential status purpose
func (m V1alpha1CredentialStatusPurpose) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this v1alpha1 credential status purpose based on context it is used
func (m V1alpha1CredentialStatusPurpose) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
