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

// HashicorpCloudPacker20230101EnforcedBlockBucket hashicorp cloud packer 20230101 enforced block bucket
//
// swagger:model hashicorp.cloud.packer_20230101.EnforcedBlockBucket
type HashicorpCloudPacker20230101EnforcedBlockBucket struct {

	// Bucket ID to which the enforced block is associated
	BucketID string `json:"bucket_id,omitempty"`

	// Created datetime
	// Format: date-time
	CreatedAt strfmt.DateTime `json:"created_at,omitempty"`

	// Enforced block Id associated with the bucket
	EnforcedBlockID string `json:"enforced_block_id,omitempty"`

	// Enforced block version associated with the bucket
	EnforcedBlockVersionID string `json:"enforced_block_version_id,omitempty"`

	// Unique identifier (ULID)
	ID string `json:"id,omitempty"`
}

// Validate validates this hashicorp cloud packer 20230101 enforced block bucket
func (m *HashicorpCloudPacker20230101EnforcedBlockBucket) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (m *HashicorpCloudPacker20230101EnforcedBlockBucket) validateCreatedAt(formats strfmt.Registry) error {
	if swag.IsZero(m.CreatedAt) { // not required
		return nil
	}

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

	return nil
}

// ContextValidate validates this hashicorp cloud packer 20230101 enforced block bucket based on context it is used
func (m *HashicorpCloudPacker20230101EnforcedBlockBucket) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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