// Path: src/main/java/org/votesmart/data/AddressAddress.java
// @XmlRootElement(name="address")
// public class AddressAddress extends GeneralInfoBase {
// 	
// 	public ArrayList<Office> office;
// 
// }
// 
// Path: src/main/java/org/votesmart/data/AddressOffice.java
// @XmlRootElement(name="address")
// public class AddressOffice extends GeneralInfoBase {
// 	
// 	public CandidateMed candidate;
// 	public ArrayList<OfficeAddress> office;
// 
// }
// 
// Path: src/main/java/org/votesmart/data/WebAddress.java
// @XmlRootElement(name="webaddress")
// public class WebAddress extends GeneralInfoBase {
// 	
// 	public CandidateMed candidate;
// 	public ArrayList<Address> address;
// 	
// 	@XmlType(name="address", namespace="webaddress")
// 	public static class Address {
// 		public String webAddressTypeId;
// 		public String webAddressType;
// 		public String webAddress;
// 	}
// 
// }


import org.votesmart.api.*;
import org.votesmart.data.AddressAddress;
import org.votesmart.data.AddressOffice;
import org.votesmart.data.WebAddress;

package org.votesmart.classes;


/**
 * <pre>
 * Address Class
 * * - Required
 * * - Multiple rows
 * 
 * Address.getCampaign
 * This method grabs campaign office(s) and basic candidate information for the specified candidate.
 * Input: candidateId*
 * Output: {@link AddressOffice}  
 * 
 * Address.getCampaignWebAddress
 * This method grabs the campaign office's Web address(es) and basic candidate information for the specified candidate.
 * Input: candidateId*
 * Output: {@link WebAddress}
 * 
 * Address.getCampaignByElection
 * This method grabs campaign office(s) and basic candidate information for the specified election.
 * Input: electionId*
 * Output: {@link AddressOffice}
 * 
 * Address.getOffice
 * This method grabs office(s) and basic candidate information for the specified candidate.
 * Input: candidateId*
 * Output: {@link AddressOffice}
 * 
 * Address.getOfficeWebAddress
 * This method grabs office's Web address(es) and basic candidate information for the specified candidate.
 * Input: candidateId*
 * Output: {@link WebAddress}
 * 
 * Address.getOfficeByOfficeState
 * This method grabs office address and basic candidate information according to the officeId and state.
 * Input: officeId*, stateId (Default: 'NA')
 * Output: {@link AddressAddress}
 * 
 * ==== EXAMPLE USAGE =====
 * 
 * AddressClass addressClass = new AddressClass();
 * 
 * // address of Office (State Assembly)
 * AddressAddress addressOffice = addressClass.getOfficeByOfficeState(office.officeId, state.stateId);
 * 
 * // address of Official
 * AddressOffice addressOffical = addressClass.getOffice(candidate.candidateId)
 * 
 * // WebAddress of Official
 * WebAddress webAddressOffical = addressClass.getOfficeWebAddress(candidate.candidateId);
 *</pre>
 */
public class AddressClass extends ClassesBase {

	/**
	 * Constructor for testing purposes. 
	 * 
	 * @param api
	 */
	public AddressClass(VoteSmartAPI api) {
		super(api);
	}
	
	/**
	 * Default constructor
	 */
	public AddressClass() throws VoteSmartException {
		super();
	}

	/**
	 * This method grabs campaign office(s) and basic candidate information for the specified candidate.
	 * 
	 * @param candidateId
	 * @return {@link AddressOffice}: address and list of office addresses.
	 */
	public AddressOffice getCampaign(String candidateId) throws VoteSmartException, VoteSmartErrorException {
		return api.query("Address.getCampaign", new ArgMap("candidateId", candidateId), AddressOffice.class );
	}
	
	/**
	 * This method grabs the campaign office's Web address(es) and basic candidate information for the specified candidate.
	 * 
	 * @param candidateId
	 * @return {@link WebAddress}: Candidate name and URL's
	 */
	public WebAddress getCampaignWebAddress(String candidateId) throws VoteSmartException, VoteSmartErrorException {
		return api.query("Address.getCampaignWebAddress", new ArgMap("candidateId", candidateId), WebAddress.class );
	}
	
	/**
	 * This method grabs campaign office(s) and basic candidate information for the specified election.
	 * 
	 * @param electionId
	 * @return {@link AddressOffice}: Candidate name and list of office addresses
	 */
	public AddressOffice getCampaignByElection(String electionId) throws VoteSmartException, VoteSmartErrorException {
		return api.query("Address.getCampaignByElection", new ArgMap("electionId", electionId), AddressOffice.class );
	}

