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

// HashicorpCloudPackerIterationTemplateType - TEMPLATE_TYPE_UNSET: TEMPLATE_TYPE_UNSET is a sentinel zero value so that an uninitialized value can be
// detected.
//   - HCL2: HCL2 configuration template; either pkr.hcl or pkr.json
//   - JSON: Legacy JSON configuration template
//
// swagger:model hashicorp.cloud.packer.Iteration.TemplateType
type HashicorpCloudPackerIterationTemplateType string

func NewHashicorpCloudPackerIterationTemplateType(value HashicorpCloudPackerIterationTemplateType) *HashicorpCloudPackerIterationTemplateType {
	return &value
}

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

const (

	// HashicorpCloudPackerIterationTemplateTypeTEMPLATETYPEUNSET captures enum value "TEMPLATE_TYPE_UNSET"
	HashicorpCloudPackerIterationTemplateTypeTEMPLATETYPEUNSET HashicorpCloudPackerIterationTemplateType = "TEMPLATE_TYPE_UNSET"

	// HashicorpCloudPackerIterationTemplateTypeHCL2 captures enum value "HCL2"
	HashicorpCloudPackerIterationTemplateTypeHCL2 HashicorpCloudPackerIterationTemplateType = "HCL2"

	// HashicorpCloudPackerIterationTemplateTypeJSON captures enum value "JSON"
	HashicorpCloudPackerIterationTemplateTypeJSON HashicorpCloudPackerIterationTemplateType = "JSON"
)

// for schema
var hashicorpCloudPackerIterationTemplateTypeEnum []interface{}

func init() {
	var res []HashicorpCloudPackerIterationTemplateType
	if err := json.Unmarshal([]byte(`["TEMPLATE_TYPE_UNSET","HCL2","JSON"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		hashicorpCloudPackerIterationTemplateTypeEnum = append(hashicorpCloudPackerIterationTemplateTypeEnum, v)
	}
}

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

// Validate validates this hashicorp cloud packer iteration template type
func (m HashicorpCloudPackerIterationTemplateType) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this hashicorp cloud packer iteration template type based on context it is used
func (m HashicorpCloudPackerIterationTemplateType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
