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

/**
 * Trigger resource type.
 *
 * @extends models['SubResource']
 */
class TriggerResource extends models['SubResource'] {
  /**
   * Create a TriggerResource.
   * @member {object} properties Properties of the trigger.
   * @member {string} [properties.description] Trigger description.
   * @member {string} [properties.runtimeState] Indicates if trigger is running
   * or not. Updated when Start/Stop APIs are called on the Trigger. Possible
   * values include: 'Started', 'Stopped', 'Disabled'
   * @member {string} [properties.type] Polymorphic Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of TriggerResource
   *
   * @returns {object} metadata of TriggerResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'TriggerResource',
      type: {
        name: 'Composite',
        className: 'TriggerResource',
        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'
            }
          },
          etag: {
            required: false,
            readOnly: true,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: true,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              additionalProperties: {
                type: {
                  name: 'Dictionary',
                  value: {
                      required: false,
                      serializedName: 'ObjectElementType',
                      type: {
                        name: 'Object'
                      }
                  }
                }
              },
              polymorphicDiscriminator: {
                serializedName: 'type',
                clientName: 'type'
              },
              uberParent: 'Trigger',
              className: 'Trigger'
            }
          }
        }
      }
    };
  }
}

module.exports = TriggerResource;
