/**
 * 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 PoolPatchParameter {
    /**
     * 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 left unchanged.
     */
    @JsonProperty(value = "startTask")
    private StartTask startTask;

    /**
     * A list of Certificates to be installed on each Compute Node in the Pool.
     * If this element is present, it replaces any existing Certificate
     * references configured on the Pool. If omitted, any existing Certificate
     * references are left unchanged. 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")
    private List<CertificateReference> certificateReferences;

    /**
     * A list of Packages to be installed on each Compute Node in the Pool.
     * Changes to Package references affect all new Nodes joining the Pool, but
     * do not affect Compute Nodes that are already in the Pool until they are
     * rebooted or reimaged. If this element is present, it replaces any
     * existing Package references. If you specify an empty collection, then
     * all Package references are removed from the Pool. If omitted, any
     * existing Package references are left unchanged.
     */
    @JsonProperty(value = "applicationPackageReferences")
    private List<ApplicationPackageReference> applicationPackageReferences;

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

    /**
     * The desired node communication mode for the pool.
     * If this element is present, it replaces the existing
     * targetNodeCommunicationMode configured on the Pool. If omitted, any
     * existing metadata is left unchanged. 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 left unchanged.
     *
     * @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 left unchanged.
     *
     * @param startTask the startTask value to set
     * @return the PoolPatchParameter object itself.
     */
    public PoolPatchParameter withStartTask(StartTask startTask) {
        this.startTask = startTask;
        return this;
    }

    /**
     * Get if this element is present, it replaces any existing Certificate references configured on the Pool. If omitted, any existing Certificate references are left unchanged. 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 if this element is present, it replaces any existing Certificate references configured on the Pool. If omitted, any existing Certificate references are left unchanged. 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 PoolPatchParameter object itself.
     */
    public PoolPatchParameter withCertificateReferences(List<CertificateReference> certificateReferences) {
        this.certificateReferences = certificateReferences;
        return this;
    }

    /**
     * Get changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. If this element is present, it replaces any existing Package references. If you specify an empty collection, then all Package references are removed from the Pool. If omitted, any existing Package references are left unchanged.
     *
     * @return the applicationPackageReferences value
     */
    public List<ApplicationPackageReference> applicationPackageReferences() {
        return this.applicationPackageReferences;
    }

    /**
     * Set changes to Package references affect all new Nodes joining the Pool, but do not affect Compute Nodes that are already in the Pool until they are rebooted or reimaged. If this element is present, it replaces any existing Package references. If you specify an empty collection, then all Package references are removed from the Pool. If omitted, any existing Package references are left unchanged.
     *
     * @param applicationPackageReferences the applicationPackageReferences value to set
     * @return the PoolPatchParameter object itself.
     */
    public PoolPatchParameter withApplicationPackageReferences(List<ApplicationPackageReference> applicationPackageReferences) {
        this.applicationPackageReferences = applicationPackageReferences;
        return this;
    }

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

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

    /**
     * Get if this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. Possible values include: 'default', 'classic', 'simplified'.
     *
     * @return the targetNodeCommunicationMode value
     */
    public NodeCommunicationMode targetNodeCommunicationMode() {
        return this.targetNodeCommunicationMode;
    }

    /**
     * Set if this element is present, it replaces the existing targetNodeCommunicationMode configured on the Pool. If omitted, any existing metadata is left unchanged. Possible values include: 'default', 'classic', 'simplified'.
     *
     * @param targetNodeCommunicationMode the targetNodeCommunicationMode value to set
     * @return the PoolPatchParameter object itself.
     */
    public PoolPatchParameter withTargetNodeCommunicationMode(NodeCommunicationMode targetNodeCommunicationMode) {
        this.targetNodeCommunicationMode = targetNodeCommunicationMode;
        return this;
    }

}
