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

/**
 * Properties that define a favorite that is associated to an Application
 * Insights component.
 *
 */
class ApplicationInsightsComponentFavorite {
  /**
   * Create a ApplicationInsightsComponentFavorite.
   * @member {string} [name] The user-defined name of the favorite.
   * @member {string} [config] Configuration of this particular favorite, which
   * are driven by the Azure portal UX. 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 favorite. Current
   * examples include MetricsExplorer (ME) and Search.
   * @member {string} [favoriteId] Internally assigned unique id of the
   * favorite definition.
   * @member {string} [favoriteType] Enum indicating if this favorite
   * definition is owned by a specific user or is shared between all users with
   * access to the Application Insights component. Possible values include:
   * 'shared', 'user'
   * @member {string} [sourceType] The source of the favorite definition.
   * @member {string} [timeModified] Date and time in UTC of the last
   * modification that was made to this favorite definition.
   * @member {array} [tags] A list of 0 or more tags that are associated with
   * this favorite definition
   * @member {string} [category] Favorite category, as defined by the user at
   * creation time.
   * @member {boolean} [isGeneratedFromTemplate] Flag denoting wether or not
   * this favorite was generated from a template.
   * @member {string} [userId] Unique user id of the specific user that owns
   * this favorite.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ApplicationInsightsComponentFavorite
   *
   * @returns {object} metadata of ApplicationInsightsComponentFavorite
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationInsightsComponentFavorite',
      type: {
        name: 'Composite',
        className: 'ApplicationInsightsComponentFavorite',
        modelProperties: {
          name: {
            required: false,
            serializedName: 'Name',
            type: {
              name: 'String'
            }
          },
          config: {
            required: false,
            serializedName: 'Config',
            type: {
              name: 'String'
            }
          },
          version: {
            required: false,
            serializedName: 'Version',
            type: {
              name: 'String'
            }
          },
          favoriteId: {
            required: false,
            readOnly: true,
            serializedName: 'FavoriteId',
            type: {
              name: 'String'
            }
          },
          favoriteType: {
            required: false,
            serializedName: 'FavoriteType',
            type: {
              name: 'Enum',
              allowedValues: [ 'shared', 'user' ]
            }
          },
          sourceType: {
            required: false,
            serializedName: 'SourceType',
            type: {
              name: 'String'
            }
          },
          timeModified: {
            required: false,
            readOnly: true,
            serializedName: 'TimeModified',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'Tags',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          category: {
            required: false,
            serializedName: 'Category',
            type: {
              name: 'String'
            }
          },
          isGeneratedFromTemplate: {
            required: false,
            serializedName: 'IsGeneratedFromTemplate',
            type: {
              name: 'Boolean'
            }
          },
          userId: {
            required: false,
            readOnly: true,
            serializedName: 'UserId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationInsightsComponentFavorite;
