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

/**
 * The Azure event log entries are of type EventData
 *
 */
class EventData {
  /**
   * Create a EventData.
   * @property {object} [authorization] The sender authorization information.
   * @property {string} [authorization.action] the permissible actions. For
   * instance: microsoft.support/supporttickets/write
   * @property {string} [authorization.role] the role of the user. For
   * instance: Subscription Admin
   * @property {string} [authorization.scope] the scope.
   * @property {object} [claims] key value pairs to identify ARM permissions.
   * @property {string} [caller] the email address of the user who has
   * performed the operation, the UPN claim or SPN claim based on availability.
   * @property {string} [description] the description of the event.
   * @property {string} [id] the Id of this event as required by ARM for RBAC.
   * It contains the EventDataID and a timestamp information.
   * @property {string} [eventDataId] the event data Id. This is a unique
   * identifier for an event.
   * @property {string} [correlationId] the correlation Id, usually a GUID in
   * the string format. The correlation Id is shared among the events that
   * belong to the same uber operation.
   * @property {object} [eventName] the event name. This value should not be
   * confused with OperationName. For practical purposes, OperationName might
   * be more appealing to end users.
   * @property {string} [eventName.value] the invariant value.
   * @property {string} [eventName.localizedValue] the locale specific value.
   * @property {object} [category] the event category.
   * @property {string} [category.value] the invariant value.
   * @property {string} [category.localizedValue] the locale specific value.
   * @property {object} [httpRequest] the HTTP request info. Usually includes
   * the 'clientRequestId', 'clientIpAddress' (IP address of the user who
   * initiated the event) and 'method' (HTTP method e.g. PUT).
   * @property {string} [httpRequest.clientRequestId] the client request id.
   * @property {string} [httpRequest.clientIpAddress] the client Ip Address
   * @property {string} [httpRequest.method] the Http request method.
   * @property {string} [httpRequest.uri] the Uri.
   * @property {string} [level] the event level. Possible values include:
   * 'Critical', 'Error', 'Warning', 'Informational', 'Verbose'
   * @property {string} [resourceGroupName] the resource group name of the
   * impacted resource.
   * @property {object} [resourceProviderName] the resource provider name of
   * the impacted resource.
   * @property {string} [resourceProviderName.value] the invariant value.
   * @property {string} [resourceProviderName.localizedValue] the locale
   * specific value.
   * @property {string} [resourceId] the resource uri that uniquely identifies
   * the resource that caused this event.
   * @property {object} [resourceType] the resource type
   * @property {string} [resourceType.value] the invariant value.
   * @property {string} [resourceType.localizedValue] the locale specific
   * value.
   * @property {string} [operationId] It is usually a GUID shared among the
   * events corresponding to single operation. This value should not be
   * confused with EventName.
   * @property {object} [operationName] the operation name.
   * @property {string} [operationName.value] the invariant value.
   * @property {string} [operationName.localizedValue] the locale specific
   * value.
   * @property {object} [properties] the set of <Key, Value> pairs (usually a
   * Dictionary<String, String>) that includes details about the event.
   * @property {object} [status] a string describing the status of the
   * operation. Some typical values are: Started, In progress, Succeeded,
   * Failed, Resolved.
   * @property {string} [status.value] the invariant value.
   * @property {string} [status.localizedValue] the locale specific value.
   * @property {object} [subStatus] the event sub status. Most of the time,
   * when included, this captures the HTTP status code of the REST call. Common
   * values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201),
   * Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad
   * Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404),
   * Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code:
   * 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP
   * Status Code: 504)
   * @property {string} [subStatus.value] the invariant value.
   * @property {string} [subStatus.localizedValue] the locale specific value.
   * @property {date} [eventTimestamp] the timestamp of when the event was
   * generated by the Azure service processing the request corresponding the
   * event. It in ISO 8601 format.
   * @property {date} [submissionTimestamp] the timestamp of when the event
   * became available for querying via this API. It is in ISO 8601 format. This
   * value should not be confused eventTimestamp. As there might be a delay
   * between the occurrence time of the event, and the time that the event is
   * submitted to the Azure logging infrastructure.
   * @property {string} [subscriptionId] the Azure subscription Id usually a
   * GUID.
   * @property {string} [tenantId] the Azure tenant Id
   */
  constructor() {
  }

