1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.paymentgateway.issuerswitch.accountmanager.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/paymentgateway/issuerswitch/v1/common_fields.proto"; 24import "google/protobuf/timestamp.proto"; 25import "google/type/money.proto"; 26 27option csharp_namespace = "Google.Cloud.PaymentGateway.IssuerSwitch.AccountManager.V1"; 28option go_package = "cloud.google.com/go/paymentgateway/issuerswitch/accountmanager/apiv1/accountmanagerpb;accountmanagerpb"; 29option java_multiple_files = true; 30option java_outer_classname = "ManagedAccountsProto"; 31option java_package = "com.google.cloud.paymentgateway.issuerswitch.accountmanager.v1"; 32option php_namespace = "Google\\Cloud\\PaymentGateway\\IssuerSwitch\\AccountManager\\V1"; 33option ruby_package = "Google::Cloud::PaymentGateway::IssuerSwitch::AccountManager::V1"; 34 35// Reconciles and provide balance information for an account within the account 36// manager. 37service ManagedAccounts { 38 option (google.api.default_host) = "issuerswitch.googleapis.com"; 39 option (google.api.oauth_scopes) = 40 "https://www.googleapis.com/auth/cloud-platform"; 41 42 // Batch reconcile account balance and return status for each account. 43 rpc BatchReconcileManagedAccountBalance( 44 BatchReconcileManagedAccountBalanceRequest) 45 returns (BatchReconcileManagedAccountBalanceResponse) { 46 option (google.api.http) = { 47 post: "/v1/{parent=projects/*/accountManagers/*}/accounts:batchReconcileBalance" 48 body: "*" 49 }; 50 option (google.api.method_signature) = "parent,requests"; 51 } 52 53 // Get information on the account managed by account manager. 54 rpc GetManagedAccount(GetManagedAccountRequest) returns (ManagedAccount) { 55 option (google.api.http) = { 56 get: "/v1/{name=projects/*/accountManagers/*/accounts/*}" 57 }; 58 option (google.api.method_signature) = "name"; 59 } 60} 61 62// Entity representing an account managed by the account manager. 63message ManagedAccount { 64 option (google.api.resource) = { 65 type: "issuerswitch.googleapis.com/ManagedAccount" 66 pattern: "projects/{project}/accountManagers/{account_manager}/accounts/{account}" 67 plural: "managedAccounts" 68 singular: "managedAccount" 69 }; 70 71 // State of an account. 72 enum State { 73 // Unspecified state. 74 STATE_UNSPECIFIED = 0; 75 76 // Account is active. 77 ACTIVE = 1; 78 79 // Account is inactive. 80 DEACTIVATED = 2; 81 } 82 83 // Reconciliation state of an account. 84 enum AccountReconciliationState { 85 // Unspecified state. 86 ACCOUNT_RECONCILIATION_STATE_UNSPECIFIED = 0; 87 88 // Successful reconciliation. 89 SUCCEEDED = 1; 90 91 // Reconciliation failed. 92 FAILED = 2; 93 } 94 95 // The name of the account which uniquely identifies the account. 96 // Format: 97 // projects/{project}/accountManagers/{account_manager}/accounts/{account} 98 // When account manager is used for managing UPI Lite transactions, 99 // `{account}` is the Lite Reference Number (LRN). 100 string name = 1; 101 102 // Required. The associated bank account information. 103 google.cloud.paymentgateway.issuerswitch.v1.AccountReference 104 account_reference = 2 [(google.api.field_behavior) = REQUIRED]; 105 106 // Output only. State of the account. 107 State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 108 109 // Required. Current balance of the account. 110 google.type.Money balance = 4 [(google.api.field_behavior) = REQUIRED]; 111 112 // Output only. State of the last reconciliation done on the account. 113 AccountReconciliationState last_reconciliation_state = 5 114 [(google.api.field_behavior) = OUTPUT_ONLY]; 115 116 // Output only. Time at which last reconciliation was done on the account. 117 google.protobuf.Timestamp last_reconciliation_time = 6 118 [(google.api.field_behavior) = OUTPUT_ONLY]; 119 120 // Output only. The time at which the account was created by the account 121 // manager. 122 google.protobuf.Timestamp create_time = 7 123 [(google.api.field_behavior) = OUTPUT_ONLY]; 124 125 // Output only. The time at which the account was last updated by the account 126 // manager. 127 google.protobuf.Timestamp update_time = 8 128 [(google.api.field_behavior) = OUTPUT_ONLY]; 129} 130 131// Reconciliation request for an account balance. 132message ReconcileManagedAccountBalanceRequest { 133 // Required. Account that needs to be reconciled. 134 ManagedAccount account = 1 [(google.api.field_behavior) = REQUIRED]; 135 136 // Required. Expected balance amount for the account. 137 google.type.Money expected_balance = 2 138 [(google.api.field_behavior) = REQUIRED]; 139 140 // Required. Timestamp to be taken as reference for reconciling the balance 141 // amount. 142 google.protobuf.Timestamp reference_time = 3 143 [(google.api.field_behavior) = REQUIRED]; 144} 145 146// Request for the `BatchReconcileManagedAccountBalance` method. 147message BatchReconcileManagedAccountBalanceRequest { 148 // Required. The parent resource. The format is 149 // `projects/{project}/accountManagers/{account_manager}`. 150 string parent = 1 [(google.api.field_behavior) = REQUIRED]; 151 152 // Required. The request message specifying the accounts to reconcile. 153 // A maximum of 200 account balances can be reconciled in a batch. 154 repeated ReconcileManagedAccountBalanceRequest requests = 2 155 [(google.api.field_behavior) = REQUIRED]; 156} 157 158// Response for the `BatchReconcileManagedAccountBalance` method. 159message BatchReconcileManagedAccountBalanceResponse { 160 // Accounts whose balances were reconciled. 161 repeated ManagedAccount accounts = 1; 162} 163 164// Request for the `GetManagedAccount` method. 165message GetManagedAccountRequest { 166 // Required. The name of the managed account to retrieve. 167 // Format: 168 // `projects/{project}/accountManagers/{account_manager}/accounts/{account}` 169 // When account manager is used for managing UPI Lite transactions, {account} 170 // should be the Lite Reference Number (LRN). 171 string name = 1 [ 172 (google.api.field_behavior) = REQUIRED, 173 (google.api.resource_reference) = { 174 type: "issuerswitch.googleapis.com/ManagedAccount" 175 } 176 ]; 177} 178