C# Class TradeMe.Api.Client.ListingMethods

The ListingMethods class contains the methods requried for making calls to the API related to Listings.
显示文件 Open project: TradeMe/trade-me-api-wrapper Class Usage Examples

Public Methods

Method Description
AnswerSpecificQuestion ( ListingAnswerQuestion answerQuestion, string listingId, string questionId ) : System.Xml.Linq.XDocument

Performs the Listing Method: Provide an answer for a specific question. POST

Serializes the given ListingAnswerQuestion into xml. Creates a query string using the parameters provided.

All the parameters are required.

REQUIRES AUTHENTICATION.

CommentOnListing ( ListingAddComment addComment, string listingId ) : System.Xml.Linq.XDocument

Performs the Listing Method: Post a comment on a listing.

Serializes the given ListingAddComment into xml. Creates a query string using the listingId provided .

All the parameters are required.

REQUIRES AUTHENTICATION.

EmailFriend ( EmailFriendRequest email, string listingId ) : System.Xml.Linq.XDocument

Performs the Listing Method: Send an email regarding an auction to a friend.

Serializes the given EmailFriendRequest into xml. Creates a query string using the listingId provided .

All the parameters are required.

REQUIRES AUTHENTICATION.

EmailSellerOfClassified ( EmailRequest emailRequest, string listingId ) : System.Xml.Linq.XDocument

Performs the Listing Method: Send an email to the seller of a classified.

Serializes the given EmailRequest into xml. Creates a query string using the listingId provided .

All the parameters are required.

REQUIRES AUTHENTICATION.

GetClosingSoonListings ( ) : ClosingSoonListings

Performs the Listing Method: Retrieves the items closing soon for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.

GetFeaturedListings ( ) : FeaturedListings

Performs the Listing Method: Retrieves the featured listings for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.

GetHotListings ( ) : HotListings

Performs the Listing Method: Retrieves the hot items for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.

GetLatestListings ( ) : LatestListings

Performs the Listing Method: Retrieves the latest listed items for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.

GetOneDollarListings ( ) : OneDollarListings

Performs the Listing Method: Retrieves the items with one dollar reserves for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.

ListingDetail ( string query ) : ListedItemDetail

Performs the Listing Method: Retrieve the details of a single listing

using the "query" string provided - should be the "Listings/{listing_id}.xml" part of the url. It shouldn't include "http://api.trademe.co.nz/v1/".

DOES NOT REQUIRE AUTHENTICATION.

ListingDetailById ( string id ) : ListedItemDetail

Performs the Listing Method: Retrieve the details of a single listing.

Creates a query string using the listing id parameter provided.

DOES NOT REQUIRE AUTHENTICATION.

ListingMethods ( ConnectionMethods connect ) : System

Initializes a new instance of the ListingMethods class.

SendComplaint ( ComplaintRequest complaintRequest, string listingId ) : XDocument

Performs the Listing Method: Sends a complaint about a listing to the Trade Me customer service team.

Serializes the given ComplaintRequest into xml. Creates a query string using the listingId provided .

All the parameters are required.

REQUIRES AUTHENTICATION.

UnansweredQuestionsAll ( ) : Questions

Performs the Listing Method: Retrieves a list of all the unanswered questions for all live auctions of the authenticated user. GET

REQUIRES AUTHENTICATION.

UnansweredQuestionsById ( string listingId ) : Questions

Performs the Listing Method: Retrieve a list of unanswered questions for all listings belonging to a member, Retrieve a list of unanswered questions on a single listing.

Creates a query string using the id parameter provided - the parameter should be null if the request is for all listings belonging to a member.

REQUIRES AUTHENTICATION.

UnansweredQuestionsByQueryString ( string query ) : Questions

Performs the Listing Method: Retrieve a list of unanswered questions for all listings belonging to a member, Retrieve a list of unanswered questions on a single listing,

using the "query" string provided - should be the "Listings/questions/unansweredquestions.xml" part of the url. It shouldn't include "http://api.trademe.co.nz/v1/".

REQUIRES AUTHENTICATION.

Private Methods

Method Description
ListedItemDetailConnectionHelper ( string url ) : ListedItemDetail

A helper method for performing the http request for ListedItemDetail requests.

Method Details

AnswerSpecificQuestion() public method

Performs the Listing Method: Provide an answer for a specific question. POST

Serializes the given ListingAnswerQuestion into xml. Creates a query string using the parameters provided.

All the parameters are required.

REQUIRES AUTHENTICATION.
public AnswerSpecificQuestion ( ListingAnswerQuestion answerQuestion, string listingId, string questionId ) : System.Xml.Linq.XDocument
answerQuestion ListingAnswerQuestion The object that will be serialized into xml and then sent in a POST message.
listingId string The id of the listing that has the question being answered.
questionId string The id of the question being answered.
return System.Xml.Linq.XDocument

CommentOnListing() public method

Performs the Listing Method: Post a comment on a listing.

Serializes the given ListingAddComment into xml. Creates a query string using the listingId provided .

