public void IncrementRule()
        {
            var rule = ReadModifyWriteRules.Increment("cf", "c1", 123);

            Assert.Equal("cf", rule.FamilyName);
            Assert.Equal("c1", rule.ColumnQualifier.ToStringUtf8());
            Assert.Equal(123, rule.IncrementAmount);
        }
        public void AppendRule()
        {
            var rule = ReadModifyWriteRules.Append("cf", "c1", "abc");

            Assert.Equal("cf", rule.FamilyName);
            Assert.Equal("c1", rule.ColumnQualifier.ToStringUtf8());
            Assert.Equal("abc", rule.AppendValue.ToStringUtf8());
        }
        /// <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}");
        }
 public void IncrementRule_Validations(string familyName)
 {
     Assert.Throws <ArgumentException>(
         () => ReadModifyWriteRules.Increment(familyName, "c1", 123));
 }
 public void AppendRule_Validations(string familyName)
 {
     Assert.Throws <ArgumentException>(
         () => ReadModifyWriteRules.Append(familyName, "c1", "abc"));
 }