	/**
	 * This method grabs office(s) and basic candidate information for the specified candidate.
	 * 
	 * @param candidateId
	 * @return {@link AddressOffice}: Candidate name and list of office addresses
	 */
	public AddressOffice getOffice(String candidateId) throws VoteSmartException, VoteSmartErrorException {

// Path: src/main/java/org/votesmart/data/AddressAddress.java
// @XmlRootElement(name="address")
// public class AddressAddress extends GeneralInfoBase {
// 	
// 	public ArrayList<Office> office;
// 
// }
// 
// Path: src/main/java/org/votesmart/data/AddressOffice.java
// @XmlRootElement(name="address")
// public class AddressOffice extends GeneralInfoBase {
// 	
// 	public CandidateMed candidate;
// 	public ArrayList<OfficeAddress> office;
// 
// }
// 
// Path: src/main/java/org/votesmart/data/WebAddress.java
// @XmlRootElement(name="webaddress")
// public class WebAddress extends GeneralInfoBase {
// 	
// 	public CandidateMed candidate;
// 	public ArrayList<Address> address;
// 	
// 	@XmlType(name="address", namespace="webaddress")
// 	public static class Address {
// 		public String webAddressTypeId;
// 		public String webAddressType;
// 		public String webAddress;
// 	}
// 
// }


// Path: src/main/java/org/votesmart/classes/AddressClass.java
import org.votesmart.api.*;
import org.votesmart.data.AddressAddress;
import org.votesmart.data.AddressOffice;
import org.votesmart.data.WebAddress;

package org.votesmart.classes;


/**
 * <pre>
 * Address Class
 * * - Required
 * * - Multiple rows
 * 
 * Address.getCampaign
 * This method grabs campaign office(s) and basic candidate information for the specified candidate.
 * Input: candidateId*
 * Output: {@link AddressOffice}  
 * 
 * Address.getCampaignWebAddress
 * This method grabs the campaign office's Web address(es) and basic candidate information for the specified candidate.
 * Input: candidateId*
 * Output: {@link WebAddress}
 * 
 * Address.getCampaignByElection
 * This method grabs campaign office(s) and basic candidate information for the specified election.
 * Input: electionId*
 * Output: {@link AddressOffice}
 * 
 * Address.getOffice
 * This method grabs office(s) and basic candidate information for the specified candidate.
 * Input: candidateId*
 * Output: {@link AddressOffice}
 * 
 * Address.getOfficeWebAddress
 * This method grabs office's Web address(es) and basic candidate information for the specified candidate.
 * Input: candidateId*
 * Output: {@link WebAddress}
 * 
 * Address.getOfficeByOfficeState
 * This method grabs office address and basic candidate information according to the officeId and state.
 * Input: officeId*, stateId (Default: 'NA')
 * Output: {@link AddressAddress}
 * 
 * ==== EXAMPLE USAGE =====
 * 
 * AddressClass addressClass = new AddressClass();
 * 
 * // address of Office (State Assembly)
 * AddressAddress addressOffice = addressClass.getOfficeByOfficeState(office.officeId, state.stateId);
 * 
 * // address of Official
 * AddressOffice addressOffical = addressClass.getOffice(candidate.candidateId)
 * 
 * // WebAddress of Official
 * WebAddress webAddressOffical = addressClass.getOfficeWebAddress(candidate.candidateId);
 *</pre>
 */
public class AddressClass extends ClassesBase {

	/**
	 * Constructor for testing purposes. 
	 * 
	 * @param api
	 */
	public AddressClass(VoteSmartAPI api) {
		super(api);
	}
	
	/**
	 * Default constructor
	 */
	public AddressClass() throws VoteSmartException {
		super();
	}

	/**
	 * This method grabs campaign office(s) and basic candidate information for the specified candidate.
	 * 
	 * @param candidateId
	 * @return {@link AddressOffice}: address and list of office addresses.
	 */
	public AddressOffice getCampaign(String candidateId) throws VoteSmartException, VoteSmartErrorException {
		return api.query("Address.getCampaign", new ArgMap("candidateId", candidateId), AddressOffice.class );
	}
	
	/**
	 * This method grabs the campaign office's Web address(es) and basic candidate information for the specified candidate.
	 * 
	 * @param candidateId
	 * @return {@link WebAddress}: Candidate name and URL's
	 */
	public WebAddress getCampaignWebAddress(String candidateId) throws VoteSmartException, VoteSmartErrorException {
		return api.query("Address.getCampaignWebAddress", new ArgMap("candidateId", candidateId), WebAddress.class );
	}
	
	/**
	 * This method grabs campaign office(s) and basic candidate information for the specified election.
	 * 
	 * @param electionId
	 * @return {@link AddressOffice}: Candidate name and list of office addresses
	 */
	public AddressOffice getCampaignByElection(String electionId) throws VoteSmartException, VoteSmartErrorException {
		return api.query("Address.getCampaignByElection", new ArgMap("electionId", electionId), AddressOffice.class );
	}

	/**
	 * This method grabs office(s) and basic candidate information for the specified candidate.
	 * 
	 * @param candidateId
	 * @return {@link AddressOffice}: Candidate name and list of office addresses
	 */
	public AddressOffice getOffice(String candidateId) throws VoteSmartException, VoteSmartErrorException {

		return api.query("Address.getOffice", new ArgMap("candidateId", candidateId), AddressOffice.class );
