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

/**
 * Class representing a PurchaseRequest.
 */
class PurchaseRequest {
  /**
   * Create a PurchaseRequest.
   * @property {object} [sku]
   * @property {string} [sku.name]
   * @property {string} [location] The Azure Region where the reserved resource
   * lives.
   * @property {string} [reservedResourceType] Possible values include:
   * 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb'
   * @property {string} [billingScopeId]
   * @property {string} [term] Possible values include: 'P1Y', 'P3Y'
   * @property {number} [quantity]
   * @property {string} [displayName] Friendly name of the Reservation
   * @property {string} [appliedScopeType] Possible values include: 'Single',
   * 'Shared'
   * @property {array} [appliedScopes]
   * @property {object} [reservedResourceProperties] Properties specific to
   * each reserved resource type. Not required if not applicable.
   * @property {string} [reservedResourceProperties.instanceFlexibility]
   * Possible values include: 'On', 'Off'
   */
  constructor() {
  }

  /**
   * Defines the metadata of PurchaseRequest
   *
   * @returns {object} metadata of PurchaseRequest
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PurchaseRequest',
      type: {
        name: 'Composite',
        className: 'PurchaseRequest',
        modelProperties: {
          sku: {
            required: false,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'SkuName'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          reservedResourceType: {
            required: false,
            serializedName: 'properties.reservedResourceType',
            type: {
              name: 'String'
            }
          },
          billingScopeId: {
            required: false,
            serializedName: 'properties.billingScopeId',
            type: {
              name: 'String'
            }
          },
          term: {
            required: false,
            serializedName: 'properties.term',
            type: {
              name: 'String'
            }
          },
          quantity: {
            required: false,
            serializedName: 'properties.quantity',
            type: {
              name: 'Number'
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            type: {
              name: 'String'
            }
          },
          appliedScopeType: {
            required: false,
            serializedName: 'properties.appliedScopeType',
            type: {
              name: 'String'
            }
          },
          appliedScopes: {
            required: false,
            serializedName: 'properties.appliedScopes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          reservedResourceProperties: {
            required: false,
            serializedName: 'properties.reservedResourceProperties',
            type: {
              name: 'Composite',
              className: 'PurchaseRequestPropertiesReservedResourceProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = PurchaseRequest;
