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

/**
 * Represents a database replication link.
 *
 * @extends models['ProxyResource']
 */
class ReplicationLink extends models['ProxyResource'] {
  /**
   * Create a ReplicationLink.
   * @property {string} [location] Location of the server that contains this
   * firewall rule.
   * @property {boolean} [isTerminationAllowed] Legacy value indicating whether
   * termination is allowed.  Currently always returns true.
   * @property {string} [replicationMode] Replication mode of this replication
   * link.
   * @property {string} [partnerServer] The name of the server hosting the
   * partner database.
   * @property {string} [partnerDatabase] The name of the partner database.
   * @property {string} [partnerLocation] The Azure Region of the partner
   * database.
   * @property {string} [role] The role of the database in the replication
   * link. Possible values include: 'Primary', 'Secondary',
   * 'NonReadableSecondary', 'Source', 'Copy'
   * @property {string} [partnerRole] The role of the partner database in the
   * replication link. Possible values include: 'Primary', 'Secondary',
   * 'NonReadableSecondary', 'Source', 'Copy'
   * @property {date} [startTime] The start time for the replication link.
   * @property {number} [percentComplete] The percentage of seeding complete
   * for the replication link.
   * @property {string} [replicationState] The replication state for the
   * replication link. Possible values include: 'PENDING', 'SEEDING',
   * 'CATCH_UP', 'SUSPENDED'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ReplicationLink
   *
   * @returns {object} metadata of ReplicationLink
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ReplicationLink',
      type: {
        name: 'Composite',
        className: 'ReplicationLink',
        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: false,
            readOnly: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          isTerminationAllowed: {
            required: false,
            readOnly: true,
            serializedName: 'properties.isTerminationAllowed',
            type: {
              name: 'Boolean'
            }
          },
          replicationMode: {
            required: false,
            readOnly: true,
            serializedName: 'properties.replicationMode',
            type: {
              name: 'String'
            }
          },
          partnerServer: {
            required: false,
            readOnly: true,
            serializedName: 'properties.partnerServer',
            type: {
              name: 'String'
            }
          },
          partnerDatabase: {
            required: false,
            readOnly: true,
            serializedName: 'properties.partnerDatabase',
            type: {
              name: 'String'
            }
          },
          partnerLocation: {
            required: false,
            readOnly: true,
            serializedName: 'properties.partnerLocation',
            type: {
              name: 'String'
            }
          },
          role: {
            required: false,
            readOnly: true,
            serializedName: 'properties.role',
            type: {
              name: 'Enum',
              allowedValues: [ 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' ]
            }
          },
          partnerRole: {
            required: false,
            readOnly: true,
            serializedName: 'properties.partnerRole',
            type: {
              name: 'Enum',
              allowedValues: [ 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', 'Copy' ]
            }
          },
          startTime: {
            required: false,
            readOnly: true,
            serializedName: 'properties.startTime',
            type: {
              name: 'DateTime'
            }
          },
          percentComplete: {
            required: false,
            readOnly: true,
            serializedName: 'properties.percentComplete',
            type: {
              name: 'Number'
            }
          },
          replicationState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.replicationState',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ReplicationLink;
