/*
 * 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 Database sync member.
 *
 * @extends models['ProxyResource']
 */
class SyncMember extends models['ProxyResource'] {
  /**
   * Create a SyncMember.
   * @property {string} [databaseType] Database type of the sync member.
   * Possible values include: 'AzureSqlDatabase', 'SqlServerDatabase'
   * @property {string} [syncAgentId] ARM resource id of the sync agent in the
   * sync member.
   * @property {uuid} [sqlServerDatabaseId] SQL Server database id of the sync
   * member.
   * @property {string} [serverName] Server name of the member database in the
   * sync member
   * @property {string} [databaseName] Database name of the member database in
   * the sync member.
   * @property {string} [userName] User name of the member database in the sync
   * member.
   * @property {string} [password] Password of the member database in the sync
   * member.
   * @property {string} [syncDirection] Sync direction of the sync member.
   * Possible values include: 'Bidirectional', 'OneWayMemberToHub',
   * 'OneWayHubToMember'
   * @property {string} [syncState] Sync state of the sync member. Possible
   * values include: 'SyncInProgress', 'SyncSucceeded', 'SyncFailed',
   * 'DisabledTombstoneCleanup', 'DisabledBackupRestore',
   * 'SyncSucceededWithWarnings', 'SyncCancelling', 'SyncCancelled',
   * 'UnProvisioned', 'Provisioning', 'Provisioned', 'ProvisionFailed',
   * 'DeProvisioning', 'DeProvisioned', 'DeProvisionFailed', 'Reprovisioning',
   * 'ReprovisionFailed', 'UnReprovisioned'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SyncMember
   *
   * @returns {object} metadata of SyncMember
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SyncMember',
      type: {
        name: 'Composite',
        className: 'SyncMember',
        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'
            }
          },
          databaseType: {
            required: false,
            serializedName: 'properties.databaseType',
            type: {
              name: 'String'
            }
          },
          syncAgentId: {
            required: false,
            serializedName: 'properties.syncAgentId',
            type: {
              name: 'String'
            }
          },
          sqlServerDatabaseId: {
            required: false,
            serializedName: 'properties.sqlServerDatabaseId',
            type: {
              name: 'String'
            }
          },
          serverName: {
            required: false,
            serializedName: 'properties.serverName',
            type: {
              name: 'String'
            }
          },
          databaseName: {
            required: false,
            serializedName: 'properties.databaseName',
            type: {
              name: 'String'
            }
          },
          userName: {
            required: false,
            serializedName: 'properties.userName',
            type: {
              name: 'String'
            }
          },
          password: {
            required: false,
            serializedName: 'properties.password',
            type: {
              name: 'String'
            }
          },
          syncDirection: {
            required: false,
            serializedName: 'properties.syncDirection',
            type: {
              name: 'String'
            }
          },
          syncState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.syncState',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = SyncMember;
