com.ebay.sdk.call.GetAccountCall Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ebaysdkcore939 Show documentation
Show all versions of ebaysdkcore939 Show documentation
Repack of the eBay SDK version 939 for repository use
/*
Copyright (c) 2013 eBay, Inc.
This program is licensed under the terms of the eBay Common Development and
Distribution License (CDDL) Version 1.0 (the "License") and any subsequent version
thereof released by eBay. The then-current version of the License can be found
at http://www.opensource.org/licenses/cddl1.php and in the eBaySDKLicense file that
is under the eBay SDK ../docs directory.
*/
package com.ebay.sdk.call;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Calendar;
import com.ebay.sdk.*;
import com.ebay.soap.eBLBaseComponents.*;
/**
* Wrapper class of the GetAccount call of eBay SOAP API.
*
* Title: SOAP API wrapper library.
* Description: Contains wrapper classes for eBay SOAP APIs.
* Copyright: Copyright (c) 2009
* Company: eBay Inc.
*
Input property: ViewType
- This field is used by the user to control which account entries are returned. The user has options to retrieve all new account entries (since last invoice), all account entries between two specified dates, or all account entries from a specified invoice. If this field is not include
*
Input property: InvoiceDate
- This field is used to retrieve all account entries from a specific invoice, which is identified through this InvoiceDate field with the timestamp of the account invoice. This field is only applicable if the AccountHistorySelection value is set to 'SpecifiedInvoice'; otherwise, this field will be ignored.
*
Input property: ViewPeriod
- Helper wrapper to set GetAccountRequestType BeginDate, EndDate:
* TimeFrom sets GetAccountRequestType.BeginDate:
* This field is used to retrieve all account entries dating back to the timestamp passed into this BeginDate field up until the timestamp passed into the EndDate field. The BeginDate value can not be set back any further than four months into the past.
*
* The allowed date formats are YYYY-MM-DD and YYYY-MM-DD HH:mm:ss The BeginDate value must be less than or equal to the EndDate value. The user might use the same values in both fields if that user wanted to retrieve all account entries from a specific day (if YYYY-MM-DD format used) or wanted to retrieve a specific account entry (if YYYY-MM-DD HH:mm:ss format used).
*
* This field is only applicable if the AccountHistorySelection value is set to 'BetweenSpecifiedDates'; otherwise, this field will be ignored. fiedDates' is used, both the BeginDate and EndDate must be included.
* TimeTo sets GetAccountRequestType.EndDate:
* This field is used to retrieve all account entries dating up to the timestamp passed into this EndDate field dating back to the timestamp passed into the BeginDate field. The EndDate value can not be set for a future date.
*
* The allowed date formats are YYYY-MM-DD and YYYY-MM-DD HH:mm:ss The EndDate value must be more than or equal to the BeginDate value. The user might use the same values in both fields if that user wanted to retrieve all account entries from a specific day (if YYYY-MM-DD format used) or wanted to retrieve a specific account entry (if YYYY-MM-DD HH:mm:ss format used).
*
* This field is only applicable if the AccountHistorySelection value is set to 'BetweenSpecifiedDates'; otherwise, this field will be ignored. If 'BetweenSpecifiedDates' is used, both the BeginDate and EndDate must be included.
*
Input property: Pagination
- This container is used to control how many account entries are returned on each page of data in the response. PaginationType is used by numerous Trading API calls, and the default and maximum values for the EntriesPerPage field differs with each call. For the GetAccount call, the default value is 500 (account entries) per page, and maximum allowed value is 2000 (account entries) per page.
*
Input property: ExcludeBalance
- By default, the current balance of the user's account will not be returned in the call response. To retrieve the current balance of their account, the user should include the ExcludeBalance flag in the request and set its value to 'false'. The current balance on the account will be shown in the AccountSummary.CurrentBalance field in the call response.
*
Input property: ExcludeSummary
- Specifies whether to return account summary information in an
* AccountSummary node. Default is true, to return AccountSummary.
*
Input property: IncludeConversionRate
- Specifies whether to retrieve the rate used for the currency conversion for usage transactions.
*
Input property: AccountEntrySortType
- Specifies how account entries should be sorted in the response, by an
* element and then in ascending or descending order.
*
Input property: Currency
- Specifies the currency used in the account report. Do not specify Currency
* in the request unless the following conditions are met. First, the user has
* or had multiple accounts under the same UserID. Second, the account
* identified in the request uses the currency you specify in the request. An
* error is returned if no account is found that uses the currency you specify
* in the request.
*
Input property: ItemID
- Specifies the item ID for which to return account entries. If ItemID is
* used, all other filters in the request are ignored. If the specified item
* does not exist or if the requesting user is not the seller of the item, an
* error is returned.
*
Output property: AccountID
- Specifies the seller's unique account number.
*
Output property: AccountSummary
- Contains summary data for the seller's account, such as the overall
* balance, bank account and credit card information, and amount and
* date of any past due balances. Can also contain data for
* one or more additional accounts, if the user has changed country
* of residence.
*
Output property: ReturnedCurrency
- Indicates the currency used for monetary amounts in the report.
*
Output property: AccountEntries
- This container holds an array of account entries. The account entries that are returned are dependent on the selection that the user made in the AccountHistorySelection field in the call request. Each AccountEntry container consists of one credit, one debit, or one administrative action on the account. It is possible that no AccountEntry containers will be returned if no account entries exist since the last invoice (if 'LastInvoice' value is used), between the specified dates (if 'BetweenSpecifiedDates' value is used), or on a specified invoice (if 'SpecifiedInvoice' value is used).
*
Output property: PaginationResult
- This container shows the total number of account entries and the total number of account entry pages that exist based on the filters used in the GetAccount call request. The total number of account entry pages is partly controlled by the Pagination.EntriesPerPage value that is set in the request.
*
Output property: HasMoreEntries
- If this boolean value is returned as 'true', there are more account entries to view on one or more pages of data. To view additional entries, the user would have to make additional GetAccount calls and increment the value of the Pagination.PageNumber field by '1' to view additional pages of account entries.
*
Output property: ReturnedEntriesPerPage
- This integer value indicates the number of account entries that are being returned per virtual page of data. This value will be the same value passed into
* the Pagination.EntriesPerPage field in the request.
*
Output property: ReturnedPageNumber
- This integer value indicates the current page number of account entries that is currently being shown. This value will be the same value passed into
* the Pagination.PageNumber field in the request.
*
* @author Ron Murphy
* @version 1.0
*/
public class GetAccountCall extends com.ebay.sdk.ApiCall
{
private AccountHistorySelectionCodeType viewType = AccountHistorySelectionCodeType.LAST_INVOICE;
private Calendar invoiceDate = null;
private TimeFilter viewPeriod = null;
private PaginationType pagination = null;
private Boolean excludeBalance = null;
private Boolean excludeSummary = null;
private Boolean includeConversionRate = null;
private AccountEntrySortTypeCodeType accountEntrySortType = null;
private CurrencyCodeType currency = null;
private String itemID = null;
private String accountID=null;
private AccountSummaryType accountSummary=null;
private CurrencyCodeType returnedCurrency=null;
private AccountEntryType[] accountEntries=null;
private PaginationResultType paginationResult=null;
private boolean hasMoreEntries=false;
private Integer returnedEntriesPerPage=null;
private Integer returnedPageNumber=null;
/**
* Constructor.
*/
public GetAccountCall() {
}
/**
* Constructor.
* @param apiContext The ApiContext object to be used to make the call.
*/
public GetAccountCall(ApiContext apiContext) {
super(apiContext);
}
/**
* Returns a seller's invoice data for their eBay account, including the account's
* summary data.
*
*
* @throws ApiException
* @throws SdkException
* @throws Exception
* @return The AccountEntryType[] object.
*/
public AccountEntryType[] getAccount()
throws com.ebay.sdk.ApiException, com.ebay.sdk.SdkException, java.lang.Exception
{
GetAccountRequestType req;
req = new GetAccountRequestType();
if( this.viewType == null )
throw new SdkException("ViewType property is not set.");
if( this.viewType.equals(AccountHistorySelectionCodeType.BETWEEN_SPECIFIED_DATES) )
{
if( this.viewPeriod == null )
throw new SdkException("GetAccountCall.ViewPeriod is not set.");
}
else if( this.viewType.equals(AccountHistorySelectionCodeType.SPECIFIED_INVOICE) )
{
if( this.invoiceDate == null )
throw new SdkException("GetAccountCall.InvoiceDate is not set.");
}
req.setDetailLevel(this.getDetailLevel());
if (this.viewType != null)
req.setAccountHistorySelection(this.viewType);
if (this.invoiceDate != null)
req.setInvoiceDate(this.invoiceDate);
if (this.viewPeriod != null)
{
req.setBeginDate(this.viewPeriod.getTimeFrom());
req.setEndDate(this.viewPeriod.getTimeTo());
}
if (this.pagination != null)
req.setPagination(this.pagination);
if (this.excludeBalance != null)
req.setExcludeBalance(this.excludeBalance);
if (this.excludeSummary != null)
req.setExcludeSummary(this.excludeSummary);
if (this.includeConversionRate != null)
req.setIncludeConversionRate(this.includeConversionRate);
if (this.accountEntrySortType != null)
req.setAccountEntrySortType(this.accountEntrySortType);
if (this.currency != null)
req.setCurrency(this.currency);
if (this.itemID != null)
req.setItemID(this.itemID);
GetAccountResponseType resp = (GetAccountResponseType) execute(req);
this.accountID = resp.getAccountID();
this.accountSummary = resp.getAccountSummary();
this.returnedCurrency = resp.getCurrency();
this.accountEntries = (resp.getAccountEntries() == null? null: resp.getAccountEntries().getAccountEntry());
this.paginationResult = resp.getPaginationResult();
this.hasMoreEntries = (resp.isHasMoreEntries() == null? false: resp.isHasMoreEntries().booleanValue());
this.returnedEntriesPerPage = resp.getEntriesPerPage();
this.returnedPageNumber = resp.getPageNumber();
return this.getAccountEntries();
}
/**
* Gets the GetAccountRequestType.accountEntrySortType.
* @return AccountEntrySortTypeCodeType
*/
public AccountEntrySortTypeCodeType getAccountEntrySortType()
{
return this.accountEntrySortType;
}
/**
* Sets the GetAccountRequestType.accountEntrySortType.
* @param accountEntrySortType AccountEntrySortTypeCodeType
*/
public void setAccountEntrySortType(AccountEntrySortTypeCodeType accountEntrySortType)
{
this.accountEntrySortType = accountEntrySortType;
}
/**
* Gets the GetAccountRequestType.currency.
* @return CurrencyCodeType
*/
public CurrencyCodeType getCurrency()
{
return this.currency;
}
/**
* Sets the GetAccountRequestType.currency.
* @param currency CurrencyCodeType
*/
public void setCurrency(CurrencyCodeType currency)
{
this.currency = currency;
}
/**
* Gets the GetAccountRequestType.excludeBalance.
* @return Boolean
*/
public Boolean getExcludeBalance()
{
return this.excludeBalance;
}
/**
* Sets the GetAccountRequestType.excludeBalance.
* @param excludeBalance Boolean
*/
public void setExcludeBalance(Boolean excludeBalance)
{
this.excludeBalance = excludeBalance;
}
/**
* Gets the GetAccountRequestType.excludeSummary.
* @return Boolean
*/
public Boolean getExcludeSummary()
{
return this.excludeSummary;
}
/**
* Sets the GetAccountRequestType.excludeSummary.
* @param excludeSummary Boolean
*/
public void setExcludeSummary(Boolean excludeSummary)
{
this.excludeSummary = excludeSummary;
}
/**
* Gets the GetAccountRequestType.includeConversionRate.
* @return Boolean
*/
public Boolean getIncludeConversionRate()
{
return this.includeConversionRate;
}
/**
* Sets the GetAccountRequestType.includeConversionRate.
* @param includeConversionRate Boolean
*/
public void setIncludeConversionRate(Boolean includeConversionRate)
{
this.includeConversionRate = includeConversionRate;
}
/**
* Gets the GetAccountRequestType.invoiceDate.
* @return Calendar
*/
public Calendar getInvoiceDate()
{
return this.invoiceDate;
}
/**
* Sets the GetAccountRequestType.invoiceDate.
* @param invoiceDate Calendar
*/
public void setInvoiceDate(Calendar invoiceDate)
{
this.invoiceDate = invoiceDate;
}
/**
* Gets the GetAccountRequestType.itemID.
* @return String
*/
public String getItemID()
{
return this.itemID;
}
/**
* Sets the GetAccountRequestType.itemID.
* @param itemID String
*/
public void setItemID(String itemID)
{
this.itemID = itemID;
}
/**
* Gets the GetAccountRequestType.pagination.
* @return PaginationType
*/
public PaginationType getPagination()
{
return this.pagination;
}
/**
* Sets the GetAccountRequestType.pagination.
* @param pagination PaginationType
*/
public void setPagination(PaginationType pagination)
{
this.pagination = pagination;
}
/**
* Gets the GetAccountRequestType.viewPeriod.
* @return TimeFilter
*/
public TimeFilter getViewPeriod()
{
return this.viewPeriod;
}
/**
* Sets the GetAccountRequestType.viewPeriod.
* @param viewPeriod TimeFilter
*/
public void setViewPeriod(TimeFilter viewPeriod)
{
this.viewPeriod = viewPeriod;
}
/**
* Gets the GetAccountRequestType.viewType.
* @return AccountHistorySelectionCodeType
*/
public AccountHistorySelectionCodeType getViewType()
{
return this.viewType;
}
/**
* Sets the GetAccountRequestType.viewType.
* @param viewType AccountHistorySelectionCodeType
*/
public void setViewType(AccountHistorySelectionCodeType viewType)
{
this.viewType = viewType;
}
/**
* Valid after executing the API.
* Gets the returned GetAccountResponseType.accountEntries.
*
* @return AccountEntryType[]
*/
public AccountEntryType[] getAccountEntries()
{
return this.accountEntries;
}
/**
* Valid after executing the API.
* Gets the returned GetAccountResponseType.accountID.
*
* @return String
*/
public String getAccountID()
{
return this.accountID;
}
/**
* Valid after executing the API.
* Gets the returned GetAccountResponseType.accountSummary.
*
* @return AccountSummaryType
*/
public AccountSummaryType getAccountSummary()
{
return this.accountSummary;
}
/**
* Valid after executing the API.
* Gets the returned GetAccountResponseType.hasMoreEntries.
*
* @return boolean
*/
public boolean getHasMoreEntries()
{
return this.hasMoreEntries;
}
/**
* Valid after executing the API.
* Gets the returned GetAccountResponseType.paginationResult.
*
* @return PaginationResultType
*/
public PaginationResultType getPaginationResult()
{
return this.paginationResult;
}
/**
* Valid after executing the API.
* Gets the returned GetAccountResponseType.returnedCurrency.
*
* @return CurrencyCodeType
*/
public CurrencyCodeType getReturnedCurrency()
{
return this.returnedCurrency;
}
/**
* Valid after executing the API.
* Gets the returned GetAccountResponseType.returnedEntriesPerPage.
*
* @return Integer
*/
public Integer getReturnedEntriesPerPage()
{
return this.returnedEntriesPerPage;
}
/**
* Valid after executing the API.
* Gets the returned GetAccountResponseType.returnedPageNumber.
*
* @return Integer
*/
public Integer getReturnedPageNumber()
{
return this.returnedPageNumber;
}
}