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

// HashicorpCloudWaypointV20241122ActionCfgRefOutputs hashicorp cloud waypoint v20241122 action cfg ref outputs
//
// swagger:model hashicorp.cloud.waypoint.v20241122.ActionCfgRef.Outputs
type HashicorpCloudWaypointV20241122ActionCfgRefOutputs struct {

	// ActionName returns the name of the action config reference in response messages
	// and is an output only field.
	// Read Only: true
	ActionName string `json:"action_name,omitempty"`

	// ExternalID returns the ID of the action config reference in response messages
	// and is an output only field.
	// Read Only: true
	ExternalID string `json:"external_id,omitempty"`
}

// Validate validates this hashicorp cloud waypoint v20241122 action cfg ref outputs
func (m *HashicorpCloudWaypointV20241122ActionCfgRefOutputs) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validate this hashicorp cloud waypoint v20241122 action cfg ref outputs based on the context it is used
func (m *HashicorpCloudWaypointV20241122ActionCfgRefOutputs) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

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

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

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

func (m *HashicorpCloudWaypointV20241122ActionCfgRefOutputs) contextValidateActionName(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

func (m *HashicorpCloudWaypointV20241122ActionCfgRefOutputs) contextValidateExternalID(ctx context.Context, formats strfmt.Registry) error {

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

	return nil
}

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

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