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

// HashicorpCloudWaypointV20241122TFAgentPool TFAgentPool represents an HCP Terraform agent pool
// https://developer.hashicorp.com/terraform/cloud-docs/agents/agent-pools
//
// swagger:model hashicorp.cloud.waypoint.v20241122.TFAgentPool
type HashicorpCloudWaypointV20241122TFAgentPool struct {

	// id is the id of the agent pool
	// Read Only: true
	ID string `json:"id,omitempty"`

	// name is the name of the agent pool
	// Read Only: true
	Name string `json:"name,omitempty"`
}

// Validate validates this hashicorp cloud waypoint v20241122 t f agent pool
func (m *HashicorpCloudWaypointV20241122TFAgentPool) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validate this hashicorp cloud waypoint v20241122 t f agent pool based on the context it is used
func (m *HashicorpCloudWaypointV20241122TFAgentPool) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *HashicorpCloudWaypointV20241122TFAgentPool) contextValidateID(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

func (m *HashicorpCloudWaypointV20241122TFAgentPool) contextValidateName(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

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

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