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

// GitHubRepositoryVisibility git hub repository visibility
//
// swagger:model GitHubRepositoryVisibility
type GitHubRepositoryVisibility string

func NewGitHubRepositoryVisibility(value GitHubRepositoryVisibility) *GitHubRepositoryVisibility {
	return &value
}

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

const (

	// GitHubRepositoryVisibilityUNKNOWN captures enum value "UNKNOWN"
	GitHubRepositoryVisibilityUNKNOWN GitHubRepositoryVisibility = "UNKNOWN"

	// GitHubRepositoryVisibilityPUBLIC captures enum value "PUBLIC"
	GitHubRepositoryVisibilityPUBLIC GitHubRepositoryVisibility = "PUBLIC"

	// GitHubRepositoryVisibilityPRIVATE captures enum value "PRIVATE"
	GitHubRepositoryVisibilityPRIVATE GitHubRepositoryVisibility = "PRIVATE"
)

// for schema
var gitHubRepositoryVisibilityEnum []interface{}

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

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

// Validate validates this git hub repository visibility
func (m GitHubRepositoryVisibility) Validate(formats strfmt.Registry) error {
	var res []error

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

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

// ContextValidate validates this git hub repository visibility based on context it is used
func (m GitHubRepositoryVisibility) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}
