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

/**
 * Execution policy for an activity.
 *
 */
class ActivityPolicy {
  /**
   * Create a ActivityPolicy.
   * @member {object} [timeout] Specifies the timeout for the activity to run.
   * The default timeout is 7 days. Type: string (or Expression with resultType
   * string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])).
   * @member {object} [retry] Maximum ordinary retry attempts. Default is 0.
   * Type: integer (or Expression with resultType integer), minimum: 0.
   * @member {number} [retryIntervalInSeconds] Interval between each retry
   * attempt (in seconds). The default is 30 sec.
   * @member {boolean} [secureInput] When set to true, Input from activity is
   * considered as secure and will not be logged to monitoring.
   * @member {boolean} [secureOutput] When set to true, Output from activity is
   * considered as secure and will not be logged to monitoring.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ActivityPolicy
   *
   * @returns {object} metadata of ActivityPolicy
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ActivityPolicy',
      type: {
        name: 'Composite',
        additionalProperties: {
          type: {
            name: 'Dictionary',
            value: {
                required: false,
                serializedName: 'ObjectElementType',
                type: {
                  name: 'Object'
                }
            }
          }
        },
        className: 'ActivityPolicy',
        modelProperties: {
          timeout: {
            required: false,
            serializedName: 'timeout',
            type: {
              name: 'Object'
            }
          },
          retry: {
            required: false,
            serializedName: 'retry',
            type: {
              name: 'Object'
            }
          },
          retryIntervalInSeconds: {
            required: false,
            serializedName: 'retryIntervalInSeconds',
            constraints: {
              InclusiveMaximum: 86400,
              InclusiveMinimum: 30
            },
            type: {
              name: 'Number'
            }
          },
          secureInput: {
            required: false,
            serializedName: 'secureInput',
            type: {
              name: 'Boolean'
            }
          },
          secureOutput: {
            required: false,
            serializedName: 'secureOutput',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = ActivityPolicy;
