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

/**
 * A job target, for example a specific database or a container of databases
 * that is evaluated during job execution.
 *
 */
class JobTarget {
  /**
   * Create a JobTarget.
   * @property {string} [membershipType] Whether the target is included or
   * excluded from the group. Possible values include: 'Include', 'Exclude'.
   * Default value: 'Include' .
   * @property {string} type The target type. Possible values include:
   * 'TargetGroup', 'SqlDatabase', 'SqlElasticPool', 'SqlShardMap', 'SqlServer'
   * @property {string} [serverName] The target server name.
   * @property {string} [databaseName] The target database name.
   * @property {string} [elasticPoolName] The target elastic pool name.
   * @property {string} [shardMapName] The target shard map.
   * @property {string} [refreshCredential] The resource ID of the credential
   * that is used during job execution to connect to the target and determine
   * the list of databases inside the target.
   */
  constructor() {
  }

  /**
   * Defines the metadata of JobTarget
   *
   * @returns {object} metadata of JobTarget
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'JobTarget',
      type: {
        name: 'Composite',
        className: 'JobTarget',
        modelProperties: {
          membershipType: {
            required: false,
            serializedName: 'membershipType',
            defaultValue: 'Include',
            type: {
              name: 'Enum',
              allowedValues: [ 'Include', 'Exclude' ]
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          serverName: {
            required: false,
            serializedName: 'serverName',
            type: {
              name: 'String'
            }
          },
          databaseName: {
            required: false,
            serializedName: 'databaseName',
            type: {
              name: 'String'
            }
          },
          elasticPoolName: {
            required: false,
            serializedName: 'elasticPoolName',
            type: {
              name: 'String'
            }
          },
          shardMapName: {
            required: false,
            serializedName: 'shardMapName',
            type: {
              name: 'String'
            }
          },
          refreshCredential: {
            required: false,
            serializedName: 'refreshCredential',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = JobTarget;
