/*
 * 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 runbook type.
 *
 * @extends models['TrackedResource']
 */
class Runbook extends models['TrackedResource'] {
  /**
   * Create a Runbook.
   * @member {string} [runbookType] Gets or sets the type of the runbook.
   * Possible values include: 'Script', 'Graph', 'PowerShellWorkflow',
   * 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell'
   * @member {object} [publishContentLink] Gets or sets the published runbook
   * content link.
   * @member {string} [publishContentLink.uri] Gets or sets the uri of the
   * runbook content.
   * @member {object} [publishContentLink.contentHash] Gets or sets the hash.
   * @member {string} [publishContentLink.contentHash.algorithm] Gets or sets
   * the content hash algorithm used to hash the content.
   * @member {string} [publishContentLink.contentHash.value] Gets or sets
   * expected hash value of the content.
   * @member {string} [publishContentLink.version] Gets or sets the version of
   * the content.
   * @member {string} [state] Gets or sets the state of the runbook. Possible
   * values include: 'New', 'Edit', 'Published'
   * @member {boolean} [logVerbose] Gets or sets verbose log option.
   * @member {boolean} [logProgress] Gets or sets progress log option.
   * @member {number} [logActivityTrace] Gets or sets the option to log
   * activity trace of the runbook.
   * @member {number} [jobCount] Gets or sets the job count of the runbook.
   * @member {object} [parameters] Gets or sets the runbook parameters.
   * @member {array} [outputTypes] Gets or sets the runbook output types.
   * @member {object} [draft] Gets or sets the draft runbook properties.
   * @member {boolean} [draft.inEdit] Gets or sets whether runbook is in edit
   * mode.
   * @member {object} [draft.draftContentLink] Gets or sets the draft runbook
   * content link.
   * @member {string} [draft.draftContentLink.uri] Gets or sets the uri of the
   * runbook content.
   * @member {object} [draft.draftContentLink.contentHash] Gets or sets the
   * hash.
   * @member {string} [draft.draftContentLink.contentHash.algorithm] Gets or
   * sets the content hash algorithm used to hash the content.
   * @member {string} [draft.draftContentLink.contentHash.value] Gets or sets
   * expected hash value of the content.
   * @member {string} [draft.draftContentLink.version] Gets or sets the version
   * of the content.
   * @member {date} [draft.creationTime] Gets or sets the creation time of the
   * runbook draft.
   * @member {date} [draft.lastModifiedTime] Gets or sets the last modified
   * time of the runbook draft.
   * @member {object} [draft.parameters] Gets or sets the runbook draft
   * parameters.
   * @member {array} [draft.outputTypes] Gets or sets the runbook output types.
   * @member {string} [provisioningState] Gets or sets the provisioning state
   * of the runbook. Possible values include: 'Succeeded'
   * @member {string} [lastModifiedBy] Gets or sets the last modified by.
   * @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 {string} [etag] Gets or sets the etag of the resource.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Runbook
   *
   * @returns {object} metadata of Runbook
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Runbook',
      type: {
        name: 'Composite',
        className: 'Runbook',
        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'
            }
          },
          runbookType: {
            required: false,
            serializedName: 'properties.runbookType',
            type: {
              name: 'String'
            }
          },
          publishContentLink: {
            required: false,
            serializedName: 'properties.publishContentLink',
            type: {
              name: 'Composite',
              className: 'ContentLink'
            }
          },
          state: {
            required: false,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          logVerbose: {
            required: false,
            serializedName: 'properties.logVerbose',
            type: {
              name: 'Boolean'
            }
          },
          logProgress: {
            required: false,
            serializedName: 'properties.logProgress',
            type: {
              name: 'Boolean'
            }
          },
          logActivityTrace: {
            required: false,
            serializedName: 'properties.logActivityTrace',
            type: {
              name: 'Number'
            }
          },
          jobCount: {
            required: false,
            serializedName: 'properties.jobCount',
            type: {
              name: 'Number'
            }
          },
          parameters: {
            required: false,
            serializedName: 'properties.parameters',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'RunbookParameterElementType',
                  type: {
                    name: 'Composite',
                    className: 'RunbookParameter'
                  }
              }
            }
          },
          outputTypes: {
            required: false,
            serializedName: 'properties.outputTypes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          draft: {
            required: false,
            serializedName: 'properties.draft',
            type: {
              name: 'Composite',
              className: 'RunbookDraft'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'Enum',
              allowedValues: [ 'Succeeded' ]
            }
          },
          lastModifiedBy: {
            required: false,
            serializedName: 'properties.lastModifiedBy',
            type: {
              name: 'String'
            }
          },
          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'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Runbook;
