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

package com.azure.resourcemanager.cosmosdbforpostgresql.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.cosmosdbforpostgresql.fluent.models.ClusterPropertiesForUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Represents a cluster for update. */
@Fluent
public final class ClusterForUpdate {
    /*
     * Properties of the cluster.
     */
    @JsonProperty(value = "properties")
    private ClusterPropertiesForUpdate innerProperties;

    /*
     * Application-specific metadata in the form of key-value pairs.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

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

    /**
     * Get the innerProperties property: Properties of the cluster.
     *
     * @return the innerProperties value.
     */
    private ClusterPropertiesForUpdate innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tags property: Application-specific metadata in the form of key-value pairs.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Application-specific metadata in the form of key-value pairs.
     *
     * @param tags the tags value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the administratorLoginPassword property: The password of the administrator login. Each cluster is created
     * with pre-defined administrative role called ‘citus’. .
     *
     * @return the administratorLoginPassword value.
     */
    public String administratorLoginPassword() {
        return this.innerProperties() == null ? null : this.innerProperties().administratorLoginPassword();
    }

    /**
     * Set the administratorLoginPassword property: The password of the administrator login. Each cluster is created
     * with pre-defined administrative role called ‘citus’. .
     *
     * @param administratorLoginPassword the administratorLoginPassword value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withAdministratorLoginPassword(String administratorLoginPassword) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withAdministratorLoginPassword(administratorLoginPassword);
        return this;
    }

    /**
     * Get the postgresqlVersion property: The major PostgreSQL version on all cluster servers.
     *
     * @return the postgresqlVersion value.
     */
    public String postgresqlVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().postgresqlVersion();
    }

    /**
     * Set the postgresqlVersion property: The major PostgreSQL version on all cluster servers.
     *
     * @param postgresqlVersion the postgresqlVersion value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withPostgresqlVersion(String postgresqlVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withPostgresqlVersion(postgresqlVersion);
        return this;
    }

    /**
     * Get the citusVersion property: The Citus extension version on all cluster servers.
     *
     * @return the citusVersion value.
     */
    public String citusVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().citusVersion();
    }

    /**
     * Set the citusVersion property: The Citus extension version on all cluster servers.
     *
     * @param citusVersion the citusVersion value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withCitusVersion(String citusVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withCitusVersion(citusVersion);
        return this;
    }

    /**
     * Get the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
     *
     * @return the enableShardsOnCoordinator value.
     */
    public Boolean enableShardsOnCoordinator() {
        return this.innerProperties() == null ? null : this.innerProperties().enableShardsOnCoordinator();
    }

    /**
     * Set the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
     *
     * @param enableShardsOnCoordinator the enableShardsOnCoordinator value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withEnableShardsOnCoordinator(Boolean enableShardsOnCoordinator) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withEnableShardsOnCoordinator(enableShardsOnCoordinator);
        return this;
    }

    /**
     * Get the enableHa property: If high availability (HA) is enabled or not for the cluster.
     *
     * @return the enableHa value.
     */
    public Boolean enableHa() {
        return this.innerProperties() == null ? null : this.innerProperties().enableHa();
    }

    /**
     * Set the enableHa property: If high availability (HA) is enabled or not for the cluster.
     *
     * @param enableHa the enableHa value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withEnableHa(Boolean enableHa) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withEnableHa(enableHa);
        return this;
    }

    /**
     * Get the preferredPrimaryZone property: Preferred primary availability zone (AZ) for all cluster servers.
     *
     * @return the preferredPrimaryZone value.
     */
    public String preferredPrimaryZone() {
        return this.innerProperties() == null ? null : this.innerProperties().preferredPrimaryZone();
    }

    /**
     * Set the preferredPrimaryZone property: Preferred primary availability zone (AZ) for all cluster servers.
     *
     * @param preferredPrimaryZone the preferredPrimaryZone value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withPreferredPrimaryZone(String preferredPrimaryZone) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withPreferredPrimaryZone(preferredPrimaryZone);
        return this;
    }

    /**
     * Get the coordinatorServerEdition property: The edition of the coordinator (default: GeneralPurpose).
     *
     * @return the coordinatorServerEdition value.
     */
    public String coordinatorServerEdition() {
        return this.innerProperties() == null ? null : this.innerProperties().coordinatorServerEdition();
    }

    /**
     * Set the coordinatorServerEdition property: The edition of the coordinator (default: GeneralPurpose).
     *
     * @param coordinatorServerEdition the coordinatorServerEdition value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withCoordinatorServerEdition(String coordinatorServerEdition) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withCoordinatorServerEdition(coordinatorServerEdition);
        return this;
    }

    /**
     * Get the coordinatorStorageQuotaInMb property: The storage of the coordinator in MB.
     *
     * @return the coordinatorStorageQuotaInMb value.
     */
    public Integer coordinatorStorageQuotaInMb() {
        return this.innerProperties() == null ? null : this.innerProperties().coordinatorStorageQuotaInMb();
    }

    /**
     * Set the coordinatorStorageQuotaInMb property: The storage of the coordinator in MB.
     *
     * @param coordinatorStorageQuotaInMb the coordinatorStorageQuotaInMb value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withCoordinatorStorageQuotaInMb(Integer coordinatorStorageQuotaInMb) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withCoordinatorStorageQuotaInMb(coordinatorStorageQuotaInMb);
        return this;
    }

    /**
     * Get the coordinatorVCores property: The vCores count of the coordinator (max: 96).
     *
     * @return the coordinatorVCores value.
     */
    public Integer coordinatorVCores() {
        return this.innerProperties() == null ? null : this.innerProperties().coordinatorVCores();
    }

    /**
     * Set the coordinatorVCores property: The vCores count of the coordinator (max: 96).
     *
     * @param coordinatorVCores the coordinatorVCores value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withCoordinatorVCores(Integer coordinatorVCores) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withCoordinatorVCores(coordinatorVCores);
        return this;
    }

    /**
     * Get the coordinatorEnablePublicIpAccess property: If public access is enabled on coordinator.
     *
     * @return the coordinatorEnablePublicIpAccess value.
     */
    public Boolean coordinatorEnablePublicIpAccess() {
        return this.innerProperties() == null ? null : this.innerProperties().coordinatorEnablePublicIpAccess();
    }

    /**
     * Set the coordinatorEnablePublicIpAccess property: If public access is enabled on coordinator.
     *
     * @param coordinatorEnablePublicIpAccess the coordinatorEnablePublicIpAccess value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withCoordinatorEnablePublicIpAccess(Boolean coordinatorEnablePublicIpAccess) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withCoordinatorEnablePublicIpAccess(coordinatorEnablePublicIpAccess);
        return this;
    }

    /**
     * Get the nodeServerEdition property: The edition of a node (default: MemoryOptimized).
     *
     * @return the nodeServerEdition value.
     */
    public String nodeServerEdition() {
        return this.innerProperties() == null ? null : this.innerProperties().nodeServerEdition();
    }

    /**
     * Set the nodeServerEdition property: The edition of a node (default: MemoryOptimized).
     *
     * @param nodeServerEdition the nodeServerEdition value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withNodeServerEdition(String nodeServerEdition) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withNodeServerEdition(nodeServerEdition);
        return this;
    }

    /**
     * Get the nodeCount property: Worker node count of the cluster. When node count is 0, it represents a single node
     * configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent
     * multi-node configuration. Node count value cannot be 1.
     *
     * @return the nodeCount value.
     */
    public Integer nodeCount() {
        return this.innerProperties() == null ? null : this.innerProperties().nodeCount();
    }

    /**
     * Set the nodeCount property: Worker node count of the cluster. When node count is 0, it represents a single node
     * configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent
     * multi-node configuration. Node count value cannot be 1.
     *
     * @param nodeCount the nodeCount value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withNodeCount(Integer nodeCount) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withNodeCount(nodeCount);
        return this;
    }

    /**
     * Get the nodeStorageQuotaInMb property: The storage in MB on each worker node.
     *
     * @return the nodeStorageQuotaInMb value.
     */
    public Integer nodeStorageQuotaInMb() {
        return this.innerProperties() == null ? null : this.innerProperties().nodeStorageQuotaInMb();
    }

    /**
     * Set the nodeStorageQuotaInMb property: The storage in MB on each worker node.
     *
     * @param nodeStorageQuotaInMb the nodeStorageQuotaInMb value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withNodeStorageQuotaInMb(Integer nodeStorageQuotaInMb) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withNodeStorageQuotaInMb(nodeStorageQuotaInMb);
        return this;
    }

    /**
     * Get the nodeVCores property: The compute in vCores on each worker node (max: 104).
     *
     * @return the nodeVCores value.
     */
    public Integer nodeVCores() {
        return this.innerProperties() == null ? null : this.innerProperties().nodeVCores();
    }

    /**
     * Set the nodeVCores property: The compute in vCores on each worker node (max: 104).
     *
     * @param nodeVCores the nodeVCores value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withNodeVCores(Integer nodeVCores) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withNodeVCores(nodeVCores);
        return this;
    }

    /**
     * Get the nodeEnablePublicIpAccess property: If public access is enabled on worker nodes.
     *
     * @return the nodeEnablePublicIpAccess value.
     */
    public Boolean nodeEnablePublicIpAccess() {
        return this.innerProperties() == null ? null : this.innerProperties().nodeEnablePublicIpAccess();
    }

    /**
     * Get the maintenanceWindow property: Maintenance window of a cluster.
     *
     * @return the maintenanceWindow value.
     */
    public MaintenanceWindow maintenanceWindow() {
        return this.innerProperties() == null ? null : this.innerProperties().maintenanceWindow();
    }

    /**
     * Set the maintenanceWindow property: Maintenance window of a cluster.
     *
     * @param maintenanceWindow the maintenanceWindow value to set.
     * @return the ClusterForUpdate object itself.
     */
    public ClusterForUpdate withMaintenanceWindow(MaintenanceWindow maintenanceWindow) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ClusterPropertiesForUpdate();
        }
        this.innerProperties().withMaintenanceWindow(maintenanceWindow);
        return this;
    }

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