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

package com.azure.resourcemanager.containerregistry.generated;

import com.azure.resourcemanager.containerregistry.models.Architecture;
import com.azure.resourcemanager.containerregistry.models.Credentials;
import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest;
import com.azure.resourcemanager.containerregistry.models.OS;
import com.azure.resourcemanager.containerregistry.models.PlatformProperties;
import com.azure.resourcemanager.containerregistry.models.TaskRunUpdateParameters;
import java.util.Arrays;

/** Samples for TaskRuns Update. */
public final class TaskRunsUpdateSamples {
    /*
     * x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2019-06-01-preview/examples/TaskRunsUpdate.json
     */
    /**
     * Sample code: TaskRuns_Update.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void taskRunsUpdate(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .containerRegistries()
            .manager()
            .serviceClient()
            .getTaskRuns()
            .update(
                "myResourceGroup",
                "myRegistry",
                "myRun",
                new TaskRunUpdateParameters()
                    .withRunRequest(
                        new EncodedTaskRunRequest()
                            .withIsArchiveEnabled(true)
                            .withEncodedTaskContent("fakeTokenPlaceholder")
                            .withEncodedValuesContent("fakeTokenPlaceholder")
                            .withValues(Arrays.asList())
                            .withPlatform(
                                new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64))
                            .withCredentials(new Credentials()))
                    .withForceUpdateTag("test"),
                com.azure.core.util.Context.NONE);
    }
}
