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

/**
 * An Application Insights workbook definition.
 *
 * @extends models['WorkbookResource']
 */
class Workbook extends models['WorkbookResource'] {
  /**
   * Create a Workbook.
   * @member {string} [kind] The kind of workbook. Choices are user and shared.
   * Possible values include: 'user', 'shared'
   * @member {string} workbookName The user-defined name of the workbook.
   * @member {string} serializedData Configuration of this particular workbook.
   * Configuration data is a string containing valid JSON
   * @member {string} [version] This instance's version of the data model. This
   * can change as new features are added that can be marked workbook.
   * @member {string} workbookId Internally assigned unique id of the workbook
   * definition.
   * @member {string} sharedTypeKind Enum indicating if this workbook
   * definition is owned by a specific user or is shared between all users with
   * access to the Application Insights component. Possible values include:
   * 'user', 'shared'. Default value: 'shared' .
   * @member {string} [timeModified] Date and time in UTC of the last
   * modification that was made to this workbook definition.
   * @member {string} category Workbook category, as defined by the user at
   * creation time.
   * @member {array} [workbookTags] A list of 0 or more tags that are
   * associated with this workbook definition
   * @member {string} userId Unique user id of the specific user that owns this
   * workbook.
   * @member {string} [sourceResourceId] Optional resourceId for a source
   * resource.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Workbook
   *
   * @returns {object} metadata of Workbook
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Workbook',
      type: {
        name: 'Composite',
        className: 'Workbook',
        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'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          workbookName: {
            required: true,
            serializedName: 'properties.name',
            type: {
              name: 'String'
            }
          },
          serializedData: {
            required: true,
            serializedName: 'properties.serializedData',
            type: {
              name: 'String'
            }
          },
          version: {
            required: false,
            serializedName: 'properties.version',
            type: {
              name: 'String'
            }
          },
          workbookId: {
            required: true,
            serializedName: 'properties.workbookId',
            type: {
              name: 'String'
            }
          },
          sharedTypeKind: {
            required: true,
            serializedName: 'properties.kind',
            defaultValue: 'shared',
            type: {
              name: 'String'
            }
          },
          timeModified: {
            required: false,
            readOnly: true,
            serializedName: 'properties.timeModified',
            type: {
              name: 'String'
            }
          },
          category: {
            required: true,
            serializedName: 'properties.category',
            type: {
              name: 'String'
            }
          },
          workbookTags: {
            required: false,
            serializedName: 'properties.tags',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          userId: {
            required: true,
            serializedName: 'properties.userId',
            type: {
              name: 'String'
            }
          },
          sourceResourceId: {
            required: false,
            serializedName: 'properties.sourceResourceId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Workbook;
