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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.containerservicefleet.models.FleetMemberProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;

/** A member of the Fleet. It contains a reference to an existing Kubernetes cluster on Azure. */
@Fluent
public final class FleetMemberInner extends ProxyResource {
    /*
     * The resource-specific properties for this resource.
     */
    @JsonProperty(value = "properties")
    private FleetMemberProperties innerProperties;

    /*
     * If eTag is provided in the response body, it may also be provided as a header per the normal etag convention.
     * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity
     * tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section
     * 14.27) header fields.
     */
    @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY)
    private String etag;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: The resource-specific properties for this resource.
     *
     * @return the innerProperties value.
     */
    private FleetMemberProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the etag property: If eTag is provided in the response body, it may also be provided as a header per the
     * normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource.
     * HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26),
     * and If-Range (section 14.27) header fields.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the clusterResourceId property: The ARM resource id of the cluster that joins the Fleet. Must be a valid
     * Azure resource id. e.g.:
     * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'.
     *
     * @return the clusterResourceId value.
     */
    public String clusterResourceId() {
        return this.innerProperties() == null ? null : this.innerProperties().clusterResourceId();
    }

    /**
     * Set the clusterResourceId property: The ARM resource id of the cluster that joins the Fleet. Must be a valid
     * Azure resource id. e.g.:
     * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'.
     *
     * @param clusterResourceId the clusterResourceId value to set.
     * @return the FleetMemberInner object itself.
     */
    public FleetMemberInner withClusterResourceId(String clusterResourceId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FleetMemberProperties();
        }
        this.innerProperties().withClusterResourceId(clusterResourceId);
        return this;
    }

    /**
     * Get the group property: The group this member belongs to for multi-cluster update management.
     *
     * @return the group value.
     */
    public String group() {
        return this.innerProperties() == null ? null : this.innerProperties().group();
    }

    /**
     * Set the group property: The group this member belongs to for multi-cluster update management.
     *
     * @param group the group value to set.
     * @return the FleetMemberInner object itself.
     */
    public FleetMemberInner withGroup(String group) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FleetMemberProperties();
        }
        this.innerProperties().withGroup(group);
        return this;
    }

    /**
     * Get the provisioningState property: The status of the last operation.
     *
     * @return the provisioningState value.
     */
    public FleetMemberProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

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