All the parameters are required.

REQUIRES AUTHENTICATION.
public CommentOnListing ( ListingAddComment addComment, string listingId ) : System.Xml.Linq.XDocument
addComment ListingAddComment The object that will be serialized into xml and then sent in a POST message.
listingId string The id of the listing the comment should be added to.
return System.Xml.Linq.XDocument

EmailFriend() public method

Performs the Listing Method: Send an email regarding an auction to a friend.

Serializes the given EmailFriendRequest into xml. Creates a query string using the listingId provided .

All the parameters are required.

REQUIRES AUTHENTICATION.
public EmailFriend ( EmailFriendRequest email, string listingId ) : System.Xml.Linq.XDocument
email EmailFriendRequest The object that will be serialized into xml and then sent in a POST message.
listingId string The id of the listing you want to email about.
return System.Xml.Linq.XDocument

EmailSellerOfClassified() public method

Performs the Listing Method: Send an email to the seller of a classified.

Serializes the given EmailRequest into xml. Creates a query string using the listingId provided .

All the parameters are required.

REQUIRES AUTHENTICATION.
public EmailSellerOfClassified ( EmailRequest emailRequest, string listingId ) : System.Xml.Linq.XDocument
emailRequest EmailRequest The object that will be serialized into xml and then sent in a POST message.
listingId string The id of the listing that youwant to email about.
return System.Xml.Linq.XDocument

GetClosingSoonListings() public method

Performs the Listing Method: Retrieves the items closing soon for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.
public GetClosingSoonListings ( ) : ClosingSoonListings
return ClosingSoonListings

GetFeaturedListings() public method

Performs the Listing Method: Retrieves the featured listings for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.
public GetFeaturedListings ( ) : FeaturedListings
return FeaturedListings

GetHotListings() public method

Performs the Listing Method: Retrieves the hot items for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.
public GetHotListings ( ) : HotListings
return HotListings

GetLatestListings() public method

Performs the Listing Method: Retrieves the latest listed items for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.
public GetLatestListings ( ) : LatestListings
return LatestListings

GetOneDollarListings() public method

Performs the Listing Method: Retrieves the items with one dollar reserves for the whole country or for a single region. GET

DOES NOT REQUIRE AUTHENTICATION.
public GetOneDollarListings ( ) : OneDollarListings
return OneDollarListings

ListingDetail() public method

Performs the Listing Method: Retrieve the details of a single listing

using the "query" string provided - should be the "Listings/{listing_id}.xml" part of the url. It shouldn't include "http://api.trademe.co.nz/v1/".

DOES NOT REQUIRE AUTHENTICATION.
public ListingDetail ( string query ) : ListedItemDetail
query string The query string that will be added to the base url and used to connect to the API with.
return ListedItemDetail

ListingDetailById() public method

Performs the Listing Method: Retrieve the details of a single listing.

Creates a query string using the listing id parameter provided.

DOES NOT REQUIRE AUTHENTICATION.
public ListingDetailById ( string id ) : ListedItemDetail
id string The listing id.
return ListedItemDetail

ListingMethods() public method

Initializes a new instance of the ListingMethods class.
public ListingMethods ( ConnectionMethods connect ) : System
connect ConnectionMethods A ConnectionMethods class used to make calls to the API
return System

SendComplaint() public method

Performs the Listing Method: Sends a complaint about a listing to the Trade Me customer service team.

Serializes the given ComplaintRequest into xml. Creates a query string using the listingId provided .

All the parameters are required.

REQUIRES AUTHENTICATION.
public SendComplaint ( ComplaintRequest complaintRequest, string listingId ) : XDocument
complaintRequest ComplaintRequest The object that will be serialized into xml and then sent in a POST message.
listingId string The id of the listing that youwant to complain about.
return XDocument

UnansweredQuestionsAll() public method

Performs the Listing Method: Retrieves a list of all the unanswered questions for all live auctions of the authenticated user. GET

REQUIRES AUTHENTICATION.
public UnansweredQuestionsAll ( ) : Questions
return Questions

UnansweredQuestionsById() public method

Performs the Listing Method: Retrieve a list of unanswered questions for all listings belonging to a member, Retrieve a list of unanswered questions on a single listing.

Creates a query string using the id parameter provided - the parameter should be null if the request is for all listings belonging to a member.

REQUIRES AUTHENTICATION.
public UnansweredQuestionsById ( string listingId ) : Questions
listingId string The listing id.
return Questions

UnansweredQuestionsByQueryString() public method

Performs the Listing Method: Retrieve a list of unanswered questions for all listings belonging to a member, Retrieve a list of unanswered questions on a single listing,

using the "query" string provided - should be the "Listings/questions/unansweredquestions.xml" part of the url. It shouldn't include "http://api.trademe.co.nz/v1/".

REQUIRES AUTHENTICATION.
public UnansweredQuestionsByQueryString ( string query ) : Questions
query string The query string that will be added to the base url and used to connect to the API.
return Questions