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

package run_model

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

// V2beta1RunStorageState Describes whether an entity is available or archived.
//
//   - STORAGE_STATE_UNSPECIFIED: Default state. This state in not used
//   - AVAILABLE: Entity is available.
//   - ARCHIVED: Entity is archived.
//
// swagger:model v2beta1RunStorageState
type V2beta1RunStorageState string

func NewV2beta1RunStorageState(value V2beta1RunStorageState) *V2beta1RunStorageState {
	return &value
}

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

const (

	// V2beta1RunStorageStateSTORAGESTATEUNSPECIFIED captures enum value "STORAGE_STATE_UNSPECIFIED"
	V2beta1RunStorageStateSTORAGESTATEUNSPECIFIED V2beta1RunStorageState = "STORAGE_STATE_UNSPECIFIED"

	// V2beta1RunStorageStateAVAILABLE captures enum value "AVAILABLE"
	V2beta1RunStorageStateAVAILABLE V2beta1RunStorageState = "AVAILABLE"

	// V2beta1RunStorageStateARCHIVED captures enum value "ARCHIVED"
	V2beta1RunStorageStateARCHIVED V2beta1RunStorageState = "ARCHIVED"
)

// for schema
var v2beta1RunStorageStateEnum []interface{}

func init() {
	var res []V2beta1RunStorageState
	if err := json.Unmarshal([]byte(`["STORAGE_STATE_UNSPECIFIED","AVAILABLE","ARCHIVED"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		v2beta1RunStorageStateEnum = append(v2beta1RunStorageStateEnum, v)
	}
}

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

// Validate validates this v2beta1 run storage state
func (m V2beta1RunStorageState) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this v2beta1 run storage state based on context it is used
func (m V2beta1RunStorageState) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
