class Bio::BaseSpace::Purchase

Represents a BaseSpace Purchase object.

Public Class Methods

new() click to toggle source

Create a new Purchase instance.

# File lib/basespace/model/purchase.rb, line 24
def initialize
  @swagger_types = {
    'Id'                   => 'str',
    'Status'               => 'str',       # PENDING, CANCELLED, ERRORED, COMPLETED
    'RefundStatus'         => 'str',       # NOTREFUNDED, REFUNDED
    'DateCreated'          => 'datetime',
    'DateUpdated'          => 'datetime',
    'InvoiceNumber'        => 'str',
    'Amount'               => 'str',
    'AmountOfTax'          => 'str',
    'AmountTotal'          => 'str',
    'Products'             => 'list<Product>',
    'PurchaseType'         => 'str',
    'AppSession'           => 'AppSessionCompact',
    'User'                 => 'UserCompact',
    'Application'          => 'ApplicationCompact',
    'HrefPurchaseDialog'   => 'str',       # new purchases only
    'RefundSecret'         => 'str',       # new purchases only
    'ExceptionMessage'     => 'str',       # errors only
    'ExceptionStackTrace'  => 'str',       # errors only
    'DateRefunded'         => 'datetime',  # refunds only
    'UserRefundedBy'       => 'str',       # refunds only
    'RefundComment'        => 'str',       # refunds only
  }
  @attributes = {
    'Id'                   => nil,
    'Status'               => nil,
    'RefundStatus'         => nil,
    'DateCreated'          => nil,
    'DateUpdated'          => nil,
    'InvoiceNumber'        => nil,
    'Amount'               => nil,
    'AmountOfTax'          => nil,
    'AmountTotal'          => nil,
    'Products'             => nil,
    'PurchaseType'         => nil,
    'AppSession'           => nil,
    'User'                 => nil,
    'Application'          => nil,
    'HrefPurchaseDialog'   => nil,
    'RefundSecret'         => nil,
    'ExceptionMessage'     => nil,
    'ExceptionStackTrace'  => nil,
    'DateRefunded'         => nil,
    'UserRefundedBy'       => nil,
    'RefundComment'        => nil,
  }
end

Public Instance Methods

is_init() click to toggle source

Test if the Purchase instance has been initialized.

Throws ModelNotInitializedError, if the object has not been populated yet.

# File lib/basespace/model/purchase.rb, line 81
def is_init
  raise ModelNotInitializedError.new('The project model has not been initialized yet') unless get_attr('Id')
end
to_s() click to toggle source

Return the purchase ID.

# File lib/basespace/model/purchase.rb, line 74
def to_s
  return @id.to_s
end