// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.customerinsights.models.EntityType;
import com.azure.resourcemanager.customerinsights.models.InstanceOperationType;
import com.azure.resourcemanager.customerinsights.models.ParticipantPropertyReference;
import com.azure.resourcemanager.customerinsights.models.ProvisioningStates;
import com.azure.resourcemanager.customerinsights.models.TypePropertiesMapping;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The link resource format. */
@Fluent
public final class LinkResourceFormatInner extends ProxyResource {
    /*
     * The definition of Link.
     */
    @JsonProperty(value = "properties")
    private LinkDefinition innerProperties;

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

    /**
     * Get the innerProperties property: The definition of Link.
     *
     * @return the innerProperties value.
     */
    private LinkDefinition innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tenantId property: The hub name.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Get the linkName property: The link name.
     *
     * @return the linkName value.
     */
    public String linkName() {
        return this.innerProperties() == null ? null : this.innerProperties().linkName();
    }

    /**
     * Get the sourceEntityType property: Type of source entity.
     *
     * @return the sourceEntityType value.
     */
    public EntityType sourceEntityType() {
        return this.innerProperties() == null ? null : this.innerProperties().sourceEntityType();
    }

    /**
     * Set the sourceEntityType property: Type of source entity.
     *
     * @param sourceEntityType the sourceEntityType value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withSourceEntityType(EntityType sourceEntityType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withSourceEntityType(sourceEntityType);
        return this;
    }

    /**
     * Get the targetEntityType property: Type of target entity.
     *
     * @return the targetEntityType value.
     */
    public EntityType targetEntityType() {
        return this.innerProperties() == null ? null : this.innerProperties().targetEntityType();
    }

    /**
     * Set the targetEntityType property: Type of target entity.
     *
     * @param targetEntityType the targetEntityType value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withTargetEntityType(EntityType targetEntityType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withTargetEntityType(targetEntityType);
        return this;
    }

    /**
     * Get the sourceEntityTypeName property: Name of the source Entity Type.
     *
     * @return the sourceEntityTypeName value.
     */
    public String sourceEntityTypeName() {
        return this.innerProperties() == null ? null : this.innerProperties().sourceEntityTypeName();
    }

    /**
     * Set the sourceEntityTypeName property: Name of the source Entity Type.
     *
     * @param sourceEntityTypeName the sourceEntityTypeName value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withSourceEntityTypeName(String sourceEntityTypeName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withSourceEntityTypeName(sourceEntityTypeName);
        return this;
    }

    /**
     * Get the targetEntityTypeName property: Name of the target Entity Type.
     *
     * @return the targetEntityTypeName value.
     */
    public String targetEntityTypeName() {
        return this.innerProperties() == null ? null : this.innerProperties().targetEntityTypeName();
    }

    /**
     * Set the targetEntityTypeName property: Name of the target Entity Type.
     *
     * @param targetEntityTypeName the targetEntityTypeName value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withTargetEntityTypeName(String targetEntityTypeName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withTargetEntityTypeName(targetEntityTypeName);
        return this;
    }

    /**
     * Get the displayName property: Localized display name for the Link.
     *
     * @return the displayName value.
     */
    public Map<String, String> displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: Localized display name for the Link.
     *
     * @param displayName the displayName value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withDisplayName(Map<String, String> displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the description property: Localized descriptions for the Link.
     *
     * @return the description value.
     */
    public Map<String, String> description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Localized descriptions for the Link.
     *
     * @param description the description value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withDescription(Map<String, String> description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the mappings property: The set of properties mappings between the source and target Types.
     *
     * @return the mappings value.
     */
    public List<TypePropertiesMapping> mappings() {
        return this.innerProperties() == null ? null : this.innerProperties().mappings();
    }

    /**
     * Set the mappings property: The set of properties mappings between the source and target Types.
     *
     * @param mappings the mappings value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withMappings(List<TypePropertiesMapping> mappings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withMappings(mappings);
        return this;
    }

    /**
     * Get the participantPropertyReferences property: The properties that represent the participating profile.
     *
     * @return the participantPropertyReferences value.
     */
    public List<ParticipantPropertyReference> participantPropertyReferences() {
        return this.innerProperties() == null ? null : this.innerProperties().participantPropertyReferences();
    }

    /**
     * Set the participantPropertyReferences property: The properties that represent the participating profile.
     *
     * @param participantPropertyReferences the participantPropertyReferences value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withParticipantPropertyReferences(
        List<ParticipantPropertyReference> participantPropertyReferences) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withParticipantPropertyReferences(participantPropertyReferences);
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning state.
     *
     * @return the provisioningState value.
     */
    public ProvisioningStates provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the referenceOnly property: Indicating whether the link is reference only link. This flag is ignored if the
     * Mappings are defined. If the mappings are not defined and it is set to true, links processing will not create or
     * update profiles.
     *
     * @return the referenceOnly value.
     */
    public Boolean referenceOnly() {
        return this.innerProperties() == null ? null : this.innerProperties().referenceOnly();
    }

    /**
     * Set the referenceOnly property: Indicating whether the link is reference only link. This flag is ignored if the
     * Mappings are defined. If the mappings are not defined and it is set to true, links processing will not create or
     * update profiles.
     *
     * @param referenceOnly the referenceOnly value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withReferenceOnly(Boolean referenceOnly) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withReferenceOnly(referenceOnly);
        return this;
    }

    /**
     * Get the operationType property: Determines whether this link is supposed to create or delete instances if Link is
     * NOT Reference Only.
     *
     * @return the operationType value.
     */
    public InstanceOperationType operationType() {
        return this.innerProperties() == null ? null : this.innerProperties().operationType();
    }

    /**
     * Set the operationType property: Determines whether this link is supposed to create or delete instances if Link is
     * NOT Reference Only.
     *
     * @param operationType the operationType value to set.
     * @return the LinkResourceFormatInner object itself.
     */
    public LinkResourceFormatInner withOperationType(InstanceOperationType operationType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LinkDefinition();
        }
        this.innerProperties().withOperationType(operationType);
        return this;
    }

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