public void ReadModifyWriteRow() { // Snippet: ReadModifyWriteRow(string,ByteString,IEnumerable<ReadModifyWriteRule>,CallSettings) // Create client BigtableClient bigtableClient = BigtableClient.Create(); // Initialize request argument(s) string formattedTableName = new TableName("[PROJECT]", "[INSTANCE]", "[TABLE]").ToString(); ByteString rowKey = ByteString.CopyFromUtf8(""); IEnumerable <ReadModifyWriteRule> rules = new List <ReadModifyWriteRule>(); // Make the request ReadModifyWriteRowResponse response = bigtableClient.ReadModifyWriteRow(formattedTableName, rowKey, rules); // End snippet }
/// <summary>Snippet for ReadModifyWriteRow</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void ReadModifyWriteRow1ResourceNames() { // Create client BigtableClient bigtableClient = BigtableClient.Create(); // Initialize request argument(s) TableName tableName = TableName.FromProjectInstanceTable("[PROJECT]", "[INSTANCE]", "[TABLE]"); ByteString rowKey = ByteString.Empty; IEnumerable <ReadModifyWriteRule> rules = new ReadModifyWriteRule[] { new ReadModifyWriteRule(), }; // Make the request ReadModifyWriteRowResponse response = bigtableClient.ReadModifyWriteRow(tableName, rowKey, rules); }
/// <summary>Snippet for ReadModifyWriteRow</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void ReadModifyWriteRow1() { // Create client BigtableClient bigtableClient = BigtableClient.Create(); // Initialize request argument(s) string tableName = "projects/[PROJECT]/instances/[INSTANCE]/tables/[TABLE]"; ByteString rowKey = ByteString.Empty; IEnumerable <ReadModifyWriteRule> rules = new ReadModifyWriteRule[] { new ReadModifyWriteRule(), }; // Make the request ReadModifyWriteRowResponse response = bigtableClient.ReadModifyWriteRow(tableName, rowKey, rules); }
public void ReadModifyWriteRow_RequestObject() { // Snippet: ReadModifyWriteRow(ReadModifyWriteRowRequest,CallSettings) // Create client BigtableClient bigtableClient = BigtableClient.Create(); // Initialize request argument(s) ReadModifyWriteRowRequest request = new ReadModifyWriteRowRequest { TableName = new TableName("[PROJECT]", "[INSTANCE]", "[TABLE]").ToString(), RowKey = ByteString.CopyFromUtf8(""), Rules = { }, }; // Make the request ReadModifyWriteRowResponse response = bigtableClient.ReadModifyWriteRow(request); // End snippet }
/// <summary>Snippet for ReadModifyWriteRow</summary> public void ReadModifyWriteRow2ResourceNames() { // Snippet: ReadModifyWriteRow(TableName, ByteString, IEnumerable<ReadModifyWriteRule>, string, CallSettings) // Create client BigtableClient bigtableClient = BigtableClient.Create(); // Initialize request argument(s) TableName tableName = TableName.FromProjectInstanceTable("[PROJECT]", "[INSTANCE]", "[TABLE]"); ByteString rowKey = ByteString.Empty; IEnumerable <ReadModifyWriteRule> rules = new ReadModifyWriteRule[] { new ReadModifyWriteRule(), }; string appProfileId = ""; // Make the request ReadModifyWriteRowResponse response = bigtableClient.ReadModifyWriteRow(tableName, rowKey, rules, appProfileId); // End snippet }
/// <summary>Snippet for ReadModifyWriteRow</summary> public void ReadModifyWriteRow2() { // Snippet: ReadModifyWriteRow(string, ByteString, IEnumerable<ReadModifyWriteRule>, string, CallSettings) // Create client BigtableClient bigtableClient = BigtableClient.Create(); // Initialize request argument(s) string tableName = "projects/[PROJECT]/instances/[INSTANCE]/tables/[TABLE]"; ByteString rowKey = ByteString.Empty; IEnumerable <ReadModifyWriteRule> rules = new ReadModifyWriteRule[] { new ReadModifyWriteRule(), }; string appProfileId = ""; // Make the request ReadModifyWriteRowResponse response = bigtableClient.ReadModifyWriteRow(tableName, rowKey, rules, appProfileId); // End snippet }
/// <summary>Snippet for ReadModifyWriteRow</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void ReadModifyWriteRowRequestObject() { // Create client BigtableClient bigtableClient = BigtableClient.Create(); // Initialize request argument(s) ReadModifyWriteRowRequest request = new ReadModifyWriteRowRequest { TableNameAsTableName = TableName.FromProjectInstanceTable("[PROJECT]", "[INSTANCE]", "[TABLE]"), RowKey = ByteString.Empty, Rules = { new ReadModifyWriteRule(), }, AppProfileId = "", }; // Make the request ReadModifyWriteRowResponse response = bigtableClient.ReadModifyWriteRow(request); }
/// <summary> /// Increments a cell value in a row with an existing value at that cell. ///</summary> /// <param name="projectId">Your Google Cloud Project ID.</param> /// <param name="instanceId">Your Google Cloud Bigtable Instance ID.</param> /// <param name="tableId">Your Google Cloud Bigtable table ID.</param> public string writeIncrement( string projectId = "YOUR-PROJECT-ID", string instanceId = "YOUR-INSTANCE-ID", string tableId = "YOUR-TABLE-ID") { BigtableClient bigtableClient = BigtableClient.Create(); TableName tableName = new TableName(projectId, instanceId, tableId); BigtableByteString rowkey = new BigtableByteString("phone#4c410523#20190501"); String COLUMN_FAMILY = "stats_summary"; // Increment the value of stats_summary:connected_wifi by -1 (change 1 to 0 to show it's disconnected) ReadModifyWriteRowResponse readModifyWriteRowResponse = bigtableClient.ReadModifyWriteRow( tableName, rowkey, ReadModifyWriteRules.Increment(COLUMN_FAMILY, "connected_wifi", -1)); return($"Successfully updated row {readModifyWriteRowResponse.Row.Key}"); }