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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Relation property bag. */
@Fluent
public final class RelationProperties {
    /*
     * The resource ID of the related resource
     */
    @JsonProperty(value = "relatedResourceId", required = true)
    private String relatedResourceId;

    /*
     * The name of the related resource
     */
    @JsonProperty(value = "relatedResourceName", access = JsonProperty.Access.WRITE_ONLY)
    private String relatedResourceName;

    /*
     * The resource type of the related resource
     */
    @JsonProperty(value = "relatedResourceType", access = JsonProperty.Access.WRITE_ONLY)
    private String relatedResourceType;

    /*
     * The resource kind of the related resource
     */
    @JsonProperty(value = "relatedResourceKind", access = JsonProperty.Access.WRITE_ONLY)
    private String relatedResourceKind;

    /**
     * Get the relatedResourceId property: The resource ID of the related resource.
     *
     * @return the relatedResourceId value.
     */
    public String relatedResourceId() {
        return this.relatedResourceId;
    }

    /**
     * Set the relatedResourceId property: The resource ID of the related resource.
     *
     * @param relatedResourceId the relatedResourceId value to set.
     * @return the RelationProperties object itself.
     */
    public RelationProperties withRelatedResourceId(String relatedResourceId) {
        this.relatedResourceId = relatedResourceId;
        return this;
    }

    /**
     * Get the relatedResourceName property: The name of the related resource.
     *
     * @return the relatedResourceName value.
     */
    public String relatedResourceName() {
        return this.relatedResourceName;
    }

    /**
     * Get the relatedResourceType property: The resource type of the related resource.
     *
     * @return the relatedResourceType value.
     */
    public String relatedResourceType() {
        return this.relatedResourceType;
    }

    /**
     * Get the relatedResourceKind property: The resource kind of the related resource.
     *
     * @return the relatedResourceKind value.
     */
    public String relatedResourceKind() {
        return this.relatedResourceKind;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (relatedResourceId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property relatedResourceId in model RelationProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(RelationProperties.class);
}
