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

// UpgradeAgentResult Agent upgrade result.
//
// swagger:model upgrade_agent_result
type UpgradeAgentResult string

func NewUpgradeAgentResult(value UpgradeAgentResult) *UpgradeAgentResult {
	return &value
}

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

const (

	// UpgradeAgentResultSuccess captures enum value "success"
	UpgradeAgentResultSuccess UpgradeAgentResult = "success"

	// UpgradeAgentResultFailure captures enum value "failure"
	UpgradeAgentResultFailure UpgradeAgentResult = "failure"
)

// for schema
var upgradeAgentResultEnum []interface{}

func init() {
	var res []UpgradeAgentResult
	if err := json.Unmarshal([]byte(`["success","failure"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		upgradeAgentResultEnum = append(upgradeAgentResultEnum, v)
	}
}

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

// Validate validates this upgrade agent result
func (m UpgradeAgentResult) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this upgrade agent result based on context it is used
func (m UpgradeAgentResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
