// 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/swag"
	"github.com/go-openapi/validate"
)

// AzureBlobStoreAPIAuthentication azure blob store Api authentication
//
// swagger:model AzureBlobStoreApiAuthentication
type AzureBlobStoreAPIAuthentication struct {

	// The account key.
	AccountKey string `json:"accountKey,omitempty"`

	// The type of Azure authentication to use.
	// Required: true
	// Enum: [ACCOUNTKEY MANAGEDIDENTITY ENVIRONMENTVARIABLE]
	AuthenticationMethod *string `json:"authenticationMethod"`
}

// Validate validates this azure blob store Api authentication
func (m *AzureBlobStoreAPIAuthentication) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateAuthenticationMethod(formats); err != nil {
		res = append(res, err)
	}

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

var azureBlobStoreApiAuthenticationTypeAuthenticationMethodPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["ACCOUNTKEY","MANAGEDIDENTITY","ENVIRONMENTVARIABLE"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		azureBlobStoreApiAuthenticationTypeAuthenticationMethodPropEnum = append(azureBlobStoreApiAuthenticationTypeAuthenticationMethodPropEnum, v)
	}
}

const (

	// AzureBlobStoreAPIAuthenticationAuthenticationMethodACCOUNTKEY captures enum value "ACCOUNTKEY"
	AzureBlobStoreAPIAuthenticationAuthenticationMethodACCOUNTKEY string = "ACCOUNTKEY"

	// AzureBlobStoreAPIAuthenticationAuthenticationMethodMANAGEDIDENTITY captures enum value "MANAGEDIDENTITY"
	AzureBlobStoreAPIAuthenticationAuthenticationMethodMANAGEDIDENTITY string = "MANAGEDIDENTITY"

	// AzureBlobStoreAPIAuthenticationAuthenticationMethodENVIRONMENTVARIABLE captures enum value "ENVIRONMENTVARIABLE"
	AzureBlobStoreAPIAuthenticationAuthenticationMethodENVIRONMENTVARIABLE string = "ENVIRONMENTVARIABLE"
)

// prop value enum
func (m *AzureBlobStoreAPIAuthentication) validateAuthenticationMethodEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, azureBlobStoreApiAuthenticationTypeAuthenticationMethodPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (m *AzureBlobStoreAPIAuthentication) validateAuthenticationMethod(formats strfmt.Registry) error {

	if err := validate.Required("authenticationMethod", "body", m.AuthenticationMethod); err != nil {
		return err
	}

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

	return nil
}

// ContextValidate validates this azure blob store Api authentication based on context it is used
func (m *AzureBlobStoreAPIAuthentication) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (m *AzureBlobStoreAPIAuthentication) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *AzureBlobStoreAPIAuthentication) UnmarshalBinary(b []byte) error {
	var res AzureBlobStoreAPIAuthentication
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}
