// 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.CardinalityTypes;
import com.azure.resourcemanager.customerinsights.models.PropertyDefinition;
import com.azure.resourcemanager.customerinsights.models.ProvisioningStates;
import com.azure.resourcemanager.customerinsights.models.RelationshipTypeMapping;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/** The relationship resource format. */
@Fluent
public final class RelationshipResourceFormatInner extends ProxyResource {
    /*
     * The definition of Relationship.
     */
    @JsonProperty(value = "properties")
    private RelationshipDefinition innerProperties;

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

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

    /**
     * Get the cardinality property: The Relationship Cardinality.
     *
     * @return the cardinality value.
     */
    public CardinalityTypes cardinality() {
        return this.innerProperties() == null ? null : this.innerProperties().cardinality();
    }

    /**
     * Set the cardinality property: The Relationship Cardinality.
     *
     * @param cardinality the cardinality value to set.
     * @return the RelationshipResourceFormatInner object itself.
     */
    public RelationshipResourceFormatInner withCardinality(CardinalityTypes cardinality) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RelationshipDefinition();
        }
        this.innerProperties().withCardinality(cardinality);
        return this;
    }

    /**
     * Get the displayName property: Localized display name for the Relationship.
     *
     * @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 Relationship.
     *
     * @param displayName the displayName value to set.
     * @return the RelationshipResourceFormatInner object itself.
     */
    public RelationshipResourceFormatInner withDisplayName(Map<String, String> displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RelationshipDefinition();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the description property: Localized descriptions for the Relationship.
     *
     * @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 Relationship.
     *
     * @param description the description value to set.
     * @return the RelationshipResourceFormatInner object itself.
     */
    public RelationshipResourceFormatInner withDescription(Map<String, String> description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RelationshipDefinition();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the expiryDateTimeUtc property: The expiry date time in UTC.
     *
     * @return the expiryDateTimeUtc value.
     */
    public OffsetDateTime expiryDateTimeUtc() {
        return this.innerProperties() == null ? null : this.innerProperties().expiryDateTimeUtc();
    }

    /**
     * Set the expiryDateTimeUtc property: The expiry date time in UTC.
     *
     * @param expiryDateTimeUtc the expiryDateTimeUtc value to set.
     * @return the RelationshipResourceFormatInner object itself.
     */
    public RelationshipResourceFormatInner withExpiryDateTimeUtc(OffsetDateTime expiryDateTimeUtc) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RelationshipDefinition();
        }
        this.innerProperties().withExpiryDateTimeUtc(expiryDateTimeUtc);
        return this;
    }

    /**
     * Get the fields property: The properties of the Relationship.
     *
     * @return the fields value.
     */
    public List<PropertyDefinition> fields() {
        return this.innerProperties() == null ? null : this.innerProperties().fields();
    }

    /**
     * Set the fields property: The properties of the Relationship.
     *
     * @param fields the fields value to set.
     * @return the RelationshipResourceFormatInner object itself.
     */
    public RelationshipResourceFormatInner withFields(List<PropertyDefinition> fields) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RelationshipDefinition();
        }
        this.innerProperties().withFields(fields);
        return this;
    }

    /**
     * Get the lookupMappings property: Optional property to be used to map fields in profile to their strong ids in
     * related profile.
     *
     * @return the lookupMappings value.
     */
    public List<RelationshipTypeMapping> lookupMappings() {
        return this.innerProperties() == null ? null : this.innerProperties().lookupMappings();
    }

    /**
     * Set the lookupMappings property: Optional property to be used to map fields in profile to their strong ids in
     * related profile.
     *
     * @param lookupMappings the lookupMappings value to set.
     * @return the RelationshipResourceFormatInner object itself.
     */
    public RelationshipResourceFormatInner withLookupMappings(List<RelationshipTypeMapping> lookupMappings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RelationshipDefinition();
        }
        this.innerProperties().withLookupMappings(lookupMappings);
        return this;
    }

    /**
     * Get the profileType property: Profile type.
     *
     * @return the profileType value.
     */
    public String profileType() {
        return this.innerProperties() == null ? null : this.innerProperties().profileType();
    }

    /**
     * Set the profileType property: Profile type.
     *
     * @param profileType the profileType value to set.
     * @return the RelationshipResourceFormatInner object itself.
     */
    public RelationshipResourceFormatInner withProfileType(String profileType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RelationshipDefinition();
        }
        this.innerProperties().withProfileType(profileType);
        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 relationshipName property: The Relationship name.
     *
     * @return the relationshipName value.
     */
    public String relationshipName() {
        return this.innerProperties() == null ? null : this.innerProperties().relationshipName();
    }

    /**
     * Get the relatedProfileType property: Related profile being referenced.
     *
     * @return the relatedProfileType value.
     */
    public String relatedProfileType() {
        return this.innerProperties() == null ? null : this.innerProperties().relatedProfileType();
    }

    /**
     * Set the relatedProfileType property: Related profile being referenced.
     *
     * @param relatedProfileType the relatedProfileType value to set.
     * @return the RelationshipResourceFormatInner object itself.
     */
    public RelationshipResourceFormatInner withRelatedProfileType(String relatedProfileType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RelationshipDefinition();
        }
        this.innerProperties().withRelatedProfileType(relatedProfileType);
        return this;
    }

    /**
     * Get the relationshipGuidId property: The relationship guid id.
     *
     * @return the relationshipGuidId value.
     */
    public String relationshipGuidId() {
        return this.innerProperties() == null ? null : this.innerProperties().relationshipGuidId();
    }

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

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