  /**
   * Defines the metadata of EventData
   *
   * @returns {object} metadata of EventData
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'EventData',
      type: {
        name: 'Composite',
        className: 'EventData',
        modelProperties: {
          authorization: {
            required: false,
            readOnly: true,
            serializedName: 'authorization',
            type: {
              name: 'Composite',
              className: 'SenderAuthorization'
            }
          },
          claims: {
            required: false,
            readOnly: true,
            serializedName: 'claims',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          caller: {
            required: false,
            readOnly: true,
            serializedName: 'caller',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            readOnly: true,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          eventDataId: {
            required: false,
            readOnly: true,
            serializedName: 'eventDataId',
            type: {
              name: 'String'
            }
          },
          correlationId: {
            required: false,
            readOnly: true,
            serializedName: 'correlationId',
            type: {
              name: 'String'
            }
          },
          eventName: {
            required: false,
            readOnly: true,
            serializedName: 'eventName',
            type: {
              name: 'Composite',
              className: 'LocalizableString'
            }
          },
          category: {
            required: false,
            readOnly: true,
            serializedName: 'category',
            type: {
              name: 'Composite',
              className: 'LocalizableString'
            }
          },
          httpRequest: {
            required: false,
            readOnly: true,
            serializedName: 'httpRequest',
            type: {
              name: 'Composite',
              className: 'HttpRequestInfo'
            }
          },
          level: {
            required: false,
            readOnly: true,
            serializedName: 'level',
            type: {
              name: 'Enum',
              allowedValues: [ 'Critical', 'Error', 'Warning', 'Informational', 'Verbose' ]
            }
          },
          resourceGroupName: {
            required: false,
            readOnly: true,
            serializedName: 'resourceGroupName',
            type: {
              name: 'String'
            }
          },
          resourceProviderName: {
            required: false,
            readOnly: true,
            serializedName: 'resourceProviderName',
            type: {
              name: 'Composite',
              className: 'LocalizableString'
            }
          },
          resourceId: {
            required: false,
            readOnly: true,
            serializedName: 'resourceId',
            type: {
              name: 'String'
            }
          },
          resourceType: {
            required: false,
            readOnly: true,
            serializedName: 'resourceType',
            type: {
              name: 'Composite',
              className: 'LocalizableString'
            }
          },
          operationId: {
            required: false,
            readOnly: true,
            serializedName: 'operationId',
            type: {
              name: 'String'
            }
          },
          operationName: {
            required: false,
            readOnly: true,
            serializedName: 'operationName',
            type: {
              name: 'Composite',
              className: 'LocalizableString'
            }
          },
          properties: {
            required: false,
            readOnly: true,
            serializedName: 'properties',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'status',
            type: {
              name: 'Composite',
              className: 'LocalizableString'
            }
          },
          subStatus: {
            required: false,
            readOnly: true,
            serializedName: 'subStatus',
            type: {
              name: 'Composite',
              className: 'LocalizableString'
            }
          },
          eventTimestamp: {
            required: false,
            readOnly: true,
            serializedName: 'eventTimestamp',
            type: {
              name: 'DateTime'
            }
          },
          submissionTimestamp: {
            required: false,
            readOnly: true,
            serializedName: 'submissionTimestamp',
            type: {
              name: 'DateTime'
            }
          },
          subscriptionId: {
            required: false,
            readOnly: true,
            serializedName: 'subscriptionId',
            type: {
              name: 'String'
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'tenantId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = EventData;
