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

/**
 * Read-write endpoint of the failover group instance.
 *
 */
class FailoverGroupReadWriteEndpoint {
  /**
   * Create a FailoverGroupReadWriteEndpoint.
   * @property {string} failoverPolicy Failover policy of the read-write
   * endpoint for the failover group. If failoverPolicy is Automatic then
   * failoverWithDataLossGracePeriodMinutes is required. Possible values
   * include: 'Manual', 'Automatic'
   * @property {number} [failoverWithDataLossGracePeriodMinutes] Grace period
   * before failover with data loss is attempted for the read-write endpoint.
   * If failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes
   * is required.
   */
  constructor() {
  }

  /**
   * Defines the metadata of FailoverGroupReadWriteEndpoint
   *
   * @returns {object} metadata of FailoverGroupReadWriteEndpoint
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'FailoverGroupReadWriteEndpoint',
      type: {
        name: 'Composite',
        className: 'FailoverGroupReadWriteEndpoint',
        modelProperties: {
          failoverPolicy: {
            required: true,
            serializedName: 'failoverPolicy',
            type: {
              name: 'String'
            }
          },
          failoverWithDataLossGracePeriodMinutes: {
            required: false,
            serializedName: 'failoverWithDataLossGracePeriodMinutes',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = FailoverGroupReadWriteEndpoint;
