// Path: src/com/createsend/models/PagedResult.java
// public class PagedResult<T> {
//     public T[] Results;
//     public String ResultsOrderedBy;
//     public String OrderDirection;
//     public int PageNumber;
//     public int PageSize;
//     public int RecordsOnThisPage;
//     public int TotalNumberOfRecords;
//     public int NumberOfPages;
//     
//     @Override
//     public String toString() {
//         return String.format("{ Results: %s, ResultsOrderedBy: %s, OrderDirection: %s, PageNumber: %s, PageSize: %s, RecordsOnThisPage: %s, TotalNumberOfRecords: %s, NumberOfPages: %s }",
//             Arrays.deepToString(Results), ResultsOrderedBy, OrderDirection, PageNumber,
//             PageSize, RecordsOnThisPage, TotalNumberOfRecords,
//             NumberOfPages);
//     }
// }
// 
// Path: src/com/createsend/util/exceptions/CreateSendException.java
// public class CreateSendException extends Exception {
//     private static final long serialVersionUID = 1695317869199799783L;
//     
//     public CreateSendException(String message) {
//         super(message);
//     }
// }


import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import com.createsend.models.PagedResult;
import com.createsend.util.exceptions.CreateSendException;
import com.createsend.util.jersey.ResourceFactory;

/**
 * Copyright (c) 2011 Toby Brain
 * 
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *  
 *  The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 *  
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *  THE SOFTWARE.
 */
package com.createsend.util;



public interface JerseyClient {
	public AuthenticationDetails getAuthenticationDetails();
	public void setAuthenticationDetails(AuthenticationDetails authDetails);
	
    public <T> T get(Class<T> klass, String... pathElements) throws CreateSendException;
    public <T> T get(Class<T> klass, MultivaluedMap<String, String> queryString,
            String... pathElements) throws CreateSendException;   
    public <T> T get(Class<T> klass, ErrorDeserialiser<?> errorDeserialiser, 
            String... pathElements) throws CreateSendException;
    public <T> T get(Class<T> klass, MultivaluedMap<String, String> queryString, 
            ResourceFactory resourceFactory, String... pathElements) throws CreateSendException;

// Path: src/com/createsend/models/PagedResult.java
// public class PagedResult<T> {
//     public T[] Results;
//     public String ResultsOrderedBy;
//     public String OrderDirection;
//     public int PageNumber;
//     public int PageSize;
//     public int RecordsOnThisPage;
//     public int TotalNumberOfRecords;
//     public int NumberOfPages;
//     
//     @Override
//     public String toString() {
//         return String.format("{ Results: %s, ResultsOrderedBy: %s, OrderDirection: %s, PageNumber: %s, PageSize: %s, RecordsOnThisPage: %s, TotalNumberOfRecords: %s, NumberOfPages: %s }",
//             Arrays.deepToString(Results), ResultsOrderedBy, OrderDirection, PageNumber,
//             PageSize, RecordsOnThisPage, TotalNumberOfRecords,
//             NumberOfPages);
//     }
// }
// 
// Path: src/com/createsend/util/exceptions/CreateSendException.java
// public class CreateSendException extends Exception {
//     private static final long serialVersionUID = 1695317869199799783L;
//     
//     public CreateSendException(String message) {
//         super(message);
//     }
// }


// Path: src/com/createsend/util/JerseyClient.java
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import com.createsend.models.PagedResult;
import com.createsend.util.exceptions.CreateSendException;
import com.createsend.util.jersey.ResourceFactory;

/**
 * Copyright (c) 2011 Toby Brain
 * 
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *  
 *  The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 *  
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *  THE SOFTWARE.
 */
package com.createsend.util;



public interface JerseyClient {
	public AuthenticationDetails getAuthenticationDetails();
	public void setAuthenticationDetails(AuthenticationDetails authDetails);
	
    public <T> T get(Class<T> klass, String... pathElements) throws CreateSendException;
    public <T> T get(Class<T> klass, MultivaluedMap<String, String> queryString,
            String... pathElements) throws CreateSendException;   
    public <T> T get(Class<T> klass, ErrorDeserialiser<?> errorDeserialiser, 
            String... pathElements) throws CreateSendException;
    public <T> T get(Class<T> klass, MultivaluedMap<String, String> queryString, 
            ResourceFactory resourceFactory, String... pathElements) throws CreateSendException;

    public <T> PagedResult<T> getPagedResult(Integer page, Integer pageSize, String orderField, 
