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

/**
 * Represents a recommendation result generated by the recommendation engine.
 *
 * @extends models['ProxyOnlyResource']
 */
class Recommendation extends models['ProxyOnlyResource'] {
  /**
   * Create a Recommendation.
   * @member {date} [creationTime] Timestamp when this instance was created.
   * @member {uuid} [recommendationId] A GUID value that each recommendation
   * object is associated with.
   * @member {string} [resourceId] Full ARM resource ID string that this
   * recommendation object is associated with.
   * @member {string} [resourceScope] Name of a resource type this
   * recommendation applies, e.g. Subscription, ServerFarm, Site. Possible
   * values include: 'ServerFarm', 'Subscription', 'WebSite'
   * @member {string} [ruleName] Unique name of the rule.
   * @member {string} [displayName] UI friendly name of the rule (may not be
   * unique).
   * @member {string} [message] Recommendation text.
   * @member {string} [level] Level indicating how critical this recommendation
   * can impact. Possible values include: 'Critical', 'Warning', 'Information',
   * 'NonUrgentSuggestion'
   * @member {string} [channels] List of channels that this recommendation can
   * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook',
   * 'All'
   * @member {array} [categoryTags] The list of category tags that this
   * recommendation belongs to.
   * @member {string} [actionName] Name of action recommended by this object.
   * @member {number} [enabled] True if this recommendation is still valid
   * (i.e. "actionable"). False if it is invalid.
   * @member {array} [states] The list of states of this recommendation. If
   * it's null then it shoud be considered "Active".
   * @member {date} [startTime] The beginning time in UTC of a range that the
   * recommendation refers to.
   * @member {date} [endTime] The end time in UTC of a range that the
   * recommendation refers to.
   * @member {date} [nextNotificationTime] When to notify this recommendation
   * next in UTC. Null means that this will never be notified anymore.
   * @member {date} [notificationExpirationTime] Date and time in UTC when this
   * notification expires.
   * @member {date} [notifiedTime] Last timestamp in UTC this instance was
   * actually notified. Null means that this recommendation hasn't been
   * notified yet.
   * @member {number} [score] A metric value measured by the rule.
   * @member {boolean} [isDynamic] True if this is associated with a
   * dynamically added rule
   * @member {string} [extensionName] Extension name of the portal if exists.
   * @member {string} [bladeName] Deep link to a blade on the portal.
   * @member {string} [forwardLink] Forward link to an external document
   * associated with the rule.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Recommendation
   *
   * @returns {object} metadata of Recommendation
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Recommendation',
      type: {
        name: 'Composite',
        className: 'Recommendation',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          creationTime: {
            required: false,
            serializedName: 'properties.creationTime',
            type: {
              name: 'DateTime'
            }
          },
          recommendationId: {
            required: false,
            serializedName: 'properties.recommendationId',
            type: {
              name: 'String'
            }
          },
          resourceId: {
            required: false,
            serializedName: 'properties.resourceId',
            type: {
              name: 'String'
            }
          },
          resourceScope: {
            required: false,
            serializedName: 'properties.resourceScope',
            type: {
              name: 'String'
            }
          },
          ruleName: {
            required: false,
            serializedName: 'properties.ruleName',
            type: {
              name: 'String'
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            type: {
              name: 'String'
            }
          },
          message: {
            required: false,
            serializedName: 'properties.message',
            type: {
              name: 'String'
            }
          },
          level: {
            required: false,
            serializedName: 'properties.level',
            type: {
              name: 'Enum',
              allowedValues: [ 'Critical', 'Warning', 'Information', 'NonUrgentSuggestion' ]
            }
          },
          channels: {
            required: false,
            serializedName: 'properties.channels',
            type: {
              name: 'Enum',
              allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ]
            }
          },
          categoryTags: {
            required: false,
            readOnly: true,
            serializedName: 'properties.categoryTags',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          actionName: {
            required: false,
            serializedName: 'properties.actionName',
            type: {
              name: 'String'
            }
          },
          enabled: {
            required: false,
            serializedName: 'properties.enabled',
            type: {
              name: 'Number'
            }
          },
          states: {
            required: false,
            serializedName: 'properties.states',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          startTime: {
            required: false,
            serializedName: 'properties.startTime',
            type: {
              name: 'DateTime'
            }
          },
          endTime: {
            required: false,
            serializedName: 'properties.endTime',
            type: {
              name: 'DateTime'
            }
          },
          nextNotificationTime: {
            required: false,
            serializedName: 'properties.nextNotificationTime',
            type: {
              name: 'DateTime'
            }
          },
          notificationExpirationTime: {
            required: false,
            serializedName: 'properties.notificationExpirationTime',
            type: {
              name: 'DateTime'
            }
          },
          notifiedTime: {
            required: false,
            serializedName: 'properties.notifiedTime',
            type: {
              name: 'DateTime'
            }
          },
          score: {
            required: false,
            serializedName: 'properties.score',
            type: {
              name: 'Number'
            }
          },
          isDynamic: {
            required: false,
            serializedName: 'properties.isDynamic',
            type: {
              name: 'Boolean'
            }
          },
          extensionName: {
            required: false,
            serializedName: 'properties.extensionName',
            type: {
              name: 'String'
            }
          },
          bladeName: {
            required: false,
            serializedName: 'properties.bladeName',
            type: {
              name: 'String'
            }
          },
          forwardLink: {
            required: false,
            serializedName: 'properties.forwardLink',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Recommendation;
