// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/exception/AllegroExecutor.java
// public class AllegroExecutor {
// 
//     private static final AllegroExceptionConventer aec = new AllegroExceptionConventer();
// 
//     public static <T> T execute(Supplier<T> task) {
//         try {
//             return task.get();
//         } catch (SOAPFaultException e) {
//             throw aec.convertException(e.getFault().getFaultCode(), e);
//         }
//     }
// }
// 
// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/login/Credentials.java
// public class Credentials {
// 
//     private long clientId;
//     private String username;
//     private String passoword;
//     private String key;
// 
//     @Nullable
//     private String restClientId;
//     @Nullable
//     private String restClientSecret;
//     @Nullable
//     private String restClientApiKey;
//     @Nullable
//     private String restRedirectUri;
// 
//     public Credentials(long clientId, String username, String passowrd, String key) {
//         this(clientId, username, passowrd, key, null, null, null, null);
//     }
// 
//     public Credentials(long clientId, String username, String passowrd, String key, @Nullable String restClientId, @Nullable String restClientSecret, @Nullable String restClientApiKey, @Nullable String restRedirectUri) {
//         this.clientId = clientId;
//         this.username = username;
//         this.passoword = passowrd;
//         this.key = key;
//         this.restClientId = restClientId;
//         this.restClientSecret = restClientSecret;
//         this.restClientApiKey = restClientApiKey;
//         this.restRedirectUri = restRedirectUri;
//     }
// 
//     public long getClientId() {
//         return clientId;
//     }
//     String getUsername() {
//         return username;
//     }
//     String getPassoword() {
//         return passoword;
//     }
//     public String getKey() {
//         return key;
//     }
//     @Nullable
//     public String getRestClientId() {
//         return restClientId;
//     }
//     @Nullable
//     public String getRestClientSecret() {
//         return restClientSecret;
//     }
//     @Nullable
//     public String getRestClientApiKey() {
//         return restClientApiKey;
//     }
//     @Nullable
//     public String getRestRedirectUri() {
//         return restRedirectUri;
//     }
// 
//     @Override
//     public String toString() {
//         return "Credentials{" +
//                 "clientId='" + clientId + "\', " +
//                 "username='" + username + '\'' +
//                 '}';
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         Credentials that = (Credentials) o;
// 
//         if (clientId != that.clientId) return false;
//         if (!username.equals(that.username)) return false;
//         if (!passoword.equals(that.passoword)) return false;
//         if (!key.equals(that.key)) return false;
//         if (restClientId != null ? !restClientId.equals(that.restClientId) : that.restClientId != null) return false;
//         if (restClientSecret != null ? !restClientSecret.equals(that.restClientSecret) : that.restClientSecret != null) return false;
//         if (restClientApiKey != null ? !restClientApiKey.equals(that.restClientApiKey) : that.restClientApiKey != null) return false;
//         return restRedirectUri != null ? restRedirectUri.equals(that.restRedirectUri) : that.restRedirectUri == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = (int) (clientId ^ (clientId >>> 32));
//         result = 31 * result + username.hashCode();
//         result = 31 * result + passoword.hashCode();
//         result = 31 * result + key.hashCode();
//         result = 31 * result + (restClientId != null ? restClientId.hashCode() : 0);
//         result = 31 * result + (restClientSecret != null ? restClientSecret.hashCode() : 0);
//         result = 31 * result + (restClientApiKey != null ? restClientApiKey.hashCode() : 0);
//         result = 31 * result + (restRedirectUri != null ? restRedirectUri.hashCode() : 0);
//         return result;
//     }
// 
// }
// 
// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/service/AbstractService.java
// public class AbstractService {
// 
//     protected ServicePort allegro;
//     protected Credentials cred;
//     protected Configuration conf;
// 
//     public AbstractService() {
//     }
// 
//     public AbstractService(ServicePort allegro, Credentials cred, Configuration conf) {
//         this.allegro = allegro;
//         this.cred = cred;
//         this.conf = conf;
//     }
// 
// }
// 
// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/service/Configuration.java
// public class Configuration {
// 
//     private int countryId;
// 
//     public Configuration(int countryId) {
//         this.countryId = countryId;
//     }
// 
//     public int getCountryId() {
//         return countryId;
//     }
// }


import com.apwglobal.nice.exception.AllegroExecutor;
import com.apwglobal.nice.login.Credentials;
import com.apwglobal.nice.service.AbstractService;
import com.apwglobal.nice.service.Configuration;
import pl.allegro.webapi.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static java.util.Collections.singletonList;
package com.apwglobal.nice.client;




public class ClientService extends AbstractService {

    public ClientService(ServicePort allegro, Credentials cred, Configuration conf) {
        super(allegro, cred, conf);
    }

