// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.universalledger.v1;

option csharp_namespace = "Google.Cloud.UniversalLedger.V1";
option go_package = "cloud.google.com/go/universalledger/apiv1/universalledgerpb;universalledgerpb";
option java_multiple_files = true;
option java_outer_classname = "AccountsProto";
option java_package = "com.google.cloud.universalledger.v1";
option php_namespace = "Google\\Cloud\\UniversalLedger\\V1";
option ruby_package = "Google::Cloud::UniversalLedger::V1";

// The status of an account.
enum AccountStatus {
  // Invalid status.
  ACCOUNT_STATUS_UNSPECIFIED = 0;

  // Active state where the account can conduct the operations allowed by its
  // roles.
  ACCOUNT_STATUS_ACTIVE = 1;

  // Inactive state where all transactions on the account are forbidden.
  // The manager of the account can still send account management transactions.
  ACCOUNT_STATUS_INACTIVE = 2;
}

// The regular set of roles.
enum Role {
  // Invalid role.
  ROLE_UNSPECIFIED = 0;

  // The role that allows an account to initiate a payment transaction.
  ROLE_PAYER = 5;

  // The role that allows an account to receive payments.
  ROLE_RECEIVER = 6;

  // The role that allows an account to deploy contracts.
  ROLE_CONTRACT_CREATOR = 7;

  // The role that allows an account to interact with deployed contracts.
  ROLE_CONTRACT_PARTICIPANT = 8;
}

// The set of permissions that can be granted to a contract.
// More values are expected to be added in the future.
enum ContractPermission {
  // Invalid permission.
  CONTRACT_PERMISSION_UNSPECIFIED = 0;

  // Allows a contract to read and write into storage owned by the account who
  // granted the permission. The contract can only read and write the properties
  // that it has previously written.
  //
  // Note this does not allow the contract to read or write data managed by
  // other contracts; nor does it allow the contract to directly update other
  // account properties (for example, the balance of the account in its native
  // currency).
  CONTRACT_PERMISSION_STORAGE = 1;
}
