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

package com.azure.resourcemanager.customerinsights.generated;

import com.azure.resourcemanager.customerinsights.models.AssignmentPrincipal;
import com.azure.resourcemanager.customerinsights.models.RoleTypes;
import java.util.Arrays;

/** Samples for RoleAssignments CreateOrUpdate. */
public final class RoleAssignmentsCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/customer-insights/resource-manager/Microsoft.CustomerInsights/stable/2017-04-26/examples/RoleAssignmentsCreateOrUpdate.json
     */
    /**
     * Sample code: RoleAssignments_CreateOrUpdate.
     *
     * @param manager Entry point to CustomerInsightsManager.
     */
    public static void roleAssignmentsCreateOrUpdate(
        com.azure.resourcemanager.customerinsights.CustomerInsightsManager manager) {
        manager
            .roleAssignments()
            .define("assignmentName8976")
            .withExistingHub("TestHubRG", "sdkTestHub")
            .withRole(RoleTypes.ADMIN)
            .withPrincipals(
                Arrays
                    .asList(
                        new AssignmentPrincipal()
                            .withPrincipalId("4c54c38ffa9b416ba5a6d6c8a20cbe7e")
                            .withPrincipalType("User"),
                        new AssignmentPrincipal()
                            .withPrincipalId("93061d15a5054f2b9948ae25724cf9d5")
                            .withPrincipalType("User")))
            .create();
    }
}
