Class PersonClient
- java.lang.Object
-
- com.inteliqua.rest.EliquaClientBase
-
- com.inteliqua.rest.EliquaClient
-
- com.inteliqua.rest.customer.client.PersonClient
-
- All Implemented Interfaces:
CrudClient<PersonCriteria,PersonCreateRequest,PersonMultiDataUpdateRequest>
public class PersonClient extends EliquaClient implements CrudClient<PersonCriteria,PersonCreateRequest,PersonMultiDataUpdateRequest>
Client class for managing person-related operations via the Eliqua API. This class handles searching, creating, and processing person-related requests.It extends
EliquaClientand implementsCrudClientto provides full CRUD functionality for persons.- Author:
- nikritikos
-
-
Constructor Summary
Constructors Constructor Description PersonClient(String host, EliquaAuthenticationProvider eliquaAuthenticationProvider)Constructs a newPersonClientwith the specified host and authentication provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.qivos.util.rest.common.envelope.SearchPayloadconstructSearchPayload(String payload, com.fasterxml.jackson.core.type.TypeReference typeReference)Constructs aPersonSearchResponseSimplePayloadfrom a raw JSON payload.PersonResponseExtendedPayloadconstructSimplePayload(String payload)Constructs aPersonResponseSimplePayloadfrom a raw JSON payload.com.qivos.util.rest.common.envelope.APIResponseEnvelope<PersonResponseExtendedPayload>create(PersonCreateRequest requestBody)Creates a new person record in the system.com.qivos.util.rest.common.envelope.APIResponseEnvelopedelete(String code)StringgetResourceURI()Retrieves the base resource URI for person-related requests.com.qivos.util.rest.common.envelope.APIResponseEnvelope<PersonSearchResponseSimplePayload>search(SearchRequest<PersonCriteria> requestBody)Searches for persons based on the given search criteria.com.qivos.util.rest.common.envelope.APIResponseEnvelope<PersonSearchResponseExtendedPayload>searchExtended(SearchRequest<PersonCriteria> requestBody)Searches for persons based on the given search criteria and returns extended information.com.qivos.util.rest.common.envelope.APIResponseEnvelope<PersonResponseSimplePayload>update(PersonMultiDataUpdateRequest requestBody, String code)Updates an existing person record in the system
-
-
-
Constructor Detail
-
PersonClient
public PersonClient(String host, EliquaAuthenticationProvider eliquaAuthenticationProvider)
Constructs a newPersonClientwith the specified host and authentication provider.- Parameters:
host- the API host URLeliquaAuthenticationProvider- the authentication provider for API access
-
-
Method Detail
-
search
public com.qivos.util.rest.common.envelope.APIResponseEnvelope<PersonSearchResponseSimplePayload> search(SearchRequest<PersonCriteria> requestBody)
Searches for persons based on the given search criteria.- Specified by:
searchin interfaceCrudClient<PersonCriteria,PersonCreateRequest,PersonMultiDataUpdateRequest>- Parameters:
requestBody- the search criteria encapsulated in aSearchRequest- Returns:
- an
APIResponseEnvelopecontainingPersonSearchResponseSimplePayload
-
searchExtended
public com.qivos.util.rest.common.envelope.APIResponseEnvelope<PersonSearchResponseExtendedPayload> searchExtended(SearchRequest<PersonCriteria> requestBody)
Searches for persons based on the given search criteria and returns extended information.- Specified by:
searchExtendedin interfaceCrudClient<PersonCriteria,PersonCreateRequest,PersonMultiDataUpdateRequest>- Parameters:
requestBody- the search criteria encapsulated in aSearchRequest- Returns:
- an
APIResponseEnvelopecontainingPersonSearchResponseExtendedPayload
-
create
public com.qivos.util.rest.common.envelope.APIResponseEnvelope<PersonResponseExtendedPayload> create(PersonCreateRequest requestBody)
Creates a new person record in the system.- Specified by:
createin interfaceCrudClient<PersonCriteria,PersonCreateRequest,PersonMultiDataUpdateRequest>- Parameters:
requestBody- the request object containing person details- Returns:
- an
APIResponseEnvelopecontainingPersonResponseSimplePayload
-
update
public com.qivos.util.rest.common.envelope.APIResponseEnvelope<PersonResponseSimplePayload> update(PersonMultiDataUpdateRequest requestBody, String code)
Updates an existing person record in the system- Specified by:
updatein interfaceCrudClient<PersonCriteria,PersonCreateRequest,PersonMultiDataUpdateRequest>- Parameters:
requestBody- the request object containing updated person detailscode- the uniquepersonQCCodeof the person to be updated- Returns:
- an
APIResponseEnvelopecontaining the updatedPersonResponseSimplePayload
-
delete
public com.qivos.util.rest.common.envelope.APIResponseEnvelope delete(String code)
- Specified by:
deletein interfaceCrudClient<PersonCriteria,PersonCreateRequest,PersonMultiDataUpdateRequest>
-
getResourceURI
public String getResourceURI()
Retrieves the base resource URI for person-related requests.- Specified by:
getResourceURIin classEliquaClient- Returns:
- the resource URI as a
String
-
constructSearchPayload
public com.qivos.util.rest.common.envelope.SearchPayload constructSearchPayload(String payload, com.fasterxml.jackson.core.type.TypeReference typeReference)
Constructs aPersonSearchResponseSimplePayloadfrom a raw JSON payload.- Parameters:
payload- the JSON payload as a string- Returns:
- the constructed
PersonSearchResponseSimplePayload - Throws:
RuntimeException- if there is an error during JSON parsing
-
constructSimplePayload
public PersonResponseExtendedPayload constructSimplePayload(String payload)
Constructs aPersonResponseSimplePayloadfrom a raw JSON payload.- Parameters:
payload- the JSON payload as a string- Returns:
- the constructed
PersonResponseSimplePayload
-
-