WebService::Etsy::Resource - Returned resources from the Etsy API.
my $resp = $api->getFeaturedSellers( detail_level => 'medium' ); # call methods on the object print $resp->count . " featured sellers\n"; # use the object like an arrayref of resources for my $shop ( @$resp ) { # $shop is a WebService::Etsy::Resource::Shop object print $shop->shop_name, "\n"; }
The API returns different resource types - shops, users, listings, methods, tags, materials, sections, feedbacks, ints, and strings.
Each return type has its own corresponding Perl class, with methods appropriate to its contents.
new( $data )
Constructor method inherited by Resource classes from the Resource base class. Takes the data for the resource as extracted from the API response.
Generally only called by other methods in this library.
The object behaves just like a string in scalar context. It does provide a value() method if you need it.
value()
The object behaves just like an integer in scalar context. It does provide a value() method if you need it.
spaced
The string value of the tag with underscores translated to spaces.
children
The "child tags" of this tag. Equivalent to calling getChildTags with this tag as the parameter. You can pass in any other parameters getChildTags accepts.
getChildTags
The string value of the category with underscores translated to spaces.
The "child categories" of this tag. Equivalent to calling getChildCategories with this category as the parameter. You can pass in any other parameters getChildCategories accepts.
getChildCategories
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#users.
Some of the methods may return undef if the relevant detail level was not requested.
shop
If the user is a seller, returns the shop object for the user. Equivalent to calling getShopDetails with this user's ID as the parameter. You can pass in any other parameters getShopDetails accepts.
getShopDetails
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#shops. Note that it extends the WebService::Etsy::Resource::User class.
WebService::Etsy::Resource::User
listings
Get the listings for the shop. Equivalent to calling getListings with this shop's ID as the parameter. You can pass in any other parameters getListings accepts.
getListings
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#listings.
Return the shop object for the listing's seller. Equivalent to calling getShopDetails with this listing's shop ID as the parameter. You can pass in any other parameters getShopDetails accepts.
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#gift_guides.
Return the listings in the guide. Equivalent to calling getGiftGuides with this guide's ID as the parameter. You can pass in any other parameters getGiftGuides accepts.
getGiftGuides
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#feedback.
buyer()
Get the user object of the buyer. Equivalent to calling getUserDetails with this user's ID as the parameter. You can pass in any other parameters getUserDetails accepts.
getUserDetails
seller()
Get the shop object of the seller. Equivalent to calling getShopDetails with this user's ID as the parameter. You can pass in any other parameters getShopDetails accepts.
author()
Get the user or shop object of the author (user if the buyer is the author, shop if the seller is the author). Equivalent to calling getUserDetails (or getShopDetails) with this user's ID as the parameter. You can pass in any other parameters getUserDetails (or getShopDetails) accepts.
subject()
Get the user or shop object of the subject (user if the buyer is the subject, shop if the seller is the subject). Equivalent to calling getUserDetails (or getShopDetails) with this user's ID as the parameter. You can pass in any other parameters getUserDetails (or getShopDetails) accepts.
from_buyer()
Boolean - is the feedback from a buyer?
from_seller()
Boolean - is the feedback from a seller?
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#shop_sections.
listings()
Get the listings in a section. Equivalent to calling getShopListings section's ID as the section parameter. You can pass in any other parameters getShopListings accepts.
getShopListings
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#methods.
http://developer.etsy.com/docs#resource_types, WebService::Etsy::Response.
Ian Malpass (ian-cpan@indecorous.com)
Copyright 2009, Ian Malpass
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WebService::Etsy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Etsy
CPAN shell
perl -MCPAN -e shell install WebService::Etsy
For more information on module installation, please visit the detailed CPAN module installation guide.