Package software.xdev.brevo.api
Class CustomObjectsApi
java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.CustomObjectsApi
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the list of object records and total records count for an object.getrecords(String objectType, Long limit, Long pageNum, String sort, String association, Map<String, String> additionalHeaders) Get the list of object records and total records count for an object.<T> TinvokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) Directly invoke the API for the given URL.upsertrecords(String objectType, UpsertrecordsRequest upsertrecordsRequest) Create/Update object records in bulk This API allows bulk upsert of object records in a single request.upsertrecords(String objectType, UpsertrecordsRequest upsertrecordsRequest, Map<String, String> additionalHeaders) Create/Update object records in bulk This API allows bulk upsert of object records in a single request.Methods inherited from class software.xdev.brevo.client.BaseApi
getApiClient, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, setApiClient
-
Constructor Details
-
CustomObjectsApi
public CustomObjectsApi() -
CustomObjectsApi
-
-
Method Details
-
getrecords
public Getrecords200Response getrecords(@Nonnull String objectType, @Nonnull Long limit, @Nonnull Long pageNum, @Nullable String sort, @Nullable String association) throws ApiException Get the list of object records and total records count for an object. This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object.- Parameters:
objectType- object type for the attribute (required)limit- Number of records returned per page (required)pageNum- Page number for pagination. It's used to fetch the object records on a provided page number. Must be a valid positive integer. (required)sort- Sort order, must be 'asc' or 'desc'. Default to 'desc' if not provided. (optional, default to desc)association- Whether to include associations, must be 'true' or 'false'. Default to 'false' if not provided. (optional)- Returns:
- Getrecords200Response
- Throws:
ApiException- if fails to make API call
-
getrecords
public Getrecords200Response getrecords(@Nonnull String objectType, @Nonnull Long limit, @Nonnull Long pageNum, @Nullable String sort, @Nullable String association, Map<String, String> additionalHeaders) throws ApiExceptionGet the list of object records and total records count for an object. This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object.- Parameters:
objectType- object type for the attribute (required)limit- Number of records returned per page (required)pageNum- Page number for pagination. It's used to fetch the object records on a provided page number. Must be a valid positive integer. (required)sort- Sort order, must be 'asc' or 'desc'. Default to 'desc' if not provided. (optional, default to desc)association- Whether to include associations, must be 'true' or 'false'. Default to 'false' if not provided. (optional)additionalHeaders- additionalHeaders for this call- Returns:
- Getrecords200Response
- Throws:
ApiException- if fails to make API call
-
upsertrecords
public Upsertrecords202Response upsertrecords(@Nonnull String objectType, @Nonnull UpsertrecordsRequest upsertrecordsRequest) throws ApiException Create/Update object records in bulk This API allows bulk upsert of object records in a single request. Each object record may include - Attributes - Identifiers - Associations **Response:** The API processes the request asynchronously and returns a processId that you can use to track the background process status. **API and Schema Limitation:** - Size: - Max 1000 objects records per request - Max request body size: 1 MB - Max 500 attributes defined per object record upsert request - This is coherent with schema limitation: an object cannot have more than 500 attributes. - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - Max 10 associations defined per object record upsert request - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. **Errors:** - Make sure both object records exist before associating them, else the API will return an error. - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error \"invalid object type\".- Parameters:
objectType- object type for the attribute (required)upsertrecordsRequest- Payload for batch upsert object records with associations (required)- Returns:
- Upsertrecords202Response
- Throws:
ApiException- if fails to make API call
-
upsertrecords
public Upsertrecords202Response upsertrecords(@Nonnull String objectType, @Nonnull UpsertrecordsRequest upsertrecordsRequest, Map<String, String> additionalHeaders) throws ApiExceptionCreate/Update object records in bulk This API allows bulk upsert of object records in a single request. Each object record may include - Attributes - Identifiers - Associations **Response:** The API processes the request asynchronously and returns a processId that you can use to track the background process status. **API and Schema Limitation:** - Size: - Max 1000 objects records per request - Max request body size: 1 MB - Max 500 attributes defined per object record upsert request - This is coherent with schema limitation: an object cannot have more than 500 attributes. - Worth noting: Nothing happens If an attribute is mentioned in the request, but was not previously defined for the object schema (no error, no attribute creation) - Max 10 associations defined per object record upsert request - This is coherent with schema limitation: an object cannot have more than 10 associations with other objects. and each object record can be linked to max 10 other records. **Errors:** - Make sure both object records exist before associating them, else the API will return an error. - This route does not create objects. The object where the object records are upserted by this API must be created already else the API will return an error \"invalid object type\".- Parameters:
objectType- object type for the attribute (required)upsertrecordsRequest- Payload for batch upsert object records with associations (required)additionalHeaders- additionalHeaders for this call- Returns:
- Upsertrecords202Response
- Throws:
ApiException- if fails to make API call
-
invokeAPI
public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiExceptionDescription copied from class:BaseApiDirectly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.- Specified by:
invokeAPIin classBaseApi- Parameters:
url- The URL for the request, either full URL or only the path.method- The HTTP method for the request.request- The request object.returnType- The return type.additionalHeaders- Additional headers for the request.- Returns:
- The API response in the specified type.
- Throws:
ApiException- if fails to make API call.
-