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

package com.azure.resourcemanager.apimanagement.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** A request to approve or reject a private endpoint connection. */
@Fluent
public final class PrivateEndpointConnectionRequest {
    /*
     * Private Endpoint Connection Resource Id.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * The connection state of the private endpoint connection.
     */
    @JsonProperty(value = "properties")
    private PrivateEndpointConnectionRequestProperties properties;

    /**
     * Get the id property: Private Endpoint Connection Resource Id.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Private Endpoint Connection Resource Id.
     *
     * @param id the id value to set.
     * @return the PrivateEndpointConnectionRequest object itself.
     */
    public PrivateEndpointConnectionRequest withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the properties property: The connection state of the private endpoint connection.
     *
     * @return the properties value.
     */
    public PrivateEndpointConnectionRequestProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: The connection state of the private endpoint connection.
     *
     * @param properties the properties value to set.
     * @return the PrivateEndpointConnectionRequest object itself.
     */
    public PrivateEndpointConnectionRequest withProperties(PrivateEndpointConnectionRequestProperties properties) {
        this.properties = properties;
        return this;
    }

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