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

package com.azure.resourcemanager.logic.generated;

import com.azure.resourcemanager.logic.models.KeyVaultKeyReference;
import com.azure.resourcemanager.logic.models.KeyVaultKeyReferenceKeyVault;

/** Samples for IntegrationAccountCertificates CreateOrUpdate. */
public final class IntegrationAccountCertificatesCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/logic/resource-manager/Microsoft.Logic/stable/2019-05-01/examples/IntegrationAccountCertificates_CreateOrUpdate.json
     */
    /**
     * Sample code: Create or update a certificate.
     *
     * @param manager Entry point to LogicManager.
     */
    public static void createOrUpdateACertificate(com.azure.resourcemanager.logic.LogicManager manager) {
        manager
            .integrationAccountCertificates()
            .define("testCertificate")
            .withRegion("brazilsouth")
            .withExistingIntegrationAccount("testResourceGroup", "testIntegrationAccount")
            .withKey(
                new KeyVaultKeyReference()
                    .withKeyVault(
                        new KeyVaultKeyReferenceKeyVault()
                            .withId(
                                "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourcegroups/testResourceGroup/providers/microsoft.keyvault/vaults/<keyVaultName>"))
                    .withKeyName("fakeTokenPlaceholder")
                    .withKeyVersion("fakeTokenPlaceholder"))
            .withPublicCertificate("<publicCertificateValue>")
            .create();
    }
}
