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

// GoogleProtobufNullValue `NullValue` is a singleton enumeration to represent the null value for the
// `Value` type union.
//
//	The JSON representation for `NullValue` is JSON `null`.
//
//	- NULL_VALUE: Null value.
//
// swagger:model google.protobuf.NullValue
type GoogleProtobufNullValue string

func NewGoogleProtobufNullValue(value GoogleProtobufNullValue) *GoogleProtobufNullValue {
	return &value
}

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

const (

	// GoogleProtobufNullValueNULLVALUE captures enum value "NULL_VALUE"
	GoogleProtobufNullValueNULLVALUE GoogleProtobufNullValue = "NULL_VALUE"
)

// for schema
var googleProtobufNullValueEnum []interface{}

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

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

// Validate validates this google protobuf null value
func (m GoogleProtobufNullValue) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this google protobuf null value based on context it is used
func (m GoogleProtobufNullValue) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
