// 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.PropertyDefinition;
import com.azure.resourcemanager.customerinsights.models.StrongId;
import java.util.Arrays;

/** Samples for Profiles CreateOrUpdate. */
public final class ProfilesCreateOrUpdateSamples {
    /*
     * x-ms-original-file: specification/customer-insights/resource-manager/Microsoft.CustomerInsights/stable/2017-04-26/examples/ProfilesCreateOrUpdate.json
     */
    /**
     * Sample code: Profiles_CreateOrUpdate.
     *
     * @param manager Entry point to CustomerInsightsManager.
     */
    public static void profilesCreateOrUpdate(
        com.azure.resourcemanager.customerinsights.CustomerInsightsManager manager) {
        manager
            .profiles()
            .define("TestProfileType396")
            .withExistingHub("TestHubRG", "sdkTestHub")
            .withStrongIds(
                Arrays
                    .asList(
                        new StrongId()
                            .withKeyPropertyNames(Arrays.asList("Id", "SavingAccountBalance"))
                            .withStrongIdName("Id"),
                        new StrongId()
                            .withKeyPropertyNames(Arrays.asList("ProfileId", "LastName"))
                            .withStrongIdName("ProfileId")))
            .withApiEntitySetName("TestProfileType396")
            .withFields(
                Arrays
                    .asList(
                        new PropertyDefinition()
                            .withFieldName("Id")
                            .withFieldType("Edm.String")
                            .withIsArray(false)
                            .withIsRequired(true),
                        new PropertyDefinition()
                            .withFieldName("ProfileId")
                            .withFieldType("Edm.String")
                            .withIsArray(false)
                            .withIsRequired(true),
                        new PropertyDefinition()
                            .withFieldName("LastName")
                            .withFieldType("Edm.String")
                            .withIsArray(false)
                            .withIsRequired(true),
                        new PropertyDefinition()
                            .withFieldName("TestProfileType396")
                            .withFieldType("Edm.String")
                            .withIsArray(false)
                            .withIsRequired(true),
                        new PropertyDefinition()
                            .withFieldName("SavingAccountBalance")
                            .withFieldType("Edm.Int32")
                            .withIsArray(false)
                            .withIsRequired(true)))
            .withSchemaItemTypeLink("SchemaItemTypeLink")
            .withSmallImage("\\\\Images\\\\smallImage")
            .withMediumImage("\\\\Images\\\\MediumImage")
            .withLargeImage("\\\\Images\\\\LargeImage")
            .create();
    }
}
