// Code generated by go-swagger; DO NOT EDIT.

package model

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// OpenapiCreateProjectReq CreateProjectReq
//
// CreateProjectReq is the request for creating project.
//
// swagger:model openapiCreateProjectReq
type OpenapiCreateProjectReq struct {

	// Flag that indicates whether to enable AWS Customer-Managed Encryption Keys.
	//
	// Currently this feature is only available upon request. If you need to try out this feature, contact [support](https://docs.pingcap.com/tidbcloud/tidb-cloud-support).
	// Example: false
	AwsCmekEnabled *bool `json:"aws_cmek_enabled,omitempty"`

	// The name of the project.
	// Example: Project0
	// Required: true
	Name *string `json:"name"`
}

// Validate validates this openapi create project req
func (m *OpenapiCreateProjectReq) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *OpenapiCreateProjectReq) validateName(formats strfmt.Registry) error {

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

	return nil
}

// ContextValidate validates this openapi create project req based on context it is used
func (m *OpenapiCreateProjectReq) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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