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

/**
 * Request Report data.
 *
 */
class RequestReportRecordContract {
  /**
   * Create a RequestReportRecordContract.
   * @property {string} [apiId] API identifier path. /apis/{apiId}
   * @property {string} [operationId] Operation identifier path.
   * /apis/{apiId}/operations/{operationId}
   * @property {string} [productId] Product identifier path.
   * /products/{productId}
   * @property {string} [userId] User identifier path. /users/{userId}
   * @property {string} [method] The HTTP method associated with this request..
   * @property {string} [url] The full URL associated with this request.
   * @property {string} [ipAddress] The client IP address associated with this
   * request.
   * @property {string} [backendResponseCode] The HTTP status code received by
   * the gateway as a result of forwarding this request to the backend.
   * @property {number} [responseCode] The HTTP status code returned by the
   * gateway.
   * @property {number} [responseSize] The size of the response returned by the
   * gateway.
   * @property {date} [timestamp] The date and time when this request was
   * received by the gateway in ISO 8601 format.
   * @property {string} [cache] Specifies if response cache was involved in
   * generating the response. If the value is none, the cache was not used. If
   * the value is hit, cached response was returned. If the value is miss, the
   * cache was used but lookup resulted in a miss and request was fulfilled by
   * the backend.
   * @property {number} [apiTime] The total time it took to process this
   * request.
   * @property {number} [serviceTime] he time it took to forward this request
   * to the backend and get the response back.
   * @property {string} [apiRegion] Azure region where the gateway that
   * processed this request is located.
   * @property {string} [subscriptionId] Subscription identifier path.
   * /subscriptions/{subscriptionId}
   * @property {string} [requestId] Request Identifier.
   * @property {number} [requestSize] The size of this request..
   */
  constructor() {
  }

  /**
   * Defines the metadata of RequestReportRecordContract
   *
   * @returns {object} metadata of RequestReportRecordContract
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RequestReportRecordContract',
      type: {
        name: 'Composite',
        className: 'RequestReportRecordContract',
        modelProperties: {
          apiId: {
            required: false,
            serializedName: 'apiId',
            type: {
              name: 'String'
            }
          },
          operationId: {
            required: false,
            serializedName: 'operationId',
            type: {
              name: 'String'
            }
          },
          productId: {
            required: false,
            readOnly: true,
            serializedName: 'productId',
            type: {
              name: 'String'
            }
          },
          userId: {
            required: false,
            readOnly: true,
            serializedName: 'userId',
            type: {
              name: 'String'
            }
          },
          method: {
            required: false,
            serializedName: 'method',
            type: {
              name: 'String'
            }
          },
          url: {
            required: false,
            serializedName: 'url',
            type: {
              name: 'String'
            }
          },
          ipAddress: {
            required: false,
            serializedName: 'ipAddress',
            type: {
              name: 'String'
            }
          },
          backendResponseCode: {
            required: false,
            serializedName: 'backendResponseCode',
            type: {
              name: 'String'
            }
          },
          responseCode: {
            required: false,
            serializedName: 'responseCode',
            type: {
              name: 'Number'
            }
          },
          responseSize: {
            required: false,
            serializedName: 'responseSize',
            type: {
              name: 'Number'
            }
          },
          timestamp: {
            required: false,
            serializedName: 'timestamp',
            type: {
              name: 'DateTime'
            }
          },
          cache: {
            required: false,
            serializedName: 'cache',
            type: {
              name: 'String'
            }
          },
          apiTime: {
            required: false,
            serializedName: 'apiTime',
            type: {
              name: 'Number'
            }
          },
          serviceTime: {
            required: false,
            serializedName: 'serviceTime',
            type: {
              name: 'Number'
            }
          },
          apiRegion: {
            required: false,
            serializedName: 'apiRegion',
            type: {
              name: 'String'
            }
          },
          subscriptionId: {
            required: false,
            serializedName: 'subscriptionId',
            type: {
              name: 'String'
            }
          },
          requestId: {
            required: false,
            serializedName: 'requestId',
            type: {
              name: 'String'
            }
          },
          requestSize: {
            required: false,
            serializedName: 'requestSize',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = RequestReportRecordContract;
