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

package ops

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

// CloudconfigConfigurationChangePhase cloudconfig configuration change phase
//
// swagger:model cloudconfig.ConfigurationChangePhase
type CloudconfigConfigurationChangePhase string

func NewCloudconfigConfigurationChangePhase(value CloudconfigConfigurationChangePhase) *CloudconfigConfigurationChangePhase {
	return &value
}

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

const (

	// CloudconfigConfigurationChangePhaseCreated captures enum value "created"
	CloudconfigConfigurationChangePhaseCreated CloudconfigConfigurationChangePhase = "created"

	// CloudconfigConfigurationChangePhaseApproving captures enum value "approving"
	CloudconfigConfigurationChangePhaseApproving CloudconfigConfigurationChangePhase = "approving"

	// CloudconfigConfigurationChangePhaseWaitForApply captures enum value "wait_for_apply"
	CloudconfigConfigurationChangePhaseWaitForApply CloudconfigConfigurationChangePhase = "wait_for_apply"

	// CloudconfigConfigurationChangePhaseApplied captures enum value "applied"
	CloudconfigConfigurationChangePhaseApplied CloudconfigConfigurationChangePhase = "applied"

	// CloudconfigConfigurationChangePhaseCancelled captures enum value "cancelled"
	CloudconfigConfigurationChangePhaseCancelled CloudconfigConfigurationChangePhase = "cancelled"

	// CloudconfigConfigurationChangePhaseWithdrawn captures enum value "withdrawn"
	CloudconfigConfigurationChangePhaseWithdrawn CloudconfigConfigurationChangePhase = "withdrawn"
)

// for schema
var cloudconfigConfigurationChangePhaseEnum []interface{}

func init() {
	var res []CloudconfigConfigurationChangePhase
	if err := json.Unmarshal([]byte(`["created","approving","wait_for_apply","applied","cancelled","withdrawn"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		cloudconfigConfigurationChangePhaseEnum = append(cloudconfigConfigurationChangePhaseEnum, v)
	}
}

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

// Validate validates this cloudconfig configuration change phase
func (m CloudconfigConfigurationChangePhase) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this cloudconfig configuration change phase based on context it is used
func (m CloudconfigConfigurationChangePhase) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
