Class: CorePro::CustomerDocument

Inherits:
Models::ModelBase show all
Defined in:
lib/corepro/customer_document.rb

Instance Attribute Summary collapse

Attributes inherited from Models::ModelBase

#requestId

Instance Method Summary collapse

Methods inherited from Models::ModelBase

escape, #to_s

Methods inherited from Models::JsonBase

#from_json!, #is_hash?, #to_hash, #to_json

Instance Attribute Details

#customerIdObject

Returns the value of attribute customerId.



8
9
10
# File 'lib/corepro/customer_document.rb', line 8

def customerId
  @customerId
end

#documentContentObject

Returns the value of attribute documentContent.



11
12
13
# File 'lib/corepro/customer_document.rb', line 11

def documentContent
  @documentContent
end

#documentNameObject

Returns the value of attribute documentName.



10
11
12
# File 'lib/corepro/customer_document.rb', line 10

def documentName
  @documentName
end

#documentTypeObject

Returns the value of attribute documentType.



9
10
11
# File 'lib/corepro/customer_document.rb', line 9

def documentType
  @documentType
end

#reasonTypeObject

Returns the value of attribute reasonType.



12
13
14
# File 'lib/corepro/customer_document.rb', line 12

def reasonType
  @reasonType
end

Instance Method Details

#upload(connection = nil, loggingObject = nil) ⇒ Object



14
15
16
17
18
19
# File 'lib/corepro/customer_document.rb', line 14

def upload(connection = nil, loggingObject = nil)
  # NOTE: documentContent is assumed to be raw content bytes.
  #       corepro API expects base64 encoded string. so we convert that here.
  self.documentContent = Base64.encode64(self.documentContent)
  CorePro::Utils::Requestor.post('/customerdocument/upload', nil, self, connection, loggingObject)
end