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

// GhAppMetadataAccountType gh app metadata account type
//
// swagger:model GhAppMetadataAccountType
type GhAppMetadataAccountType string

func NewGhAppMetadataAccountType(value GhAppMetadataAccountType) *GhAppMetadataAccountType {
	return &value
}

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

const (

	// GhAppMetadataAccountTypeUNKNOWN captures enum value "UNKNOWN"
	GhAppMetadataAccountTypeUNKNOWN GhAppMetadataAccountType = "UNKNOWN"

	// GhAppMetadataAccountTypeUSER captures enum value "USER"
	GhAppMetadataAccountTypeUSER GhAppMetadataAccountType = "USER"

	// GhAppMetadataAccountTypeORGANIZATION captures enum value "ORGANIZATION"
	GhAppMetadataAccountTypeORGANIZATION GhAppMetadataAccountType = "ORGANIZATION"
)

// for schema
var ghAppMetadataAccountTypeEnum []interface{}

func init() {
	var res []GhAppMetadataAccountType
	if err := json.Unmarshal([]byte(`["UNKNOWN","USER","ORGANIZATION"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		ghAppMetadataAccountTypeEnum = append(ghAppMetadataAccountTypeEnum, v)
	}
}

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

// Validate validates this gh app metadata account type
func (m GhAppMetadataAccountType) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this gh app metadata account type based on context it is used
func (m GhAppMetadataAccountType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
