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

// HashicorpCloudWaypointTFAgentPool TFAgentPool represents an HCP Terraform agent pool
// https://developer.hashicorp.com/terraform/cloud-docs/agents/agent-pools
//
// swagger:model hashicorp.cloud.waypoint.TFAgentPool
type HashicorpCloudWaypointTFAgentPool 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 t f agent pool
func (m *HashicorpCloudWaypointTFAgentPool) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validate this hashicorp cloud waypoint t f agent pool based on the context it is used
func (m *HashicorpCloudWaypointTFAgentPool) 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 *HashicorpCloudWaypointTFAgentPool) 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 *HashicorpCloudWaypointTFAgentPool) 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 *HashicorpCloudWaypointTFAgentPool) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

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