# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::Reservations::Mgmt::V2019_04_01_preview
  module Models
    #
    # Model object.
    #
    #
    class PurchaseRequest

      include MsRestAzure

      # @return [SkuName]
      attr_accessor :sku

      # @return [String] The Azure Region where the reserved resource lives.
      attr_accessor :location

      # @return [ReservedResourceType] Possible values include:
      # 'VirtualMachines', 'SqlDatabases', 'SuseLinux', 'CosmosDb', 'RedHat',
      # 'SqlDataWarehouse', 'VMwareCloudSimple', 'RedHatOsa'
      attr_accessor :reserved_resource_type

      # @return [String]
      attr_accessor :billing_scope_id

      # @return [ReservationTerm] Possible values include: 'P1Y', 'P3Y'
      attr_accessor :term

      # @return [ReservationBillingPlan] Possible values include: 'Upfront',
      # 'Monthly'
      attr_accessor :billing_plan

      # @return [Integer]
      attr_accessor :quantity

      # @return [String] Friendly name of the Reservation
      attr_accessor :display_name

      # @return [AppliedScopeType] Possible values include: 'Single', 'Shared'
      attr_accessor :applied_scope_type

      # @return [Array<String>]
      attr_accessor :applied_scopes

      # @return [Boolean]
      attr_accessor :renew

      # @return [PurchaseRequestPropertiesReservedResourceProperties]
      # Properties specific to each reserved resource type. Not required if not
      # applicable.
      attr_accessor :reserved_resource_properties


      #
      # Mapper for PurchaseRequest class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'PurchaseRequest',
          type: {
            name: 'Composite',
            class_name: 'PurchaseRequest',
            model_properties: {
              sku: {
                client_side_validation: true,
                required: false,
                serialized_name: 'sku',
                type: {
                  name: 'Composite',
                  class_name: 'SkuName'
                }
              },
              location: {
                client_side_validation: true,
                required: false,
                serialized_name: 'location',
                type: {
                  name: 'String'
                }
              },
              reserved_resource_type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.reservedResourceType',
                type: {
                  name: 'String'
                }
              },
              billing_scope_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.billingScopeId',
                type: {
                  name: 'String'
                }
              },
              term: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.term',
                type: {
                  name: 'String'
                }
              },
              billing_plan: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.billingPlan',
                type: {
                  name: 'String'
                }
              },
              quantity: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.quantity',
                type: {
                  name: 'Number'
                }
              },
              display_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.displayName',
                type: {
                  name: 'String'
                }
              },
              applied_scope_type: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.appliedScopeType',
                type: {
                  name: 'String'
                }
              },
              applied_scopes: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.appliedScopes',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'StringElementType',
                      type: {
                        name: 'String'
                      }
                  }
                }
              },
              renew: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.renew',
                type: {
                  name: 'Boolean'
                }
              },
              reserved_resource_properties: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.reservedResourceProperties',
                type: {
                  name: 'Composite',
                  class_name: 'PurchaseRequestPropertiesReservedResourceProperties'
                }
              }
            }
          }
        }
      end
    end
  end
end
