NAME
WebService::Etsy::Resource - Returned resources from the Etsy API.
SYNOPSIS
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";
}
DESCRIPTION
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.
METHODS
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.
RESULT OBJECTS
WebService::Etsy::Resource::String
The object behaves just like a string in scalar context. It does provide a value()
method if you need it.
WebService::Etsy::Resource::Int
The object behaves just like an integer in scalar context. It does provide a value()
method if you need it.
WebService::Etsy::Resource::Material
The object behaves just like a string in scalar context. It does provide a value()
method if you need it.
WebService::Etsy::Resource::Tag
The object behaves just like a string in scalar context. It does provide a value()
method if you need it.
Additional methods
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 parametersgetChildTags
accepts.
WebService::Etsy::Resource::Category
The object behaves just like a string in scalar context. It does provide a value()
method if you need it.
Additional methods
spaced
-
The string value of the category with underscores translated to spaces.
children
-
The "child categories" of this tag. Equivalent to calling
getChildCategories
with this category as the parameter. You can pass in any other parametersgetChildCategories
accepts.
WebService::Etsy::Resource::User
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.
Additional methods
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 parametersgetShopDetails
accepts.
WebService::Etsy::Resource::Shop
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.
Some of the methods may return undef if the relevant detail level was not requested.
Additional methods
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 parametersgetListings
accepts.
WebService::Etsy::Resource::Listing
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#listings.
Some of the methods may return undef if the relevant detail level was not requested.
Additional methods
shop
-
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 parametersgetShopDetails
accepts.
WebService::Etsy::Resource::GiftGuide
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#gift_guides.
Additional methods
listings
-
Return the listings in the guide. Equivalent to calling
getGiftGuides
with this guide's ID as the parameter. You can pass in any other parametersgetGiftGuides
accepts.
WebService::Etsy::Resource::Feedback
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#feedback.
Additional methods
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 parametersgetUserDetails
accepts. 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 parametersgetShopDetails
accepts. -
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
(orgetShopDetails
) with this user's ID as the parameter. You can pass in any other parametersgetUserDetails
(orgetShopDetails
) 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
(orgetShopDetails
) with this user's ID as the parameter. You can pass in any other parametersgetUserDetails
(orgetShopDetails
) accepts. from_buyer()
-
Boolean - is the feedback from a buyer?
from_seller()
-
Boolean - is the feedback from a seller?
WebService::Etsy::Resource::ShopSection
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#shop_sections.
Additional methods
listings()
-
Get the listings in a section. Equivalent to calling
getShopListings
section's ID as the section parameter. You can pass in any other parametersgetShopListings
accepts.
WebService::Etsy::Resource::Method
The object includes methods corresponding to the field values described at http://developer.etsy.com/docs#methods.
SEE ALSO
http://developer.etsy.com/docs#resource_types, WebService::Etsy::Response.
AUTHOR
Ian Malpass (ian-cpan@indecorous.com)
COPYRIGHT
Copyright 2009, Ian Malpass
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.