All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentProperties Maven / Gradle / Ivy

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

package com.azure.resourcemanager.security.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * describes the custom entity store assignment properties.
 */
@Fluent
public final class CustomEntityStoreAssignmentProperties
    implements JsonSerializable {
    /*
     * The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]
     */
    private String principal;

    /*
     * The link to entity store database.
     */
    private String entityStoreDatabaseLink;

    /**
     * Creates an instance of CustomEntityStoreAssignmentProperties class.
     */
    public CustomEntityStoreAssignmentProperties() {
    }

    /**
     * Get the principal property: The principal assigned with entity store. Format of principal is: [AAD
     * type]=[PrincipalObjectId];[TenantId].
     * 
     * @return the principal value.
     */
    public String principal() {
        return this.principal;
    }

    /**
     * Set the principal property: The principal assigned with entity store. Format of principal is: [AAD
     * type]=[PrincipalObjectId];[TenantId].
     * 
     * @param principal the principal value to set.
     * @return the CustomEntityStoreAssignmentProperties object itself.
     */
    public CustomEntityStoreAssignmentProperties withPrincipal(String principal) {
        this.principal = principal;
        return this;
    }

    /**
     * Get the entityStoreDatabaseLink property: The link to entity store database.
     * 
     * @return the entityStoreDatabaseLink value.
     */
    public String entityStoreDatabaseLink() {
        return this.entityStoreDatabaseLink;
    }

    /**
     * Set the entityStoreDatabaseLink property: The link to entity store database.
     * 
     * @param entityStoreDatabaseLink the entityStoreDatabaseLink value to set.
     * @return the CustomEntityStoreAssignmentProperties object itself.
     */
    public CustomEntityStoreAssignmentProperties withEntityStoreDatabaseLink(String entityStoreDatabaseLink) {
        this.entityStoreDatabaseLink = entityStoreDatabaseLink;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("principal", this.principal);
        jsonWriter.writeStringField("entityStoreDatabaseLink", this.entityStoreDatabaseLink);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of CustomEntityStoreAssignmentProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of CustomEntityStoreAssignmentProperties if the JsonReader was pointing to an instance of it,
     * or null if it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the CustomEntityStoreAssignmentProperties.
     */
    public static CustomEntityStoreAssignmentProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            CustomEntityStoreAssignmentProperties deserializedCustomEntityStoreAssignmentProperties
                = new CustomEntityStoreAssignmentProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("principal".equals(fieldName)) {
                    deserializedCustomEntityStoreAssignmentProperties.principal = reader.getString();
                } else if ("entityStoreDatabaseLink".equals(fieldName)) {
                    deserializedCustomEntityStoreAssignmentProperties.entityStoreDatabaseLink = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedCustomEntityStoreAssignmentProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy