/*
 * 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 condition to be satisfied for an action to be executed.
 *
 */
class Trigger {
  /**
   * Create a Trigger.
   * @member {number} [lifetimePercentage] Percentage of lifetime at which to
   * trigger. Value should be between 1 and 99.
   * @member {number} [daysBeforeExpiry] Days before expiry to attempt renewal.
   * Value should be between 1 and validity_in_months multiplied by 27. If
   * validity_in_months is 36, then value should be between 1 and 972 (36 *
   * 27).
   */
  constructor() {
  }

  /**
   * Defines the metadata of Trigger
   *
   * @returns {object} metadata of Trigger
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Trigger',
      type: {
        name: 'Composite',
        className: 'Trigger',
        modelProperties: {
          lifetimePercentage: {
            required: false,
            serializedName: 'lifetime_percentage',
            constraints: {
              InclusiveMaximum: 99,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          daysBeforeExpiry: {
            required: false,
            serializedName: 'days_before_expiry',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = Trigger;
