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

package com.azure.resourcemanager.storage.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.storage.fluent.models.ImmutabilityPolicyInner;

/** Samples for BlobContainers CreateOrUpdateImmutabilityPolicy. */
public final class BlobContainersCreateOrUpdateImmutabilityPolicySamples {
    /*
     * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-09-01/examples/BlobContainersPutImmutabilityPolicy.json
     */
    /**
     * Sample code: CreateOrUpdateImmutabilityPolicy.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void createOrUpdateImmutabilityPolicy(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .storageAccounts()
            .manager()
            .serviceClient()
            .getBlobContainers()
            .createOrUpdateImmutabilityPolicyWithResponse(
                "res1782",
                "sto7069",
                "container6397",
                null,
                new ImmutabilityPolicyInner()
                    .withImmutabilityPeriodSinceCreationInDays(3)
                    .withAllowProtectedAppendWrites(true),
                Context.NONE);
    }

    /*
     * x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2022-09-01/examples/BlobContainersPutImmutabilityPolicyAllowProtectedAppendWritesAll.json
     */
    /**
     * Sample code: CreateOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void createOrUpdateImmutabilityPolicyWithAllowProtectedAppendWritesAll(
        com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .storageAccounts()
            .manager()
            .serviceClient()
            .getBlobContainers()
            .createOrUpdateImmutabilityPolicyWithResponse(
                "res1782",
                "sto7069",
                "container6397",
                null,
                new ImmutabilityPolicyInner()
                    .withImmutabilityPeriodSinceCreationInDays(3)
                    .withAllowProtectedAppendWritesAll(true),
                Context.NONE);
    }
}
