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

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

// CentralCrossAccountDeployment central cross account deployment
//
// swagger:model centralCrossAccountDeployment
type CentralCrossAccountDeployment struct {

	// bucket name
	// Required: true
	BucketName *string `json:"bucket_name"`

	// created at
	// Required: true
	// Format: date-time
	CreatedAt *strfmt.DateTime `json:"created_at"`

	// id
	// Required: true
	ID *string `json:"id"`

	// kms key arn
	// Required: true
	KmsKeyArn *string `json:"kms_key_arn"`

	// pca arn client
	// Required: true
	PcaArnClient *string `json:"pca_arn_client"`

	// pca arn cluster components
	// Required: true
	PcaArnClusterComponents *string `json:"pca_arn_cluster_components"`

	// project id
	// Required: true
	ProjectID *string `json:"project_id"`

	// provider
	// Required: true
	Provider *string `json:"provider"`

	// region
	// Required: true
	Region *string `json:"region"`

	// role arn eks
	// Required: true
	RoleArnEks *string `json:"role_arn_eks"`

	// role arn node
	// Required: true
	RoleArnNode *string `json:"role_arn_node"`

	// role arn tidb cloud
	// Required: true
	RoleArnTidbCloud *string `json:"role_arn_tidb_cloud"`

	// security group id
	// Required: true
	SecurityGroupID *string `json:"security_group_id"`

	// status
	// Required: true
	Status *string `json:"status"`

	// subnet ids
	// Required: true
	SubnetIds []string `json:"subnet_ids"`

	// vpc id
	// Required: true
	VpcID *string `json:"vpc_id"`
}

// Validate validates this central cross account deployment
func (m *CentralCrossAccountDeployment) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func (m *CentralCrossAccountDeployment) validateBucketName(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateCreatedAt(formats strfmt.Registry) error {

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

	if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
		return err
	}

	return nil
}

func (m *CentralCrossAccountDeployment) validateID(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateKmsKeyArn(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validatePcaArnClient(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validatePcaArnClusterComponents(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateProjectID(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateProvider(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateRegion(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateRoleArnEks(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateRoleArnNode(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateRoleArnTidbCloud(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateSecurityGroupID(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateStatus(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateSubnetIds(formats strfmt.Registry) error {

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

	return nil
}

func (m *CentralCrossAccountDeployment) validateVpcID(formats strfmt.Registry) error {

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

	return nil
}

// ContextValidate validates this central cross account deployment based on context it is used
func (m *CentralCrossAccountDeployment) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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