    public List<ItemPostBuyDataStruct> getClientsDate(String session, long itemId) {
        DoGetPostBuyDataRequest request = new DoGetPostBuyDataRequest();
        request.setSessionHandle(session);
        request.setItemsArray(new ArrayOfLong(singletonList(itemId)));
        DoGetPostBuyDataResponse response = AllegroExecutor.execute(() -> allegro.doGetPostBuyData(request));
// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/exception/AllegroExecutor.java
// public class AllegroExecutor {
// 
//     private static final AllegroExceptionConventer aec = new AllegroExceptionConventer();
// 
//     public static <T> T execute(Supplier<T> task) {
//         try {
//             return task.get();
//         } catch (SOAPFaultException e) {
//             throw aec.convertException(e.getFault().getFaultCode(), e);
//         }
//     }
// }
// 
// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/login/Credentials.java
// public class Credentials {
// 
//     private long clientId;
//     private String username;
//     private String passoword;
//     private String key;
// 
//     @Nullable
//     private String restClientId;
//     @Nullable
//     private String restClientSecret;
//     @Nullable
//     private String restClientApiKey;
//     @Nullable
//     private String restRedirectUri;
// 
//     public Credentials(long clientId, String username, String passowrd, String key) {
//         this(clientId, username, passowrd, key, null, null, null, null);
//     }
// 
//     public Credentials(long clientId, String username, String passowrd, String key, @Nullable String restClientId, @Nullable String restClientSecret, @Nullable String restClientApiKey, @Nullable String restRedirectUri) {
//         this.clientId = clientId;
//         this.username = username;
//         this.passoword = passowrd;
//         this.key = key;
//         this.restClientId = restClientId;
//         this.restClientSecret = restClientSecret;
//         this.restClientApiKey = restClientApiKey;
//         this.restRedirectUri = restRedirectUri;
//     }
// 
//     public long getClientId() {
//         return clientId;
//     }
//     String getUsername() {
//         return username;
//     }
//     String getPassoword() {
//         return passoword;
//     }
//     public String getKey() {
//         return key;
//     }
//     @Nullable
//     public String getRestClientId() {
//         return restClientId;
//     }
//     @Nullable
//     public String getRestClientSecret() {
//         return restClientSecret;
//     }
//     @Nullable
//     public String getRestClientApiKey() {
//         return restClientApiKey;
//     }
//     @Nullable
//     public String getRestRedirectUri() {
//         return restRedirectUri;
//     }
// 
//     @Override
//     public String toString() {
//         return "Credentials{" +
//                 "clientId='" + clientId + "\', " +
//                 "username='" + username + '\'' +
//                 '}';
//     }
// 
//     @Override
//     public boolean equals(Object o) {
//         if (this == o) return true;
//         if (o == null || getClass() != o.getClass()) return false;
// 
//         Credentials that = (Credentials) o;
// 
//         if (clientId != that.clientId) return false;
//         if (!username.equals(that.username)) return false;
//         if (!passoword.equals(that.passoword)) return false;
//         if (!key.equals(that.key)) return false;
//         if (restClientId != null ? !restClientId.equals(that.restClientId) : that.restClientId != null) return false;
//         if (restClientSecret != null ? !restClientSecret.equals(that.restClientSecret) : that.restClientSecret != null) return false;
//         if (restClientApiKey != null ? !restClientApiKey.equals(that.restClientApiKey) : that.restClientApiKey != null) return false;
//         return restRedirectUri != null ? restRedirectUri.equals(that.restRedirectUri) : that.restRedirectUri == null;
//     }
// 
//     @Override
//     public int hashCode() {
//         int result = (int) (clientId ^ (clientId >>> 32));
//         result = 31 * result + username.hashCode();
//         result = 31 * result + passoword.hashCode();
//         result = 31 * result + key.hashCode();
//         result = 31 * result + (restClientId != null ? restClientId.hashCode() : 0);
//         result = 31 * result + (restClientSecret != null ? restClientSecret.hashCode() : 0);
//         result = 31 * result + (restClientApiKey != null ? restClientApiKey.hashCode() : 0);
//         result = 31 * result + (restRedirectUri != null ? restRedirectUri.hashCode() : 0);
//         return result;
//     }
// 
// }
// 
// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/service/AbstractService.java
// public class AbstractService {
// 
//     protected ServicePort allegro;
//     protected Credentials cred;
//     protected Configuration conf;
// 
//     public AbstractService() {
//     }
// 
//     public AbstractService(ServicePort allegro, Credentials cred, Configuration conf) {
//         this.allegro = allegro;
//         this.cred = cred;
//         this.conf = conf;
//     }
// 
// }
// 
// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/service/Configuration.java
// public class Configuration {
// 
//     private int countryId;
// 
//     public Configuration(int countryId) {
//         this.countryId = countryId;
//     }
// 
//     public int getCountryId() {
//         return countryId;
//     }
// }


// Path: allegro-nice-api/src/main/java/com/apwglobal/nice/client/ClientService.java
import com.apwglobal.nice.exception.AllegroExecutor;
import com.apwglobal.nice.login.Credentials;
import com.apwglobal.nice.service.AbstractService;
import com.apwglobal.nice.service.Configuration;
import pl.allegro.webapi.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static java.util.Collections.singletonList;

package com.apwglobal.nice.client;




public class ClientService extends AbstractService {

    public ClientService(ServicePort allegro, Credentials cred, Configuration conf) {
        super(allegro, cred, conf);
    }

    public List<ItemPostBuyDataStruct> getClientsDate(String session, long itemId) {
        DoGetPostBuyDataRequest request = new DoGetPostBuyDataRequest();
        request.setSessionHandle(session);
        request.setItemsArray(new ArrayOfLong(singletonList(itemId)));
        DoGetPostBuyDataResponse response = AllegroExecutor.execute(() -> allegro.doGetPostBuyData(request));
        return response.getItemsPostBuyData().getItem();