Class CouponsApi

java.lang.Object
software.xdev.brevo.client.BaseApi
software.xdev.brevo.api.CouponsApi

public class CouponsApi extends BaseApi
  • Constructor Details

    • CouponsApi

      public CouponsApi()
    • CouponsApi

      public CouponsApi(ApiClient apiClient)
  • 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 ApiException
      Create а 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

      public void createCoupons(@Nonnull CreateCouponsRequest createCouponsRequest) throws ApiException
      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 ApiException
      Create 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

      public GetCouponCollection getCouponCollection(@Nonnull String id) throws ApiException
      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 ApiException
      Get 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 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)
      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 ApiException
      Update 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 ApiException
      Description copied from class: BaseApi
      Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
      Specified by:
      invokeAPI in class BaseApi
      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.