// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.loganalytics.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.loganalytics.models.Column;
import com.azure.resourcemanager.loganalytics.models.ColumnTypeEnum;
import com.azure.resourcemanager.loganalytics.models.Schema;
import com.azure.resourcemanager.loganalytics.models.Table;
import java.util.Arrays;

/** Samples for Tables Update. */
public final class TablesUpdateSamples {
    /*
     * x-ms-original-file: specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesUpsert.json
     */
    /**
     * Sample code: TablesUpsert.
     *
     * @param manager Entry point to LogAnalyticsManager.
     */
    public static void tablesUpsert(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) {
        Table resource =
            manager
                .tables()
                .getWithResponse("oiautorest6685", "oiautorest6685", "AzureNetworkFlow", Context.NONE)
                .getValue();
        resource
            .update()
            .withRetentionInDays(45)
            .withTotalRetentionInDays(70)
            .withSchema(
                new Schema()
                    .withName("AzureNetworkFlow")
                    .withColumns(Arrays.asList(new Column().withName("MyNewColumn").withType(ColumnTypeEnum.GUID))))
            .apply();
    }
}
