diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java index d8110bd947c..8bb5d30f817 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -88,6 +88,8 @@ * calls that map to API methods. Sample code to get started: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DatabaseName name = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * Database response = databaseAdminClient.getDatabase(name); @@ -123,6 +125,8 @@ *To customize credentials: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * DatabaseAdminSettings databaseAdminSettings = * DatabaseAdminSettings.newBuilder() * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) @@ -133,6 +137,8 @@ *To customize the endpoint: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * DatabaseAdminSettings databaseAdminSettings = * DatabaseAdminSettings.newBuilder().setEndpoint(myEndpoint).build(); * DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create(databaseAdminSettings); @@ -211,6 +217,8 @@ public final OperationsClient getOperationsClient() { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * for (Database element : databaseAdminClient.listDatabases(parent).iterateAll()) { @@ -238,6 +246,8 @@ public final ListDatabasesPagedResponse listDatabases(InstanceName parent) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * for (Database element : databaseAdminClient.listDatabases(parent).iterateAll()) { @@ -262,6 +272,8 @@ public final ListDatabasesPagedResponse listDatabases(String parent) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListDatabasesRequest request = * ListDatabasesRequest.newBuilder() @@ -289,6 +301,8 @@ public final ListDatabasesPagedResponse listDatabases(ListDatabasesRequest reque *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListDatabasesRequest request = * ListDatabasesRequest.newBuilder() @@ -317,6 +331,8 @@ public final ListDatabasesPagedResponse listDatabases(ListDatabasesRequest reque *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListDatabasesRequest request = * ListDatabasesRequest.newBuilder() @@ -356,6 +372,8 @@ public final UnaryCallablelistData * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * String createStatement = "createStatement744686547"; @@ -395,6 +413,8 @@ public final OperationFuturecreateDatabaseAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * String createStatement = "createStatement744686547"; @@ -434,6 +454,8 @@ public final OperationFuturecreateDatabaseAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CreateDatabaseRequest request = * CreateDatabaseRequest.newBuilder() @@ -468,6 +490,8 @@ public final OperationFuturecreateDatabaseAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CreateDatabaseRequest request = * CreateDatabaseRequest.newBuilder() @@ -502,6 +526,8 @@ public final OperationFuturecreateDatabaseAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CreateDatabaseRequest request = * CreateDatabaseRequest.newBuilder() @@ -529,6 +555,8 @@ public final UnaryCallablecreateDatabaseCalla * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DatabaseName name = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * Database response = databaseAdminClient.getDatabase(name); @@ -552,6 +580,8 @@ public final Database getDatabase(DatabaseName name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String name = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString(); * Database response = databaseAdminClient.getDatabase(name); @@ -574,6 +604,8 @@ public final Database getDatabase(String name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * GetDatabaseRequest request = * GetDatabaseRequest.newBuilder() @@ -597,6 +629,8 @@ public final Database getDatabase(GetDatabaseRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * GetDatabaseRequest request = * GetDatabaseRequest.newBuilder() @@ -625,6 +659,8 @@ public final UnaryCallablegetDatabaseCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * Liststatements = new ArrayList<>(); @@ -659,6 +695,8 @@ public final OperationFuture updateDatabaseDdl * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString(); * Liststatements = new ArrayList<>(); @@ -693,6 +731,8 @@ public final OperationFuture updateDatabaseDdl * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * UpdateDatabaseDdlRequest request = * UpdateDatabaseDdlRequest.newBuilder() @@ -725,6 +765,8 @@ public final OperationFutureupdateDatabaseDdl * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * UpdateDatabaseDdlRequest request = * UpdateDatabaseDdlRequest.newBuilder() @@ -757,6 +799,8 @@ public final OperationFutureupdateDatabaseDdl * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * UpdateDatabaseDdlRequest request = * UpdateDatabaseDdlRequest.newBuilder() @@ -784,6 +828,8 @@ public final UnaryCallableupdateDatabaseDd * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * databaseAdminClient.dropDatabase(database); @@ -810,6 +856,8 @@ public final void dropDatabase(DatabaseName database) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString(); * databaseAdminClient.dropDatabase(database); @@ -833,6 +881,8 @@ public final void dropDatabase(String database) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DropDatabaseRequest request = * DropDatabaseRequest.newBuilder() @@ -858,6 +908,8 @@ public final void dropDatabase(DropDatabaseRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DropDatabaseRequest request = * DropDatabaseRequest.newBuilder() @@ -882,6 +934,8 @@ public final UnaryCallabledropDatabaseCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * GetDatabaseDdlResponse response = databaseAdminClient.getDatabaseDdl(database); @@ -909,6 +963,8 @@ public final GetDatabaseDdlResponse getDatabaseDdl(DatabaseName database) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString(); * GetDatabaseDdlResponse response = databaseAdminClient.getDatabaseDdl(database); @@ -934,6 +990,8 @@ public final GetDatabaseDdlResponse getDatabaseDdl(String database) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * GetDatabaseDdlRequest request = * GetDatabaseDdlRequest.newBuilder() @@ -959,6 +1017,8 @@ public final GetDatabaseDdlResponse getDatabaseDdl(GetDatabaseDdlRequest request *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * GetDatabaseDdlRequest request = * GetDatabaseDdlRequest.newBuilder() @@ -988,6 +1048,8 @@ public final GetDatabaseDdlResponse getDatabaseDdl(GetDatabaseDdlRequest request *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); * Policy policy = Policy.newBuilder().build(); @@ -1023,6 +1085,8 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString(); * Policy policy = Policy.newBuilder().build(); @@ -1055,11 +1119,14 @@ public final Policy setIamPolicy(String resource, Policy policy) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * SetIamPolicyRequest request = * SetIamPolicyRequest.newBuilder() * .setResource(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * Policy response = databaseAdminClient.setIamPolicy(request); * } @@ -1084,11 +1151,14 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * SetIamPolicyRequest request = * SetIamPolicyRequest.newBuilder() * .setResource(BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * ApiFuturefuture = databaseAdminClient.setIamPolicyCallable().futureCall(request); * // Do something. @@ -1113,6 +1183,8 @@ public final UnaryCallable setIamPolicyCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); * Policy response = databaseAdminClient.getIamPolicy(resource); @@ -1144,6 +1216,8 @@ public final Policy getIamPolicy(ResourceName resource) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString(); * Policy response = databaseAdminClient.getIamPolicy(resource); @@ -1172,6 +1246,8 @@ public final Policy getIamPolicy(String resource) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * GetIamPolicyRequest request = * GetIamPolicyRequest.newBuilder() @@ -1202,6 +1278,8 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * GetIamPolicyRequest request = * GetIamPolicyRequest.newBuilder() @@ -1231,6 +1309,8 @@ public final UnaryCallablegetIamPolicyCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ResourceName resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); * Listpermissions = new ArrayList<>(); @@ -1269,6 +1349,8 @@ public final TestIamPermissionsResponse testIamPermissions( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String resource = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString(); * Listpermissions = new ArrayList<>(); @@ -1307,6 +1389,8 @@ public final TestIamPermissionsResponse testIamPermissions( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * TestIamPermissionsRequest request = * TestIamPermissionsRequest.newBuilder() @@ -1337,6 +1421,8 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * TestIamPermissionsRequest request = * TestIamPermissionsRequest.newBuilder() @@ -1371,6 +1457,8 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * Backup backup = Backup.newBuilder().build(); @@ -1416,6 +1504,8 @@ public final OperationFuturecreateBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * Backup backup = Backup.newBuilder().build(); @@ -1461,6 +1551,8 @@ public final OperationFuturecreateBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CreateBackupRequest request = * CreateBackupRequest.newBuilder() @@ -1497,6 +1589,8 @@ public final OperationFuturecreateBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CreateBackupRequest request = * CreateBackupRequest.newBuilder() @@ -1533,6 +1627,8 @@ public final OperationFuturecreateBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CreateBackupRequest request = * CreateBackupRequest.newBuilder() @@ -1567,6 +1663,8 @@ public final UnaryCallablecreateBackupCallable( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * String backupId = "backupId2121930365"; @@ -1620,6 +1718,8 @@ public final OperationFuturecopyBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * String backupId = "backupId2121930365"; @@ -1673,6 +1773,8 @@ public final OperationFuturecopyBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * String backupId = "backupId2121930365"; @@ -1726,6 +1828,8 @@ public final OperationFuturecopyBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * String backupId = "backupId2121930365"; @@ -1779,6 +1883,8 @@ public final OperationFuturecopyBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CopyBackupRequest request = * CopyBackupRequest.newBuilder() @@ -1816,6 +1922,8 @@ public final OperationFuturecopyBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CopyBackupRequest request = * CopyBackupRequest.newBuilder() @@ -1853,6 +1961,8 @@ public final OperationFuturecopyBackupAsync( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * CopyBackupRequest request = * CopyBackupRequest.newBuilder() @@ -1879,6 +1989,8 @@ public final UnaryCallablecopyBackupCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); * Backup response = databaseAdminClient.getBackup(name); @@ -1902,6 +2014,8 @@ public final Backup getBackup(BackupName name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString(); * Backup response = databaseAdminClient.getBackup(name); @@ -1924,6 +2038,8 @@ public final Backup getBackup(String name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * GetBackupRequest request = * GetBackupRequest.newBuilder() @@ -1947,6 +2063,8 @@ public final Backup getBackup(GetBackupRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * GetBackupRequest request = * GetBackupRequest.newBuilder() @@ -1969,6 +2087,8 @@ public final UnaryCallablegetBackupCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * Backup backup = Backup.newBuilder().build(); * FieldMask updateMask = FieldMask.newBuilder().build(); @@ -1998,6 +2118,8 @@ public final Backup updateBackup(Backup backup, FieldMask updateMask) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * UpdateBackupRequest request = * UpdateBackupRequest.newBuilder() @@ -2022,6 +2144,8 @@ public final Backup updateBackup(UpdateBackupRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * UpdateBackupRequest request = * UpdateBackupRequest.newBuilder() @@ -2045,6 +2169,8 @@ public final UnaryCallableupdateBackupCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * BackupName name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]"); * databaseAdminClient.deleteBackup(name); @@ -2068,6 +2194,8 @@ public final void deleteBackup(BackupName name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String name = BackupName.of("[PROJECT]", "[INSTANCE]", "[BACKUP]").toString(); * databaseAdminClient.deleteBackup(name); @@ -2090,6 +2218,8 @@ public final void deleteBackup(String name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DeleteBackupRequest request = * DeleteBackupRequest.newBuilder() @@ -2113,6 +2243,8 @@ public final void deleteBackup(DeleteBackupRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DeleteBackupRequest request = * DeleteBackupRequest.newBuilder() @@ -2136,6 +2268,8 @@ public final UnaryCallabledeleteBackupCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * for (Backup element : databaseAdminClient.listBackups(parent).iterateAll()) { @@ -2164,6 +2298,8 @@ public final ListBackupsPagedResponse listBackups(InstanceName parent) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * for (Backup element : databaseAdminClient.listBackups(parent).iterateAll()) { @@ -2189,6 +2325,8 @@ public final ListBackupsPagedResponse listBackups(String parent) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListBackupsRequest request = * ListBackupsRequest.newBuilder() @@ -2218,6 +2356,8 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListBackupsRequest request = * ListBackupsRequest.newBuilder() @@ -2247,6 +2387,8 @@ public final ListBackupsPagedResponse listBackups(ListBackupsRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListBackupsRequest request = * ListBackupsRequest.newBuilder() @@ -2294,6 +2436,8 @@ public final UnaryCallablelistBackupsC * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * String databaseId = "databaseId1688905718"; @@ -2346,6 +2490,8 @@ public final OperationFuturerestoreDatabaseA * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * String databaseId = "databaseId1688905718"; @@ -2398,6 +2544,8 @@ public final OperationFuturerestoreDatabaseA * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * String databaseId = "databaseId1688905718"; @@ -2450,6 +2598,8 @@ public final OperationFuturerestoreDatabaseA * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * String databaseId = "databaseId1688905718"; @@ -2502,6 +2652,8 @@ public final OperationFuturerestoreDatabaseA * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * RestoreDatabaseRequest request = * RestoreDatabaseRequest.newBuilder() @@ -2541,6 +2693,8 @@ public final OperationFuturerestoreDatabaseA * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * RestoreDatabaseRequest request = * RestoreDatabaseRequest.newBuilder() @@ -2580,6 +2734,8 @@ public final OperationFuturerestoreDatabaseA * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * RestoreDatabaseRequest request = * RestoreDatabaseRequest.newBuilder() @@ -2610,6 +2766,8 @@ public final UnaryCallablerestoreDatabaseCal * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * for (Operation element : databaseAdminClient.listDatabaseOperations(parent).iterateAll()) { @@ -2642,6 +2800,8 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations(Instance *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * for (Operation element : databaseAdminClient.listDatabaseOperations(parent).iterateAll()) { @@ -2672,6 +2832,8 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations(String p *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListDatabaseOperationsRequest request = * ListDatabaseOperationsRequest.newBuilder() @@ -2706,6 +2868,8 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListDatabaseOperationsRequest request = * ListDatabaseOperationsRequest.newBuilder() @@ -2740,6 +2904,8 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListDatabaseOperationsRequest request = * ListDatabaseOperationsRequest.newBuilder() @@ -2783,6 +2949,8 @@ public final ListDatabaseOperationsPagedResponse listDatabaseOperations( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * InstanceName parent = InstanceName.of("[PROJECT]", "[INSTANCE]"); * for (Operation element : databaseAdminClient.listBackupOperations(parent).iterateAll()) { @@ -2817,6 +2985,8 @@ public final ListBackupOperationsPagedResponse listBackupOperations(InstanceName *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * String parent = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * for (Operation element : databaseAdminClient.listBackupOperations(parent).iterateAll()) { @@ -2849,6 +3019,8 @@ public final ListBackupOperationsPagedResponse listBackupOperations(String paren *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListBackupOperationsRequest request = * ListBackupOperationsRequest.newBuilder() @@ -2885,6 +3057,8 @@ public final ListBackupOperationsPagedResponse listBackupOperations( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListBackupOperationsRequest request = * ListBackupOperationsRequest.newBuilder() @@ -2921,6 +3095,8 @@ public final ListBackupOperationsPagedResponse listBackupOperations( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * ListBackupOperationsRequest request = * ListBackupOperationsRequest.newBuilder() diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java index 5d924f60ed6..d0f6aeb24ba 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/DatabaseAdminSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,6 +90,8 @@ *For example, to set the total timeout of getDatabase to 30 seconds: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * DatabaseAdminSettings.Builder databaseAdminSettingsBuilder = DatabaseAdminSettings.newBuilder(); * databaseAdminSettingsBuilder * .getDatabaseSettings() diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java index 42874c08c82..199af03da55 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,8 @@ *Sample for DatabaseAdminClient: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (DatabaseAdminClient databaseAdminClient = DatabaseAdminClient.create()) { * DatabaseName name = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * Database response = databaseAdminClient.getDatabase(name); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java index 5572033a6ae..6b9df8b0e50 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java index 992e5a79d2b..c6cab995b34 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/DatabaseAdminStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,6 +108,8 @@ *For example, to set the total timeout of getDatabase to 30 seconds: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * DatabaseAdminStubSettings.Builder databaseAdminSettingsBuilder = * DatabaseAdminStubSettings.newBuilder(); * databaseAdminSettingsBuilder diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminCallableFactory.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminCallableFactory.java index 172d6b25abb..eaec711af7c 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminCallableFactory.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java index 0df16f344e9..f7f0d8472bf 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/database/v1/stub/GrpcDatabaseAdminStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClient.java index 745c9229431..e122abe48e5 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,6 +85,8 @@ * calls that map to API methods. Sample code to get started: * *{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * InstanceConfigName name = InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]"); * InstanceConfig response = instanceAdminClient.getInstanceConfig(name); @@ -120,6 +122,8 @@ *To customize credentials: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * InstanceAdminSettings instanceAdminSettings = * InstanceAdminSettings.newBuilder() * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) @@ -130,6 +134,8 @@ *To customize the endpoint: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * InstanceAdminSettings instanceAdminSettings = * InstanceAdminSettings.newBuilder().setEndpoint(myEndpoint).build(); * InstanceAdminClient instanceAdminClient = InstanceAdminClient.create(instanceAdminSettings); @@ -208,6 +214,8 @@ public final OperationsClient getOperationsClient() { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * for (InstanceConfig element : instanceAdminClient.listInstanceConfigs(parent).iterateAll()) { @@ -235,6 +243,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(ProjectName pa *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String parent = ProjectName.of("[PROJECT]").toString(); * for (InstanceConfig element : instanceAdminClient.listInstanceConfigs(parent).iterateAll()) { @@ -260,6 +270,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs(String parent) *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ListInstanceConfigsRequest request = * ListInstanceConfigsRequest.newBuilder() @@ -288,6 +300,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ListInstanceConfigsRequest request = * ListInstanceConfigsRequest.newBuilder() @@ -316,6 +330,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ListInstanceConfigsRequest request = * ListInstanceConfigsRequest.newBuilder() @@ -351,6 +367,8 @@ public final ListInstanceConfigsPagedResponse listInstanceConfigs( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * InstanceConfigName name = InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]"); * InstanceConfig response = instanceAdminClient.getInstanceConfig(name); @@ -376,6 +394,8 @@ public final InstanceConfig getInstanceConfig(InstanceConfigName name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String name = InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]").toString(); * InstanceConfig response = instanceAdminClient.getInstanceConfig(name); @@ -398,6 +418,8 @@ public final InstanceConfig getInstanceConfig(String name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * GetInstanceConfigRequest request = * GetInstanceConfigRequest.newBuilder() @@ -421,6 +443,8 @@ public final InstanceConfig getInstanceConfig(GetInstanceConfigRequest request) *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * GetInstanceConfigRequest request = * GetInstanceConfigRequest.newBuilder() @@ -444,6 +468,8 @@ public final UnaryCallablegetInstance * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * for (Instance element : instanceAdminClient.listInstances(parent).iterateAll()) { @@ -471,6 +497,8 @@ public final ListInstancesPagedResponse listInstances(ProjectName parent) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String parent = ProjectName.of("[PROJECT]").toString(); * for (Instance element : instanceAdminClient.listInstances(parent).iterateAll()) { @@ -495,6 +523,8 @@ public final ListInstancesPagedResponse listInstances(String parent) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ListInstancesRequest request = * ListInstancesRequest.newBuilder() @@ -523,6 +553,8 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ListInstancesRequest request = * ListInstancesRequest.newBuilder() @@ -552,6 +584,8 @@ public final ListInstancesPagedResponse listInstances(ListInstancesRequest reque *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ListInstancesRequest request = * ListInstancesRequest.newBuilder() @@ -586,6 +620,8 @@ public final UnaryCallablelistInst * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); * Instance response = instanceAdminClient.getInstance(name); @@ -609,6 +645,8 @@ public final Instance getInstance(InstanceName name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * Instance response = instanceAdminClient.getInstance(name); @@ -631,6 +669,8 @@ public final Instance getInstance(String name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * GetInstanceRequest request = * GetInstanceRequest.newBuilder() @@ -655,6 +695,8 @@ public final Instance getInstance(GetInstanceRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * GetInstanceRequest request = * GetInstanceRequest.newBuilder() @@ -706,6 +748,8 @@ public final UnaryCallablegetInstanceCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ProjectName parent = ProjectName.of("[PROJECT]"); * String instanceId = "instanceId902024336"; @@ -769,6 +813,8 @@ public final OperationFuturecreateInstanceAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String parent = ProjectName.of("[PROJECT]").toString(); * String instanceId = "instanceId902024336"; @@ -832,6 +878,8 @@ public final OperationFuturecreateInstanceAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * CreateInstanceRequest request = * CreateInstanceRequest.newBuilder() @@ -886,6 +934,8 @@ public final OperationFuturecreateInstanceAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * CreateInstanceRequest request = * CreateInstanceRequest.newBuilder() @@ -940,6 +990,8 @@ public final OperationFuturecreateInstanceAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * CreateInstanceRequest request = * CreateInstanceRequest.newBuilder() @@ -997,6 +1049,8 @@ public final UnaryCallablecreateInstanceCalla * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * Instance instance = Instance.newBuilder().build(); * FieldMask fieldMask = FieldMask.newBuilder().build(); @@ -1061,6 +1115,8 @@ public final OperationFutureupdateInstanceAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * UpdateInstanceRequest request = * UpdateInstanceRequest.newBuilder() @@ -1118,6 +1174,8 @@ public final OperationFutureupdateInstanceAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * UpdateInstanceRequest request = * UpdateInstanceRequest.newBuilder() @@ -1175,6 +1233,8 @@ public final OperationFutureupdateInstanceAsy * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * UpdateInstanceRequest request = * UpdateInstanceRequest.newBuilder() @@ -1208,6 +1268,8 @@ public final UnaryCallableupdateInstanceCalla * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * InstanceName name = InstanceName.of("[PROJECT]", "[INSTANCE]"); * instanceAdminClient.deleteInstance(name); @@ -1240,6 +1302,8 @@ public final void deleteInstance(InstanceName name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String name = InstanceName.of("[PROJECT]", "[INSTANCE]").toString(); * instanceAdminClient.deleteInstance(name); @@ -1271,6 +1335,8 @@ public final void deleteInstance(String name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * DeleteInstanceRequest request = * DeleteInstanceRequest.newBuilder() @@ -1303,6 +1369,8 @@ public final void deleteInstance(DeleteInstanceRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * DeleteInstanceRequest request = * DeleteInstanceRequest.newBuilder() @@ -1328,6 +1396,8 @@ public final UnaryCallabledeleteInstanceCallable( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ResourceName resource = ProjectName.of("[PROJECT]"); * Policy policy = Policy.newBuilder().build(); @@ -1361,6 +1431,8 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String resource = ProjectName.of("[PROJECT]").toString(); * Policy policy = Policy.newBuilder().build(); @@ -1391,11 +1463,14 @@ public final Policy setIamPolicy(String resource, Policy policy) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * SetIamPolicyRequest request = * SetIamPolicyRequest.newBuilder() * .setResource(ProjectName.of("[PROJECT]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * Policy response = instanceAdminClient.setIamPolicy(request); * } @@ -1418,11 +1493,14 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * SetIamPolicyRequest request = * SetIamPolicyRequest.newBuilder() * .setResource(ProjectName.of("[PROJECT]").toString()) * .setPolicy(Policy.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) * .build(); * ApiFuturefuture = instanceAdminClient.setIamPolicyCallable().futureCall(request); * // Do something. @@ -1445,6 +1523,8 @@ public final UnaryCallable setIamPolicyCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ResourceName resource = ProjectName.of("[PROJECT]"); * Policy response = instanceAdminClient.getIamPolicy(resource); @@ -1474,6 +1554,8 @@ public final Policy getIamPolicy(ResourceName resource) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String resource = ProjectName.of("[PROJECT]").toString(); * Policy response = instanceAdminClient.getIamPolicy(resource); @@ -1500,6 +1582,8 @@ public final Policy getIamPolicy(String resource) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * GetIamPolicyRequest request = * GetIamPolicyRequest.newBuilder() @@ -1528,6 +1612,8 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * GetIamPolicyRequest request = * GetIamPolicyRequest.newBuilder() @@ -1555,6 +1641,8 @@ public final UnaryCallablegetIamPolicyCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * ResourceName resource = ProjectName.of("[PROJECT]"); * Listpermissions = new ArrayList<>(); @@ -1591,6 +1679,8 @@ public final TestIamPermissionsResponse testIamPermissions( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * String resource = ProjectName.of("[PROJECT]").toString(); * Listpermissions = new ArrayList<>(); @@ -1627,6 +1717,8 @@ public final TestIamPermissionsResponse testIamPermissions( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * TestIamPermissionsRequest request = * TestIamPermissionsRequest.newBuilder() @@ -1655,6 +1747,8 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * TestIamPermissionsRequest request = * TestIamPermissionsRequest.newBuilder() diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminSettings.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminSettings.java index 13cce892bec..dc2c2b81efe 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminSettings.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/InstanceAdminSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,6 +74,8 @@ *For example, to set the total timeout of getInstanceConfig to 30 seconds: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * InstanceAdminSettings.Builder instanceAdminSettingsBuilder = InstanceAdminSettings.newBuilder(); * instanceAdminSettingsBuilder * .getInstanceConfigSettings() diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java index fcc5426dfe3..385739e5c80 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,6 +40,8 @@ *Sample for InstanceAdminClient: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (InstanceAdminClient instanceAdminClient = InstanceAdminClient.create()) { * InstanceConfigName name = InstanceConfigName.of("[PROJECT]", "[INSTANCE_CONFIG]"); * InstanceConfig response = instanceAdminClient.getInstanceConfig(name); diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminCallableFactory.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminCallableFactory.java index 63cb8366206..f4f94054039 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminCallableFactory.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminCallableFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminStub.java index 1f6a7cb6b73..20cd1496cfb 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/GrpcInstanceAdminStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStub.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStub.java index ccd71babf22..dbc187aee61 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStub.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStub.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStubSettings.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStubSettings.java index 9f9cce8660e..a9351322d17 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStubSettings.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/admin/instance/v1/stub/InstanceAdminStubSettings.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -92,6 +92,8 @@ *For example, to set the total timeout of getInstanceConfig to 30 seconds: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * InstanceAdminStubSettings.Builder instanceAdminSettingsBuilder = * InstanceAdminStubSettings.newBuilder(); * instanceAdminSettingsBuilder diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java index f9ea725bb4d..62fc1d38862 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/v1/SpannerClient.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 Google LLC + * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,6 +73,8 @@ * calls that map to API methods. Sample code to get started: * *{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * Session response = spannerClient.createSession(database); @@ -108,6 +110,8 @@ *To customize credentials: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * SpannerSettings spannerSettings = * SpannerSettings.newBuilder() * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) @@ -118,6 +122,8 @@ *To customize the endpoint: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * SpannerSettings spannerSettings = SpannerSettings.newBuilder().setEndpoint(myEndpoint).build(); * SpannerClient spannerClient = SpannerClient.create(spannerSettings); * }@@ -196,6 +202,8 @@ public SpannerStub getStub() { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * Session response = spannerClient.createSession(database); @@ -234,6 +242,8 @@ public final Session createSession(DatabaseName database) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString(); * Session response = spannerClient.createSession(database); @@ -269,6 +279,8 @@ public final Session createSession(String database) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * CreateSessionRequest request = * CreateSessionRequest.newBuilder() @@ -307,6 +319,8 @@ public final Session createSession(CreateSessionRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * CreateSessionRequest request = * CreateSessionRequest.newBuilder() @@ -333,6 +347,8 @@ public final UnaryCallablecreateSessionCallable( * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * int sessionCount = 185691686; @@ -368,6 +384,8 @@ public final BatchCreateSessionsResponse batchCreateSessions( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString(); * int sessionCount = 185691686; @@ -402,6 +420,8 @@ public final BatchCreateSessionsResponse batchCreateSessions(String database, in *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * BatchCreateSessionsRequest request = * BatchCreateSessionsRequest.newBuilder() @@ -430,6 +450,8 @@ public final BatchCreateSessionsResponse batchCreateSessions(BatchCreateSessions *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * BatchCreateSessionsRequest request = * BatchCreateSessionsRequest.newBuilder() @@ -457,6 +479,8 @@ public final BatchCreateSessionsResponse batchCreateSessions(BatchCreateSessions *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * SessionName name = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]"); * Session response = spannerClient.getSession(name); @@ -480,6 +504,8 @@ public final Session getSession(SessionName name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String name = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]").toString(); * Session response = spannerClient.getSession(name); @@ -502,6 +528,8 @@ public final Session getSession(String name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * GetSessionRequest request = * GetSessionRequest.newBuilder() @@ -527,6 +555,8 @@ public final Session getSession(GetSessionRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * GetSessionRequest request = * GetSessionRequest.newBuilder() @@ -550,6 +580,8 @@ public final UnaryCallablegetSessionCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * DatabaseName database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]"); * for (Session element : spannerClient.listSessions(database).iterateAll()) { @@ -576,6 +608,8 @@ public final ListSessionsPagedResponse listSessions(DatabaseName database) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String database = DatabaseName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]").toString(); * for (Session element : spannerClient.listSessions(database).iterateAll()) { @@ -599,6 +633,8 @@ public final ListSessionsPagedResponse listSessions(String database) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ListSessionsRequest request = * ListSessionsRequest.newBuilder() @@ -627,6 +663,8 @@ public final ListSessionsPagedResponse listSessions(ListSessionsRequest request) *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ListSessionsRequest request = * ListSessionsRequest.newBuilder() @@ -655,6 +693,8 @@ public final ListSessionsPagedResponse listSessions(ListSessionsRequest request) *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ListSessionsRequest request = * ListSessionsRequest.newBuilder() @@ -690,6 +730,8 @@ public final UnaryCallablelistSessio * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * SessionName name = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]"); * spannerClient.deleteSession(name); @@ -713,6 +755,8 @@ public final void deleteSession(SessionName name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String name = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]").toString(); * spannerClient.deleteSession(name); @@ -735,6 +779,8 @@ public final void deleteSession(String name) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * DeleteSessionRequest request = * DeleteSessionRequest.newBuilder() @@ -760,6 +806,8 @@ public final void deleteSession(DeleteSessionRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * DeleteSessionRequest request = * DeleteSessionRequest.newBuilder() @@ -792,6 +840,8 @@ public final UnaryCallabledeleteSessionCallable() * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ExecuteSqlRequest request = * ExecuteSqlRequest.newBuilder() @@ -834,6 +884,8 @@ public final ResultSet executeSql(ExecuteSqlRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ExecuteSqlRequest request = * ExecuteSqlRequest.newBuilder() @@ -869,6 +921,8 @@ public final UnaryCallableexecuteSqlCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ExecuteSqlRequest request = * ExecuteSqlRequest.newBuilder() @@ -913,6 +967,8 @@ public final UnaryCallableexecuteSqlCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ExecuteBatchDmlRequest request = * ExecuteBatchDmlRequest.newBuilder() @@ -950,6 +1006,8 @@ public final ExecuteBatchDmlResponse executeBatchDml(ExecuteBatchDmlRequest requ *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ExecuteBatchDmlRequest request = * ExecuteBatchDmlRequest.newBuilder() @@ -989,6 +1047,8 @@ public final ExecuteBatchDmlResponse executeBatchDml(ExecuteBatchDmlRequest requ *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ReadRequest request = * ReadRequest.newBuilder() @@ -1032,6 +1092,8 @@ public final ResultSet read(ReadRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ReadRequest request = * ReadRequest.newBuilder() @@ -1067,6 +1129,8 @@ public final UnaryCallablereadCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * ReadRequest request = * ReadRequest.newBuilder() @@ -1102,6 +1166,8 @@ public final ServerStreamingCallablestreamingRea * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * SessionName session = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]"); * TransactionOptions options = TransactionOptions.newBuilder().build(); @@ -1131,6 +1197,8 @@ public final Transaction beginTransaction(SessionName session, TransactionOption *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String session = * SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]").toString(); @@ -1158,6 +1226,8 @@ public final Transaction beginTransaction(String session, TransactionOptions opt *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * BeginTransactionRequest request = * BeginTransactionRequest.newBuilder() @@ -1186,6 +1256,8 @@ public final Transaction beginTransaction(BeginTransactionRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * BeginTransactionRequest request = * BeginTransactionRequest.newBuilder() @@ -1222,6 +1294,8 @@ public final UnaryCallablebeginTransactio * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * SessionName session = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]"); * ByteString transactionId = ByteString.EMPTY; @@ -1265,6 +1339,8 @@ public final CommitResponse commit( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * SessionName session = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]"); * TransactionOptions singleUseTransaction = TransactionOptions.newBuilder().build(); @@ -1314,6 +1390,8 @@ public final CommitResponse commit( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String session = * SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]").toString(); @@ -1358,6 +1436,8 @@ public final CommitResponse commit( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String session = * SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]").toString(); @@ -1408,6 +1488,8 @@ public final CommitResponse commit( *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * CommitRequest request = * CommitRequest.newBuilder() @@ -1446,6 +1528,8 @@ public final CommitResponse commit(CommitRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * CommitRequest request = * CommitRequest.newBuilder() @@ -1478,6 +1562,8 @@ public final UnaryCallablecommitCallable() { * Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * SessionName session = SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]"); * ByteString transactionId = ByteString.EMPTY; @@ -1511,6 +1597,8 @@ public final void rollback(SessionName session, ByteString transactionId) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * String session = * SessionName.of("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]").toString(); @@ -1542,6 +1630,8 @@ public final void rollback(String session, ByteString transactionId) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * RollbackRequest request = * RollbackRequest.newBuilder() @@ -1573,6 +1663,8 @@ public final void rollback(RollbackRequest request) { *Sample code: * *
{@code + * // This snippet has been automatically generated for illustrative purposes only. + * // It may require modifications to work in your environment. * try (SpannerClient spannerClient = SpannerClient.create()) { * RollbackRequest request = * RollbackRequest.newBuilder() @@ -1606,6 +1698,8 @@ public final UnaryCallable