Business::Monzo::Attachment
A class for a Monzo attachment, extends Business::Monzo::Resource
The Attachment class has the following attributes (with their type).
id (Str) user_id (Str) external_id (Str) upload_url (Str) file_name (Str) file_url (Str) file_type (Str) created (DateTime)
Note that when when a Str is passed to ->created this will be coerced to a DateTime object.
Gets the upload_url and file_url for the given file_name and file_type. Returns a new Business::Monzo::Attachment object with the attributes file_name, file_type, file_url, and upload_url populated. Note the required parameters:
my $file_details = $Attachment->upload( file_name => 'foo.png', # REQUIRED file_type => 'image/png', # REQUIRED );
TODO: should probably make this easier - upload should actually upload a given file (file handle?)
Registers an attachment against an entity (transaction, etc). Returns a new Business::Monzo::Attachment object with the details populated
my $file_details = $Attachment->webhooks( # the following are REQUIRED if not set on $Attachment file_url => 'http://www.example.com/foo.png', # REQUIRED file_type => 'image/png', # REQUIRED # one of the following REQUIRED: external_id => $id, entity => $object # Business::Monzo:: - Transaction, Account, etc );
Removes an attachment
$attachment->deregister;
Business::Monzo
Business::Monzo::Resource
Lee Johnson - leejo@cpan.org
leejo@cpan.org
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. If you would like to contribute documentation, features, bug fixes, or anything else then please raise an issue / pull request:
https://github.com/leejo/business-monzo
To install Business::Monzo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::Monzo
CPAN shell
perl -MCPAN -e shell install Business::Monzo
For more information on module installation, please visit the detailed CPAN module installation guide.