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

/**
 * Definition of the module type.
 *
 * @extends models['TrackedResource']
 */
class Module extends models['TrackedResource'] {
  /**
   * Create a Module.
   * @member {boolean} [isGlobal] Gets or sets the isGlobal flag of the module.
   * @member {string} [version] Gets or sets the version of the module.
   * @member {number} [sizeInBytes] Gets or sets the size in bytes of the
   * module.
   * @member {number} [activityCount] Gets or sets the activity count of the
   * module.
   * @member {string} [provisioningState] Gets or sets the provisioning state
   * of the module. Possible values include: 'Created', 'Creating',
   * 'StartingImportModuleRunbook', 'RunningImportModuleRunbook',
   * 'ContentRetrieved', 'ContentDownloaded', 'ContentValidated',
   * 'ConnectionTypeImported', 'ContentStored', 'ModuleDataStored',
   * 'ActivitiesStored', 'ModuleImportRunbookComplete', 'Succeeded', 'Failed',
   * 'Cancelled', 'Updating'
   * @member {object} [contentLink] Gets or sets the contentLink of the module.
   * @member {string} [contentLink.uri] Gets or sets the uri of the runbook
   * content.
   * @member {object} [contentLink.contentHash] Gets or sets the hash.
   * @member {string} [contentLink.contentHash.algorithm] Gets or sets the
   * content hash algorithm used to hash the content.
   * @member {string} [contentLink.contentHash.value] Gets or sets expected
   * hash value of the content.
   * @member {string} [contentLink.version] Gets or sets the version of the
   * content.
   * @member {object} [error] Gets or sets the error info of the module.
   * @member {string} [error.code] Gets or sets the error code.
   * @member {string} [error.message] Gets or sets the error message.
   * @member {date} [creationTime] Gets or sets the creation time.
   * @member {date} [lastModifiedTime] Gets or sets the last modified time.
   * @member {string} [description] Gets or sets the description.
   * @member {boolean} [isComposite] Gets or sets type of module, if its
   * composite or not.
   * @member {string} [etag] Gets or sets the etag of the resource.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Module
   *
   * @returns {object} metadata of Module
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Module',
      type: {
        name: 'Composite',
        className: 'Module',
        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'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          isGlobal: {
            required: false,
            serializedName: 'properties.isGlobal',
            type: {
              name: 'Boolean'
            }
          },
          version: {
            required: false,
            serializedName: 'properties.version',
            type: {
              name: 'String'
            }
          },
          sizeInBytes: {
            required: false,
            serializedName: 'properties.sizeInBytes',
            type: {
              name: 'Number'
            }
          },
          activityCount: {
            required: false,
            serializedName: 'properties.activityCount',
            type: {
              name: 'Number'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'Enum',
              allowedValues: [ 'Created', 'Creating', 'StartingImportModuleRunbook', 'RunningImportModuleRunbook', 'ContentRetrieved', 'ContentDownloaded', 'ContentValidated', 'ConnectionTypeImported', 'ContentStored', 'ModuleDataStored', 'ActivitiesStored', 'ModuleImportRunbookComplete', 'Succeeded', 'Failed', 'Cancelled', 'Updating' ]
            }
          },
          contentLink: {
            required: false,
            serializedName: 'properties.contentLink',
            type: {
              name: 'Composite',
              className: 'ContentLink'
            }
          },
          error: {
            required: false,
            serializedName: 'properties.error',
            type: {
              name: 'Composite',
              className: 'ModuleErrorInfo'
            }
          },
          creationTime: {
            required: false,
            nullable: false,
            serializedName: 'properties.creationTime',
            type: {
              name: 'DateTime'
            }
          },
          lastModifiedTime: {
            required: false,
            nullable: false,
            serializedName: 'properties.lastModifiedTime',
            type: {
              name: 'DateTime'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          isComposite: {
            required: false,
            serializedName: 'properties.isComposite',
            type: {
              name: 'Boolean'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Module;
