Search in sources :

Example 1 with UrlListResponse

use of com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse in project Java-Mandrill-Wrapper by cribbstechnologies.

the class MandrillUrlsRequest method doSearch.

public UrlListResponse doSearch(MandrillRequestWithQuery searchRequest) throws RequestFailedException {
    UrlListResponse response = new UrlListResponse();
    response.setList(((BaseMandrillAnonymousListResponse<UrlResponse>) request.postRequest(searchRequest, ServiceMethods.Urls.SEARCH, UrlListResponse.class, urlsListReference)).getList());
    return response;
}
Also used : UrlResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlResponse) UrlListResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse)

Example 2 with UrlListResponse

use of com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse in project Java-Mandrill-Wrapper by cribbstechnologies.

the class UrlsTest method testQuery.

@Test
public void testQuery() {
    MandrillRequestWithQuery request = new MandrillRequestWithQuery();
    request.setQ("http://www.google.com");
    try {
        UrlListResponse response = urlsRequest.doSearch(request);
    } catch (RequestFailedException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
}
Also used : MandrillRequestWithQuery(com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithQuery) RequestFailedException(com.cribbstechnologies.clients.mandrill.exception.RequestFailedException) UrlListResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse) Test(org.junit.Test)

Example 3 with UrlListResponse

use of com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse in project Java-Mandrill-Wrapper by cribbstechnologies.

the class MandrillUrlsRequest method getList.

public UrlListResponse getList(BaseMandrillRequest listRequest) throws RequestFailedException {
    UrlListResponse response = new UrlListResponse();
    response.setList(((BaseMandrillAnonymousListResponse<UrlResponse>) request.postRequest(listRequest, ServiceMethods.Urls.LIST, UrlListResponse.class, urlsListReference)).getList());
    return response;
}
Also used : UrlResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlResponse) UrlListResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse)

Example 4 with UrlListResponse

use of com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse in project Java-Mandrill-Wrapper by cribbstechnologies.

the class MandrillUrlsRequest method getTimeSeries.

public UrlListResponse getTimeSeries(MandrillRequestWithUrl seriesRequest) throws RequestFailedException {
    UrlListResponse response = new UrlListResponse();
    response.setList(((BaseMandrillAnonymousListResponse<UrlResponse>) request.postRequest(seriesRequest, ServiceMethods.Urls.TIME_SERIES, UrlListResponse.class, urlsListReference)).getList());
    return response;
}
Also used : UrlResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlResponse) UrlListResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse)

Example 5 with UrlListResponse

use of com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse in project Java-Mandrill-Wrapper by cribbstechnologies.

the class UrlsTest method testGetTimeSeries.

@Test
public void testGetTimeSeries() {
    MandrillRequestWithUrl request = new MandrillRequestWithUrl();
    request.setUrl("http://www.google.com");
    try {
        UrlListResponse response = urlsRequest.getTimeSeries(request);
    } catch (RequestFailedException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
}
Also used : RequestFailedException(com.cribbstechnologies.clients.mandrill.exception.RequestFailedException) MandrillRequestWithUrl(com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithUrl) UrlListResponse(com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse) Test(org.junit.Test)

Aggregations

UrlListResponse (com.cribbstechnologies.clients.mandrill.model.response.urls.UrlListResponse)5 UrlResponse (com.cribbstechnologies.clients.mandrill.model.response.urls.UrlResponse)3 RequestFailedException (com.cribbstechnologies.clients.mandrill.exception.RequestFailedException)2 Test (org.junit.Test)2 MandrillRequestWithQuery (com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithQuery)1 MandrillRequestWithUrl (com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithUrl)1