/*
 * 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';

const models = require('./index');

/**
 * An Azure SQL job agent.
 *
 * @extends models['TrackedResource']
 */
class JobAgent extends models['TrackedResource'] {
  /**
   * Create a JobAgent.
   * @property {object} [sku] The name and tier of the SKU.
   * @property {string} [sku.name] The name of the SKU. Ex - P3. It is
   * typically a letter+number code
   * @property {string} [sku.tier] This field is required to be implemented by
   * the Resource Provider if the service has more than one tier, but is not
   * required on a PUT.
   * @property {string} [sku.size] The SKU size. When the name field is the
   * combination of tier and some other value, this would be the standalone
   * code.
   * @property {string} [sku.family] If the service has different generations
   * of hardware, for the same SKU, then that can be captured here.
   * @property {number} [sku.capacity] If the SKU supports scale out/in then
   * the capacity integer should be included. If scale out/in is not possible
   * for the resource this may be omitted.
   * @property {string} databaseId Resource ID of the database to store job
   * metadata in.
   * @property {string} [state] The state of the job agent. Possible values
   * include: 'Creating', 'Ready', 'Updating', 'Deleting', 'Disabled'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of JobAgent
   *
   * @returns {object} metadata of JobAgent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobAgent',
      type: {
        name: 'Composite',
        className: 'JobAgent',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          sku: {
            required: false,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'Sku'
            }
          },
          databaseId: {
            required: true,
            serializedName: 'properties.databaseId',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = JobAgent;
