/*
 * 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.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

/**
 * @summary A reference to a certificate to be installed on compute nodes in a
 * pool. This must exist inside the same account as the pool.
  *
 */
class CertificateReference {
  /**
   * Create a CertificateReference.
   * @property {string} id The fully qualified ID of the certificate to install
   * on the pool. This must be inside the same batch account as the pool.
   * @property {string} [storeLocation] The location of the certificate store
   * on the compute node into which to install the certificate. The default
   * value is currentUser. This property is applicable only for pools
   * configured with Windows nodes (that is, created with
   * cloudServiceConfiguration, or with virtualMachineConfiguration using a
   * Windows image reference). 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.
   * Possible values include: 'CurrentUser', 'LocalMachine'
   * @property {string} [storeName] The name of the certificate store on the
   * compute node into which to install the certificate. This property is
   * applicable only for pools configured with Windows nodes (that is, created
   * with cloudServiceConfiguration, or with virtualMachineConfiguration using
   * a Windows image reference). Common store names include: My, Root, CA,
   * Trust, Disallowed, TrustedPeople, TrustedPublisher, AuthRoot, AddressBook,
   * but any custom store name can also be used. The default value is My.
   * @property {array} [visibility] Which user accounts on the compute node
   * should have access to the private data of the certificate.
   */
  constructor() {
  }

  /**
   * Defines the metadata of CertificateReference
   *
   * @returns {object} metadata of CertificateReference
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CertificateReference',
      type: {
        name: 'Composite',
        className: 'CertificateReference',
        modelProperties: {
          id: {
            required: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          storeLocation: {
            required: false,
            serializedName: 'storeLocation',
            type: {
              name: 'Enum',
              allowedValues: [ 'CurrentUser', 'LocalMachine' ]
            }
          },
          storeName: {
            required: false,
            serializedName: 'storeName',
            type: {
              name: 'String'
            }
          },
          visibility: {
            required: false,
            serializedName: 'visibility',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'CertificateVisibilityElementType',
                  type: {
                    name: 'Enum',
                    allowedValues: [ 'StartTask', 'Task', 'RemoteUser' ]
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = CertificateReference;
