Package software.xdev.brevo.api
Class CouponsApi
java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.CouponsApi
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCouponCollection(CreateCouponCollectionRequest createCouponCollectionRequest) Create а coupon collectioncreateCouponCollection(CreateCouponCollectionRequest createCouponCollectionRequest, Map<String, String> additionalHeaders) Create а coupon collectionvoidcreateCoupons(CreateCouponsRequest createCouponsRequest) Create coupons for a coupon collectionvoidcreateCoupons(CreateCouponsRequest createCouponsRequest, Map<String, String> additionalHeaders) Create coupons for a coupon collectionGet a coupon collection by idgetCouponCollection(String id, Map<String, String> additionalHeaders) Get a coupon collection by idgetCouponCollections(Long limit, Long offset, String sort, String sortBy) Get all your coupon collectionsgetCouponCollections(Long limit, Long offset, String sort, String sortBy, Map<String, String> additionalHeaders) Get all your coupon collections<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.updateCouponCollection(String id, UpdateCouponCollectionRequest updateCouponCollectionRequest) Update a coupon collection by idupdateCouponCollection(String id, UpdateCouponCollectionRequest updateCouponCollectionRequest, Map<String, String> additionalHeaders) Update a coupon collection by idMethods inherited from class software.xdev.brevo.client.BaseApi
getApiClient, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, setApiClient
-
Constructor Details
-
CouponsApi
public CouponsApi() -
CouponsApi
-
-
Method Details
-
createCouponCollection
public CreateCouponCollection201Response createCouponCollection(@Nonnull CreateCouponCollectionRequest createCouponCollectionRequest) throws ApiException Create а coupon collection- Parameters:
createCouponCollectionRequest- Values to create a coupon collection (required)- Returns:
- CreateCouponCollection201Response
- Throws:
ApiException- if fails to make API call
-
createCouponCollection
public CreateCouponCollection201Response createCouponCollection(@Nonnull CreateCouponCollectionRequest createCouponCollectionRequest, Map<String, String> additionalHeaders) throws ApiExceptionCreate а coupon collection- Parameters:
createCouponCollectionRequest- Values to create a coupon collection (required)additionalHeaders- additionalHeaders for this call- Returns:
- CreateCouponCollection201Response
- Throws:
ApiException- if fails to make API call
-
createCoupons
Create coupons for a coupon collection- Parameters:
createCouponsRequest- Values to create coupons (required)- Throws:
ApiException- if fails to make API call
-
createCoupons
public void createCoupons(@Nonnull CreateCouponsRequest createCouponsRequest, Map<String, String> additionalHeaders) throws ApiExceptionCreate coupons for a coupon collection- Parameters:
createCouponsRequest- Values to create coupons (required)additionalHeaders- additionalHeaders for this call- Throws:
ApiException- if fails to make API call
-
getCouponCollection
Get a coupon collection by id- Parameters:
id- Id of the collection to return (required)- Returns:
- GetCouponCollection
- Throws:
ApiException- if fails to make API call
-
getCouponCollection
public GetCouponCollection getCouponCollection(@Nonnull String id, Map<String, String> additionalHeaders) throws ApiExceptionGet a coupon collection by id- Parameters:
id- Id of the collection to return (required)additionalHeaders- additionalHeaders for this call- Returns:
- GetCouponCollection
- Throws:
ApiException- if fails to make API call
-
getCouponCollections
public GetCouponCollection getCouponCollections(@Nullable Long limit, @Nullable Long offset, @Nullable String sort, @Nullable String sortBy) throws ApiException Get all your coupon collections- Parameters:
limit- Number of documents returned per page (optional, default to 50)offset- Index of the first document on the page (optional, default to 0)sort- Sort the results by creation time in ascending/descending order (optional, default to desc)sortBy- The field used to sort coupon collections (optional, default to createdAt)- Returns:
- GetCouponCollection
- Throws:
ApiException- if fails to make API call
-
getCouponCollections
public GetCouponCollection getCouponCollections(@Nullable Long limit, @Nullable Long offset, @Nullable String sort, @Nullable String sortBy, Map<String, String> additionalHeaders) throws ApiExceptionGet all your coupon collections- Parameters:
limit- Number of documents returned per page (optional, default to 50)offset- Index of the first document on the page (optional, default to 0)sort- Sort the results by creation time in ascending/descending order (optional, default to desc)sortBy- The field used to sort coupon collections (optional, default to createdAt)additionalHeaders- additionalHeaders for this call- Returns:
- GetCouponCollection
- Throws:
ApiException- if fails to make API call
-
updateCouponCollection
public UpdateCouponCollection200Response updateCouponCollection(@Nonnull String id, @Nullable UpdateCouponCollectionRequest updateCouponCollectionRequest) throws ApiException Update a coupon collection by id- Parameters:
id- Id of the collection to update (required)updateCouponCollectionRequest- Values to update the coupon collection (optional)- Returns:
- UpdateCouponCollection200Response
- Throws:
ApiException- if fails to make API call
-
updateCouponCollection
public UpdateCouponCollection200Response updateCouponCollection(@Nonnull String id, @Nullable UpdateCouponCollectionRequest updateCouponCollectionRequest, Map<String, String> additionalHeaders) throws ApiExceptionUpdate a coupon collection by id- Parameters:
id- Id of the collection to update (required)updateCouponCollectionRequest- Values to update the coupon collection (optional)additionalHeaders- additionalHeaders for this call- Returns:
- UpdateCouponCollection200Response
- 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.
-