/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 */

package com.microsoft.azure.batch.protocol.models;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The set of changes to be made to a Pool.
 */
public class PoolUpdatePropertiesParameter {
    /**
     * A Task to run on each Compute Node as it joins the Pool. The Task runs
     * when the Compute Node is added to the Pool or when the Compute Node is
     * restarted.
     * If this element is present, it overwrites any existing StartTask. If
     * omitted, any existing StartTask is removed from the Pool.
     */
    @JsonProperty(value = "startTask")
    private StartTask startTask;

    /**
     * A list of Certificates to be installed on each Compute Node in the Pool.
     * This list replaces any existing Certificate references configured on the
     * Pool. If you specify an empty collection, any existing Certificate
     * references are removed from the Pool. For Windows Nodes, the Batch
     * service installs the Certificates to the specified Certificate store and
     * location. For Linux Compute Nodes, the Certificates are stored in a
     * directory inside the Task working directory and an environment variable
     * AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this
     * location. For Certificates with visibility of 'remoteUser', a 'certs'
     * directory is created in the user's home directory (e.g.,
     * /home/{user-name}/certs) and Certificates are placed in that directory.
     *
     * Warning: This property is deprecated and will be removed after February,
     * 2024. Please use the [Azure KeyVault
     * Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide)
     * instead.
     */
    @JsonProperty(value = "certificateReferences", required = true)
    private List<CertificateReference> certificateReferences;

    /**
     * The list of Application Packages to be installed on each Compute Node in
     * the Pool.
     * The list replaces any existing Application Package references on the
     * Pool. Changes to Application Package references affect all new Compute
     * Nodes joining the Pool, but do not affect Compute Nodes that are already
     * in the Pool until they are rebooted or reimaged. There is a maximum of
     * 10 Application Package references on any given Pool. If omitted, or if
     * you specify an empty collection, any existing Application Packages
     * references are removed from the Pool. A maximum of 10 references may be
     * specified on a given Pool.
     */
    @JsonProperty(value = "applicationPackageReferences", required = true)
    private List<ApplicationPackageReference> applicationPackageReferences;

    /**
     * A list of name-value pairs associated with the Pool as metadata.
     * This list replaces any existing metadata configured on the Pool. If
     * omitted, or if you specify an empty collection, any existing metadata is
     * removed from the Pool.
     */
    @JsonProperty(value = "metadata", required = true)
    private List<MetadataItem> metadata;

    /**
     * The desired node communication mode for the pool.
     * This setting replaces any existing targetNodeCommunication setting on
     * the Pool. If omitted, the existing setting is default. Possible values
     * include: 'default', 'classic', 'simplified'.
     */
    @JsonProperty(value = "targetNodeCommunicationMode")
    private NodeCommunicationMode targetNodeCommunicationMode;

    /**
     * Get if this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is removed from the Pool.
     *
     * @return the startTask value
     */
    public StartTask startTask() {
        return this.startTask;
    }

    /**
     * Set if this element is present, it overwrites any existing StartTask. If omitted, any existing StartTask is removed from the Pool.
     *
     * @param startTask the startTask value to set
     * @return the PoolUpdatePropertiesParameter object itself.
     */
    public PoolUpdatePropertiesParameter withStartTask(StartTask startTask) {
        this.startTask = startTask;
        return this;
    }

    /**
     * Get this list replaces any existing Certificate references configured on the Pool. If you specify an empty collection, any existing Certificate references are removed from the Pool. For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory.
     Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
     *
     * @return the certificateReferences value
     */
    public List<CertificateReference> certificateReferences() {
        return this.certificateReferences;
    }

    /**
     * Set this list replaces any existing Certificate references configured on the Pool. If you specify an empty collection, any existing Certificate references are removed from the Pool. For Windows Nodes, the Batch service installs the Certificates to the specified Certificate store and location. For Linux Compute Nodes, the Certificates are stored in a directory inside the Task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the Task to query for this location. For Certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and Certificates are placed in that directory.
     Warning: This property is deprecated and will be removed after February, 2024. Please use the [Azure KeyVault Extension](https://learn.microsoft.com/azure/batch/batch-certificate-migration-guide) instead.
     *
     * @param certificateReferences the certificateReferences value to set
     * @return the PoolUpdatePropertiesParameter object itself.
     */
    public PoolUpdatePropertiesParameter withCertificateReferences(List<CertificateReference> certificateReferences) {
        this.certificateReferences = certificateReferences;
        return this;
    }

    /**
     * Get the list replaces any existing Application Package references on the Pool. Changes to Application Package references affect all new Compute Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Application Package references on any given Pool. If omitted, or if you specify an empty collection, any existing Application Packages references are removed from the Pool. A maximum of 10 references may be specified on a given Pool.
     *
     * @return the applicationPackageReferences value
     */
    public List<ApplicationPackageReference> applicationPackageReferences() {
        return this.applicationPackageReferences;
    }

    /**
     * Set the list replaces any existing Application Package references on the Pool. Changes to Application Package references affect all new Compute Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. There is a maximum of 10 Application Package references on any given Pool. If omitted, or if you specify an empty collection, any existing Application Packages references are removed from the Pool. A maximum of 10 references may be specified on a given Pool.
     *
     * @param applicationPackageReferences the applicationPackageReferences value to set
     * @return the PoolUpdatePropertiesParameter object itself.
     */
    public PoolUpdatePropertiesParameter withApplicationPackageReferences(List<ApplicationPackageReference> applicationPackageReferences) {
        this.applicationPackageReferences = applicationPackageReferences;
        return this;
    }

    /**
     * Get this list replaces any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the Pool.
     *
     * @return the metadata value
     */
    public List<MetadataItem> metadata() {
        return this.metadata;
    }

    /**
     * Set this list replaces any existing metadata configured on the Pool. If omitted, or if you specify an empty collection, any existing metadata is removed from the Pool.
     *
     * @param metadata the metadata value to set
     * @return the PoolUpdatePropertiesParameter object itself.
     */
    public PoolUpdatePropertiesParameter withMetadata(List<MetadataItem> metadata) {
        this.metadata = metadata;
        return this;
    }

    /**
     * Get this setting replaces any existing targetNodeCommunication setting on the Pool. If omitted, the existing setting is default. Possible values include: 'default', 'classic', 'simplified'.
     *
     * @return the targetNodeCommunicationMode value
     */
    public NodeCommunicationMode targetNodeCommunicationMode() {
        return this.targetNodeCommunicationMode;
    }

    /**
     * Set this setting replaces any existing targetNodeCommunication setting on the Pool. If omitted, the existing setting is default. Possible values include: 'default', 'classic', 'simplified'.
     *
     * @param targetNodeCommunicationMode the targetNodeCommunicationMode value to set
     * @return the PoolUpdatePropertiesParameter object itself.
     */
    public PoolUpdatePropertiesParameter withTargetNodeCommunicationMode(NodeCommunicationMode targetNodeCommunicationMode) {
        this.targetNodeCommunicationMode = targetNodeCommunicationMode;
        return this;
    }

}
