// Copyright IBM Corp. 2014, 2026
// SPDX-License-Identifier: BUSL-1.1

syntax = "proto3";

package proto;

option go_package = "github.com/hashicorp/terraform-policy-plugin/proto";

service CallbackService {
  rpc GetResources(GetResourcesRequest) returns (GetResourcesResponse);
  rpc GetDataSource(GetDataSourceRequest) returns (GetDataSourceResponse);
}

message GetResourcesRequest {
  string type = 1;
  bytes attributes = 2;
  // evaluation_request_id is the ID of the policy evaluation request that is
  // making this callback request.
  uint32 evaluation_request_id = 3;

 
}

message GetResourcesResponse {
  repeated bytes results = 1;
  // partial means that the request encountered unknown objects during evaluation,
  // and the results may be incomplete.
  bool partial = 2;
}

message GetDataSourceRequest {
  string type = 1;
  bytes config = 2;
  // evaluation_request_id is the ID of the policy evaluation request that is
  // making this callback request.
  uint32 evaluation_request_id = 3;
}

message GetDataSourceResponse {
  bytes result = 1;
  // deferred indicates that the data source read was deferred during evaluation.
  bool deferred = 2;
}
