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

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.machinelearning.fluent.models.SharedPrivateLinkResourceProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The SharedPrivateLinkResource model. */
@Fluent
public final class SharedPrivateLinkResource {
    /*
     * Unique name of the private link.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Resource properties.
     */
    @JsonProperty(value = "properties")
    private SharedPrivateLinkResourceProperty innerProperties;

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

    /**
     * Get the name property: Unique name of the private link.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Unique name of the private link.
     *
     * @param name the name value to set.
     * @return the SharedPrivateLinkResource object itself.
     */
    public SharedPrivateLinkResource withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the innerProperties property: Resource properties.
     *
     * @return the innerProperties value.
     */
    private SharedPrivateLinkResourceProperty innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the privateLinkResourceId property: The resource id that private link links to.
     *
     * @return the privateLinkResourceId value.
     */
    public String privateLinkResourceId() {
        return this.innerProperties() == null ? null : this.innerProperties().privateLinkResourceId();
    }

    /**
     * Set the privateLinkResourceId property: The resource id that private link links to.
     *
     * @param privateLinkResourceId the privateLinkResourceId value to set.
     * @return the SharedPrivateLinkResource object itself.
     */
    public SharedPrivateLinkResource withPrivateLinkResourceId(String privateLinkResourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SharedPrivateLinkResourceProperty();
        }
        this.innerProperties().withPrivateLinkResourceId(privateLinkResourceId);
        return this;
    }

    /**
     * Get the groupId property: The private link resource group id.
     *
     * @return the groupId value.
     */
    public String groupId() {
        return this.innerProperties() == null ? null : this.innerProperties().groupId();
    }

    /**
     * Set the groupId property: The private link resource group id.
     *
     * @param groupId the groupId value to set.
     * @return the SharedPrivateLinkResource object itself.
     */
    public SharedPrivateLinkResource withGroupId(String groupId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SharedPrivateLinkResourceProperty();
        }
        this.innerProperties().withGroupId(groupId);
        return this;
    }

    /**
     * Get the requestMessage property: Request message.
     *
     * @return the requestMessage value.
     */
    public String requestMessage() {
        return this.innerProperties() == null ? null : this.innerProperties().requestMessage();
    }

    /**
     * Set the requestMessage property: Request message.
     *
     * @param requestMessage the requestMessage value to set.
     * @return the SharedPrivateLinkResource object itself.
     */
    public SharedPrivateLinkResource withRequestMessage(String requestMessage) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SharedPrivateLinkResourceProperty();
        }
        this.innerProperties().withRequestMessage(requestMessage);
        return this;
    }

    /**
     * Get the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the
     * service.
     *
     * @return the status value.
     */
    public PrivateEndpointServiceConnectionStatus status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Set the status property: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the
     * service.
     *
     * @param status the status value to set.
     * @return the SharedPrivateLinkResource object itself.
     */
    public SharedPrivateLinkResource withStatus(PrivateEndpointServiceConnectionStatus status) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SharedPrivateLinkResourceProperty();
        }
        this.innerProperties().withStatus(status);
        return this;
    }

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