From c90e3f437d3b669c4377a4fe367ac494ef5ccdf9 Mon Sep 17 00:00:00 2001
From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com>
Date: Wed, 25 Mar 2026 08:25:16 +0000
Subject: [PATCH] SDK regeneration
---
.fern/metadata.json | 15 +-
composer.json | 11 +-
phpunit.xml | 4 +-
reference.md | 656 +++++++++++----
.../GetAccountResponsePlanVerticalsItem.php | 8 +-
src/Balance/BalanceClient.php | 33 +-
src/Balance/BalanceClientInterface.php | 8 +-
.../Requests/GetContactBalancesRequest.php | 24 +
...BalanceProgramsPidActiveBalanceRequest.php | 7 +
...ceProgramsPidTransactionHistoryRequest.php | 23 +-
.../GetSubscriptionBalancesRequest.php | 24 +
...ceProgramsPidBalanceDefinitionsRequest.php | 10 +-
.../UpdateBalanceDefinitionRequest.php | 10 +-
...sPidTransactionHistoryRequestSortField.php | 10 -
...ramsPidTransactionHistoryRequestStatus.php | 12 +
...ansactionHistoryRequestTransactionType.php | 9 +
...ogramsPidBalanceDefinitionsRequestMeta.php | 37 +
.../UpdateBalanceDefinitionRequestMeta.php | 37 +
src/Brevo.php | 4 +-
src/Companies/CompaniesClient.php | 81 ++
src/Companies/CompaniesClientInterface.php | 28 +
.../Requests/PatchCrmAttributesIdRequest.php | 45 ++
.../PatchCrmAttributesIdRequestObjectType.php | 9 +
...rmAttributesIdRequestOptionsLabelsItem.php | 42 +
src/Contacts/ContactsClient.php | 60 +-
src/Contacts/ContactsClientInterface.php | 60 +-
src/CustomObjects/CustomObjectsClient.php | 20 +-
.../CustomObjectsClientInterface.php | 20 +-
.../Types/UpsertrecordsRequestRecordsItem.php | 2 +-
.../Types/UpsertrecordsResponse.php | 2 +-
.../Requests/CreateUpdateProductRequest.php | 18 +-
...UpdateBatchProductsRequestProductsItem.php | 18 +-
src/EmailCampaigns/EmailCampaignsClient.php | 10 +-
.../EmailCampaignsClientInterface.php | 7 +-
.../Requests/GetEmailCampaignRequest.php | 7 +
.../Types/GetEmailCampaignResponse.php | 17 +
.../Types/GetEmailCampaignResponseStatus.php | 3 +
.../Types/GetEmailCampaignsRequestStatus.php | 2 +
...GetEmailCampaignsResponseCampaignsItem.php | 17 +
...ilCampaignsResponseCampaignsItemStatus.php | 3 +
src/Event/EventClient.php | 132 ++-
src/Event/EventClientInterface.php | 40 +
src/Event/Requests/GetEventsRequest.php | 66 ++
.../Types/CreateBatchEventsRequestItem.php | 92 +++
...reateBatchEventsRequestItemIdentifiers.php | 77 ++
.../CreateBatchEventsRequestItemObject.php | 45 ++
...atchEventsRequestItemObjectIdentifiers.php | 45 ++
src/Program/ProgramClient.php | 45 ++
src/Program/ProgramClientInterface.php | 16 +
.../GetParameterSubscriptionInfoRequest.php | 7 +
src/Tier/Requests/CreateTierGroupRequest.php | 9 +
src/Tier/Requests/UpdateTierGroupRequest.php | 9 +
src/Tier/Types/CreateTierGroupRequestMeta.php | 37 +
src/Tier/Types/UpdateTierGroupRequestMeta.php | 37 +
.../TransactionalEmailsClient.php | 8 +-
.../TransactionalEmailsClientInterface.php | 8 +-
.../TransactionalSmsClient.php | 12 +-
.../TransactionalSmsClientInterface.php | 12 +-
.../TransactionalWhatsAppClient.php | 3 +-
.../TransactionalWhatsAppClientInterface.php | 3 +-
src/Types/BatchAcceptedResponse.php | 45 ++
src/Types/BatchEventsResponse.php | 70 ++
src/Types/BatchEventsResponseErrorsItem.php | 43 +
src/Types/GetCampaignStats.php | 16 +-
src/Types/GetEventsList.php | 46 ++
src/Types/GetEventsListEventsItem.php | 93 +++
src/Types/GetExtendedCampaignOverview.php | 17 +
.../GetExtendedCampaignOverviewStatus.php | 3 +
src/Types/GetProductDetails.php | 16 +
src/Types/InternalServerErrorBody.php | 42 +
src/Types/InternalServerErrorBodyCode.php | 43 +
src/Types/OrderProductsItem.php | 30 +-
src/Types/UpdateCampaignStatusStatus.php | 1 +
.../Requests/CreateWebhookRequest.php | 1 +
.../Requests/UpdateWebhookRequest.php | 1 +
.../Types/CreateWebhookRequestEventsItem.php | 1 +
.../Types/UpdateWebhookRequestEventsItem.php | 1 +
src/Webhooks/WebhooksClient.php | 20 +-
src/Webhooks/WebhooksClientInterface.php | 20 +-
.../WhatsAppCampaignsClient.php | 63 +-
.../WhatsAppCampaignsClientInterface.php | 63 +-
tests/Wire/AccountWireTest.php | 69 --
tests/Wire/BalanceWireTest.php | 486 ------------
tests/Wire/CompaniesWireTest.php | 234 ------
tests/Wire/ContactsWireTest.php | 727 -----------------
tests/Wire/ConversationsWireTest.php | 261 ------
tests/Wire/CouponsWireTest.php | 145 ----
tests/Wire/CustomObjectsWireTest.php | 111 ---
tests/Wire/DealsWireTest.php | 267 -------
tests/Wire/DomainsWireTest.php | 134 ----
tests/Wire/EcommerceWireTest.php | 478 -----------
tests/Wire/EmailCampaignsWireTest.php | 341 --------
tests/Wire/EventWireTest.php | 53 --
tests/Wire/ExternalFeedsWireTest.php | 151 ----
tests/Wire/FilesWireTest.php | 137 ----
tests/Wire/InboundParsingWireTest.php | 91 ---
tests/Wire/MasterAccountWireTest.php | 749 ------------------
tests/Wire/NotesWireTest.php | 142 ----
tests/Wire/PaymentsWireTest.php | 99 ---
tests/Wire/ProcessWireTest.php | 70 --
tests/Wire/ProgramWireTest.php | 284 -------
tests/Wire/RewardWireTest.php | 262 ------
tests/Wire/SendersWireTest.php | 186 -----
tests/Wire/SmsCampaignsWireTest.php | 270 -------
tests/Wire/SmsTemplatesWireTest.php | 49 --
tests/Wire/TasksWireTest.php | 163 ----
tests/Wire/TierWireTest.php | 286 -------
tests/Wire/TransactionalEmailsWireTest.php | 535 -------------
tests/Wire/TransactionalSmsWireTest.php | 142 ----
tests/Wire/TransactionalWhatsAppWireTest.php | 77 --
tests/Wire/UserWireTest.php | 168 ----
tests/Wire/WebhooksWireTest.php | 170 ----
tests/Wire/WhatsAppCampaignsWireTest.php | 233 ------
tests/Wire/WireMockTestCase.php | 80 --
tests/Wire/bootstrap.php | 55 --
wiremock/docker-compose.test.yml | 14 -
116 files changed, 2254 insertions(+), 8216 deletions(-)
create mode 100644 src/Balance/Requests/GetContactBalancesRequest.php
create mode 100644 src/Balance/Requests/GetSubscriptionBalancesRequest.php
delete mode 100644 src/Balance/Types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.php
create mode 100644 src/Balance/Types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus.php
create mode 100644 src/Balance/Types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType.php
create mode 100644 src/Balance/Types/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestMeta.php
create mode 100644 src/Balance/Types/UpdateBalanceDefinitionRequestMeta.php
create mode 100644 src/Companies/Requests/PatchCrmAttributesIdRequest.php
create mode 100644 src/Companies/Types/PatchCrmAttributesIdRequestObjectType.php
create mode 100644 src/Companies/Types/PatchCrmAttributesIdRequestOptionsLabelsItem.php
create mode 100644 src/Event/Requests/GetEventsRequest.php
create mode 100644 src/Event/Types/CreateBatchEventsRequestItem.php
create mode 100644 src/Event/Types/CreateBatchEventsRequestItemIdentifiers.php
create mode 100644 src/Event/Types/CreateBatchEventsRequestItemObject.php
create mode 100644 src/Event/Types/CreateBatchEventsRequestItemObjectIdentifiers.php
create mode 100644 src/Tier/Types/CreateTierGroupRequestMeta.php
create mode 100644 src/Tier/Types/UpdateTierGroupRequestMeta.php
create mode 100644 src/Types/BatchAcceptedResponse.php
create mode 100644 src/Types/BatchEventsResponse.php
create mode 100644 src/Types/BatchEventsResponseErrorsItem.php
create mode 100644 src/Types/GetEventsList.php
create mode 100644 src/Types/GetEventsListEventsItem.php
create mode 100644 src/Types/InternalServerErrorBody.php
create mode 100644 src/Types/InternalServerErrorBodyCode.php
delete mode 100644 tests/Wire/AccountWireTest.php
delete mode 100644 tests/Wire/BalanceWireTest.php
delete mode 100644 tests/Wire/CompaniesWireTest.php
delete mode 100644 tests/Wire/ContactsWireTest.php
delete mode 100644 tests/Wire/ConversationsWireTest.php
delete mode 100644 tests/Wire/CouponsWireTest.php
delete mode 100644 tests/Wire/CustomObjectsWireTest.php
delete mode 100644 tests/Wire/DealsWireTest.php
delete mode 100644 tests/Wire/DomainsWireTest.php
delete mode 100644 tests/Wire/EcommerceWireTest.php
delete mode 100644 tests/Wire/EmailCampaignsWireTest.php
delete mode 100644 tests/Wire/EventWireTest.php
delete mode 100644 tests/Wire/ExternalFeedsWireTest.php
delete mode 100644 tests/Wire/FilesWireTest.php
delete mode 100644 tests/Wire/InboundParsingWireTest.php
delete mode 100644 tests/Wire/MasterAccountWireTest.php
delete mode 100644 tests/Wire/NotesWireTest.php
delete mode 100644 tests/Wire/PaymentsWireTest.php
delete mode 100644 tests/Wire/ProcessWireTest.php
delete mode 100644 tests/Wire/ProgramWireTest.php
delete mode 100644 tests/Wire/RewardWireTest.php
delete mode 100644 tests/Wire/SendersWireTest.php
delete mode 100644 tests/Wire/SmsCampaignsWireTest.php
delete mode 100644 tests/Wire/SmsTemplatesWireTest.php
delete mode 100644 tests/Wire/TasksWireTest.php
delete mode 100644 tests/Wire/TierWireTest.php
delete mode 100644 tests/Wire/TransactionalEmailsWireTest.php
delete mode 100644 tests/Wire/TransactionalSmsWireTest.php
delete mode 100644 tests/Wire/TransactionalWhatsAppWireTest.php
delete mode 100644 tests/Wire/UserWireTest.php
delete mode 100644 tests/Wire/WebhooksWireTest.php
delete mode 100644 tests/Wire/WhatsAppCampaignsWireTest.php
delete mode 100644 tests/Wire/WireMockTestCase.php
delete mode 100644 tests/Wire/bootstrap.php
delete mode 100644 wiremock/docker-compose.test.yml
diff --git a/.fern/metadata.json b/.fern/metadata.json
index e28b6632..b984b843 100644
--- a/.fern/metadata.json
+++ b/.fern/metadata.json
@@ -5,12 +5,21 @@
"generatorConfig": {
"clientName": "Brevo",
"namespace": "Brevo",
- "enable-wire-tests": true,
+ "composerJson": {
+ "description": "Official PHP SDK for the Brevo API.",
+ "author": {
+ "name": "Brevo",
+ "url": "https://brevo.com",
+ "email": "support@brevo.com"
+ },
+ "license": "MIT"
+ },
+ "enable-wire-tests": false,
"propertyAccess": "public",
"packageName": "getbrevo/brevo-php",
"generateClientInterfaces": true,
"useDefaultRequestParameterValues": true
},
- "originGitCommit": "319754b925d4dc1d265cd7fa0046676d3fbeaafc",
- "sdkVersion": "4.2.0"
+ "originGitCommit": "7d08ac3fbe2aa66ba3d56077e8582739d530298b",
+ "sdkVersion": "4.0.11"
}
\ No newline at end of file
diff --git a/composer.json b/composer.json
index c6a8beee..2ba0e420 100644
--- a/composer.json
+++ b/composer.json
@@ -1,13 +1,13 @@
{
"name": "getbrevo/brevo-php",
- "version": "4.2.0",
- "description": "Brevo PHP Library",
+ "version": "4.0.11",
+ "description": "Official PHP SDK for the Brevo API.",
"keywords": [
"brevo",
"api",
"sdk"
],
- "license": [],
+ "license": "MIT",
"require": {
"php": "^8.1",
"ext-json": "*",
@@ -42,5 +42,10 @@
],
"test": "phpunit",
"analyze": "phpstan analyze src tests --memory-limit=1G"
+ },
+ "author": {
+ "name": "Brevo",
+ "url": "https://brevo.com",
+ "email": "support@brevo.com"
}
}
\ No newline at end of file
diff --git a/phpunit.xml b/phpunit.xml
index 718cb50e..54630a51 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -1,7 +1,7 @@
-
+
tests
-
+
\ No newline at end of file
diff --git a/reference.md b/reference.md
index 0642fb6f..9b942c0f 100644
--- a/reference.md
+++ b/reference.md
@@ -3806,6 +3806,7 @@ Possible values for type **Transactional** and channel **SMS**
type **Marketing** channel **SMS** ####
`sent`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`,
`subscribe`,`skip`
+#### `reply`
@@ -3853,22 +3854,16 @@ type **Marketing** channel **SMS** ####
-
-
-To have it activated please send us a request and we will activate it for your account.
+
+This is an enterprise feature. Contact us to activate it for your account.
-Exports webhook event history to CSV format for analysis and reporting.
-
-Use this to:
-- Generate comprehensive webhook event reports
-- Analyze webhook delivery patterns and success rates
-- Export event data for external analysis tools
-- Create historical reports for compliance and auditing
-- Track webhook performance and reliability metrics
+Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body.
-Key information returned:
-- Process ID for tracking export completion
-- CSV file will be delivered to specified webhook URL
+Use this endpoint to:
+- Export webhook event history filtered by date range, event type, or email address
+- Generate reports for compliance, auditing, or performance analysis
+- Track delivery patterns and webhook reliability over time
@@ -4175,6 +4170,7 @@ $client->webhooks->updateWebhook(
#### `spam`, `opened`, `click`, `hardBounce`, `softBounce`,
`unsubscribed`, `listAddition` & `delivered` - Possible values
for **Inbound** type webhook: #### `inboundEmailProcessed`
+#### `reply`
@@ -4868,12 +4864,8 @@ $client->externalFeeds->deleteExternalFeed(
-
-
-Custom objects are only available to Enterprise plans.
-
-This feature is in beta. These are subject to change.
-
-
+Custom objects are only available to Enterprise plans.
+This feature is in beta. These are subject to change.
This API allows bulk upsert of object records in a single request. Each object record may include
- Attributes
- Identifiers
@@ -4887,8 +4879,8 @@ This API allows bulk upsert of object records in a single request. Each object r
- 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.
+ - Max 10 associations defined per associated object type, in each record of the request
+ - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests.
**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".
@@ -4960,12 +4952,8 @@ $client->customObjects->upsertrecords(
-
-
-Custom objects are only available to Enterprise plans.
-
-This feature is in beta. These are subject to change.
-
-
+Custom objects are only available to Enterprise plans.
+This feature is in beta. These are subject to change.
This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint.
@@ -5124,26 +5112,6 @@ $client->customObjects->batchDeleteObjectRecords(
-
-#### 📝 Description
-
-
--
-
-
--
-
-
-Accepted Number Formats
-
-91xxxxxxxxxx
-+91xxxxxxxxxx
-0091xxxxxxxxxx
-
-
-
-
-
-
#### 🔌 Usage
@@ -5250,6 +5218,8 @@ $client->contacts->getContacts(
-
+Follow this format when passing a "SMS" phone number as an attribute.
+Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
Creates new contacts on Brevo. Contacts can be created by passing either -
1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
@@ -5708,9 +5678,7 @@ $client->contacts->updateBatchContacts(
-
-
-attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.
-
+attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.
@@ -5927,17 +5895,11 @@ $client->contacts->requestContactExport(
-
-
-Ongoing changes for this endpoint
-
+Ongoing changes for this endpoint
We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
-
These are non breaking changes.
-
The default value for the attributes will be 0.
-
-The uniqueSubscribers field is deprecated
-
+The uniqueSubscribers field is deprecated
@@ -6051,13 +6013,9 @@ $client->contacts->createFolder(
-
-
-Ongoing changes for this endpoint.
-
+Ongoing changes for this endpoint.
We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
-
-These are non breaking changes. The default value for the attributes will be 0.
-
+These are non breaking changes. The default value for the attributes will be 0.
@@ -6208,13 +6166,9 @@ $client->contacts->deleteFolder(
-
-
-Ongoing changes for this endpoint.
-
+Ongoing changes for this endpoint.
We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
-
-These are non breaking changes. The default value for the attributes will be 0.
-
+These are non breaking changes. The default value for the attributes will be 0.
@@ -6431,13 +6385,9 @@ $client->contacts->importContacts(
-
-
-Ongoing changes for this endpoint.
-
+Ongoing changes for this endpoint.
We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
-
-These are non breaking changes. The default value for the attributes will be 0.
-
+These are non breaking changes. The default value for the attributes will be 0.
@@ -6966,14 +6916,8 @@ $client->contacts->getSegments(
-
-
-Accepted Number Formats
-
-91xxxxxxxxxx
-+91xxxxxxxxxx
-0091xxxxxxxxxx
-
-
+Follow this format when passing a "SMS" phone number as an attribute.
+Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
There are 2 ways to get a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
@@ -7055,6 +6999,8 @@ $client->contacts->getContactInfo(
-
+Follow this format when passing a "SMS" phone number as an attribute.
+Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
If a blocklisted contact's email address is updated, it is going to remove that blocklisting from the contact and they will be resubscribed.
There are 2 ways to update a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
@@ -8601,7 +8547,6 @@ $client->ecommerce->createOrder(
new OrderProductsItem([
'price' => 99.99,
'productId' => 'P1',
- 'quantity' => 10,
]),
],
'status' => 'completed',
@@ -8672,7 +8617,6 @@ $client->ecommerce->createBatchOrder(
new OrderProductsItem([
'price' => 99.99,
'productId' => 'P1',
- 'quantity' => 10,
]),
],
'status' => 'completed',
@@ -8910,6 +8854,14 @@ $client->ecommerce->createUpdateProduct(
-
+**$brand:** `?string` — Brand of the product
+
+
+
+
+
+-
+
**$categories:** `?array` — Category ID-s of the product
@@ -8926,6 +8878,14 @@ $client->ecommerce->createUpdateProduct(
-
+**$description:** `?string` — Description of the product
+
+
+
+
+
+-
+
**$id:** `string` — Product ID for which you requested the details
@@ -8950,7 +8910,7 @@ $client->ecommerce->createUpdateProduct(
-
-**$metaInfo:** `?array` — Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20.
+**$metaInfo:** `?array` — Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**.
@@ -9668,6 +9628,114 @@ $client->payments->deletePaymentRequest(
## Event
+$client->event->getEvents($request) -> ?GetEventsList
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+
+This endpoint currently only supports custom events.
+
+
+Retrieve a list of events filtered by various criteria.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->event->getEvents(
+ new GetEventsRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$contactId:** `?int` — Filter by contact ID (repeatable)
+
+
+
+
+
+-
+
+**$eventName:** `?string` — Filter by event name (repeatable)
+
+
+
+
+
+-
+
+**$objectType:** `?string` — Filter by object type (repeatable)
+
+
+
+
+
+-
+
+**$startDate:** `?string` — Mandatory if endDate is used. Start of date range (YYYY-MM-DD or RFC3339). Defaults to 6 months ago when omitted alongside endDate. Must be ≤ endDate.
+
+
+
+
+
+-
+
+**$endDate:** `?string` — Mandatory if startDate is used. End of date range (YYYY-MM-DD or RFC3339). Must be ≥ startDate.
+
+
+
+
+
+-
+
+**$limit:** `?int` — Max events to return. Default 100, min 1, max 10000.
+
+
+
+
+
+-
+
+**$offset:** `?int` — Events to skip for pagination. Default 0, min 0.
+
+
+
+
+
+
+
+
+
+
+
$client->event->createEvent($request)
-
@@ -9763,6 +9831,67 @@ $client->event->createEvent(
+
+
+
+
+$client->event->createBatchEvents($request) -> ?BatchAcceptedResponse
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Create multiple events to track contacts' interactions in a single request.
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->event->createBatchEvents(
+ [
+ new CreateBatchEventsRequestItem([
+ 'eventName' => 'order_created',
+ 'identifiers' => new CreateBatchEventsRequestItemIdentifiers([]),
+ ]),
+ ],
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$request:** `array`
+
+
+
+
+
+
+
@@ -10075,6 +10204,14 @@ $client->balance->getActiveBalancesApi(
**$balanceDefinitionId:** `string` — Balance Definition ID
+
+
+
+
+-
+
+**$includeInternal:** `?bool` — Include balances tied to internal definitions.
+
@@ -10334,7 +10471,7 @@ $client->balance->createBalanceDefinition(
-
-**$meta:** `?array` — Additional metadata for the balance definition.
+**$meta:** `?PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestMeta` — Additional metadata for the balance definition.
@@ -10605,7 +10742,7 @@ $client->balance->updateBalanceDefinition(
-
-**$meta:** `?array` — Optional metadata for the balance definition.
+**$meta:** `?UpdateBalanceDefinitionRequestMeta` — Optional metadata for the balance definition.
@@ -11112,7 +11249,7 @@ $client->balance->deleteBalanceLimit(
-$client->balance->getContactBalances($pid) -> ?GetContactBalancesResponse
+$client->balance->getContactBalances($pid, $request) -> ?GetContactBalancesResponse
-
@@ -11141,6 +11278,7 @@ Returns balance list
```php
$client->balance->getContactBalances(
'pid',
+ new GetContactBalancesRequest([]),
);
```
@@ -11158,6 +11296,14 @@ $client->balance->getContactBalances(
**$pid:** `string` — Loyalty Program Id
+
+
+
+
+-
+
+**$includeInternal:** `?bool` — Include balances tied to internal definitions.
+
@@ -11287,7 +11433,7 @@ $client->balance->createBalanceOrder(
-$client->balance->getSubscriptionBalances($pid, $cid) -> ?GetSubscriptionBalancesResponse
+$client->balance->getSubscriptionBalances($pid, $cid, $request) -> ?GetSubscriptionBalancesResponse
-
@@ -11317,6 +11463,7 @@ Returns subscription balances
$client->balance->getSubscriptionBalances(
'pid',
'cid',
+ new GetSubscriptionBalancesRequest([]),
);
```
@@ -11342,6 +11489,14 @@ $client->balance->getSubscriptionBalances(
**$cid:** `string` — Contact Id
+
+
+
+
+-
+
+**$includeInternal:** `?bool` — Include balances tied to internal definitions.
+
@@ -11459,7 +11614,7 @@ $client->balance->getTransactionHistoryApi(
'pid',
new GetLoyaltyBalanceProgramsPidTransactionHistoryRequest([
'contactId' => 1,
- 'balanceDefinitionId' => 'balance_definition_id',
+ 'balanceDefinitionId' => 'balanceDefinitionId',
]),
);
```
@@ -11492,7 +11647,7 @@ $client->balance->getTransactionHistoryApi(
-
-**$offset:** `?int` — Skip a number of records
+**$offset:** `?int` — Page number to retrieve
@@ -11534,6 +11689,22 @@ $client->balance->getTransactionHistoryApi(
**$filters:** `?string` — Filters to apply
+
+
+
+
+-
+
+**$status:** `?string` — Transaction status filter. Allowed values: draft, completed, rejected, cancelled, expired
+
+
+
+
+
+-
+
+**$transactionType:** `?string` — Transaction type filter. Allowed values: credit, debit
+
@@ -12316,6 +12487,79 @@ $client->program->getParameterSubscriptionInfo(
**$loyaltySubscriptionId:** `?string` — The loyalty subscription ID to filter by.
+
+
+
+
+-
+
+**$includeInternal:** `?bool` — Include balances tied to internal definitions.
+
+
+
+
+
+
+
+
+
+
+
+$client->program->deleteContactSubscription($pid, $cid)
+
+-
+
+#### 📝 Description
+
+
+-
+
+
+-
+
+Delete subscription for a contact
+
+
+
+
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->program->deleteContactSubscription(
+ 'pid',
+ 1,
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$pid:** `string` — Loyalty Program ID. A unique identifier for the loyalty program.
+
+
+
+
+
+-
+
+**$cid:** `int` — Contact ID.
+
@@ -13734,6 +13978,14 @@ $client->tier->createTierGroup(
-
+**$meta:** `?CreateTierGroupRequestMeta` — Additional metadata for the tier group.
+
+
+
+
+
+-
+
**$tierOrder:** `?array` — Order of the tiers in the group in ascending order
@@ -13913,6 +14165,14 @@ $client->tier->updateTierGroup(
-
+**$meta:** `?UpdateTierGroupRequestMeta` — Additional metadata for the tier group.
+
+
+
+
+
+-
+
**$tierOrder:** `array` — Order of the tiers in the group in ascending order
@@ -14350,11 +14610,8 @@ $client->tier->deleteTier(
-
-
-The response payload for this endpoint has changed
-
-You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
-
+The response payload for this endpoint has changed
+You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
@@ -14848,6 +15105,14 @@ $client->emailCampaigns->getEmailCampaign(
**$statistics:** `?string` — Filter on type of the statistics required. Example **globalStats** value will only fetch globalStats info of the campaign in returned response.
+
+
+
+
+-
+
+**$excludeHtmlContent:** `?bool` — Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body
+
@@ -16352,19 +16617,11 @@ $client->whatsAppCampaigns->getWhatsAppCampaigns(
-
-
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
-
-[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
-
-
-
-This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information.
-
+You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
[Get all the Lists](https://developers.brevo.com/reference/getlists-1)
-
-[Get all the Segments](https://developers.brevo.com/reference/getsegments)
-
+[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -16449,11 +16706,8 @@ $client->whatsAppCampaigns->createWhatsAppCampaign(
-
-
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
-
-[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
-
+You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -16492,11 +16746,8 @@ $client->whatsAppCampaigns->getWhatsAppConfig();
-
-
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
-
-[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
-
+You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -16690,11 +16941,8 @@ $client->whatsAppCampaigns->getWhatsAppTemplates(
-
-
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
-
-[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
-
+You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+[Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
@@ -16750,11 +16998,11 @@ $client->whatsAppCampaigns->sendWhatsAppTemplateApproval(
-
-
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
-
-[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
-
+You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
+[Get all the Lists](https://developers.brevo.com/reference/getlists-1)
+[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -16810,19 +17058,11 @@ $client->whatsAppCampaigns->getWhatsAppCampaign(
-
-
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
-
-[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
-
-
-
-This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information.
-
+You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
[Get all the Lists](https://developers.brevo.com/reference/getlists-1)
-
-[Get all the Segments](https://developers.brevo.com/reference/getsegments)
-
+[Get all the Segments](https://developers.brevo.com/reference/getsegments)
@@ -17483,6 +17723,115 @@ $client->companies->createACompanyDealAttribute(
+
+
+
+
+$client->companies->deleteAnAttribute($id)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->companies->deleteAnAttribute(
+ 'id',
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — Attribute ID
+
+
+
+
+
+
+
+
+
+
+
+$client->companies->updateAnAttribute($id, $request)
+
+-
+
+#### 🔌 Usage
+
+
+-
+
+
+-
+
+```php
+$client->companies->updateAnAttribute(
+ 'id',
+ new PatchCrmAttributesIdRequest([]),
+);
+```
+
+
+
+
+
+#### ⚙️ Parameters
+
+
+-
+
+
+-
+
+**$id:** `string` — Attribute ID
+
+
+
+
+
+-
+
+**$label:** `?string` — Attribute display label
+
+
+
+
+
+-
+
+**$optionsLabels:** `?array` — Updated labels for selectable options
+
+
+
+
+
+-
+
+**$objectType:** `?string` — The type of object the attribute belongs to, it cannot be updated after creation
+
+
+
+
+
+
+
@@ -19127,7 +19476,8 @@ $client->tasks->getAllTaskTypes();
-
-You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+[Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**)
@@ -20103,13 +20453,9 @@ $client->transactionalEmails->getTransacEmailsList(
-
-
-You can get the uuid using either of the following methods:
-
+You can get the uuid using either of the following methods:
Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response.
-
-The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL.
-
+The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL.
@@ -21002,15 +21348,9 @@ $client->transactionalEmails->sendTestTemplate(
-
-
-If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code.
-
-Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number.
-
-
-
-Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.
-
+If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code.
+Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number.
+Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.
diff --git a/src/Account/Types/GetAccountResponsePlanVerticalsItem.php b/src/Account/Types/GetAccountResponsePlanVerticalsItem.php
index fa6ca5e5..a2a92912 100644
--- a/src/Account/Types/GetAccountResponsePlanVerticalsItem.php
+++ b/src/Account/Types/GetAccountResponsePlanVerticalsItem.php
@@ -44,10 +44,10 @@ class GetAccountResponsePlanVerticalsItem extends JsonSerializableType
public string $endDate;
/**
- * @var GetAccountResponsePlanVerticalsItemUsers $users User seat information for the plan
+ * @var ?GetAccountResponsePlanVerticalsItemUsers $users User seat information for the plan
*/
#[JsonProperty('users')]
- public GetAccountResponsePlanVerticalsItemUsers $users;
+ public ?GetAccountResponsePlanVerticalsItemUsers $users;
/**
* @var ?string $credits Credits allocated for this plan category (optional, may not be present for all plan categories)
@@ -63,7 +63,7 @@ class GetAccountResponsePlanVerticalsItem extends JsonSerializableType
* status: value-of,
* startDate: string,
* endDate: string,
- * users: GetAccountResponsePlanVerticalsItemUsers,
+ * users?: ?GetAccountResponsePlanVerticalsItemUsers,
* credits?: ?string,
* } $values
*/
@@ -76,7 +76,7 @@ public function __construct(
$this->status = $values['status'];
$this->startDate = $values['startDate'];
$this->endDate = $values['endDate'];
- $this->users = $values['users'];
+ $this->users = $values['users'] ?? null;
$this->credits = $values['credits'] ?? null;
}
diff --git a/src/Balance/BalanceClient.php b/src/Balance/BalanceClient.php
index 947e60c9..5f0b824f 100644
--- a/src/Balance/BalanceClient.php
+++ b/src/Balance/BalanceClient.php
@@ -22,9 +22,11 @@
use Brevo\Balance\Requests\CreateBalanceLimitRequest;
use Brevo\Balance\Requests\GetBalanceLimitRequest;
use Brevo\Balance\Requests\UpdateBalanceLimitRequest;
+use Brevo\Balance\Requests\GetContactBalancesRequest;
use Brevo\Balance\Types\GetContactBalancesResponse;
use Brevo\Balance\Requests\CreateBalanceOrderRequest;
use Brevo\Balance\Types\CreateBalanceOrderResponse;
+use Brevo\Balance\Requests\GetSubscriptionBalancesRequest;
use Brevo\Balance\Types\GetSubscriptionBalancesResponse;
use Brevo\Balance\Requests\PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest;
use Brevo\Balance\Types\PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse;
@@ -104,6 +106,9 @@ public function getActiveBalancesApi(string $pid, GetLoyaltyBalanceProgramsPidAc
if ($request->sort != null) {
$query['sort'] = $request->sort;
}
+ if ($request->includeInternal != null) {
+ $query['includeInternal'] = $request->includeInternal;
+ }
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
@@ -604,6 +609,7 @@ public function deleteBalanceLimit(string $pid, string $bdid, string $blid, ?arr
* Returns balance list
*
* @param string $pid Loyalty Program Id
+ * @param GetContactBalancesRequest $request
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -616,15 +622,20 @@ public function deleteBalanceLimit(string $pid, string $bdid, string $blid, ?arr
* @throws BrevoException
* @throws BrevoApiException
*/
- public function getContactBalances(string $pid, ?array $options = null): ?GetContactBalancesResponse
+ public function getContactBalances(string $pid, GetContactBalancesRequest $request = new GetContactBalancesRequest(), ?array $options = null): ?GetContactBalancesResponse
{
$options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->includeInternal != null) {
+ $query['includeInternal'] = $request->includeInternal;
+ }
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
path: "loyalty/balance/programs/{$pid}/contact-balances",
method: HttpMethod::GET,
+ query: $query,
),
$options,
);
@@ -703,6 +714,7 @@ public function createBalanceOrder(string $pid, CreateBalanceOrderRequest $reque
*
* @param string $pid Loyalty Program Id
* @param string $cid Contact Id
+ * @param GetSubscriptionBalancesRequest $request
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -715,15 +727,20 @@ public function createBalanceOrder(string $pid, CreateBalanceOrderRequest $reque
* @throws BrevoException
* @throws BrevoApiException
*/
- public function getSubscriptionBalances(string $pid, string $cid, ?array $options = null): ?GetSubscriptionBalancesResponse
+ public function getSubscriptionBalances(string $pid, string $cid, GetSubscriptionBalancesRequest $request = new GetSubscriptionBalancesRequest(), ?array $options = null): ?GetSubscriptionBalancesResponse
{
$options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->includeInternal != null) {
+ $query['includeInternal'] = $request->includeInternal;
+ }
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
path: "loyalty/balance/programs/{$pid}/subscriptions/{$cid}/balances",
method: HttpMethod::GET,
+ query: $query,
),
$options,
);
@@ -819,8 +836,8 @@ public function getTransactionHistoryApi(string $pid, GetLoyaltyBalanceProgramsP
{
$options = array_merge($this->options, $options ?? []);
$query = [];
- $query['contact_id'] = $request->contactId;
- $query['balance_definition_id'] = $request->balanceDefinitionId;
+ $query['contactId'] = $request->contactId;
+ $query['balanceDefinitionId'] = $request->balanceDefinitionId;
if ($request->limit != null) {
$query['limit'] = $request->limit;
}
@@ -828,7 +845,7 @@ public function getTransactionHistoryApi(string $pid, GetLoyaltyBalanceProgramsP
$query['offset'] = $request->offset;
}
if ($request->sortField != null) {
- $query['sort_field'] = $request->sortField;
+ $query['sortField'] = $request->sortField;
}
if ($request->sort != null) {
$query['sort'] = $request->sort;
@@ -836,6 +853,12 @@ public function getTransactionHistoryApi(string $pid, GetLoyaltyBalanceProgramsP
if ($request->filters != null) {
$query['filters'] = $request->filters;
}
+ if ($request->status != null) {
+ $query['status'] = $request->status;
+ }
+ if ($request->transactionType != null) {
+ $query['transactionType'] = $request->transactionType;
+ }
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
diff --git a/src/Balance/BalanceClientInterface.php b/src/Balance/BalanceClientInterface.php
index 15b0a746..35c62bff 100644
--- a/src/Balance/BalanceClientInterface.php
+++ b/src/Balance/BalanceClientInterface.php
@@ -13,9 +13,11 @@
use Brevo\Balance\Requests\CreateBalanceLimitRequest;
use Brevo\Balance\Requests\GetBalanceLimitRequest;
use Brevo\Balance\Requests\UpdateBalanceLimitRequest;
+use Brevo\Balance\Requests\GetContactBalancesRequest;
use Brevo\Balance\Types\GetContactBalancesResponse;
use Brevo\Balance\Requests\CreateBalanceOrderRequest;
use Brevo\Balance\Types\CreateBalanceOrderResponse;
+use Brevo\Balance\Requests\GetSubscriptionBalancesRequest;
use Brevo\Balance\Types\GetSubscriptionBalancesResponse;
use Brevo\Balance\Requests\PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest;
use Brevo\Balance\Types\PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesResponse;
@@ -206,6 +208,7 @@ public function deleteBalanceLimit(string $pid, string $bdid, string $blid, ?arr
* Returns balance list
*
* @param string $pid Loyalty Program Id
+ * @param GetContactBalancesRequest $request
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -216,7 +219,7 @@ public function deleteBalanceLimit(string $pid, string $bdid, string $blid, ?arr
* } $options
* @return ?GetContactBalancesResponse
*/
- public function getContactBalances(string $pid, ?array $options = null): ?GetContactBalancesResponse;
+ public function getContactBalances(string $pid, GetContactBalancesRequest $request = new GetContactBalancesRequest(), ?array $options = null): ?GetContactBalancesResponse;
/**
* Returns created order
@@ -240,6 +243,7 @@ public function createBalanceOrder(string $pid, CreateBalanceOrderRequest $reque
*
* @param string $pid Loyalty Program Id
* @param string $cid Contact Id
+ * @param GetSubscriptionBalancesRequest $request
* @param ?array{
* baseUrl?: string,
* maxRetries?: int,
@@ -250,7 +254,7 @@ public function createBalanceOrder(string $pid, CreateBalanceOrderRequest $reque
* } $options
* @return ?GetSubscriptionBalancesResponse
*/
- public function getSubscriptionBalances(string $pid, string $cid, ?array $options = null): ?GetSubscriptionBalancesResponse;
+ public function getSubscriptionBalances(string $pid, string $cid, GetSubscriptionBalancesRequest $request = new GetSubscriptionBalancesRequest(), ?array $options = null): ?GetSubscriptionBalancesResponse;
/**
* Creates a balance for a contact
diff --git a/src/Balance/Requests/GetContactBalancesRequest.php b/src/Balance/Requests/GetContactBalancesRequest.php
new file mode 100644
index 00000000..3bcc1ce1
--- /dev/null
+++ b/src/Balance/Requests/GetContactBalancesRequest.php
@@ -0,0 +1,24 @@
+includeInternal = $values['includeInternal'] ?? null;
+ }
+}
diff --git a/src/Balance/Requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.php b/src/Balance/Requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.php
index c802d8fd..695b861c 100644
--- a/src/Balance/Requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.php
+++ b/src/Balance/Requests/GetLoyaltyBalanceProgramsPidActiveBalanceRequest.php
@@ -36,6 +36,11 @@ class GetLoyaltyBalanceProgramsPidActiveBalanceRequest extends JsonSerializableT
*/
public string $balanceDefinitionId;
+ /**
+ * @var ?bool $includeInternal Include balances tied to internal definitions.
+ */
+ public ?bool $includeInternal;
+
/**
* @param array{
* contactId: int,
@@ -44,6 +49,7 @@ class GetLoyaltyBalanceProgramsPidActiveBalanceRequest extends JsonSerializableT
* offset?: ?int,
* sortField?: ?string,
* sort?: ?string,
+ * includeInternal?: ?bool,
* } $values
*/
public function __construct(
@@ -55,5 +61,6 @@ public function __construct(
$this->sort = $values['sort'] ?? null;
$this->contactId = $values['contactId'];
$this->balanceDefinitionId = $values['balanceDefinitionId'];
+ $this->includeInternal = $values['includeInternal'] ?? null;
}
}
diff --git a/src/Balance/Requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.php b/src/Balance/Requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.php
index e291f75b..8668fe53 100644
--- a/src/Balance/Requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.php
+++ b/src/Balance/Requests/GetLoyaltyBalanceProgramsPidTransactionHistoryRequest.php
@@ -3,8 +3,9 @@
namespace Brevo\Balance\Requests;
use Brevo\Core\Json\JsonSerializableType;
-use Brevo\Balance\Types\GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField;
use Brevo\Balance\Types\GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSort;
+use Brevo\Balance\Types\GetLoyaltyBalanceProgramsPidTransactionHistoryRequestStatus;
+use Brevo\Balance\Types\GetLoyaltyBalanceProgramsPidTransactionHistoryRequestTransactionType;
class GetLoyaltyBalanceProgramsPidTransactionHistoryRequest extends JsonSerializableType
{
@@ -14,12 +15,12 @@ class GetLoyaltyBalanceProgramsPidTransactionHistoryRequest extends JsonSerializ
public ?int $limit = 20;
/**
- * @var ?int $offset Skip a number of records
+ * @var ?int $offset Page number to retrieve
*/
public ?int $offset = 0;
/**
- * @var ?value-of $sortField Field to sort by
+ * @var ?'createdAt' $sortField Field to sort by
*/
public ?string $sortField;
@@ -43,15 +44,27 @@ class GetLoyaltyBalanceProgramsPidTransactionHistoryRequest extends JsonSerializ
*/
public ?array $filters;
+ /**
+ * @var ?value-of $status Transaction status filter. Allowed values: draft, completed, rejected, cancelled, expired
+ */
+ public ?string $status;
+
+ /**
+ * @var ?value-of $transactionType Transaction type filter. Allowed values: credit, debit
+ */
+ public ?string $transactionType;
+
/**
* @param array{
* contactId?: int,
* balanceDefinitionId: string,
* limit?: ?int,
* offset?: ?int,
- * sortField?: ?value-of,
+ * sortField?: ?'createdAt',
* sort?: ?value-of,
* filters?: ?array,
+ * status?: ?value-of,
+ * transactionType?: ?value-of,
* } $values
*/
public function __construct(
@@ -64,5 +77,7 @@ public function __construct(
$this->contactId = $values['contactId'] ?? 0;
$this->balanceDefinitionId = $values['balanceDefinitionId'];
$this->filters = $values['filters'] ?? null;
+ $this->status = $values['status'] ?? null;
+ $this->transactionType = $values['transactionType'] ?? null;
}
}
diff --git a/src/Balance/Requests/GetSubscriptionBalancesRequest.php b/src/Balance/Requests/GetSubscriptionBalancesRequest.php
new file mode 100644
index 00000000..5d5a88f3
--- /dev/null
+++ b/src/Balance/Requests/GetSubscriptionBalancesRequest.php
@@ -0,0 +1,24 @@
+includeInternal = $values['includeInternal'] ?? null;
+ }
+}
diff --git a/src/Balance/Requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.php b/src/Balance/Requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.php
index cad6526b..be6d909d 100644
--- a/src/Balance/Requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.php
+++ b/src/Balance/Requests/PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest.php
@@ -11,7 +11,7 @@
use Brevo\Balance\Types\PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestBalanceOptionAmountOvertakingStrategy;
use Brevo\Balance\Types\PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestBalanceOptionCreditRounding;
use Brevo\Balance\Types\PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestBalanceOptionDebitRounding;
-use Brevo\Core\Types\ArrayType;
+use Brevo\Balance\Types\PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestMeta;
use Brevo\Balance\Types\PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestUnit;
class PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest extends JsonSerializableType
@@ -89,10 +89,10 @@ class PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest extends JsonSeriali
public ?float $maxDebitAmountLimit;
/**
- * @var ?array $meta Additional metadata for the balance definition.
+ * @var ?PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestMeta $meta Additional metadata for the balance definition.
*/
- #[JsonProperty('meta'), ArrayType(['string' => 'mixed'])]
- public ?array $meta;
+ #[JsonProperty('meta')]
+ public ?PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestMeta $meta;
/**
* @var ?float $minAmount Minimum allowable balance amount.
@@ -128,7 +128,7 @@ class PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest extends JsonSeriali
* maxAmount?: ?float,
* maxCreditAmountLimit?: ?float,
* maxDebitAmountLimit?: ?float,
- * meta?: ?array,
+ * meta?: ?PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestMeta,
* minAmount?: ?float,
* } $values
*/
diff --git a/src/Balance/Requests/UpdateBalanceDefinitionRequest.php b/src/Balance/Requests/UpdateBalanceDefinitionRequest.php
index 5c4828cb..73349a4c 100644
--- a/src/Balance/Requests/UpdateBalanceDefinitionRequest.php
+++ b/src/Balance/Requests/UpdateBalanceDefinitionRequest.php
@@ -9,7 +9,7 @@
use Brevo\Balance\Types\UpdateBalanceDefinitionRequestBalanceOptionAmountOvertakingStrategy;
use Brevo\Balance\Types\UpdateBalanceDefinitionRequestBalanceOptionCreditRounding;
use Brevo\Balance\Types\UpdateBalanceDefinitionRequestBalanceOptionDebitRounding;
-use Brevo\Core\Types\ArrayType;
+use Brevo\Balance\Types\UpdateBalanceDefinitionRequestMeta;
use Brevo\Balance\Types\UpdateBalanceDefinitionRequestUnit;
class UpdateBalanceDefinitionRequest extends JsonSerializableType
@@ -87,10 +87,10 @@ class UpdateBalanceDefinitionRequest extends JsonSerializableType
public ?float $maxDebitAmountLimit;
/**
- * @var ?array $meta Optional metadata for the balance definition.
+ * @var ?UpdateBalanceDefinitionRequestMeta $meta Optional metadata for the balance definition.
*/
- #[JsonProperty('meta'), ArrayType(['string' => 'mixed'])]
- public ?array $meta;
+ #[JsonProperty('meta')]
+ public ?UpdateBalanceDefinitionRequestMeta $meta;
/**
* @var ?float $minAmount Minimum allowable balance amount.
@@ -126,7 +126,7 @@ class UpdateBalanceDefinitionRequest extends JsonSerializableType
* maxAmount?: ?float,
* maxCreditAmountLimit?: ?float,
* maxDebitAmountLimit?: ?float,
- * meta?: ?array,
+ * meta?: ?UpdateBalanceDefinitionRequestMeta,
* minAmount?: ?float,
* } $values
*/
diff --git a/src/Balance/Types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.php b/src/Balance/Types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.php
deleted file mode 100644
index c353b074..00000000
--- a/src/Balance/Types/GetLoyaltyBalanceProgramsPidTransactionHistoryRequestSortField.php
+++ /dev/null
@@ -1,10 +0,0 @@
-isInternal = $values['isInternal'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Balance/Types/UpdateBalanceDefinitionRequestMeta.php b/src/Balance/Types/UpdateBalanceDefinitionRequestMeta.php
new file mode 100644
index 00000000..e3aba927
--- /dev/null
+++ b/src/Balance/Types/UpdateBalanceDefinitionRequestMeta.php
@@ -0,0 +1,37 @@
+isInternal = $values['isInternal'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Brevo.php b/src/Brevo.php
index e0d769ba..0a355af2 100644
--- a/src/Brevo.php
+++ b/src/Brevo.php
@@ -265,8 +265,8 @@ public function __construct(
'api-key' => $apiKey,
'X-Fern-Language' => 'PHP',
'X-Fern-SDK-Name' => 'Brevo',
- 'X-Fern-SDK-Version' => '4.2.0',
- 'User-Agent' => 'getbrevo/brevo-php/4.2.0',
+ 'X-Fern-SDK-Version' => '4.0.11',
+ 'User-Agent' => 'getbrevo/brevo-php/4.0.11',
];
$this->options = $options ?? [];
diff --git a/src/Companies/CompaniesClient.php b/src/Companies/CompaniesClient.php
index 18afd286..35d0dd08 100644
--- a/src/Companies/CompaniesClient.php
+++ b/src/Companies/CompaniesClient.php
@@ -25,6 +25,7 @@
use Brevo\Companies\Requests\PatchCompaniesIdRequest;
use Brevo\Companies\Requests\PostCrmAttributesRequest;
use Brevo\Companies\Types\PostCrmAttributesResponse;
+use Brevo\Companies\Requests\PatchCrmAttributesIdRequest;
use Brevo\Companies\Types\GetCrmAttributesCompaniesResponseItem;
use Brevo\Core\Json\JsonDecoder;
@@ -462,6 +463,86 @@ public function createACompanyDealAttribute(PostCrmAttributesRequest $request, ?
);
}
+ /**
+ * @param string $id Attribute ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws BrevoException
+ * @throws BrevoApiException
+ */
+ public function deleteAnAttribute(string $id, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "crm/attributes/{$id}",
+ method: HttpMethod::DELETE,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new BrevoException(message: $e->getMessage(), previous: $e);
+ }
+ throw new BrevoApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
+ /**
+ * @param string $id Attribute ID
+ * @param PatchCrmAttributesIdRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws BrevoException
+ * @throws BrevoApiException
+ */
+ public function updateAnAttribute(string $id, PatchCrmAttributesIdRequest $request = new PatchCrmAttributesIdRequest(), ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "crm/attributes/{$id}",
+ method: HttpMethod::PATCH,
+ body: $request,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new BrevoException(message: $e->getMessage(), previous: $e);
+ }
+ throw new BrevoApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
/**
* @param ?array{
* baseUrl?: string,
diff --git a/src/Companies/CompaniesClientInterface.php b/src/Companies/CompaniesClientInterface.php
index bca72805..432fb0ac 100644
--- a/src/Companies/CompaniesClientInterface.php
+++ b/src/Companies/CompaniesClientInterface.php
@@ -13,6 +13,7 @@
use Brevo\Companies\Requests\PatchCompaniesIdRequest;
use Brevo\Companies\Requests\PostCrmAttributesRequest;
use Brevo\Companies\Types\PostCrmAttributesResponse;
+use Brevo\Companies\Requests\PatchCrmAttributesIdRequest;
use Brevo\Companies\Types\GetCrmAttributesCompaniesResponseItem;
interface CompaniesClientInterface
@@ -130,6 +131,33 @@ public function updateACompany(string $id, PatchCompaniesIdRequest $request = ne
*/
public function createACompanyDealAttribute(PostCrmAttributesRequest $request, ?array $options = null): ?PostCrmAttributesResponse;
+ /**
+ * @param string $id Attribute ID
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ */
+ public function deleteAnAttribute(string $id, ?array $options = null): void;
+
+ /**
+ * @param string $id Attribute ID
+ * @param PatchCrmAttributesIdRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ */
+ public function updateAnAttribute(string $id, PatchCrmAttributesIdRequest $request = new PatchCrmAttributesIdRequest(), ?array $options = null): void;
+
/**
* @param ?array{
* baseUrl?: string,
diff --git a/src/Companies/Requests/PatchCrmAttributesIdRequest.php b/src/Companies/Requests/PatchCrmAttributesIdRequest.php
new file mode 100644
index 00000000..8de1934d
--- /dev/null
+++ b/src/Companies/Requests/PatchCrmAttributesIdRequest.php
@@ -0,0 +1,45 @@
+ $optionsLabels Updated labels for selectable options
+ */
+ #[JsonProperty('optionsLabels'), ArrayType([PatchCrmAttributesIdRequestOptionsLabelsItem::class])]
+ public ?array $optionsLabels;
+
+ /**
+ * @var ?value-of $objectType The type of object the attribute belongs to, it cannot be updated after creation
+ */
+ #[JsonProperty('objectType')]
+ public ?string $objectType;
+
+ /**
+ * @param array{
+ * label?: ?string,
+ * optionsLabels?: ?array,
+ * objectType?: ?value-of,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->label = $values['label'] ?? null;
+ $this->optionsLabels = $values['optionsLabels'] ?? null;
+ $this->objectType = $values['objectType'] ?? null;
+ }
+}
diff --git a/src/Companies/Types/PatchCrmAttributesIdRequestObjectType.php b/src/Companies/Types/PatchCrmAttributesIdRequestObjectType.php
new file mode 100644
index 00000000..facdbef0
--- /dev/null
+++ b/src/Companies/Types/PatchCrmAttributesIdRequestObjectType.php
@@ -0,0 +1,9 @@
+key = $values['key'];
+ $this->value = $values['value'];
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Contacts/ContactsClient.php b/src/Contacts/ContactsClient.php
index 011c6822..74152437 100644
--- a/src/Contacts/ContactsClient.php
+++ b/src/Contacts/ContactsClient.php
@@ -92,14 +92,6 @@ public function __construct(
}
/**
- *
- * Accepted Number Formats
- *
- * 91xxxxxxxxxx
- * +91xxxxxxxxxx
- * 0091xxxxxxxxxx
- *
- *
* @param GetContactsRequest $request
* @param ?array{
* baseUrl?: string,
@@ -172,6 +164,8 @@ public function getContacts(GetContactsRequest $request = new GetContactsRequest
}
/**
+ * Follow this format when passing a "SMS" phone number as an attribute.
+ * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
* Creates new contacts on Brevo. Contacts can be created by passing either -
1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
*
* @param CreateContactRequest $request
@@ -471,9 +465,7 @@ public function updateBatchContacts(UpdateBatchContactsRequest $request = new Up
}
/**
- *
- * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.
- *
+ * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.
*
* @param CreateDoiContactRequest $request
* @param ?array{
@@ -564,17 +556,11 @@ public function requestContactExport(RequestContactExportRequest $request, ?arra
}
/**
- *
- * Ongoing changes for this endpoint
- *
+ * Ongoing changes for this endpoint
* We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
- *
* These are non breaking changes.
- *
* The default value for the attributes will be 0.
- *
- * The uniqueSubscribers field is deprecated
- *
+ * The uniqueSubscribers field is deprecated
*
* @param GetFoldersRequest $request
* @param ?array{
@@ -680,13 +666,9 @@ public function createFolder(CreateUpdateFolder $request, ?array $options = null
}
/**
- *
- * Ongoing changes for this endpoint.
- *
+ * Ongoing changes for this endpoint.
* We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
- *
- * These are non breaking changes. The default value for the attributes will be 0.
- *
+ * These are non breaking changes. The default value for the attributes will be 0.
*
* @param int $folderId id of the folder
* @param ?array{
@@ -814,13 +796,9 @@ public function deleteFolder(int $folderId, ?array $options = null): void
}
/**
- *
- * Ongoing changes for this endpoint.
- *
+ * Ongoing changes for this endpoint.
* We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
- *
- * These are non breaking changes. The default value for the attributes will be 0.
- *
+ * These are non breaking changes. The default value for the attributes will be 0.
*
* @param int $folderId Id of the folder
* @param GetFolderListsRequest $request
@@ -929,13 +907,9 @@ public function importContacts(ImportContactsRequest $request = new ImportContac
}
/**
- *
- * Ongoing changes for this endpoint.
- *
+ * Ongoing changes for this endpoint.
* We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
- *
- * These are non breaking changes. The default value for the attributes will be 0.
- *
+ * These are non breaking changes. The default value for the attributes will be 0.
*
* @param GetListsRequest $request
* @param ?array{
@@ -1390,14 +1364,8 @@ public function getSegments(GetSegmentsRequest $request = new GetSegmentsRequest
}
/**
- *
- * Accepted Number Formats
- *
- * 91xxxxxxxxxx
- * +91xxxxxxxxxx
- * 0091xxxxxxxxxx
- *
- *
+ * Follow this format when passing a "SMS" phone number as an attribute.
+ * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
* There are 2 ways to get a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
*
* @param (
@@ -1461,6 +1429,8 @@ public function getContactInfo(string|int $identifier, GetContactInfoRequest $re
}
/**
+ * Follow this format when passing a "SMS" phone number as an attribute.
+ * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
If a blocklisted contact's email address is updated, it is going to remove that blocklisting from the contact and they will be resubscribed.
* There are 2 ways to update a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
*
* @param (
diff --git a/src/Contacts/ContactsClientInterface.php b/src/Contacts/ContactsClientInterface.php
index efed77b9..55bcea41 100644
--- a/src/Contacts/ContactsClientInterface.php
+++ b/src/Contacts/ContactsClientInterface.php
@@ -49,14 +49,6 @@
interface ContactsClientInterface
{
/**
- *
- * Accepted Number Formats
- *
- * 91xxxxxxxxxx
- * +91xxxxxxxxxx
- * 0091xxxxxxxxxx
- *
- *
* @param GetContactsRequest $request
* @param ?array{
* baseUrl?: string,
@@ -71,6 +63,8 @@ interface ContactsClientInterface
public function getContacts(GetContactsRequest $request = new GetContactsRequest(), ?array $options = null): ?GetContacts;
/**
+ * Follow this format when passing a "SMS" phone number as an attribute.
+ * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
* Creates new contacts on Brevo. Contacts can be created by passing either -
1. email address of the contact (email_id),
2. phone number of the contact (to be passed as "SMS" field in "attributes" along with proper country code), For example- {"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}
3. ext_id
*
* @param CreateContactRequest $request
@@ -172,9 +166,7 @@ public function deleteMultiAttributeOptions(string $attributeType, string $multi
public function updateBatchContacts(UpdateBatchContactsRequest $request = new UpdateBatchContactsRequest(), ?array $options = null): void;
/**
- *
- * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.
- *
+ * attributes param in this endpoint is an object containing key-value pairs where values can be either a string, integer, array, or boolean. You can create key-value pairs with these four datatypes. When a value is an array, it should be an array of strings.
*
* @param CreateDoiContactRequest $request
* @param ?array{
@@ -205,17 +197,11 @@ public function createDoiContact(CreateDoiContactRequest $request, ?array $optio
public function requestContactExport(RequestContactExportRequest $request, ?array $options = null): ?RequestContactExportResponse;
/**
- *
- * Ongoing changes for this endpoint
- *
+ * Ongoing changes for this endpoint
* We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
- *
* These are non breaking changes.
- *
* The default value for the attributes will be 0.
- *
- * The uniqueSubscribers field is deprecated
- *
+ * The uniqueSubscribers field is deprecated
*
* @param GetFoldersRequest $request
* @param ?array{
@@ -245,13 +231,9 @@ public function getFolders(GetFoldersRequest $request = new GetFoldersRequest(),
public function createFolder(CreateUpdateFolder $request, ?array $options = null): ?CreateFolderResponse;
/**
- *
- * Ongoing changes for this endpoint.
- *
+ * Ongoing changes for this endpoint.
* We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
- *
- * These are non breaking changes. The default value for the attributes will be 0.
- *
+ * These are non breaking changes. The default value for the attributes will be 0.
*
* @param int $folderId id of the folder
* @param ?array{
@@ -294,13 +276,9 @@ public function updateFolder(int $folderId, UpdateFolderRequest $request, ?array
public function deleteFolder(int $folderId, ?array $options = null): void;
/**
- *
- * Ongoing changes for this endpoint.
- *
+ * Ongoing changes for this endpoint.
* We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
- *
- * These are non breaking changes. The default value for the attributes will be 0.
- *
+ * These are non breaking changes. The default value for the attributes will be 0.
*
* @param int $folderId Id of the folder
* @param GetFolderListsRequest $request
@@ -333,13 +311,9 @@ public function getFolderLists(int $folderId, GetFolderListsRequest $request = n
public function importContacts(ImportContactsRequest $request = new ImportContactsRequest(), ?array $options = null): ?ImportContactsResponse;
/**
- *
- * Ongoing changes for this endpoint.
- *
+ * Ongoing changes for this endpoint.
* We're dropping support for the response attributes totalSubscribers and totalBlacklisted.
- *
- * These are non breaking changes. The default value for the attributes will be 0.
- *
+ * These are non breaking changes. The default value for the attributes will be 0.
*
* @param GetListsRequest $request
* @param ?array{
@@ -470,14 +444,8 @@ public function removeContactFromList(int $listId, RemoveContactFromListRequest
public function getSegments(GetSegmentsRequest $request = new GetSegmentsRequest(), ?array $options = null): ?GetSegmentsResponse;
/**
- *
- * Accepted Number Formats
- *
- * 91xxxxxxxxxx
- * +91xxxxxxxxxx
- * 0091xxxxxxxxxx
- *
- *
+ * Follow this format when passing a "SMS" phone number as an attribute.
+ * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
* There are 2 ways to get a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL), phone_id (for SMS) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL, SMS and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, phone_id for SMS attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE_NUMBER attribute
Along with the contact details, this endpoint will show the statistics of contact for the recent 90 days by default. To fetch the earlier statistics, please use Get contact campaign stats ``https://developers.brevo.com/reference/contacts-7#getcontactstats`` endpoint with the appropriate date ranges.
*
* @param (
@@ -498,6 +466,8 @@ public function getSegments(GetSegmentsRequest $request = new GetSegmentsRequest
public function getContactInfo(string|int $identifier, GetContactInfoRequest $request = new GetContactInfoRequest(), ?array $options = null): ?GetContactInfoResponse;
/**
+ * Follow this format when passing a "SMS" phone number as an attribute.
+ * Accepted Number Formats 91xxxxxxxxxx +91xxxxxxxxxx 0091xxxxxxxxxx
If a blocklisted contact's email address is updated, it is going to remove that blocklisting from the contact and they will be resubscribed.
* There are 2 ways to update a contact
Option 1- https://api.brevo.com/v3/contacts/{identifier}
Option 2- https://api.brevo.com/v3/contacts/{identifier}?identifierType={}
Option 1 only works if identifierType is email_id (for EMAIL) or contact_id (for ID of the contact),where you can directly pass the value of EMAIL and ID of the contact.
Option 2 works for all identifierType, use email_id for EMAIL attribute, contact_id for ID of the contact, ext_id for EXT_ID attribute, phone_id for SMS attribute, whatsapp_id for WHATSAPP attribute, landline_number_id for LANDLINE attribute
*
* @param (
diff --git a/src/CustomObjects/CustomObjectsClient.php b/src/CustomObjects/CustomObjectsClient.php
index 9753d373..e7c08a9d 100644
--- a/src/CustomObjects/CustomObjectsClient.php
+++ b/src/CustomObjects/CustomObjectsClient.php
@@ -55,12 +55,8 @@ public function __construct(
}
/**
- *
- * Custom objects are only available to Enterprise plans.
- *
- * This feature is in beta. These are subject to change.
- *
- *
+ * Custom objects are only available to Enterprise plans.
+ * This feature is in beta. These are subject to change.
* This API allows bulk upsert of object records in a single request. Each object record may include
* - Attributes
* - Identifiers
@@ -74,8 +70,8 @@ public function __construct(
* - 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.
+ * - Max 10 associations defined per associated object type, in each record of the request
+ * - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests.
* **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".
@@ -128,12 +124,8 @@ public function upsertrecords(string $objectType, UpsertrecordsRequest $request,
}
/**
- *
- * Custom objects are only available to Enterprise plans.
- *
- * This feature is in beta. These are subject to change.
- *
- *
+ * Custom objects are only available to Enterprise plans.
+ * This feature is in beta. These are subject to change.
* This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint.
*
* @param string $objectType object type for the attribute
diff --git a/src/CustomObjects/CustomObjectsClientInterface.php b/src/CustomObjects/CustomObjectsClientInterface.php
index fd6edd53..76d9adba 100644
--- a/src/CustomObjects/CustomObjectsClientInterface.php
+++ b/src/CustomObjects/CustomObjectsClientInterface.php
@@ -12,12 +12,8 @@
interface CustomObjectsClientInterface
{
/**
- *
- * Custom objects are only available to Enterprise plans.
- *
- * This feature is in beta. These are subject to change.
- *
- *
+ * Custom objects are only available to Enterprise plans.
+ * This feature is in beta. These are subject to change.
* This API allows bulk upsert of object records in a single request. Each object record may include
* - Attributes
* - Identifiers
@@ -31,8 +27,8 @@ interface CustomObjectsClientInterface
* - 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.
+ * - Max 10 associations defined per associated object type, in each record of the request
+ * - This is not a schema limitation. You can associate an object record to an unlimited number of other object records by running multiple requests.
* **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".
@@ -52,12 +48,8 @@ interface CustomObjectsClientInterface
public function upsertrecords(string $objectType, UpsertrecordsRequest $request, ?array $options = null): ?UpsertrecordsResponse;
/**
- *
- * Custom objects are only available to Enterprise plans.
- *
- * This feature is in beta. These are subject to change.
- *
- *
+ * Custom objects are only available to Enterprise plans.
+ * This feature is in beta. These are subject to change.
* This API retrieves a list of object records along with their associated records and provides the total count of records for the specified object. **Note**: Contact as object type is not supported in this endpoint.
*
* @param string $objectType object type for the attribute
diff --git a/src/CustomObjects/Types/UpsertrecordsRequestRecordsItem.php b/src/CustomObjects/Types/UpsertrecordsRequestRecordsItem.php
index fb62b110..b92810e8 100644
--- a/src/CustomObjects/Types/UpsertrecordsRequestRecordsItem.php
+++ b/src/CustomObjects/Types/UpsertrecordsRequestRecordsItem.php
@@ -19,7 +19,7 @@ class UpsertrecordsRequestRecordsItem extends JsonSerializableType
public ?array $associations;
/**
- * @var ?array $attributes Attributes attached with the object record. Only the already created attributes will be used with records. Minimum 1 attribute is required.
+ * @var ?array $attributes Attributes attached with the object record. Only the already created attributes will be used with records. Pass the value with the attributes key you want to set or update for the object record. Minimum 1 attribute is required.
*/
#[JsonProperty('attributes'), ArrayType(['string' => 'mixed'])]
public ?array $attributes;
diff --git a/src/CustomObjects/Types/UpsertrecordsResponse.php b/src/CustomObjects/Types/UpsertrecordsResponse.php
index d5f7bd9f..df8270b8 100644
--- a/src/CustomObjects/Types/UpsertrecordsResponse.php
+++ b/src/CustomObjects/Types/UpsertrecordsResponse.php
@@ -14,7 +14,7 @@ class UpsertrecordsResponse extends JsonSerializableType
public ?string $message;
/**
- * @var ?int $processId Unique Id for the batch process used to track the status of the batch.
+ * @var ?int $processId Unique Id for the batch process used to track the status of the batch. **How to use this processId:** Refer to the [Get process status API](https://developers.brevo.com/reference/get-process) to check the execution status of this batch using the returned `processId`.
*/
#[JsonProperty('processId')]
public ?int $processId;
diff --git a/src/Ecommerce/Requests/CreateUpdateProductRequest.php b/src/Ecommerce/Requests/CreateUpdateProductRequest.php
index 04a0b951..fc47fc6b 100644
--- a/src/Ecommerce/Requests/CreateUpdateProductRequest.php
+++ b/src/Ecommerce/Requests/CreateUpdateProductRequest.php
@@ -9,6 +9,12 @@
class CreateUpdateProductRequest extends JsonSerializableType
{
+ /**
+ * @var ?string $brand Brand of the product
+ */
+ #[JsonProperty('brand')]
+ public ?string $brand;
+
/**
* @var ?array $categories Category ID-s of the product
*/
@@ -21,6 +27,12 @@ class CreateUpdateProductRequest extends JsonSerializableType
#[JsonProperty('deletedAt')]
public ?string $deletedAt;
+ /**
+ * @var ?string $description Description of the product
+ */
+ #[JsonProperty('description')]
+ public ?string $description;
+
/**
* @var string $id Product ID for which you requested the details
*/
@@ -43,7 +55,7 @@ class CreateUpdateProductRequest extends JsonSerializableType
* @var ?array $metaInfo Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20.
+ * )> $metaInfo Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**.
*/
#[JsonProperty('metaInfo'), ArrayType(['string' => new Union('string', 'integer')])]
public ?array $metaInfo;
@@ -94,8 +106,10 @@ class CreateUpdateProductRequest extends JsonSerializableType
* @param array{
* id: string,
* name: string,
+ * brand?: ?string,
* categories?: ?array,
* deletedAt?: ?string,
+ * description?: ?string,
* imageUrl?: ?string,
* isDeleted?: ?bool,
* metaInfo?: ?arraybrand = $values['brand'] ?? null;
$this->categories = $values['categories'] ?? null;
$this->deletedAt = $values['deletedAt'] ?? null;
+ $this->description = $values['description'] ?? null;
$this->id = $values['id'];
$this->imageUrl = $values['imageUrl'] ?? null;
$this->isDeleted = $values['isDeleted'] ?? null;
diff --git a/src/Ecommerce/Types/CreateUpdateBatchProductsRequestProductsItem.php b/src/Ecommerce/Types/CreateUpdateBatchProductsRequestProductsItem.php
index 0a07527b..0d51b15e 100644
--- a/src/Ecommerce/Types/CreateUpdateBatchProductsRequestProductsItem.php
+++ b/src/Ecommerce/Types/CreateUpdateBatchProductsRequestProductsItem.php
@@ -9,6 +9,12 @@
class CreateUpdateBatchProductsRequestProductsItem extends JsonSerializableType
{
+ /**
+ * @var ?string $brand Brand of the product
+ */
+ #[JsonProperty('brand')]
+ public ?string $brand;
+
/**
* @var ?array $categories Category ID-s of the product
*/
@@ -21,6 +27,12 @@ class CreateUpdateBatchProductsRequestProductsItem extends JsonSerializableType
#[JsonProperty('deletedAt')]
public ?string $deletedAt;
+ /**
+ * @var ?string $description Description of the product
+ */
+ #[JsonProperty('description')]
+ public ?string $description;
+
/**
* @var string $id Product ID for which you requested the details
*/
@@ -43,7 +55,7 @@ class CreateUpdateBatchProductsRequestProductsItem extends JsonSerializableType
* @var ?array $metaInfo Meta data of product such as description, vendor, producer, stock level. The size of cumulative metaInfo shall not exceed **1000 KB**. Maximum length of metaInfo object can be 20.
+ * )> $metaInfo Meta data of product such as description, vendor, producer, stock level. The total characters of cumulative metaInfo shall not exceed **20000 characters**.
*/
#[JsonProperty('metaInfo'), ArrayType(['string' => new Union('string', 'integer')])]
public ?array $metaInfo;
@@ -88,8 +100,10 @@ class CreateUpdateBatchProductsRequestProductsItem extends JsonSerializableType
* @param array{
* id: string,
* name: string,
+ * brand?: ?string,
* categories?: ?array,
* deletedAt?: ?string,
+ * description?: ?string,
* imageUrl?: ?string,
* isDeleted?: ?bool,
* metaInfo?: ?arraybrand = $values['brand'] ?? null;
$this->categories = $values['categories'] ?? null;
$this->deletedAt = $values['deletedAt'] ?? null;
+ $this->description = $values['description'] ?? null;
$this->id = $values['id'];
$this->imageUrl = $values['imageUrl'] ?? null;
$this->isDeleted = $values['isDeleted'] ?? null;
diff --git a/src/EmailCampaigns/EmailCampaignsClient.php b/src/EmailCampaigns/EmailCampaignsClient.php
index 5a46bb47..fbb10fca 100644
--- a/src/EmailCampaigns/EmailCampaignsClient.php
+++ b/src/EmailCampaigns/EmailCampaignsClient.php
@@ -65,11 +65,8 @@ public function __construct(
}
/**
- *
- * The response payload for this endpoint has changed
- *
- * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
- *
+ * The response payload for this endpoint has changed
+ * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
*
* @param GetEmailCampaignsRequest $request
* @param ?array{
@@ -261,6 +258,9 @@ public function getEmailCampaign(int $campaignId, GetEmailCampaignRequest $reque
if ($request->statistics != null) {
$query['statistics'] = $request->statistics;
}
+ if ($request->excludeHtmlContent != null) {
+ $query['excludeHtmlContent'] = $request->excludeHtmlContent;
+ }
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
diff --git a/src/EmailCampaigns/EmailCampaignsClientInterface.php b/src/EmailCampaigns/EmailCampaignsClientInterface.php
index 5c4a0aaf..dd31a0b9 100644
--- a/src/EmailCampaigns/EmailCampaignsClientInterface.php
+++ b/src/EmailCampaigns/EmailCampaignsClientInterface.php
@@ -22,11 +22,8 @@
interface EmailCampaignsClientInterface
{
/**
- *
- * The response payload for this endpoint has changed
- *
- * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
- *
+ * The response payload for this endpoint has changed
+ * You now need to specify which type of statistics you would like to retrieve. For more information visit [this page](https://developers.brevo.com/changelog/get-all-marketing-campaigns).
*
* @param GetEmailCampaignsRequest $request
* @param ?array{
diff --git a/src/EmailCampaigns/Requests/GetEmailCampaignRequest.php b/src/EmailCampaigns/Requests/GetEmailCampaignRequest.php
index 098a8729..58c1a8db 100644
--- a/src/EmailCampaigns/Requests/GetEmailCampaignRequest.php
+++ b/src/EmailCampaigns/Requests/GetEmailCampaignRequest.php
@@ -12,14 +12,21 @@ class GetEmailCampaignRequest extends JsonSerializableType
*/
public ?string $statistics;
+ /**
+ * @var ?bool $excludeHtmlContent Use this flag to exclude htmlContent from the response body. If set to **true**, htmlContent field will be returned as empty string in the response body
+ */
+ public ?bool $excludeHtmlContent;
+
/**
* @param array{
* statistics?: ?value-of,
+ * excludeHtmlContent?: ?bool,
* } $values
*/
public function __construct(
array $values = [],
) {
$this->statistics = $values['statistics'] ?? null;
+ $this->excludeHtmlContent = $values['excludeHtmlContent'] ?? null;
}
}
diff --git a/src/EmailCampaigns/Types/GetEmailCampaignResponse.php b/src/EmailCampaigns/Types/GetEmailCampaignResponse.php
index 330a3a54..14d380c8 100644
--- a/src/EmailCampaigns/Types/GetEmailCampaignResponse.php
+++ b/src/EmailCampaigns/Types/GetEmailCampaignResponse.php
@@ -4,11 +4,18 @@
use Brevo\Core\Json\JsonSerializableType;
use Brevo\Core\Json\JsonProperty;
+use Brevo\Core\Types\ArrayType;
use Brevo\Types\GetCampaignRecipients;
use Brevo\Types\GetExtendedCampaignStats;
class GetEmailCampaignResponse extends JsonSerializableType
{
+ /**
+ * @var ?string $attachmentFile Url of the attachment file. Only available if the campaign has an attachment.
+ */
+ #[JsonProperty('attachmentFile')]
+ public ?string $attachmentFile;
+
/**
* @var ?bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled.
*/
@@ -177,6 +184,12 @@ class GetEmailCampaignResponse extends JsonSerializableType
#[JsonProperty('tag')]
public ?string $tag;
+ /**
+ * @var ?array $tags List of tags of the campaign
+ */
+ #[JsonProperty('tags'), ArrayType(['string'])]
+ public ?array $tags;
+
/**
* @var bool $testSent Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent)
*/
@@ -241,6 +254,7 @@ class GetEmailCampaignResponse extends JsonSerializableType
* testSent: bool,
* recipients: GetCampaignRecipients,
* statistics: GetExtendedCampaignStats,
+ * attachmentFile?: ?string,
* abTesting?: ?bool,
* previewText?: ?string,
* scheduledAt?: ?string,
@@ -258,6 +272,7 @@ class GetEmailCampaignResponse extends JsonSerializableType
* sentDate?: ?string,
* shareLink?: ?string,
* tag?: ?string,
+ * tags?: ?array,
* toField?: ?string,
* utmCampaignValue?: ?string,
* utmIdActive?: ?bool,
@@ -268,6 +283,7 @@ class GetEmailCampaignResponse extends JsonSerializableType
public function __construct(
array $values,
) {
+ $this->attachmentFile = $values['attachmentFile'] ?? null;
$this->abTesting = $values['abTesting'] ?? null;
$this->id = $values['id'];
$this->name = $values['name'];
@@ -296,6 +312,7 @@ public function __construct(
$this->sentDate = $values['sentDate'] ?? null;
$this->shareLink = $values['shareLink'] ?? null;
$this->tag = $values['tag'] ?? null;
+ $this->tags = $values['tags'] ?? null;
$this->testSent = $values['testSent'];
$this->toField = $values['toField'] ?? null;
$this->utmCampaignValue = $values['utmCampaignValue'] ?? null;
diff --git a/src/EmailCampaigns/Types/GetEmailCampaignResponseStatus.php b/src/EmailCampaigns/Types/GetEmailCampaignResponseStatus.php
index c31e7577..81d3d787 100644
--- a/src/EmailCampaigns/Types/GetEmailCampaignResponseStatus.php
+++ b/src/EmailCampaigns/Types/GetEmailCampaignResponseStatus.php
@@ -10,4 +10,7 @@ enum GetEmailCampaignResponseStatus: string
case Queued = "queued";
case Suspended = "suspended";
case InProcess = "in_process";
+ case InReview = "in_review";
+ case Cancelling = "cancelling";
+ case Cancelled = "cancelled";
}
diff --git a/src/EmailCampaigns/Types/GetEmailCampaignsRequestStatus.php b/src/EmailCampaigns/Types/GetEmailCampaignsRequestStatus.php
index aabc2ee4..68034273 100644
--- a/src/EmailCampaigns/Types/GetEmailCampaignsRequestStatus.php
+++ b/src/EmailCampaigns/Types/GetEmailCampaignsRequestStatus.php
@@ -11,4 +11,6 @@ enum GetEmailCampaignsRequestStatus: string
case Draft = "draft";
case InProcess = "inProcess";
case InReview = "inReview";
+ case Cancelling = "cancelling";
+ case Cancelled = "cancelled";
}
diff --git a/src/EmailCampaigns/Types/GetEmailCampaignsResponseCampaignsItem.php b/src/EmailCampaigns/Types/GetEmailCampaignsResponseCampaignsItem.php
index 3119c4a9..460a98de 100644
--- a/src/EmailCampaigns/Types/GetEmailCampaignsResponseCampaignsItem.php
+++ b/src/EmailCampaigns/Types/GetEmailCampaignsResponseCampaignsItem.php
@@ -4,11 +4,18 @@
use Brevo\Core\Json\JsonSerializableType;
use Brevo\Core\Json\JsonProperty;
+use Brevo\Core\Types\ArrayType;
use Brevo\Types\GetCampaignRecipients;
use Brevo\Types\GetExtendedCampaignStats;
class GetEmailCampaignsResponseCampaignsItem extends JsonSerializableType
{
+ /**
+ * @var ?string $attachmentFile Url of the attachment file. Only available if the campaign has an attachment.
+ */
+ #[JsonProperty('attachmentFile')]
+ public ?string $attachmentFile;
+
/**
* @var ?bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled.
*/
@@ -177,6 +184,12 @@ class GetEmailCampaignsResponseCampaignsItem extends JsonSerializableType
#[JsonProperty('tag')]
public ?string $tag;
+ /**
+ * @var ?array $tags List of tags of the campaign
+ */
+ #[JsonProperty('tags'), ArrayType(['string'])]
+ public ?array $tags;
+
/**
* @var bool $testSent Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent)
*/
@@ -241,6 +254,7 @@ class GetEmailCampaignsResponseCampaignsItem extends JsonSerializableType
* testSent: bool,
* recipients: GetCampaignRecipients,
* statistics: GetExtendedCampaignStats,
+ * attachmentFile?: ?string,
* abTesting?: ?bool,
* previewText?: ?string,
* scheduledAt?: ?string,
@@ -258,6 +272,7 @@ class GetEmailCampaignsResponseCampaignsItem extends JsonSerializableType
* sentDate?: ?string,
* shareLink?: ?string,
* tag?: ?string,
+ * tags?: ?array,
* toField?: ?string,
* utmCampaignValue?: ?string,
* utmIdActive?: ?bool,
@@ -268,6 +283,7 @@ class GetEmailCampaignsResponseCampaignsItem extends JsonSerializableType
public function __construct(
array $values,
) {
+ $this->attachmentFile = $values['attachmentFile'] ?? null;
$this->abTesting = $values['abTesting'] ?? null;
$this->id = $values['id'];
$this->name = $values['name'];
@@ -296,6 +312,7 @@ public function __construct(
$this->sentDate = $values['sentDate'] ?? null;
$this->shareLink = $values['shareLink'] ?? null;
$this->tag = $values['tag'] ?? null;
+ $this->tags = $values['tags'] ?? null;
$this->testSent = $values['testSent'];
$this->toField = $values['toField'] ?? null;
$this->utmCampaignValue = $values['utmCampaignValue'] ?? null;
diff --git a/src/EmailCampaigns/Types/GetEmailCampaignsResponseCampaignsItemStatus.php b/src/EmailCampaigns/Types/GetEmailCampaignsResponseCampaignsItemStatus.php
index a44d4a01..d4aecb92 100644
--- a/src/EmailCampaigns/Types/GetEmailCampaignsResponseCampaignsItemStatus.php
+++ b/src/EmailCampaigns/Types/GetEmailCampaignsResponseCampaignsItemStatus.php
@@ -10,4 +10,7 @@ enum GetEmailCampaignsResponseCampaignsItemStatus: string
case Queued = "queued";
case Suspended = "suspended";
case InProcess = "in_process";
+ case InReview = "in_review";
+ case Cancelling = "cancelling";
+ case Cancelled = "cancelled";
}
diff --git a/src/Event/EventClient.php b/src/Event/EventClient.php
index d7471244..c697f6fa 100644
--- a/src/Event/EventClient.php
+++ b/src/Event/EventClient.php
@@ -4,13 +4,19 @@
use Psr\Http\Client\ClientInterface;
use Brevo\Core\Client\RawClient;
-use Brevo\Event\Requests\CreateEventRequest;
+use Brevo\Event\Requests\GetEventsRequest;
+use Brevo\Types\GetEventsList;
use Brevo\Exceptions\BrevoException;
use Brevo\Exceptions\BrevoApiException;
use Brevo\Core\Json\JsonApiRequest;
use Brevo\Environments;
use Brevo\Core\Client\HttpMethod;
+use JsonException;
use Psr\Http\Client\ClientExceptionInterface;
+use Brevo\Event\Requests\CreateEventRequest;
+use Brevo\Event\Types\CreateBatchEventsRequestItem;
+use Brevo\Types\BatchAcceptedResponse;
+use Brevo\Core\Json\JsonSerializer;
class EventClient implements EventClientInterface
{
@@ -48,6 +54,81 @@ public function __construct(
$this->options = $options ?? [];
}
+ /**
+ *
+ * This endpoint currently only supports custom events.
+ *
+ *
+ * Retrieve a list of events filtered by various criteria.
+ *
+ * @param GetEventsRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?GetEventsList
+ * @throws BrevoException
+ * @throws BrevoApiException
+ */
+ public function getEvents(GetEventsRequest $request = new GetEventsRequest(), ?array $options = null): ?GetEventsList
+ {
+ $options = array_merge($this->options, $options ?? []);
+ $query = [];
+ if ($request->contactId != null) {
+ $query['contact_id'] = $request->contactId;
+ }
+ if ($request->eventName != null) {
+ $query['event_name'] = $request->eventName;
+ }
+ if ($request->objectType != null) {
+ $query['object_type'] = $request->objectType;
+ }
+ if ($request->startDate != null) {
+ $query['startDate'] = $request->startDate;
+ }
+ if ($request->endDate != null) {
+ $query['endDate'] = $request->endDate;
+ }
+ if ($request->limit != null) {
+ $query['limit'] = $request->limit;
+ }
+ if ($request->offset != null) {
+ $query['offset'] = $request->offset;
+ }
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "events",
+ method: HttpMethod::GET,
+ query: $query,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return GetEventsList::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new BrevoException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new BrevoException(message: $e->getMessage(), previous: $e);
+ }
+ throw new BrevoApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
/**
* Create an event to track a contact's interaction.
*
@@ -89,4 +170,53 @@ public function createEvent(CreateEventRequest $request, ?array $options = null)
body: $response->getBody()->getContents(),
);
}
+
+ /**
+ * Create multiple events to track contacts' interactions in a single request.
+ *
+ * @param array $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?BatchAcceptedResponse
+ * @throws BrevoException
+ * @throws BrevoApiException
+ */
+ public function createBatchEvents(array $request, ?array $options = null): ?BatchAcceptedResponse
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "events/batch",
+ method: HttpMethod::POST,
+ body: JsonSerializer::serializeArray($request, [CreateBatchEventsRequestItem::class]),
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ $json = $response->getBody()->getContents();
+ if (empty($json)) {
+ return null;
+ }
+ return BatchAcceptedResponse::fromJson($json);
+ }
+ } catch (JsonException $e) {
+ throw new BrevoException(message: "Failed to deserialize response: {$e->getMessage()}", previous: $e);
+ } catch (ClientExceptionInterface $e) {
+ throw new BrevoException(message: $e->getMessage(), previous: $e);
+ }
+ throw new BrevoApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
}
diff --git a/src/Event/EventClientInterface.php b/src/Event/EventClientInterface.php
index 53ab3fd6..eb63f203 100644
--- a/src/Event/EventClientInterface.php
+++ b/src/Event/EventClientInterface.php
@@ -2,10 +2,34 @@
namespace Brevo\Event;
+use Brevo\Event\Requests\GetEventsRequest;
+use Brevo\Types\GetEventsList;
use Brevo\Event\Requests\CreateEventRequest;
+use Brevo\Event\Types\CreateBatchEventsRequestItem;
+use Brevo\Types\BatchAcceptedResponse;
interface EventClientInterface
{
+ /**
+ *
+ * This endpoint currently only supports custom events.
+ *
+ *
+ * Retrieve a list of events filtered by various criteria.
+ *
+ * @param GetEventsRequest $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?GetEventsList
+ */
+ public function getEvents(GetEventsRequest $request = new GetEventsRequest(), ?array $options = null): ?GetEventsList;
+
/**
* Create an event to track a contact's interaction.
*
@@ -20,4 +44,20 @@ interface EventClientInterface
* } $options
*/
public function createEvent(CreateEventRequest $request, ?array $options = null): void;
+
+ /**
+ * Create multiple events to track contacts' interactions in a single request.
+ *
+ * @param array $request
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @return ?BatchAcceptedResponse
+ */
+ public function createBatchEvents(array $request, ?array $options = null): ?BatchAcceptedResponse;
}
diff --git a/src/Event/Requests/GetEventsRequest.php b/src/Event/Requests/GetEventsRequest.php
new file mode 100644
index 00000000..18730240
--- /dev/null
+++ b/src/Event/Requests/GetEventsRequest.php
@@ -0,0 +1,66 @@
+ $contactId Filter by contact ID (repeatable)
+ */
+ public ?array $contactId;
+
+ /**
+ * @var ?array $eventName Filter by event name (repeatable)
+ */
+ public ?array $eventName;
+
+ /**
+ * @var ?array $objectType Filter by object type (repeatable)
+ */
+ public ?array $objectType;
+
+ /**
+ * @var ?string $startDate Mandatory if endDate is used. Start of date range (YYYY-MM-DD or RFC3339). Defaults to 6 months ago when omitted alongside endDate. Must be ≤ endDate.
+ */
+ public ?string $startDate;
+
+ /**
+ * @var ?string $endDate Mandatory if startDate is used. End of date range (YYYY-MM-DD or RFC3339). Must be ≥ startDate.
+ */
+ public ?string $endDate;
+
+ /**
+ * @var ?int $limit Max events to return. Default 100, min 1, max 10000.
+ */
+ public ?int $limit = 100;
+
+ /**
+ * @var ?int $offset Events to skip for pagination. Default 0, min 0.
+ */
+ public ?int $offset = 0;
+
+ /**
+ * @param array{
+ * contactId?: ?array,
+ * eventName?: ?array,
+ * objectType?: ?array,
+ * startDate?: ?string,
+ * endDate?: ?string,
+ * limit?: ?int,
+ * offset?: ?int,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->contactId = $values['contactId'] ?? null;
+ $this->eventName = $values['eventName'] ?? null;
+ $this->objectType = $values['objectType'] ?? null;
+ $this->startDate = $values['startDate'] ?? null;
+ $this->endDate = $values['endDate'] ?? null;
+ $this->limit = $values['limit'] ?? null;
+ $this->offset = $values['offset'] ?? null;
+ }
+}
diff --git a/src/Event/Types/CreateBatchEventsRequestItem.php b/src/Event/Types/CreateBatchEventsRequestItem.php
new file mode 100644
index 00000000..ef5c0597
--- /dev/null
+++ b/src/Event/Types/CreateBatchEventsRequestItem.php
@@ -0,0 +1,92 @@
+ $contactProperties Properties defining the state of the contact associated to this event. Useful to update contact attributes defined in your contacts database while passing the event. For example: **"FIRSTNAME": "Jane" , "AGE": 37**
+ */
+ #[JsonProperty('contact_properties'), ArrayType(['string' => new Union('string', 'integer')])]
+ public ?array $contactProperties;
+
+ /**
+ * @var ?string $eventDate Timestamp of when the event occurred (e.g. "2024-01-24T17:39:57+01:00"). If no value is passed, the timestamp of the event creation is used.
+ */
+ #[JsonProperty('event_date')]
+ public ?string $eventDate;
+
+ /**
+ * @var string $eventName The name of the event that occurred. This is how you will find your event in Brevo. Limited to 255 characters, alphanumerical characters and - _ only.
+ */
+ #[JsonProperty('event_name')]
+ public string $eventName;
+
+ /**
+ * @var ?array
+ * |array
+ * )> $eventProperties Properties of the event. Top level properties and nested properties can be used to better segment contacts and personalise workflow conditions. The following field type are supported: string, number, boolean (true/false), date (Timestamp e.g. "2024-01-24T17:39:57+01:00"). Keys are limited to 255 characters, alphanumerical characters and - _ only. Size is limited to 50Kb.
+ */
+ #[JsonProperty('event_properties'), ArrayType(['string' => new Union('string', 'integer', ['string' => 'mixed'], ['mixed'])])]
+ public ?array $eventProperties;
+
+ /**
+ * @var CreateBatchEventsRequestItemIdentifiers $identifiers Identifies the contact associated with the event. At least one identifier is required.
+ */
+ #[JsonProperty('identifiers')]
+ public CreateBatchEventsRequestItemIdentifiers $identifiers;
+
+ /**
+ * @var ?CreateBatchEventsRequestItemObject $object Identifiers of the object record associated with this event. Ignored if the object type or identifier for this record does not exist on the account.
+ */
+ #[JsonProperty('object')]
+ public ?CreateBatchEventsRequestItemObject $object;
+
+ /**
+ * @param array{
+ * eventName: string,
+ * identifiers: CreateBatchEventsRequestItemIdentifiers,
+ * contactProperties?: ?array,
+ * eventDate?: ?string,
+ * eventProperties?: ?array
+ * |array
+ * )>,
+ * object?: ?CreateBatchEventsRequestItemObject,
+ * } $values
+ */
+ public function __construct(
+ array $values,
+ ) {
+ $this->contactProperties = $values['contactProperties'] ?? null;
+ $this->eventDate = $values['eventDate'] ?? null;
+ $this->eventName = $values['eventName'];
+ $this->eventProperties = $values['eventProperties'] ?? null;
+ $this->identifiers = $values['identifiers'];
+ $this->object = $values['object'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Event/Types/CreateBatchEventsRequestItemIdentifiers.php b/src/Event/Types/CreateBatchEventsRequestItemIdentifiers.php
new file mode 100644
index 00000000..64f57e4e
--- /dev/null
+++ b/src/Event/Types/CreateBatchEventsRequestItemIdentifiers.php
@@ -0,0 +1,77 @@
+contactId = $values['contactId'] ?? null;
+ $this->emailId = $values['emailId'] ?? null;
+ $this->extId = $values['extId'] ?? null;
+ $this->landlineNumberId = $values['landlineNumberId'] ?? null;
+ $this->phoneId = $values['phoneId'] ?? null;
+ $this->whatsappId = $values['whatsappId'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Event/Types/CreateBatchEventsRequestItemObject.php b/src/Event/Types/CreateBatchEventsRequestItemObject.php
new file mode 100644
index 00000000..f84a8c91
--- /dev/null
+++ b/src/Event/Types/CreateBatchEventsRequestItemObject.php
@@ -0,0 +1,45 @@
+identifiers = $values['identifiers'] ?? null;
+ $this->type = $values['type'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Event/Types/CreateBatchEventsRequestItemObjectIdentifiers.php b/src/Event/Types/CreateBatchEventsRequestItemObjectIdentifiers.php
new file mode 100644
index 00000000..e6ae056e
--- /dev/null
+++ b/src/Event/Types/CreateBatchEventsRequestItemObjectIdentifiers.php
@@ -0,0 +1,45 @@
+extId = $values['extId'] ?? null;
+ $this->id = $values['id'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Program/ProgramClient.php b/src/Program/ProgramClient.php
index 124490a6..02ef7113 100644
--- a/src/Program/ProgramClient.php
+++ b/src/Program/ProgramClient.php
@@ -391,6 +391,9 @@ public function getParameterSubscriptionInfo(string $pid, GetParameterSubscripti
if ($request->loyaltySubscriptionId != null) {
$query['loyaltySubscriptionId'] = $request->loyaltySubscriptionId;
}
+ if ($request->includeInternal != null) {
+ $query['includeInternal'] = $request->includeInternal;
+ }
try {
$response = $this->client->sendRequest(
new JsonApiRequest(
@@ -421,6 +424,48 @@ public function getParameterSubscriptionInfo(string $pid, GetParameterSubscripti
);
}
+ /**
+ * Delete subscription for a contact
+ *
+ * @param string $pid Loyalty Program ID. A unique identifier for the loyalty program.
+ * @param int $cid Contact ID.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ * @throws BrevoException
+ * @throws BrevoApiException
+ */
+ public function deleteContactSubscription(string $pid, int $cid, ?array $options = null): void
+ {
+ $options = array_merge($this->options, $options ?? []);
+ try {
+ $response = $this->client->sendRequest(
+ new JsonApiRequest(
+ baseUrl: $options['baseUrl'] ?? $this->client->options['baseUrl'] ?? Environments::Default_->value,
+ path: "loyalty/config/programs/{$pid}/contact/{$cid}",
+ method: HttpMethod::DELETE,
+ ),
+ $options,
+ );
+ $statusCode = $response->getStatusCode();
+ if ($statusCode >= 200 && $statusCode < 400) {
+ return;
+ }
+ } catch (ClientExceptionInterface $e) {
+ throw new BrevoException(message: $e->getMessage(), previous: $e);
+ }
+ throw new BrevoApiException(
+ message: 'API request failed',
+ statusCode: $statusCode,
+ body: $response->getBody()->getContents(),
+ );
+ }
+
/**
* Publishes loyalty program
*
diff --git a/src/Program/ProgramClientInterface.php b/src/Program/ProgramClientInterface.php
index 2755eeb7..9ced0e96 100644
--- a/src/Program/ProgramClientInterface.php
+++ b/src/Program/ProgramClientInterface.php
@@ -132,6 +132,22 @@ public function partiallyUpdateLoyaltyProgram(string $pid, PartiallyUpdateLoyalt
*/
public function getParameterSubscriptionInfo(string $pid, GetParameterSubscriptionInfoRequest $request = new GetParameterSubscriptionInfoRequest(), ?array $options = null): ?GetParameterSubscriptionInfoResponse;
+ /**
+ * Delete subscription for a contact
+ *
+ * @param string $pid Loyalty Program ID. A unique identifier for the loyalty program.
+ * @param int $cid Contact ID.
+ * @param ?array{
+ * baseUrl?: string,
+ * maxRetries?: int,
+ * timeout?: float,
+ * headers?: array,
+ * queryParameters?: array,
+ * bodyProperties?: array,
+ * } $options
+ */
+ public function deleteContactSubscription(string $pid, int $cid, ?array $options = null): void;
+
/**
* Publishes loyalty program
*
diff --git a/src/Program/Requests/GetParameterSubscriptionInfoRequest.php b/src/Program/Requests/GetParameterSubscriptionInfoRequest.php
index 83445599..f828e55b 100644
--- a/src/Program/Requests/GetParameterSubscriptionInfoRequest.php
+++ b/src/Program/Requests/GetParameterSubscriptionInfoRequest.php
@@ -21,11 +21,17 @@ class GetParameterSubscriptionInfoRequest extends JsonSerializableType
*/
public ?string $loyaltySubscriptionId;
+ /**
+ * @var ?bool $includeInternal Include balances tied to internal definitions.
+ */
+ public ?bool $includeInternal;
+
/**
* @param array{
* contactId?: ?string,
* params?: ?string,
* loyaltySubscriptionId?: ?string,
+ * includeInternal?: ?bool,
* } $values
*/
public function __construct(
@@ -34,5 +40,6 @@ public function __construct(
$this->contactId = $values['contactId'] ?? null;
$this->params = $values['params'] ?? null;
$this->loyaltySubscriptionId = $values['loyaltySubscriptionId'] ?? null;
+ $this->includeInternal = $values['includeInternal'] ?? null;
}
}
diff --git a/src/Tier/Requests/CreateTierGroupRequest.php b/src/Tier/Requests/CreateTierGroupRequest.php
index 9eab89e0..63ec4611 100644
--- a/src/Tier/Requests/CreateTierGroupRequest.php
+++ b/src/Tier/Requests/CreateTierGroupRequest.php
@@ -5,6 +5,7 @@
use Brevo\Core\Json\JsonSerializableType;
use Brevo\Tier\Types\CreateTierGroupRequestDowngradeStrategy;
use Brevo\Core\Json\JsonProperty;
+use Brevo\Tier\Types\CreateTierGroupRequestMeta;
use Brevo\Core\Types\ArrayType;
use Brevo\Tier\Types\CreateTierGroupRequestUpgradeStrategy;
@@ -22,6 +23,12 @@ class CreateTierGroupRequest extends JsonSerializableType
#[JsonProperty('name')]
public string $name;
+ /**
+ * @var ?CreateTierGroupRequestMeta $meta Additional metadata for the tier group.
+ */
+ #[JsonProperty('meta')]
+ public ?CreateTierGroupRequestMeta $meta;
+
/**
* @var ?array $tierOrder Order of the tiers in the group in ascending order
*/
@@ -38,6 +45,7 @@ class CreateTierGroupRequest extends JsonSerializableType
* @param array{
* name: string,
* downgradeStrategy?: ?value-of,
+ * meta?: ?CreateTierGroupRequestMeta,
* tierOrder?: ?array,
* upgradeStrategy?: ?value-of,
* } $values
@@ -47,6 +55,7 @@ public function __construct(
) {
$this->downgradeStrategy = $values['downgradeStrategy'] ?? null;
$this->name = $values['name'];
+ $this->meta = $values['meta'] ?? null;
$this->tierOrder = $values['tierOrder'] ?? null;
$this->upgradeStrategy = $values['upgradeStrategy'] ?? null;
}
diff --git a/src/Tier/Requests/UpdateTierGroupRequest.php b/src/Tier/Requests/UpdateTierGroupRequest.php
index 14f7f47e..fa546ce8 100644
--- a/src/Tier/Requests/UpdateTierGroupRequest.php
+++ b/src/Tier/Requests/UpdateTierGroupRequest.php
@@ -5,6 +5,7 @@
use Brevo\Core\Json\JsonSerializableType;
use Brevo\Tier\Types\UpdateTierGroupRequestDowngradeStrategy;
use Brevo\Core\Json\JsonProperty;
+use Brevo\Tier\Types\UpdateTierGroupRequestMeta;
use Brevo\Core\Types\ArrayType;
use Brevo\Tier\Types\UpdateTierGroupRequestUpgradeStrategy;
@@ -22,6 +23,12 @@ class UpdateTierGroupRequest extends JsonSerializableType
#[JsonProperty('name')]
public string $name;
+ /**
+ * @var ?UpdateTierGroupRequestMeta $meta Additional metadata for the tier group.
+ */
+ #[JsonProperty('meta')]
+ public ?UpdateTierGroupRequestMeta $meta;
+
/**
* @var array $tierOrder Order of the tiers in the group in ascending order
*/
@@ -40,6 +47,7 @@ class UpdateTierGroupRequest extends JsonSerializableType
* name: string,
* tierOrder: array,
* upgradeStrategy: value-of,
+ * meta?: ?UpdateTierGroupRequestMeta,
* } $values
*/
public function __construct(
@@ -47,6 +55,7 @@ public function __construct(
) {
$this->downgradeStrategy = $values['downgradeStrategy'];
$this->name = $values['name'];
+ $this->meta = $values['meta'] ?? null;
$this->tierOrder = $values['tierOrder'];
$this->upgradeStrategy = $values['upgradeStrategy'];
}
diff --git a/src/Tier/Types/CreateTierGroupRequestMeta.php b/src/Tier/Types/CreateTierGroupRequestMeta.php
new file mode 100644
index 00000000..a6c4797e
--- /dev/null
+++ b/src/Tier/Types/CreateTierGroupRequestMeta.php
@@ -0,0 +1,37 @@
+isInternal = $values['isInternal'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Tier/Types/UpdateTierGroupRequestMeta.php b/src/Tier/Types/UpdateTierGroupRequestMeta.php
new file mode 100644
index 00000000..9541bd9a
--- /dev/null
+++ b/src/Tier/Types/UpdateTierGroupRequestMeta.php
@@ -0,0 +1,37 @@
+isInternal = $values['isInternal'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/TransactionalEmails/TransactionalEmailsClient.php b/src/TransactionalEmails/TransactionalEmailsClient.php
index a419140a..7d22012e 100644
--- a/src/TransactionalEmails/TransactionalEmailsClient.php
+++ b/src/TransactionalEmails/TransactionalEmailsClient.php
@@ -590,13 +590,9 @@ public function getTransacEmailsList(GetTransacEmailsListRequest $request = new
}
/**
- *
- * You can get the uuid using either of the following methods:
- *
+ * You can get the uuid using either of the following methods:
* Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response.
- *
- * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL.
- *
+ * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL.
*
* @param string $uuid Unique id of the transactional email that has been sent to a particular contact
* @param ?array{
diff --git a/src/TransactionalEmails/TransactionalEmailsClientInterface.php b/src/TransactionalEmails/TransactionalEmailsClientInterface.php
index 3f5710df..30db1594 100644
--- a/src/TransactionalEmails/TransactionalEmailsClientInterface.php
+++ b/src/TransactionalEmails/TransactionalEmailsClientInterface.php
@@ -185,13 +185,9 @@ public function getScheduledEmailById(string $identifier, GetScheduledEmailByIdR
public function getTransacEmailsList(GetTransacEmailsListRequest $request = new GetTransacEmailsListRequest(), ?array $options = null): ?GetTransacEmailsListResponse;
/**
- *
- * You can get the uuid using either of the following methods:
- *
+ * You can get the uuid using either of the following methods:
* Send a GET request to https://api.brevo.com/v3/smtp/emails and pass the message_id in the url. Use your api-key to authenticate the request and you will get your uuid as a response.
- *
- * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL.
- *
+ * The uuid can also be fetched from the transactional logs page in your Brevo account, from the address URL.
*
* @param string $uuid Unique id of the transactional email that has been sent to a particular contact
* @param ?array{
diff --git a/src/TransactionalSms/TransactionalSmsClient.php b/src/TransactionalSms/TransactionalSmsClient.php
index bbbb4b51..06058c1f 100644
--- a/src/TransactionalSms/TransactionalSmsClient.php
+++ b/src/TransactionalSms/TransactionalSmsClient.php
@@ -58,15 +58,9 @@ public function __construct(
}
/**
- *
- * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code.
- *
- * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number.
- *
- *
- *
- * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.
- *
+ * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code.
+ * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number.
+ * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.
*
* @param SendTransacSms $request
* @param ?array{
diff --git a/src/TransactionalSms/TransactionalSmsClientInterface.php b/src/TransactionalSms/TransactionalSmsClientInterface.php
index 0afebe46..776913ab 100644
--- a/src/TransactionalSms/TransactionalSmsClientInterface.php
+++ b/src/TransactionalSms/TransactionalSmsClientInterface.php
@@ -15,15 +15,9 @@
interface TransactionalSmsClientInterface
{
/**
- *
- * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code.
- *
- * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number.
- *
- *
- *
- * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.
- *
+ * If the user includes stop code in the Transactional SMS, then it will be switched to Marketing SMS automatically and it will be interpreted as a Marketing SMS. To send Transactional SMS as Transactional, it is important not to use stop code.
+ * Note: For adding a stop code, client has to add reply STOP to [STOP_CODE] and the [STOP_CODE] will be replaced with the number.
+ * Transactional SMS can be sent at any time without time restrictions. However, if a message is categorized as Marketing, it must adhere to specific time restrictions. Messages sent outside of these restricted hours will experience delays and will be processed during allowable times. Specifically, Marketing SMS cannot be processed between 10pm and 8am, on Sundays, and on French public holidays.
*
* @param SendTransacSms $request
* @param ?array{
diff --git a/src/TransactionalWhatsApp/TransactionalWhatsAppClient.php b/src/TransactionalWhatsApp/TransactionalWhatsAppClient.php
index 54e9071a..06152c36 100644
--- a/src/TransactionalWhatsApp/TransactionalWhatsAppClient.php
+++ b/src/TransactionalWhatsApp/TransactionalWhatsAppClient.php
@@ -56,7 +56,8 @@ public function __construct(
}
/**
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
* This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**)
*
* @param (
diff --git a/src/TransactionalWhatsApp/TransactionalWhatsAppClientInterface.php b/src/TransactionalWhatsApp/TransactionalWhatsAppClientInterface.php
index f506a6f2..0d6f4514 100644
--- a/src/TransactionalWhatsApp/TransactionalWhatsAppClientInterface.php
+++ b/src/TransactionalWhatsApp/TransactionalWhatsAppClientInterface.php
@@ -11,7 +11,8 @@
interface TransactionalWhatsAppClientInterface
{
/**
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below. [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
* This endpoint is used to send a WhatsApp message.
(**The first message you send using the API must contain a Template ID. You must create a template on WhatsApp on the Brevo platform to fetch the Template ID.**)
*
* @param (
diff --git a/src/Types/BatchAcceptedResponse.php b/src/Types/BatchAcceptedResponse.php
new file mode 100644
index 00000000..8dfee1ab
--- /dev/null
+++ b/src/Types/BatchAcceptedResponse.php
@@ -0,0 +1,45 @@
+message = $values['message'];
+ $this->count = $values['count'];
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/BatchEventsResponse.php b/src/Types/BatchEventsResponse.php
new file mode 100644
index 00000000..4b579bfc
--- /dev/null
+++ b/src/Types/BatchEventsResponse.php
@@ -0,0 +1,70 @@
+ $errors List of errors for the failed events
+ */
+ #[JsonProperty('errors'), ArrayType([BatchEventsResponseErrorsItem::class])]
+ public array $errors;
+
+ /**
+ * @param array{
+ * status: string,
+ * totalEvents: int,
+ * successfulEvents: int,
+ * failedEvents: int,
+ * errors: array,
+ * } $values
+ */
+ public function __construct(
+ array $values,
+ ) {
+ $this->status = $values['status'];
+ $this->totalEvents = $values['totalEvents'];
+ $this->successfulEvents = $values['successfulEvents'];
+ $this->failedEvents = $values['failedEvents'];
+ $this->errors = $values['errors'];
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/BatchEventsResponseErrorsItem.php b/src/Types/BatchEventsResponseErrorsItem.php
new file mode 100644
index 00000000..8f26da9b
--- /dev/null
+++ b/src/Types/BatchEventsResponseErrorsItem.php
@@ -0,0 +1,43 @@
+ $eventIndex Index positions (0-based) of the events that caused the error
+ */
+ #[JsonProperty('eventIndex'), ArrayType(['integer'])]
+ public ?array $eventIndex;
+
+ /**
+ * @var ?string $message Description of the error
+ */
+ #[JsonProperty('message')]
+ public ?string $message;
+
+ /**
+ * @param array{
+ * eventIndex?: ?array,
+ * message?: ?string,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->eventIndex = $values['eventIndex'] ?? null;
+ $this->message = $values['message'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/GetCampaignStats.php b/src/Types/GetCampaignStats.php
index 7dbff244..5f37a150 100644
--- a/src/Types/GetCampaignStats.php
+++ b/src/Types/GetCampaignStats.php
@@ -8,10 +8,10 @@
class GetCampaignStats extends JsonSerializableType
{
/**
- * @var int $appleMppOpens Numbers of times your email has been opened automatically through Apple MPP.
+ * @var ?int $appleMppOpens Numbers of times your email has been opened automatically through Apple MPP.
*/
#[JsonProperty('appleMppOpens')]
- public int $appleMppOpens;
+ public ?int $appleMppOpens;
/**
* @var int $clickers Number of total clicks for the campaign
@@ -56,10 +56,10 @@ class GetCampaignStats extends JsonSerializableType
public ?int $listId;
/**
- * @var float $opensRate Percentage of recipients who open the email out of your total number of recipients. Depending on your Campaign settings, they may include Apple MPP opens.
+ * @var ?float $opensRate Percentage of recipients who open the email out of your total number of recipients. Depending on your Campaign settings, they may include Apple MPP opens.
*/
#[JsonProperty('opensRate')]
- public float $opensRate;
+ public ?float $opensRate;
/**
* @var ?int $returnBounce Total number of non-delivered campaigns for a particular campaign id.
@@ -117,12 +117,10 @@ class GetCampaignStats extends JsonSerializableType
/**
* @param array{
- * appleMppOpens: int,
* clickers: int,
* complaints: int,
* delivered: int,
* hardBounces: int,
- * opensRate: float,
* sent: int,
* softBounces: int,
* trackableViews: int,
@@ -130,9 +128,11 @@ class GetCampaignStats extends JsonSerializableType
* uniqueViews: int,
* unsubscriptions: int,
* viewed: int,
+ * appleMppOpens?: ?int,
* deferred?: ?int,
* estimatedViews?: ?int,
* listId?: ?int,
+ * opensRate?: ?float,
* returnBounce?: ?int,
* trackableViewsRate?: ?float,
* } $values
@@ -140,7 +140,7 @@ class GetCampaignStats extends JsonSerializableType
public function __construct(
array $values,
) {
- $this->appleMppOpens = $values['appleMppOpens'];
+ $this->appleMppOpens = $values['appleMppOpens'] ?? null;
$this->clickers = $values['clickers'];
$this->complaints = $values['complaints'];
$this->deferred = $values['deferred'] ?? null;
@@ -148,7 +148,7 @@ public function __construct(
$this->estimatedViews = $values['estimatedViews'] ?? null;
$this->hardBounces = $values['hardBounces'];
$this->listId = $values['listId'] ?? null;
- $this->opensRate = $values['opensRate'];
+ $this->opensRate = $values['opensRate'] ?? null;
$this->returnBounce = $values['returnBounce'] ?? null;
$this->sent = $values['sent'];
$this->softBounces = $values['softBounces'];
diff --git a/src/Types/GetEventsList.php b/src/Types/GetEventsList.php
new file mode 100644
index 00000000..12afe051
--- /dev/null
+++ b/src/Types/GetEventsList.php
@@ -0,0 +1,46 @@
+ $events List of matching events ordered by event_date descending
+ */
+ #[JsonProperty('events'), ArrayType([GetEventsListEventsItem::class])]
+ public ?array $events;
+
+ /**
+ * @var int $count Total count of events matching the filters (use for pagination)
+ */
+ #[JsonProperty('count')]
+ public int $count;
+
+ /**
+ * @param array{
+ * count: int,
+ * events?: ?array,
+ * } $values
+ */
+ public function __construct(
+ array $values,
+ ) {
+ $this->events = $values['events'] ?? null;
+ $this->count = $values['count'];
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/GetEventsListEventsItem.php b/src/Types/GetEventsListEventsItem.php
new file mode 100644
index 00000000..2fc7d99a
--- /dev/null
+++ b/src/Types/GetEventsListEventsItem.php
@@ -0,0 +1,93 @@
+ $eventProperties Event-level custom properties
+ */
+ #[JsonProperty('event_properties'), ArrayType(['string' => 'mixed'])]
+ public ?array $eventProperties;
+
+ /**
+ * @var ?array $contactProperties Contact-level properties at time of event
+ */
+ #[JsonProperty('contact_properties'), ArrayType(['string' => 'mixed'])]
+ public ?array $contactProperties;
+
+ /**
+ * @param array{
+ * contactId?: ?int,
+ * eventDate?: ?DateTime,
+ * eventName?: ?string,
+ * eventFilterId?: ?string,
+ * source?: ?string,
+ * objectType?: ?string,
+ * eventProperties?: ?array,
+ * contactProperties?: ?array,
+ * } $values
+ */
+ public function __construct(
+ array $values = [],
+ ) {
+ $this->contactId = $values['contactId'] ?? null;
+ $this->eventDate = $values['eventDate'] ?? null;
+ $this->eventName = $values['eventName'] ?? null;
+ $this->eventFilterId = $values['eventFilterId'] ?? null;
+ $this->source = $values['source'] ?? null;
+ $this->objectType = $values['objectType'] ?? null;
+ $this->eventProperties = $values['eventProperties'] ?? null;
+ $this->contactProperties = $values['contactProperties'] ?? null;
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/GetExtendedCampaignOverview.php b/src/Types/GetExtendedCampaignOverview.php
index 0b33a912..b9da9072 100644
--- a/src/Types/GetExtendedCampaignOverview.php
+++ b/src/Types/GetExtendedCampaignOverview.php
@@ -4,9 +4,16 @@
use Brevo\Core\Json\JsonSerializableType;
use Brevo\Core\Json\JsonProperty;
+use Brevo\Core\Types\ArrayType;
class GetExtendedCampaignOverview extends JsonSerializableType
{
+ /**
+ * @var ?string $attachmentFile Url of the attachment file. Only available if the campaign has an attachment.
+ */
+ #[JsonProperty('attachmentFile')]
+ public ?string $attachmentFile;
+
/**
* @var ?bool $abTesting Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled.
*/
@@ -175,6 +182,12 @@ class GetExtendedCampaignOverview extends JsonSerializableType
#[JsonProperty('tag')]
public ?string $tag;
+ /**
+ * @var ?array $tags List of tags of the campaign
+ */
+ #[JsonProperty('tags'), ArrayType(['string'])]
+ public ?array $tags;
+
/**
* @var bool $testSent Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent)
*/
@@ -225,6 +238,7 @@ class GetExtendedCampaignOverview extends JsonSerializableType
* replyTo: string,
* sender: GetExtendedCampaignOverviewSender,
* testSent: bool,
+ * attachmentFile?: ?string,
* abTesting?: ?bool,
* previewText?: ?string,
* scheduledAt?: ?string,
@@ -242,6 +256,7 @@ class GetExtendedCampaignOverview extends JsonSerializableType
* sentDate?: ?string,
* shareLink?: ?string,
* tag?: ?string,
+ * tags?: ?array,
* toField?: ?string,
* utmCampaignValue?: ?string,
* utmIdActive?: ?bool,
@@ -252,6 +267,7 @@ class GetExtendedCampaignOverview extends JsonSerializableType
public function __construct(
array $values,
) {
+ $this->attachmentFile = $values['attachmentFile'] ?? null;
$this->abTesting = $values['abTesting'] ?? null;
$this->id = $values['id'];
$this->name = $values['name'];
@@ -280,6 +296,7 @@ public function __construct(
$this->sentDate = $values['sentDate'] ?? null;
$this->shareLink = $values['shareLink'] ?? null;
$this->tag = $values['tag'] ?? null;
+ $this->tags = $values['tags'] ?? null;
$this->testSent = $values['testSent'];
$this->toField = $values['toField'] ?? null;
$this->utmCampaignValue = $values['utmCampaignValue'] ?? null;
diff --git a/src/Types/GetExtendedCampaignOverviewStatus.php b/src/Types/GetExtendedCampaignOverviewStatus.php
index c3bcf9cf..40be82a4 100644
--- a/src/Types/GetExtendedCampaignOverviewStatus.php
+++ b/src/Types/GetExtendedCampaignOverviewStatus.php
@@ -10,4 +10,7 @@ enum GetExtendedCampaignOverviewStatus: string
case Queued = "queued";
case Suspended = "suspended";
case InProcess = "in_process";
+ case InReview = "in_review";
+ case Cancelling = "cancelling";
+ case Cancelled = "cancelled";
}
diff --git a/src/Types/GetProductDetails.php b/src/Types/GetProductDetails.php
index bdc31b93..955187aa 100644
--- a/src/Types/GetProductDetails.php
+++ b/src/Types/GetProductDetails.php
@@ -8,6 +8,12 @@
class GetProductDetails extends JsonSerializableType
{
+ /**
+ * @var ?string $brand Brand of the product
+ */
+ #[JsonProperty('brand')]
+ public ?string $brand;
+
/**
* @var ?array $categories Category ID-s of the product
*/
@@ -20,6 +26,12 @@ class GetProductDetails extends JsonSerializableType
#[JsonProperty('createdAt')]
public string $createdAt;
+ /**
+ * @var ?string $description Description of the product
+ */
+ #[JsonProperty('description')]
+ public ?string $description;
+
/**
* @var string $id Product ID for which you requested the details
*/
@@ -112,7 +124,9 @@ class GetProductDetails extends JsonSerializableType
* name: string,
* s3ThumbAnalytics: string,
* s3ThumbEditor: string,
+ * brand?: ?string,
* categories?: ?array,
+ * description?: ?string,
* imageUrl?: ?string,
* isDeleted?: ?bool,
* metaInfo?: ?array,
@@ -127,8 +141,10 @@ class GetProductDetails extends JsonSerializableType
public function __construct(
array $values,
) {
+ $this->brand = $values['brand'] ?? null;
$this->categories = $values['categories'] ?? null;
$this->createdAt = $values['createdAt'];
+ $this->description = $values['description'] ?? null;
$this->id = $values['id'];
$this->imageUrl = $values['imageUrl'] ?? null;
$this->isDeleted = $values['isDeleted'] ?? null;
diff --git a/src/Types/InternalServerErrorBody.php b/src/Types/InternalServerErrorBody.php
new file mode 100644
index 00000000..b41d5b71
--- /dev/null
+++ b/src/Types/InternalServerErrorBody.php
@@ -0,0 +1,42 @@
+ $code Error code displayed in case of a failure
+ */
+ #[JsonProperty('code')]
+ public string $code;
+
+ /**
+ * @var string $message Readable message associated to the failure
+ */
+ #[JsonProperty('message')]
+ public string $message;
+
+ /**
+ * @param array{
+ * code: value-of,
+ * message: string,
+ * } $values
+ */
+ public function __construct(
+ array $values,
+ ) {
+ $this->code = $values['code'];
+ $this->message = $values['message'];
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString(): string
+ {
+ return $this->toJson();
+ }
+}
diff --git a/src/Types/InternalServerErrorBodyCode.php b/src/Types/InternalServerErrorBodyCode.php
new file mode 100644
index 00000000..a330e741
--- /dev/null
+++ b/src/Types/InternalServerErrorBodyCode.php
@@ -0,0 +1,43 @@
+price = $values['price'];
$this->productId = $values['productId'];
- $this->quantity = $values['quantity'];
$this->variantId = $values['variantId'] ?? null;
+ $this->quantity = $values['quantity'] ?? null;
+ $this->quantityFloat = $values['quantityFloat'] ?? null;
}
/**
diff --git a/src/Types/UpdateCampaignStatusStatus.php b/src/Types/UpdateCampaignStatusStatus.php
index 318a9dc8..4fbb7b94 100644
--- a/src/Types/UpdateCampaignStatusStatus.php
+++ b/src/Types/UpdateCampaignStatusStatus.php
@@ -11,5 +11,6 @@ enum UpdateCampaignStatusStatus: string
case Queued = "queued";
case Replicate = "replicate";
case ReplicateTemplate = "replicateTemplate";
+ case Cancel = "cancel";
case Draft = "draft";
}
diff --git a/src/Webhooks/Requests/CreateWebhookRequest.php b/src/Webhooks/Requests/CreateWebhookRequest.php
index fb1c2279..d6d32619 100644
--- a/src/Webhooks/Requests/CreateWebhookRequest.php
+++ b/src/Webhooks/Requests/CreateWebhookRequest.php
@@ -62,6 +62,7 @@ class CreateWebhookRequest extends JsonSerializableType
* type **Marketing** channel **SMS** ####
* `sent`,`delivered`,`softBounce`,`hardBounce`,`unsubscribe`,`reply`,
* `subscribe`,`skip`
+ * #### `reply`
*
* @var array> $events
*/
diff --git a/src/Webhooks/Requests/UpdateWebhookRequest.php b/src/Webhooks/Requests/UpdateWebhookRequest.php
index cb9d11b1..47fc022e 100644
--- a/src/Webhooks/Requests/UpdateWebhookRequest.php
+++ b/src/Webhooks/Requests/UpdateWebhookRequest.php
@@ -44,6 +44,7 @@ class UpdateWebhookRequest extends JsonSerializableType
* #### `spam`, `opened`, `click`, `hardBounce`, `softBounce`,
* `unsubscribed`, `listAddition` & `delivered` - Possible values
* for **Inbound** type webhook: #### `inboundEmailProcessed`
+ * #### `reply`
*
* @var ?array> $events
*/
diff --git a/src/Webhooks/Types/CreateWebhookRequestEventsItem.php b/src/Webhooks/Types/CreateWebhookRequestEventsItem.php
index 0c31dd35..60f392d0 100644
--- a/src/Webhooks/Types/CreateWebhookRequestEventsItem.php
+++ b/src/Webhooks/Types/CreateWebhookRequestEventsItem.php
@@ -21,4 +21,5 @@ enum CreateWebhookRequestEventsItem: string
case ContactUpdated = "contactUpdated";
case ContactDeleted = "contactDeleted";
case InboundEmailProcessed = "inboundEmailProcessed";
+ case Reply = "reply";
}
diff --git a/src/Webhooks/Types/UpdateWebhookRequestEventsItem.php b/src/Webhooks/Types/UpdateWebhookRequestEventsItem.php
index c7aaccc8..a6eb51ed 100644
--- a/src/Webhooks/Types/UpdateWebhookRequestEventsItem.php
+++ b/src/Webhooks/Types/UpdateWebhookRequestEventsItem.php
@@ -21,4 +21,5 @@ enum UpdateWebhookRequestEventsItem: string
case ContactUpdated = "contactUpdated";
case ContactDeleted = "contactDeleted";
case InboundEmailProcessed = "inboundEmailProcessed";
+ case Reply = "reply";
}
diff --git a/src/Webhooks/WebhooksClient.php b/src/Webhooks/WebhooksClient.php
index c8c817e8..7b1503a5 100644
--- a/src/Webhooks/WebhooksClient.php
+++ b/src/Webhooks/WebhooksClient.php
@@ -187,22 +187,16 @@ public function createWebhook(CreateWebhookRequest $request, ?array $options = n
}
/**
- *
- * To have it activated please send us a request and we will activate it for your account.
+ *
+ * This is an enterprise feature. Contact us to activate it for your account.
*
*
- * Exports webhook event history to CSV format for analysis and reporting.
+ * Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body.
*
- * Use this to:
- * - Generate comprehensive webhook event reports
- * - Analyze webhook delivery patterns and success rates
- * - Export event data for external analysis tools
- * - Create historical reports for compliance and auditing
- * - Track webhook performance and reliability metrics
- *
- * Key information returned:
- * - Process ID for tracking export completion
- * - CSV file will be delivered to specified webhook URL
+ * Use this endpoint to:
+ * - Export webhook event history filtered by date range, event type, or email address
+ * - Generate reports for compliance, auditing, or performance analysis
+ * - Track delivery patterns and webhook reliability over time
*
* @param ExportWebhooksHistoryRequest $request
* @param ?array{
diff --git a/src/Webhooks/WebhooksClientInterface.php b/src/Webhooks/WebhooksClientInterface.php
index 70f357fa..2da06240 100644
--- a/src/Webhooks/WebhooksClientInterface.php
+++ b/src/Webhooks/WebhooksClientInterface.php
@@ -71,22 +71,16 @@ public function getWebhooks(GetWebhooksRequest $request = new GetWebhooksRequest
public function createWebhook(CreateWebhookRequest $request, ?array $options = null): ?CreateWebhookResponse;
/**
- *
- * To have it activated please send us a request and we will activate it for your account.
+ *
+ * This is an enterprise feature. Contact us to activate it for your account.
*
*
- * Exports webhook event history to CSV format for analysis and reporting.
+ * Submits a request to export webhook event history as a CSV file. The download link is sent to the `notifyURL` you provide in the request body.
*
- * Use this to:
- * - Generate comprehensive webhook event reports
- * - Analyze webhook delivery patterns and success rates
- * - Export event data for external analysis tools
- * - Create historical reports for compliance and auditing
- * - Track webhook performance and reliability metrics
- *
- * Key information returned:
- * - Process ID for tracking export completion
- * - CSV file will be delivered to specified webhook URL
+ * Use this endpoint to:
+ * - Export webhook event history filtered by date range, event type, or email address
+ * - Generate reports for compliance, auditing, or performance analysis
+ * - Track delivery patterns and webhook reliability over time
*
* @param ExportWebhooksHistoryRequest $request
* @param ?array{
diff --git a/src/WhatsAppCampaigns/WhatsAppCampaignsClient.php b/src/WhatsAppCampaigns/WhatsAppCampaignsClient.php
index 9f257dc0..aa217f12 100644
--- a/src/WhatsAppCampaigns/WhatsAppCampaignsClient.php
+++ b/src/WhatsAppCampaigns/WhatsAppCampaignsClient.php
@@ -123,19 +123,11 @@ public function getWhatsAppCampaigns(GetWhatsAppCampaignsRequest $request = new
}
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
- *
- *
- * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information.
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+ * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
* [Get all the Lists](https://developers.brevo.com/reference/getlists-1)
- *
- * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
- *
+ * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
*
* @param CreateWhatsAppCampaignRequest $request
* @param ?array{
@@ -184,11 +176,8 @@ public function createWhatsAppCampaign(CreateWhatsAppCampaignRequest $request, ?
}
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
*
* @param ?array{
* baseUrl?: string,
@@ -235,11 +224,8 @@ public function getWhatsAppConfig(?array $options = null): ?GetWhatsAppConfigRes
}
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
*
* @param CreateWhatsAppTemplateRequest $request
* @param ?array{
@@ -354,11 +340,8 @@ public function getWhatsAppTemplates(GetWhatsAppTemplatesRequest $request = new
}
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
*
* @param int $templateId id of the template
* @param ?array{
@@ -399,11 +382,11 @@ public function sendWhatsAppTemplateApproval(int $templateId, ?array $options =
}
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+ * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
+ * [Get all the Lists](https://developers.brevo.com/reference/getlists-1)
+ * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
*
* @param int $campaignId Id of the campaign
* @param ?array{
@@ -451,19 +434,11 @@ public function getWhatsAppCampaign(int $campaignId, ?array $options = null): ?G
}
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
- *
- *
- * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information.
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+ * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
* [Get all the Lists](https://developers.brevo.com/reference/getlists-1)
- *
- * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
- *
+ * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
*
* @param int $campaignId id of the campaign
* @param UpdateWhatsAppCampaignRequest $request
diff --git a/src/WhatsAppCampaigns/WhatsAppCampaignsClientInterface.php b/src/WhatsAppCampaigns/WhatsAppCampaignsClientInterface.php
index 0ed7441a..0817e849 100644
--- a/src/WhatsAppCampaigns/WhatsAppCampaignsClientInterface.php
+++ b/src/WhatsAppCampaigns/WhatsAppCampaignsClientInterface.php
@@ -31,19 +31,11 @@ interface WhatsAppCampaignsClientInterface
public function getWhatsAppCampaigns(GetWhatsAppCampaignsRequest $request = new GetWhatsAppCampaignsRequest(), ?array $options = null): ?GetWhatsAppCampaignsResponse;
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
- *
- *
- * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information.
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+ * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
* [Get all the Lists](https://developers.brevo.com/reference/getlists-1)
- *
- * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
- *
+ * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
*
* @param CreateWhatsAppCampaignRequest $request
* @param ?array{
@@ -59,11 +51,8 @@ public function getWhatsAppCampaigns(GetWhatsAppCampaignsRequest $request = new
public function createWhatsAppCampaign(CreateWhatsAppCampaignRequest $request, ?array $options = null): ?CreateWhatsAppCampaignResponse;
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
*
* @param ?array{
* baseUrl?: string,
@@ -78,11 +67,8 @@ public function createWhatsAppCampaign(CreateWhatsAppCampaignRequest $request, ?
public function getWhatsAppConfig(?array $options = null): ?GetWhatsAppConfigResponse;
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
*
* @param CreateWhatsAppTemplateRequest $request
* @param ?array{
@@ -112,11 +98,8 @@ public function createWhatsAppTemplate(CreateWhatsAppTemplateRequest $request, ?
public function getWhatsAppTemplates(GetWhatsAppTemplatesRequest $request = new GetWhatsAppTemplatesRequest(), ?array $options = null): ?GetWhatsAppTemplatesResponse;
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating WhatsApp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
*
* @param int $templateId id of the template
* @param ?array{
@@ -131,11 +114,11 @@ public function getWhatsAppTemplates(GetWhatsAppTemplatesRequest $request = new
public function sendWhatsAppTemplateApproval(int $templateId, ?array $options = null): void;
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+ * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
+ * [Get all the Lists](https://developers.brevo.com/reference/getlists-1)
+ * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
*
* @param int $campaignId Id of the campaign
* @param ?array{
@@ -151,19 +134,11 @@ public function sendWhatsAppTemplateApproval(int $templateId, ?array $options =
public function getWhatsAppCampaign(int $campaignId, ?array $options = null): ?GetWhatsAppCampaignResponse;
/**
- *
- * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
- *
- * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
- *
- *
- *
- * This API requires the List and Segment ids as recipients in Body params. You can use the below Contact endpoints to get the required information.
- *
+ * You can use this API for WhatsApp only if you have setup your WhatsApp account on Brevo platform. To setup your WhatsApp account, follow the steps in the guide below.
+ * [Activating Whatsapp](https://developers.brevo.com/docs/whatsapp-campaigns-1) in your account
+ * This API requires the List and Segment ids as recipients in Body params.You can use the below Contact endpoints to get the required information.
* [Get all the Lists](https://developers.brevo.com/reference/getlists-1)
- *
- * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
- *
+ * [Get all the Segments](https://developers.brevo.com/reference/getsegments)
*
* @param int $campaignId id of the campaign
* @param UpdateWhatsAppCampaignRequest $request
diff --git a/tests/Wire/AccountWireTest.php b/tests/Wire/AccountWireTest.php
deleted file mode 100644
index 484dd93e..00000000
--- a/tests/Wire/AccountWireTest.php
+++ /dev/null
@@ -1,69 +0,0 @@
-client->account->getAccount(
- [
- 'headers' => [
- 'X-Test-Id' => 'account.get_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/account",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAccountActivity(): void {
- $testId = 'account.get_account_activity.0';
- $this->client->account->getAccountActivity(
- new GetAccountActivityRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'account.get_account_activity.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/organization/activities",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/BalanceWireTest.php b/tests/Wire/BalanceWireTest.php
deleted file mode 100644
index 899fcceb..00000000
--- a/tests/Wire/BalanceWireTest.php
+++ /dev/null
@@ -1,486 +0,0 @@
-client->balance->getActiveBalancesApi(
- 'pid',
- new GetLoyaltyBalanceProgramsPidActiveBalanceRequest([
- 'contactId' => 1,
- 'balanceDefinitionId' => 'balance_definition_id',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.get_active_balances_api.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/balance/programs/pid/active-balance",
- ['contact_id' => '1', 'balance_definition_id' => 'balance_definition_id'],
- 1
- );
- }
-
- /**
- */
- public function testGetBalanceDefinitionList(): void {
- $testId = 'balance.get_balance_definition_list.0';
- $this->client->balance->getBalanceDefinitionList(
- 'pid',
- new GetBalanceDefinitionListRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.get_balance_definition_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/balance/programs/pid/balance-definitions",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateBalanceDefinition(): void {
- $testId = 'balance.create_balance_definition.0';
- $this->client->balance->createBalanceDefinition(
- 'pid',
- new PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequest([
- 'name' => 'name',
- 'unit' => PostLoyaltyBalanceProgramsPidBalanceDefinitionsRequestUnit::Points->value,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.create_balance_definition.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/balance/programs/pid/balance-definitions",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetBalanceDefinition(): void {
- $testId = 'balance.get_balance_definition.0';
- $this->client->balance->getBalanceDefinition(
- 'pid',
- 'bdid',
- new GetBalanceDefinitionRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.get_balance_definition.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/balance/programs/pid/balance-definitions/bdid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateBalanceDefinition(): void {
- $testId = 'balance.update_balance_definition.0';
- $this->client->balance->updateBalanceDefinition(
- 'pid',
- 'bdid',
- new UpdateBalanceDefinitionRequest([
- 'name' => 'name',
- 'unit' => UpdateBalanceDefinitionRequestUnit::Points->value,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.update_balance_definition.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/loyalty/balance/programs/pid/balance-definitions/bdid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteBalanceDefinition(): void {
- $testId = 'balance.delete_balance_definition.0';
- $this->client->balance->deleteBalanceDefinition(
- 'pid',
- 'bdid',
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.delete_balance_definition.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/loyalty/balance/programs/pid/balance-definitions/bdid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateBalanceLimit(): void {
- $testId = 'balance.create_balance_limit.0';
- $this->client->balance->createBalanceLimit(
- 'pid',
- 'bdid',
- new CreateBalanceLimitRequest([
- 'constraintType' => CreateBalanceLimitRequestConstraintType::Transaction->value,
- 'durationUnit' => CreateBalanceLimitRequestDurationUnit::Day->value,
- 'durationValue' => 1,
- 'transactionType' => CreateBalanceLimitRequestTransactionType::Credit->value,
- 'value' => 1,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.create_balance_limit.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/balance/programs/pid/balance-definitions/bdid/limits",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetBalanceLimit(): void {
- $testId = 'balance.get_balance_limit.0';
- $this->client->balance->getBalanceLimit(
- 'pid',
- 'bdid',
- 'blid',
- new GetBalanceLimitRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.get_balance_limit.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateBalanceLimit(): void {
- $testId = 'balance.update_balance_limit.0';
- $this->client->balance->updateBalanceLimit(
- 'pid',
- 'bdid',
- 'blid',
- new UpdateBalanceLimitRequest([
- 'constraintType' => UpdateBalanceLimitRequestConstraintType::Transaction->value,
- 'durationUnit' => UpdateBalanceLimitRequestDurationUnit::Day->value,
- 'durationValue' => 1,
- 'transactionType' => UpdateBalanceLimitRequestTransactionType::Credit->value,
- 'value' => 1,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.update_balance_limit.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteBalanceLimit(): void {
- $testId = 'balance.delete_balance_limit.0';
- $this->client->balance->deleteBalanceLimit(
- 'pid',
- 'bdid',
- 'blid',
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.delete_balance_limit.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/loyalty/balance/programs/pid/balance-definitions/bdid/limits/blid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetContactBalances(): void {
- $testId = 'balance.get_contact_balances.0';
- $this->client->balance->getContactBalances(
- 'pid',
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.get_contact_balances.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/balance/programs/pid/contact-balances",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateBalanceOrder(): void {
- $testId = 'balance.create_balance_order.0';
- $this->client->balance->createBalanceOrder(
- 'pid',
- new CreateBalanceOrderRequest([
- 'amount' => 1.1,
- 'balanceDefinitionId' => 'balanceDefinitionId',
- 'contactId' => 1,
- 'dueAt' => 'dueAt',
- 'source' => 'source',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.create_balance_order.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/balance/programs/pid/create-order",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSubscriptionBalances(): void {
- $testId = 'balance.get_subscription_balances.0';
- $this->client->balance->getSubscriptionBalances(
- 'pid',
- 'cid',
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.get_subscription_balances.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/balance/programs/pid/subscriptions/cid/balances",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateSubscriptionBalances(): void {
- $testId = 'balance.create_subscription_balances.0';
- $this->client->balance->createSubscriptionBalances(
- 'pid',
- 'cid',
- new PostLoyaltyBalanceProgramsPidSubscriptionsCidBalancesRequest([
- 'balanceDefinitionId' => 'balanceDefinitionId',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.create_subscription_balances.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/balance/programs/pid/subscriptions/cid/balances",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetTransactionHistoryApi(): void {
- $testId = 'balance.get_transaction_history_api.0';
- $this->client->balance->getTransactionHistoryApi(
- 'pid',
- new GetLoyaltyBalanceProgramsPidTransactionHistoryRequest([
- 'contactId' => 1,
- 'balanceDefinitionId' => 'balance_definition_id',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.get_transaction_history_api.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/balance/programs/pid/transaction-history",
- ['contact_id' => '1', 'balance_definition_id' => 'balance_definition_id'],
- 1
- );
- }
-
- /**
- */
- public function testBeginTransaction(): void {
- $testId = 'balance.begin_transaction.0';
- $this->client->balance->beginTransaction(
- 'pid',
- new BeginTransactionRequest([
- 'amount' => 1.1,
- 'balanceDefinitionId' => 'balanceDefinitionId',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.begin_transaction.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/balance/programs/pid/transactions",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCancelTransaction(): void {
- $testId = 'balance.cancel_transaction.0';
- $this->client->balance->cancelTransaction(
- 'pid',
- 'tid',
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.cancel_transaction.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/balance/programs/pid/transactions/tid/cancel",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCompleteTransaction(): void {
- $testId = 'balance.complete_transaction.0';
- $this->client->balance->completeTransaction(
- 'pid',
- 'tid',
- [
- 'headers' => [
- 'X-Test-Id' => 'balance.complete_transaction.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/balance/programs/pid/transactions/tid/complete",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/CompaniesWireTest.php b/tests/Wire/CompaniesWireTest.php
deleted file mode 100644
index 2c3b8b9a..00000000
--- a/tests/Wire/CompaniesWireTest.php
+++ /dev/null
@@ -1,234 +0,0 @@
-client->companies->getAllCompanies(
- new GetCompaniesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.get_all_companies.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/companies",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateACompany(): void {
- $testId = 'companies.create_a_company.0';
- $this->client->companies->createACompany(
- new PostCompaniesRequest([
- 'name' => 'company',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.create_a_company.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/companies",
- null,
- 1
- );
- }
-
- /**
- */
- public function testImportCompaniesCreationAndUpdation(): void {
- $testId = 'companies.import_companies_creation_and_updation.0';
- $this->client->companies->importCompaniesCreationAndUpdation(
- new PostCompaniesImportRequest([
- 'file' => File::createFromString("example_file", "example_file"),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.import_companies_creation_and_updation.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/companies/import",
- null,
- 1
- );
- }
-
- /**
- */
- public function testLinkAndUnlinkCompanyWithContactAndDeal(): void {
- $testId = 'companies.link_and_unlink_company_with_contact_and_deal.0';
- $this->client->companies->linkAndUnlinkCompanyWithContactAndDeal(
- 'id',
- new PatchCompaniesLinkUnlinkIdRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.link_and_unlink_company_with_contact_and_deal.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PATCH",
- "/companies/link-unlink/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetACompany(): void {
- $testId = 'companies.get_a_company.0';
- $this->client->companies->getACompany(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.get_a_company.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/companies/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteACompany(): void {
- $testId = 'companies.delete_a_company.0';
- $this->client->companies->deleteACompany(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.delete_a_company.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/companies/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateACompany(): void {
- $testId = 'companies.update_a_company.0';
- $this->client->companies->updateACompany(
- 'id',
- new PatchCompaniesIdRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.update_a_company.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PATCH",
- "/companies/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateACompanyDealAttribute(): void {
- $testId = 'companies.create_a_company_deal_attribute.0';
- $this->client->companies->createACompanyDealAttribute(
- new PostCrmAttributesRequest([
- 'attributeType' => PostCrmAttributesRequestAttributeType::Text->value,
- 'label' => 'Attribute Label',
- 'objectType' => PostCrmAttributesRequestObjectType::Companies->value,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.create_a_company_deal_attribute.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/crm/attributes",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetCompanyAttributes(): void {
- $testId = 'companies.get_company_attributes.0';
- $this->client->companies->getCompanyAttributes(
- [
- 'headers' => [
- 'X-Test-Id' => 'companies.get_company_attributes.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/attributes/companies",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/ContactsWireTest.php b/tests/Wire/ContactsWireTest.php
deleted file mode 100644
index 76b6db18..00000000
--- a/tests/Wire/ContactsWireTest.php
+++ /dev/null
@@ -1,727 +0,0 @@
-client->contacts->getContacts(
- new GetContactsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_contacts.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateContact(): void {
- $testId = 'contacts.create_contact.0';
- $this->client->contacts->createContact(
- new CreateContactRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.create_contact.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAttributes(): void {
- $testId = 'contacts.get_attributes.0';
- $this->client->contacts->getAttributes(
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_attributes.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/attributes",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateAttribute(): void {
- $testId = 'contacts.create_attribute.0';
- $this->client->contacts->createAttribute(
- CreateAttributeRequestAttributeCategory::Normal->value,
- 'attributeName',
- new CreateAttributeRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.create_attribute.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/attributes/normal/attributeName",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateAttribute(): void {
- $testId = 'contacts.update_attribute.0';
- $this->client->contacts->updateAttribute(
- UpdateAttributeRequestAttributeCategory::Category->value,
- 'attributeName',
- new UpdateAttributeRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.update_attribute.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/contacts/attributes/category/attributeName",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteAttribute(): void {
- $testId = 'contacts.delete_attribute.0';
- $this->client->contacts->deleteAttribute(
- DeleteAttributeRequestAttributeCategory::Normal->value,
- 'attributeName',
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.delete_attribute.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/contacts/attributes/normal/attributeName",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteMultiAttributeOptions(): void {
- $testId = 'contacts.delete_multi_attribute_options.0';
- $this->client->contacts->deleteMultiAttributeOptions(
- 'multiple-choice',
- 'multipleChoiceAttribute',
- 'multipleChoiceAttributeOption',
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.delete_multi_attribute_options.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/contacts/attributes/multiple-choice/multipleChoiceAttribute/multipleChoiceAttributeOption",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateBatchContacts(): void {
- $testId = 'contacts.update_batch_contacts.0';
- $this->client->contacts->updateBatchContacts(
- new UpdateBatchContactsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.update_batch_contacts.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/batch",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateDoiContact(): void {
- $testId = 'contacts.create_doi_contact.0';
- $this->client->contacts->createDoiContact(
- new CreateDoiContactRequest([
- 'email' => 'elly@example.com',
- 'includeListIds' => [
- 36,
- ],
- 'redirectionUrl' => 'http://requestb.in/173lyyx1',
- 'templateId' => 2,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.create_doi_contact.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/doubleOptinConfirmation",
- null,
- 1
- );
- }
-
- /**
- */
- public function testRequestContactExport(): void {
- $testId = 'contacts.request_contact_export.0';
- $this->client->contacts->requestContactExport(
- new RequestContactExportRequest([
- 'customContactFilter' => new RequestContactExportRequestCustomContactFilter([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.request_contact_export.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/export",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetFolders(): void {
- $testId = 'contacts.get_folders.0';
- $this->client->contacts->getFolders(
- new GetFoldersRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_folders.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/folders",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateFolder(): void {
- $testId = 'contacts.create_folder.0';
- $this->client->contacts->createFolder(
- new CreateUpdateFolder([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.create_folder.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/folders",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetFolder(): void {
- $testId = 'contacts.get_folder.0';
- $this->client->contacts->getFolder(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_folder.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/folders/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateFolder(): void {
- $testId = 'contacts.update_folder.0';
- $this->client->contacts->updateFolder(
- 1000000,
- new UpdateFolderRequest([
- 'body' => new CreateUpdateFolder([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.update_folder.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/contacts/folders/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteFolder(): void {
- $testId = 'contacts.delete_folder.0';
- $this->client->contacts->deleteFolder(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.delete_folder.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/contacts/folders/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetFolderLists(): void {
- $testId = 'contacts.get_folder_lists.0';
- $this->client->contacts->getFolderLists(
- 1000000,
- new GetFolderListsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_folder_lists.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/folders/1000000/lists",
- null,
- 1
- );
- }
-
- /**
- */
- public function testImportContacts(): void {
- $testId = 'contacts.import_contacts.0';
- $this->client->contacts->importContacts(
- new ImportContactsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.import_contacts.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/import",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetLists(): void {
- $testId = 'contacts.get_lists.0';
- $this->client->contacts->getLists(
- new GetListsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_lists.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/lists",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateList(): void {
- $testId = 'contacts.create_list.0';
- $this->client->contacts->createList(
- new CreateListRequest([
- 'folderId' => 2,
- 'name' => 'Magento Customer - ES',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.create_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/lists",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetList(): void {
- $testId = 'contacts.get_list.0';
- $this->client->contacts->getList(
- 1000000,
- new GetListRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/lists/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateList(): void {
- $testId = 'contacts.update_list.0';
- $this->client->contacts->updateList(
- 1000000,
- new UpdateListRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.update_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/contacts/lists/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteList(): void {
- $testId = 'contacts.delete_list.0';
- $this->client->contacts->deleteList(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.delete_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/contacts/lists/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetContactsFromList(): void {
- $testId = 'contacts.get_contacts_from_list.0';
- $this->client->contacts->getContactsFromList(
- 1000000,
- new GetContactsFromListRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_contacts_from_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/lists/1000000/contacts",
- null,
- 1
- );
- }
-
- /**
- */
- public function testAddContactToList(): void {
- $testId = 'contacts.add_contact_to_list.0';
- $this->client->contacts->addContactToList(
- 1000000,
- new AddContactToListRequest([
- 'body' => new AddContactToListRequestBodyEmails([
- 'emails' => [
- 'jeff32@example.com',
- 'jim56@example.com',
- ],
- ]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.add_contact_to_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/lists/1000000/contacts/add",
- null,
- 1
- );
- }
-
- /**
- */
- public function testRemoveContactFromList(): void {
- $testId = 'contacts.remove_contact_from_list.0';
- $this->client->contacts->removeContactFromList(
- 1000000,
- new RemoveContactFromListRequest([
- 'body' => new RemoveContactFromListRequestBodyEmails([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.remove_contact_from_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/contacts/lists/1000000/contacts/remove",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSegments(): void {
- $testId = 'contacts.get_segments.0';
- $this->client->contacts->getSegments(
- new GetSegmentsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_segments.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/segments",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetContactInfo(): void {
- $testId = 'contacts.get_contact_info.0';
- $this->client->contacts->getContactInfo(
- 'identifier',
- new GetContactInfoRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_contact_info.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/identifier",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateContact(): void {
- $testId = 'contacts.update_contact.0';
- $this->client->contacts->updateContact(
- 'identifier',
- new UpdateContactRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.update_contact.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/contacts/identifier",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteContact(): void {
- $testId = 'contacts.delete_contact.0';
- $this->client->contacts->deleteContact(
- 'identifier',
- new DeleteContactRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.delete_contact.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/contacts/identifier",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetContactStats(): void {
- $testId = 'contacts.get_contact_stats.0';
- $this->client->contacts->getContactStats(
- 'identifier',
- new GetContactStatsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'contacts.get_contact_stats.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/contacts/identifier/campaignStats",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/ConversationsWireTest.php b/tests/Wire/ConversationsWireTest.php
deleted file mode 100644
index d5710017..00000000
--- a/tests/Wire/ConversationsWireTest.php
+++ /dev/null
@@ -1,261 +0,0 @@
-client->conversations->setsAgentsStatusToOnlineFor23Minutes(
- new PostConversationsAgentOnlinePingRequest([
- 'agentId' => "d9nKoegKSjmCtyK78",
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.sets_agents_status_to_online_for23minutes.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/conversations/agentOnlinePing",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendAMessageAsAnAgent(): void {
- $testId = 'conversations.send_a_message_as_an_agent.0';
- $this->client->conversations->sendAMessageAsAnAgent(
- new PostConversationsMessagesRequest([
- 'agentId' => "d9nKoegKSjmCtyK78",
- 'text' => "Hello! How can I help you?",
- 'visitorId' => "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.send_a_message_as_an_agent.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/conversations/messages",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAMessage(): void {
- $testId = 'conversations.get_a_message.0';
- $this->client->conversations->getAMessage(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.get_a_message.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/conversations/messages/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateAMessageSentByAnAgent(): void {
- $testId = 'conversations.update_a_message_sent_by_an_agent.0';
- $this->client->conversations->updateAMessageSentByAnAgent(
- 'id',
- new PutConversationsMessagesIdRequest([
- 'text' => 'Good morning! How can I help you?',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.update_a_message_sent_by_an_agent.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/conversations/messages/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteAMessageSentByAnAgent(): void {
- $testId = 'conversations.delete_a_message_sent_by_an_agent.0';
- $this->client->conversations->deleteAMessageSentByAnAgent(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.delete_a_message_sent_by_an_agent.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/conversations/messages/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendAnAutomatedMessageToAVisitor(): void {
- $testId = 'conversations.send_an_automated_message_to_a_visitor.0';
- $this->client->conversations->sendAnAutomatedMessageToAVisitor(
- new PostConversationsPushedMessagesRequest([
- 'groupId' => "PjRBMhWGen6aRHjif",
- 'text' => "Your order has shipped! Here’s your tracking number: 9114 5847 3325 9667 4328 88",
- 'visitorId' => "kZMvWhf8npAu3H6qd57w2Hv6nh6rnxvg",
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.send_an_automated_message_to_a_visitor.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/conversations/pushedMessages",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAnAutomatedMessage(): void {
- $testId = 'conversations.get_an_automated_message.0';
- $this->client->conversations->getAnAutomatedMessage(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.get_an_automated_message.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/conversations/pushedMessages/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateAnAutomatedMessage(): void {
- $testId = 'conversations.update_an_automated_message.0';
- $this->client->conversations->updateAnAutomatedMessage(
- 'id',
- new PutConversationsPushedMessagesIdRequest([
- 'text' => 'Your order has shipped! Here’s your tracking number: 9114 5847 4668 7775 9233 54',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.update_an_automated_message.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/conversations/pushedMessages/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteAnAutomatedMessage(): void {
- $testId = 'conversations.delete_an_automated_message.0';
- $this->client->conversations->deleteAnAutomatedMessage(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.delete_an_automated_message.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/conversations/pushedMessages/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSetVisitorGroupAssignment(): void {
- $testId = 'conversations.set_visitor_group_assignment.0';
- $this->client->conversations->setVisitorGroupAssignment(
- new PutConversationsVisitorGroupRequest([
- 'groupId' => "PjRBMhWGen6aRHjif",
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'conversations.set_visitor_group_assignment.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/conversations/visitorGroup",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/CouponsWireTest.php b/tests/Wire/CouponsWireTest.php
deleted file mode 100644
index 6ad354c7..00000000
--- a/tests/Wire/CouponsWireTest.php
+++ /dev/null
@@ -1,145 +0,0 @@
-client->coupons->getCouponCollections(
- new GetCouponCollectionsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'coupons.get_coupon_collections.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/couponCollections",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateCouponCollection(): void {
- $testId = 'coupons.create_coupon_collection.0';
- $this->client->coupons->createCouponCollection(
- new CreateCouponCollectionRequest([
- 'defaultCoupon' => 'Winter',
- 'name' => '10%OFF',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'coupons.create_coupon_collection.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/couponCollections",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetCouponCollection(): void {
- $testId = 'coupons.get_coupon_collection.0';
- $this->client->coupons->getCouponCollection(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'coupons.get_coupon_collection.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/couponCollections/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateCouponCollection(): void {
- $testId = 'coupons.update_coupon_collection.0';
- $this->client->coupons->updateCouponCollection(
- 'id',
- new UpdateCouponCollectionRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'coupons.update_coupon_collection.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PATCH",
- "/couponCollections/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateCoupons(): void {
- $testId = 'coupons.create_coupons.0';
- $this->client->coupons->createCoupons(
- new CreateCouponsRequest([
- 'collectionId' => '23befbae-1505-47a8-bd27-e30ef739f32c',
- 'coupons' => [
- 'Uf12AF',
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'coupons.create_coupons.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/coupons",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/CustomObjectsWireTest.php b/tests/Wire/CustomObjectsWireTest.php
deleted file mode 100644
index b4aea204..00000000
--- a/tests/Wire/CustomObjectsWireTest.php
+++ /dev/null
@@ -1,111 +0,0 @@
-client->customObjects->upsertrecords(
- 'vehicle',
- new UpsertrecordsRequest([
- 'records' => [
- new UpsertrecordsRequestRecordsItem([]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'custom_objects.upsertrecords.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/objects/vehicle/batch/upsert",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetrecords(): void {
- $testId = 'custom_objects.getrecords.0';
- $this->client->customObjects->getrecords(
- 'vehicle',
- new GetrecordsRequest([
- 'limit' => 1000000,
- 'pageNum' => 1000000,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'custom_objects.getrecords.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/objects/vehicle/records",
- ['limit' => '1000000', 'page_num' => '1000000'],
- 1
- );
- }
-
- /**
- */
- public function testBatchDeleteObjectRecords(): void {
- $testId = 'custom_objects.batch_delete_object_records.0';
- $this->client->customObjects->batchDeleteObjectRecords(
- 'vehicle',
- new BatchDeleteObjectRecordsRequest([
- 'identifiers' => new BatchDeleteObjectRecordsRequestIdentifiersIds([
- 'ids' => [
- 1,
- ],
- ]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'custom_objects.batch_delete_object_records.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/objects/vehicle/batch/delete",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/DealsWireTest.php b/tests/Wire/DealsWireTest.php
deleted file mode 100644
index 2a88a1f0..00000000
--- a/tests/Wire/DealsWireTest.php
+++ /dev/null
@@ -1,267 +0,0 @@
-client->deals->getDealAttributes(
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.get_deal_attributes.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/attributes/deals",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAllDeals(): void {
- $testId = 'deals.get_all_deals.0';
- $this->client->deals->getAllDeals(
- new GetCrmDealsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.get_all_deals.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/deals",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateADeal(): void {
- $testId = 'deals.create_a_deal.0';
- $this->client->deals->createADeal(
- new PostCrmDealsRequest([
- 'name' => 'Deal: Connect with company',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.create_a_deal.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/crm/deals",
- null,
- 1
- );
- }
-
- /**
- */
- public function testImportDealsCreationAndUpdation(): void {
- $testId = 'deals.import_deals_creation_and_updation.0';
- $this->client->deals->importDealsCreationAndUpdation(
- new PostCrmDealsImportRequest([
- 'file' => File::createFromString("example_file", "example_file"),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.import_deals_creation_and_updation.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/crm/deals/import",
- null,
- 1
- );
- }
-
- /**
- */
- public function testLinkAndUnlinkADealWithContactsAndCompanies(): void {
- $testId = 'deals.link_and_unlink_a_deal_with_contacts_and_companies.0';
- $this->client->deals->linkAndUnlinkADealWithContactsAndCompanies(
- 'id',
- new PatchCrmDealsLinkUnlinkIdRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.link_and_unlink_a_deal_with_contacts_and_companies.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PATCH",
- "/crm/deals/link-unlink/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetADeal(): void {
- $testId = 'deals.get_a_deal.0';
- $this->client->deals->getADeal(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.get_a_deal.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/deals/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteADeal(): void {
- $testId = 'deals.delete_a_deal.0';
- $this->client->deals->deleteADeal(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.delete_a_deal.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/crm/deals/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateADeal(): void {
- $testId = 'deals.update_a_deal.0';
- $this->client->deals->updateADeal(
- 'id',
- new PatchCrmDealsIdRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.update_a_deal.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PATCH",
- "/crm/deals/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetPipelineStages(): void {
- $testId = 'deals.get_pipeline_stages.0';
- $this->client->deals->getPipelineStages(
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.get_pipeline_stages.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/pipeline/details",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAllPipelines(): void {
- $testId = 'deals.get_all_pipelines.0';
- $this->client->deals->getAllPipelines(
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.get_all_pipelines.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/pipeline/details/all",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAPipeline(): void {
- $testId = 'deals.get_a_pipeline.0';
- $this->client->deals->getAPipeline(
- 'pipelineID',
- [
- 'headers' => [
- 'X-Test-Id' => 'deals.get_a_pipeline.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/pipeline/details/pipelineID",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/DomainsWireTest.php b/tests/Wire/DomainsWireTest.php
deleted file mode 100644
index 84e49f9e..00000000
--- a/tests/Wire/DomainsWireTest.php
+++ /dev/null
@@ -1,134 +0,0 @@
-client->domains->getDomains(
- [
- 'headers' => [
- 'X-Test-Id' => 'domains.get_domains.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/senders/domains",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateDomain(): void {
- $testId = 'domains.create_domain.0';
- $this->client->domains->createDomain(
- new CreateDomainRequest([
- 'name' => 'mycompany.com',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'domains.create_domain.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/senders/domains",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetDomainConfiguration(): void {
- $testId = 'domains.get_domain_configuration.0';
- $this->client->domains->getDomainConfiguration(
- 'domainName',
- [
- 'headers' => [
- 'X-Test-Id' => 'domains.get_domain_configuration.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/senders/domains/domainName",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteDomain(): void {
- $testId = 'domains.delete_domain.0';
- $this->client->domains->deleteDomain(
- 'domainName',
- [
- 'headers' => [
- 'X-Test-Id' => 'domains.delete_domain.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/senders/domains/domainName",
- null,
- 1
- );
- }
-
- /**
- */
- public function testAuthenticateDomain(): void {
- $testId = 'domains.authenticate_domain.0';
- $this->client->domains->authenticateDomain(
- 'domainName',
- [
- 'headers' => [
- 'X-Test-Id' => 'domains.authenticate_domain.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/senders/domains/domainName/authenticate",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/EcommerceWireTest.php b/tests/Wire/EcommerceWireTest.php
deleted file mode 100644
index b0b8783f..00000000
--- a/tests/Wire/EcommerceWireTest.php
+++ /dev/null
@@ -1,478 +0,0 @@
-client->ecommerce->getCategories(
- new GetCategoriesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_categories.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/categories",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateUpdateCategory(): void {
- $testId = 'ecommerce.create_update_category.0';
- $this->client->ecommerce->createUpdateCategory(
- new CreateUpdateCategoryRequest([
- 'id' => 'CAT123',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.create_update_category.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/categories",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateUpdateBatchCategory(): void {
- $testId = 'ecommerce.create_update_batch_category.0';
- $this->client->ecommerce->createUpdateBatchCategory(
- new CreateUpdateBatchCategoryRequest([
- 'categories' => [
- new CreateUpdateBatchCategoryRequestCategoriesItem([
- 'id' => 'CAT123',
- ]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.create_update_batch_category.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/categories/batch",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetCategoryInfo(): void {
- $testId = 'ecommerce.get_category_info.0';
- $this->client->ecommerce->getCategoryInfo(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_category_info.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/categories/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testActivateTheECommerceApp(): void {
- $testId = 'ecommerce.activate_the_e_commerce_app.0';
- $this->client->ecommerce->activateTheECommerceApp(
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.activate_the_e_commerce_app.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/ecommerce/activate",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows(): void {
- $testId = 'ecommerce.get_attribution_metrics_for_one_or_more_brevo_campaigns_or_workflows.0';
- $this->client->ecommerce->getAttributionMetricsForOneOrMoreBrevoCampaignsOrWorkflows(
- new GetEcommerceAttributionMetricsRequest([
- 'periodFrom' => new DateTime('2022-01-02T00:00:00Z'),
- 'periodTo' => new DateTime('2022-01-03T00:00:00Z'),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_attribution_metrics_for_one_or_more_brevo_campaigns_or_workflows.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/ecommerce/attribution/metrics",
- ['periodFrom' => '2022-01-02T00:00:00Z', 'periodTo' => '2022-01-03T00:00:00Z'],
- 1
- );
- }
-
- /**
- */
- public function testGetDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow(): void {
- $testId = 'ecommerce.get_detailed_attribution_metrics_for_a_single_brevo_campaign_or_workflow.0';
- $this->client->ecommerce->getDetailedAttributionMetricsForASingleBrevoCampaignOrWorkflow(
- GetEcommerceAttributionMetricsConversionSourceConversionSourceIdRequestConversionSource::EmailCampaign->value,
- 'sale',
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_detailed_attribution_metrics_for_a_single_brevo_campaign_or_workflow.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/ecommerce/attribution/metrics/email_campaign/sale",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAttributedProductSalesForASingleBrevoCampaignOrWorkflow(): void {
- $testId = 'ecommerce.get_attributed_product_sales_for_a_single_brevo_campaign_or_workflow.0';
- $this->client->ecommerce->getAttributedProductSalesForASingleBrevoCampaignOrWorkflow(
- GetEcommerceAttributionProductsConversionSourceConversionSourceIdRequestConversionSource::EmailCampaign->value,
- 'sale',
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_attributed_product_sales_for_a_single_brevo_campaign_or_workflow.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/ecommerce/attribution/products/email_campaign/sale",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(): void {
- $testId = 'ecommerce.get_the_iso4217compliant_display_currency_code_for_your_brevo_account.0';
- $this->client->ecommerce->getTheIso4217CompliantDisplayCurrencyCodeForYourBrevoAccount(
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_the_iso4217compliant_display_currency_code_for_your_brevo_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/ecommerce/config/displayCurrency",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSetConfigDisplayCurrency(): void {
- $testId = 'ecommerce.set_config_display_currency.0';
- $this->client->ecommerce->setConfigDisplayCurrency(
- new SetConfigDisplayCurrencyRequest([
- 'code' => 'EUR',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.set_config_display_currency.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/ecommerce/config/displayCurrency",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetOrders(): void {
- $testId = 'ecommerce.get_orders.0';
- $this->client->ecommerce->getOrders(
- new GetOrdersRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_orders.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/orders",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateOrder(): void {
- $testId = 'ecommerce.create_order.0';
- $this->client->ecommerce->createOrder(
- new Order([
- 'amount' => 308.42,
- 'createdAt' => '2021-07-29T20:59:23.383Z',
- 'id' => '14',
- 'products' => [
- new OrderProductsItem([
- 'price' => 99.99,
- 'productId' => 'P1',
- 'quantity' => 10,
- ]),
- ],
- 'status' => 'completed',
- 'updatedAt' => '2021-07-30T10:59:23.383Z',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.create_order.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/orders/status",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateBatchOrder(): void {
- $testId = 'ecommerce.create_batch_order.0';
- $this->client->ecommerce->createBatchOrder(
- new CreateBatchOrderRequest([
- 'orders' => [
- new Order([
- 'amount' => 308.42,
- 'createdAt' => '2021-07-29T20:59:23.383Z',
- 'id' => '14',
- 'products' => [
- new OrderProductsItem([
- 'price' => 99.99,
- 'productId' => 'P1',
- 'quantity' => 10,
- ]),
- ],
- 'status' => 'completed',
- 'updatedAt' => '2021-07-30T10:59:23.383Z',
- ]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.create_batch_order.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/orders/status/batch",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetProducts(): void {
- $testId = 'ecommerce.get_products.0';
- $this->client->ecommerce->getProducts(
- new GetProductsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_products.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/products",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateUpdateProduct(): void {
- $testId = 'ecommerce.create_update_product.0';
- $this->client->ecommerce->createUpdateProduct(
- new CreateUpdateProductRequest([
- 'id' => 'P11',
- 'name' => 'Iphone 11',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.create_update_product.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/products",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateUpdateBatchProducts(): void {
- $testId = 'ecommerce.create_update_batch_products.0';
- $this->client->ecommerce->createUpdateBatchProducts(
- new CreateUpdateBatchProductsRequest([
- 'products' => [
- new CreateUpdateBatchProductsRequestProductsItem([
- 'id' => 'P11',
- 'name' => 'Iphone 11',
- ]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.create_update_batch_products.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/products/batch",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetProductInfo(): void {
- $testId = 'ecommerce.get_product_info.0';
- $this->client->ecommerce->getProductInfo(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.get_product_info.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/products/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateProductAlert(): void {
- $testId = 'ecommerce.create_product_alert.0';
- $this->client->ecommerce->createProductAlert(
- 'id',
- 'back_in_stock',
- new CreateProductAlertRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'ecommerce.create_product_alert.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/products/id/alerts/back_in_stock",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/EmailCampaignsWireTest.php b/tests/Wire/EmailCampaignsWireTest.php
deleted file mode 100644
index 43848059..00000000
--- a/tests/Wire/EmailCampaignsWireTest.php
+++ /dev/null
@@ -1,341 +0,0 @@
-client->emailCampaigns->getEmailCampaigns(
- new GetEmailCampaignsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.get_email_campaigns.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/emailCampaigns",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateEmailCampaign(): void {
- $testId = 'email_campaigns.create_email_campaign.0';
- $this->client->emailCampaigns->createEmailCampaign(
- new CreateEmailCampaignRequest([
- 'name' => 'Newsletter - May 2017',
- 'sender' => new CreateEmailCampaignRequestSender([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.create_email_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/emailCampaigns",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUploadImageToGallery(): void {
- $testId = 'email_campaigns.upload_image_to_gallery.0';
- $this->client->emailCampaigns->uploadImageToGallery(
- new UploadImageToGalleryRequest([
- 'imageUrl' => 'https://somedomain.com/image1.jpg',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.upload_image_to_gallery.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/emailCampaigns/images",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetEmailCampaign(): void {
- $testId = 'email_campaigns.get_email_campaign.0';
- $this->client->emailCampaigns->getEmailCampaign(
- 1000000,
- new GetEmailCampaignRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.get_email_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/emailCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateEmailCampaign(): void {
- $testId = 'email_campaigns.update_email_campaign.0';
- $this->client->emailCampaigns->updateEmailCampaign(
- 1000000,
- new UpdateEmailCampaignRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.update_email_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/emailCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteEmailCampaign(): void {
- $testId = 'email_campaigns.delete_email_campaign.0';
- $this->client->emailCampaigns->deleteEmailCampaign(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.delete_email_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/emailCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAbTestCampaignResult(): void {
- $testId = 'email_campaigns.get_ab_test_campaign_result.0';
- $this->client->emailCampaigns->getAbTestCampaignResult(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.get_ab_test_campaign_result.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/emailCampaigns/1000000/abTestCampaignResult",
- null,
- 1
- );
- }
-
- /**
- */
- public function testEmailExportRecipients(): void {
- $testId = 'email_campaigns.email_export_recipients.0';
- $this->client->emailCampaigns->emailExportRecipients(
- 1000000,
- new EmailExportRecipientsRequest([
- 'recipientsType' => EmailExportRecipientsRequestRecipientsType::All->value,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.email_export_recipients.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/emailCampaigns/1000000/exportRecipients",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendEmailCampaignNow(): void {
- $testId = 'email_campaigns.send_email_campaign_now.0';
- $this->client->emailCampaigns->sendEmailCampaignNow(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.send_email_campaign_now.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/emailCampaigns/1000000/sendNow",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendReport(): void {
- $testId = 'email_campaigns.send_report.0';
- $this->client->emailCampaigns->sendReport(
- 1000000,
- new SendReportRequest([
- 'body' => new SendReport([
- 'email' => new SendReportEmail([
- 'body' => 'Please find attached the report of our last email campaign.',
- 'to' => [
- 'jim.suehan@example.com',
- ],
- ]),
- ]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.send_report.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/emailCampaigns/1000000/sendReport",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendTestEmail(): void {
- $testId = 'email_campaigns.send_test_email.0';
- $this->client->emailCampaigns->sendTestEmail(
- 1000000,
- new SendTestEmailRequest([
- 'body' => new SendTestEmail([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.send_test_email.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/emailCampaigns/1000000/sendTest",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSharedTemplateUrl(): void {
- $testId = 'email_campaigns.get_shared_template_url.0';
- $this->client->emailCampaigns->getSharedTemplateUrl(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.get_shared_template_url.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/emailCampaigns/1000000/sharedUrl",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateCampaignStatus(): void {
- $testId = 'email_campaigns.update_campaign_status.0';
- $this->client->emailCampaigns->updateCampaignStatus(
- 1000000,
- new UpdateCampaignStatusRequest([
- 'body' => new UpdateCampaignStatus([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'email_campaigns.update_campaign_status.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/emailCampaigns/1000000/status",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/EventWireTest.php b/tests/Wire/EventWireTest.php
deleted file mode 100644
index d5f871d0..00000000
--- a/tests/Wire/EventWireTest.php
+++ /dev/null
@@ -1,53 +0,0 @@
-client->event->createEvent(
- new CreateEventRequest([
- 'eventName' => 'video_played',
- 'identifiers' => new CreateEventRequestIdentifiers([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'event.create_event.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/events",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/ExternalFeedsWireTest.php b/tests/Wire/ExternalFeedsWireTest.php
deleted file mode 100644
index df568736..00000000
--- a/tests/Wire/ExternalFeedsWireTest.php
+++ /dev/null
@@ -1,151 +0,0 @@
-client->externalFeeds->getAllExternalFeeds(
- new GetAllExternalFeedsRequest([
- 'search' => 'product',
- 'startDate' => new DateTime('2024-01-01'),
- 'endDate' => new DateTime('2024-01-31'),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'external_feeds.get_all_external_feeds.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/feeds",
- ['search' => 'product', 'startDate' => '2024-01-01', 'endDate' => '2024-01-31'],
- 1
- );
- }
-
- /**
- */
- public function testCreateExternalFeed(): void {
- $testId = 'external_feeds.create_external_feed.0';
- $this->client->externalFeeds->createExternalFeed(
- new CreateExternalFeedRequest([
- 'name' => 'Public API Feed',
- 'url' => 'https://jsonplaceholder.typicode.com/posts',
- 'authType' => CreateExternalFeedRequestAuthType::NoAuth->value,
- 'maxRetries' => 3,
- 'cache' => true,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'external_feeds.create_external_feed.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/feeds",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetExternalFeedByUuid(): void {
- $testId = 'external_feeds.get_external_feed_by_uuid.0';
- $this->client->externalFeeds->getExternalFeedByUuid(
- 'b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6',
- [
- 'headers' => [
- 'X-Test-Id' => 'external_feeds.get_external_feed_by_uuid.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateExternalFeed(): void {
- $testId = 'external_feeds.update_external_feed.0';
- $this->client->externalFeeds->updateExternalFeed(
- 'b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6',
- new UpdateExternalFeedRequest([
- 'name' => 'Updated Product Catalog',
- 'url' => 'https://api.newstore.com/products/v2',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'external_feeds.update_external_feed.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteExternalFeed(): void {
- $testId = 'external_feeds.delete_external_feed.0';
- $this->client->externalFeeds->deleteExternalFeed(
- 'b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6',
- [
- 'headers' => [
- 'X-Test-Id' => 'external_feeds.delete_external_feed.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/feeds/b1c2d3e4-f5a6-47b8-89c0-d1e2f3a4b5c6",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/FilesWireTest.php b/tests/Wire/FilesWireTest.php
deleted file mode 100644
index ed6e71c1..00000000
--- a/tests/Wire/FilesWireTest.php
+++ /dev/null
@@ -1,137 +0,0 @@
-client->files->getAllFiles(
- new GetCrmFilesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'files.get_all_files.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/files",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUploadAFile(): void {
- $testId = 'files.upload_a_file.0';
- $this->client->files->uploadAFile(
- new PostCrmFilesRequest([
- 'file' => File::createFromString("example_file", "example_file"),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'files.upload_a_file.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/crm/files",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDownloadAFile(): void {
- $testId = 'files.download_a_file.0';
- $this->client->files->downloadAFile(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'files.download_a_file.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/files/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteAFile(): void {
- $testId = 'files.delete_a_file.0';
- $this->client->files->deleteAFile(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'files.delete_a_file.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/crm/files/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetFileDetails(): void {
- $testId = 'files.get_file_details.0';
- $this->client->files->getFileDetails(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'files.get_file_details.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/files/id/data",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/InboundParsingWireTest.php b/tests/Wire/InboundParsingWireTest.php
deleted file mode 100644
index 3b0bbc02..00000000
--- a/tests/Wire/InboundParsingWireTest.php
+++ /dev/null
@@ -1,91 +0,0 @@
-client->inboundParsing->getInboundEmailEvents(
- new GetInboundEmailEventsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'inbound_parsing.get_inbound_email_events.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/inbound/events",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetInboundEmailEventsByUuid(): void {
- $testId = 'inbound_parsing.get_inbound_email_events_by_uuid.0';
- $this->client->inboundParsing->getInboundEmailEventsByUuid(
- 'uuid',
- [
- 'headers' => [
- 'X-Test-Id' => 'inbound_parsing.get_inbound_email_events_by_uuid.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/inbound/events/uuid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetInboundEmailAttachment(): void {
- $testId = 'inbound_parsing.get_inbound_email_attachment.0';
- $this->client->inboundParsing->getInboundEmailAttachment(
- 'downloadToken',
- [
- 'headers' => [
- 'X-Test-Id' => 'inbound_parsing.get_inbound_email_attachment.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/inbound/attachments/downloadToken",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/MasterAccountWireTest.php b/tests/Wire/MasterAccountWireTest.php
deleted file mode 100644
index 18110ef2..00000000
--- a/tests/Wire/MasterAccountWireTest.php
+++ /dev/null
@@ -1,749 +0,0 @@
-client->masterAccount->createANewGroupOfSubAccounts(
- new PostCorporateGroupRequest([
- 'groupName' => 'My group',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.create_a_new_group_of_sub_accounts.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/corporate/group",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteSubAccountFromGroup(): void {
- $testId = 'master_account.delete_sub_account_from_group.0';
- $this->client->masterAccount->deleteSubAccountFromGroup(
- 'groupId',
- new PutCorporateGroupUnlinkGroupIdSubAccountsRequest([
- 'subAccountIds' => [
- 423432,
- 234323,
- 87678,
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.delete_sub_account_from_group.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/corporate/group/unlink/groupId/subAccounts",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAGroupDetails(): void {
- $testId = 'master_account.get_a_group_details.0';
- $this->client->masterAccount->getAGroupDetails(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.get_a_group_details.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/corporate/group/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateAGroupOfSubAccounts(): void {
- $testId = 'master_account.update_a_group_of_sub_accounts.0';
- $this->client->masterAccount->updateAGroupOfSubAccounts(
- 'id',
- new PutCorporateGroupIdRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.update_a_group_of_sub_accounts.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/corporate/group/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteAGroup(): void {
- $testId = 'master_account.delete_a_group.0';
- $this->client->masterAccount->deleteAGroup(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.delete_a_group.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/corporate/group/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSubAccountGroups(): void {
- $testId = 'master_account.get_sub_account_groups.0';
- $this->client->masterAccount->getSubAccountGroups(
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.get_sub_account_groups.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/corporate/groups",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetCorporateInvitedUsersList(): void {
- $testId = 'master_account.get_corporate_invited_users_list.0';
- $this->client->masterAccount->getCorporateInvitedUsersList(
- new GetCorporateInvitedUsersListRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.get_corporate_invited_users_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/corporate/invited/users",
- null,
- 1
- );
- }
-
- /**
- */
- public function testListOfAllIPs(): void {
- $testId = 'master_account.list_of_all_i_ps.0';
- $this->client->masterAccount->listOfAllIPs(
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.list_of_all_i_ps.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/corporate/ip",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetTheDetailsOfRequestedMasterAccount(): void {
- $testId = 'master_account.get_the_details_of_requested_master_account.0';
- $this->client->masterAccount->getTheDetailsOfRequestedMasterAccount(
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.get_the_details_of_requested_master_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/corporate/masterAccount",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGenerateSsoTokenToAccessAdminAccount(): void {
- $testId = 'master_account.generate_sso_token_to_access_admin_account.0';
- $this->client->masterAccount->generateSsoTokenToAccessAdminAccount(
- new PostCorporateSsoTokenRequest([
- 'email' => 'vipin+ent-user@brevo.com',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.generate_sso_token_to_access_admin_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/corporate/ssoToken",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetTheListOfAllTheSubAccountsOfTheMasterAccount(): void {
- $testId = 'master_account.get_the_list_of_all_the_sub_accounts_of_the_master_account.0';
- $this->client->masterAccount->getTheListOfAllTheSubAccountsOfTheMasterAccount(
- new GetCorporateSubAccountRequest([
- 'offset' => 1,
- 'limit' => 1,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.get_the_list_of_all_the_sub_accounts_of_the_master_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/corporate/subAccount",
- ['offset' => '1', 'limit' => '1'],
- 1
- );
- }
-
- /**
- */
- public function testCreateANewSubAccountUnderAMasterAccount(): void {
- $testId = 'master_account.create_a_new_sub_account_under_a_master_account.0';
- $this->client->masterAccount->createANewSubAccountUnderAMasterAccount(
- new PostCorporateSubAccountRequest([
- 'companyName' => 'Test Sub-account',
- 'email' => 'test-sub@example.com',
- 'groupIds' => [
- '5f8f8c3b5f56a02d4433b3a7',
- '5f8f8c3b5f56a02d4433b3a8',
- ],
- 'language' => PostCorporateSubAccountRequestLanguage::Fr->value,
- 'timezone' => 'Europe/Paris',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.create_a_new_sub_account_under_a_master_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/corporate/subAccount",
- null,
- 1
- );
- }
-
- /**
- */
- public function testAssociateAnIpToSubAccounts(): void {
- $testId = 'master_account.associate_an_ip_to_sub_accounts.0';
- $this->client->masterAccount->associateAnIpToSubAccounts(
- new PostCorporateSubAccountIpAssociateRequest([
- 'ids' => [
- 234322,
- 325553,
- 893432,
- ],
- 'ip' => '103.11.32.88',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.associate_an_ip_to_sub_accounts.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/corporate/subAccount/ip/associate",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDissociateAnIpToSubAccounts(): void {
- $testId = 'master_account.dissociate_an_ip_to_sub_accounts.0';
- $this->client->masterAccount->dissociateAnIpToSubAccounts(
- new PutCorporateSubAccountIpDissociateRequest([
- 'ids' => [
- 234322,
- 325553,
- 893432,
- ],
- 'ip' => '103.11.32.88',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.dissociate_an_ip_to_sub_accounts.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/corporate/subAccount/ip/dissociate",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateAnApiKeyForASubAccount(): void {
- $testId = 'master_account.create_an_api_key_for_a_sub_account.0';
- $this->client->masterAccount->createAnApiKeyForASubAccount(
- new PostCorporateSubAccountKeyRequest([
- 'id' => 3232323,
- 'name' => 'My Api Key',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.create_an_api_key_for_a_sub_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/corporate/subAccount/key",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGenerateSsoTokenToAccessSubAccount(): void {
- $testId = 'master_account.generate_sso_token_to_access_sub_account.0';
- $this->client->masterAccount->generateSsoTokenToAccessSubAccount(
- new PostCorporateSubAccountSsoTokenRequest([
- 'id' => 3232323,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.generate_sso_token_to_access_sub_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/corporate/subAccount/ssoToken",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSubAccountDetails(): void {
- $testId = 'master_account.get_sub_account_details.0';
- $this->client->masterAccount->getSubAccountDetails(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.get_sub_account_details.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/corporate/subAccount/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteASubAccount(): void {
- $testId = 'master_account.delete_a_sub_account.0';
- $this->client->masterAccount->deleteASubAccount(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.delete_a_sub_account.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/corporate/subAccount/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testEnableDisableSubAccountApplicationS(): void {
- $testId = 'master_account.enable_disable_sub_account_application_s.0';
- $this->client->masterAccount->enableDisableSubAccountApplicationS(
- 1000000,
- new PutCorporateSubAccountIdApplicationsToggleRequest([
- 'landingPages' => true,
- 'meetings' => true,
- 'smsCampaigns' => false,
- 'webPush' => false,
- 'whatsapp' => true,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.enable_disable_sub_account_application_s.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/corporate/subAccount/1000000/applications/toggle",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateSubAccountPlan(): void {
- $testId = 'master_account.update_sub_account_plan.0';
- $this->client->masterAccount->updateSubAccountPlan(
- 1000000,
- new PutCorporateSubAccountIdPlanRequest([
- 'credits' => new PutCorporateSubAccountIdPlanRequestCredits([
- 'email' => 5000,
- 'externalFeeds' => 1,
- 'sms' => 2000,
- 'whatsapp' => 100,
- 'wpSubscribers' => -1,
- ]),
- 'features' => new PutCorporateSubAccountIdPlanRequestFeatures([
- 'inbox' => 10,
- 'landingPage' => 20,
- 'salesUsers' => 6,
- 'users' => 15,
- ]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.update_sub_account_plan.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/corporate/subAccount/1000000/plan",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateSubAccountsPlan(): void {
- $testId = 'master_account.update_sub_accounts_plan.0';
- $this->client->masterAccount->updateSubAccountsPlan(
- new PutCorporateSubAccountsPlanRequest([
- 'credits' => new PutCorporateSubAccountsPlanRequestCredits([
- 'email' => 5000,
- 'externalFeeds' => 1,
- 'sms' => 2000,
- 'whatsapp' => 100,
- 'wpSubscribers' => -1,
- ]),
- 'features' => new PutCorporateSubAccountsPlanRequestFeatures([
- 'landingPage' => 20,
- 'salesUsers' => 6,
- 'users' => 15,
- ]),
- 'subAccountIds' => [
- 4534345,
- 987893,
- 876785,
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.update_sub_accounts_plan.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/corporate/subAccounts/plan",
- null,
- 1
- );
- }
-
- /**
- */
- public function testInviteAdminUser(): void {
- $testId = 'master_account.invite_admin_user.0';
- $this->client->masterAccount->inviteAdminUser(
- new InviteAdminUserRequest([
- 'allFeaturesAccess' => true,
- 'email' => 'inviteuser@example.com',
- 'privileges' => [
- new InviteAdminUserRequestPrivilegesItem([]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.invite_admin_user.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/corporate/user/invitation/send",
- null,
- 1
- );
- }
-
- /**
- */
- public function testResendCancelAdminUserInvitation(): void {
- $testId = 'master_account.resend_cancel_admin_user_invitation.0';
- $this->client->masterAccount->resendCancelAdminUserInvitation(
- PutCorporateUserInvitationActionEmailRequestAction::Resend->value,
- 'email',
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.resend_cancel_admin_user_invitation.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/corporate/user/invitation/resend/email",
- null,
- 1
- );
- }
-
- /**
- */
- public function testRevokeAnAdminUser(): void {
- $testId = 'master_account.revoke_an_admin_user.0';
- $this->client->masterAccount->revokeAnAdminUser(
- 'email',
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.revoke_an_admin_user.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/corporate/user/revoke/email",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetCorporateUserPermission(): void {
- $testId = 'master_account.get_corporate_user_permission.0';
- $this->client->masterAccount->getCorporateUserPermission(
- 'email',
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.get_corporate_user_permission.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/corporate/user/email/permissions",
- null,
- 1
- );
- }
-
- /**
- */
- public function testChangeAdminUserPermissions(): void {
- $testId = 'master_account.change_admin_user_permissions.0';
- $this->client->masterAccount->changeAdminUserPermissions(
- 'email',
- new PutCorporateUserEmailPermissionsRequest([
- 'allFeaturesAccess' => false,
- 'privileges' => [
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::UserManagement->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::All->value,
- ],
- ]),
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::Api->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::All->value,
- ],
- ]),
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::MyPlan->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::None->value,
- ],
- ]),
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::AppsManagement->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::All->value,
- ],
- ]),
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::CreateSubOrganizations->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::All->value,
- ],
- ]),
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::SubOrganizationGroups->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::Create->value,
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::EditDelete->value,
- ],
- ]),
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::ManageSubOrganizations->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::All->value,
- ],
- ]),
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::Security->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::None->value,
- ],
- ]),
- new PutCorporateUserEmailPermissionsRequestPrivilegesItem([
- 'feature' => PutCorporateUserEmailPermissionsRequestPrivilegesItemFeature::Analytics->value,
- 'permissions' => [
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::CreateAlerts->value,
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::DownloadData->value,
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::MyLooks->value,
- PutCorporateUserEmailPermissionsRequestPrivilegesItemPermissionsItem::ExploreCreate->value,
- ],
- ]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'master_account.change_admin_user_permissions.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/corporate/user/email/permissions",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/NotesWireTest.php b/tests/Wire/NotesWireTest.php
deleted file mode 100644
index 0120fd47..00000000
--- a/tests/Wire/NotesWireTest.php
+++ /dev/null
@@ -1,142 +0,0 @@
-client->notes->getAllNotes(
- new GetCrmNotesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'notes.get_all_notes.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/notes",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateANote(): void {
- $testId = 'notes.create_a_note.0';
- $this->client->notes->createANote(
- new NoteData([
- 'text' => 'In communication with client_dev for resolution of queries.',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'notes.create_a_note.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/crm/notes",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetANote(): void {
- $testId = 'notes.get_a_note.0';
- $this->client->notes->getANote(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'notes.get_a_note.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/notes/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteANote(): void {
- $testId = 'notes.delete_a_note.0';
- $this->client->notes->deleteANote(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'notes.delete_a_note.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/crm/notes/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateANote(): void {
- $testId = 'notes.update_a_note.0';
- $this->client->notes->updateANote(
- 'id',
- new PatchCrmNotesIdRequest([
- 'body' => new NoteData([
- 'text' => 'In communication with client_dev for resolution of queries.',
- ]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'notes.update_a_note.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PATCH",
- "/crm/notes/id",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/PaymentsWireTest.php b/tests/Wire/PaymentsWireTest.php
deleted file mode 100644
index 42ab01e2..00000000
--- a/tests/Wire/PaymentsWireTest.php
+++ /dev/null
@@ -1,99 +0,0 @@
-client->payments->createPaymentRequest(
- new CreatePaymentRequestRequest([
- 'cart' => new Cart([
- 'currency' => 'EUR',
- 'specificAmount' => 1200,
- ]),
- 'contactId' => 43,
- 'reference' => 'Invoice #INV0001',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'payments.create_payment_request.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/payments/requests",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetPaymentRequest(): void {
- $testId = 'payments.get_payment_request.0';
- $this->client->payments->getPaymentRequest(
- '050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc',
- [
- 'headers' => [
- 'X-Test-Id' => 'payments.get_payment_request.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/payments/requests/050db7b0-9bb7-4c1e-9c68-5a8dace8c1dc",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeletePaymentRequest(): void {
- $testId = 'payments.delete_payment_request.0';
- $this->client->payments->deletePaymentRequest(
- '9ae7d68a-565c-4695-9381-d8fb3e3a14cc',
- [
- 'headers' => [
- 'X-Test-Id' => 'payments.delete_payment_request.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/payments/requests/9ae7d68a-565c-4695-9381-d8fb3e3a14cc",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/ProcessWireTest.php b/tests/Wire/ProcessWireTest.php
deleted file mode 100644
index c9e8c691..00000000
--- a/tests/Wire/ProcessWireTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-client->process->getProcesses(
- new GetProcessesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'process.get_processes.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/processes",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetProcess(): void {
- $testId = 'process.get_process.0';
- $this->client->process->getProcess(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'process.get_process.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/processes/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/ProgramWireTest.php b/tests/Wire/ProgramWireTest.php
deleted file mode 100644
index 7fe42d58..00000000
--- a/tests/Wire/ProgramWireTest.php
+++ /dev/null
@@ -1,284 +0,0 @@
-client->program->getLpList(
- new GetLpListRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'program.get_lp_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/config/programs",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateNewLp(): void {
- $testId = 'program.create_new_lp.0';
- $this->client->program->createNewLp(
- new CreateNewLpRequest([
- 'name' => 'name',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'program.create_new_lp.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/config/programs",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetLoyaltyProgramInfo(): void {
- $testId = 'program.get_loyalty_program_info.0';
- $this->client->program->getLoyaltyProgramInfo(
- 'pid',
- [
- 'headers' => [
- 'X-Test-Id' => 'program.get_loyalty_program_info.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/config/programs/pid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateLoyaltyProgram(): void {
- $testId = 'program.update_loyalty_program.0';
- $this->client->program->updateLoyaltyProgram(
- 'pid',
- new UpdateLoyaltyProgramRequest([
- 'name' => 'name',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'program.update_loyalty_program.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/loyalty/config/programs/pid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteLoyaltyProgram(): void {
- $testId = 'program.delete_loyalty_program.0';
- $this->client->program->deleteLoyaltyProgram(
- 'pid',
- [
- 'headers' => [
- 'X-Test-Id' => 'program.delete_loyalty_program.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/loyalty/config/programs/pid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testPartiallyUpdateLoyaltyProgram(): void {
- $testId = 'program.partially_update_loyalty_program.0';
- $this->client->program->partiallyUpdateLoyaltyProgram(
- 'pid',
- new PartiallyUpdateLoyaltyProgramRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'program.partially_update_loyalty_program.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PATCH",
- "/loyalty/config/programs/pid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetParameterSubscriptionInfo(): void {
- $testId = 'program.get_parameter_subscription_info.0';
- $this->client->program->getParameterSubscriptionInfo(
- 'pid',
- new GetParameterSubscriptionInfoRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'program.get_parameter_subscription_info.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/config/programs/pid/account-info",
- null,
- 1
- );
- }
-
- /**
- */
- public function testPublishLoyaltyProgram(): void {
- $testId = 'program.publish_loyalty_program.0';
- $this->client->program->publishLoyaltyProgram(
- 'pid',
- [
- 'headers' => [
- 'X-Test-Id' => 'program.publish_loyalty_program.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/config/programs/pid/publish",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSubscribeMemberToASubscription(): void {
- $testId = 'program.subscribe_member_to_a_subscription.0';
- $this->client->program->subscribeMemberToASubscription(
- 'pid',
- new SubscribeMemberToASubscriptionRequest([
- 'memberContactIds' => [
- 1,
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'program.subscribe_member_to_a_subscription.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/config/programs/pid/subscription-members",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteContactMembers(): void {
- $testId = 'program.delete_contact_members.0';
- $this->client->program->deleteContactMembers(
- 'pid',
- new DeleteContactMembersRequest([
- 'memberContactIds' => 'memberContactIds',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'program.delete_contact_members.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/loyalty/config/programs/pid/subscription-members",
- ['memberContactIds' => 'memberContactIds'],
- 1
- );
- }
-
- /**
- */
- public function testSubscribeToLoyaltyProgram(): void {
- $testId = 'program.subscribe_to_loyalty_program.0';
- $this->client->program->subscribeToLoyaltyProgram(
- 'pid',
- new SubscribeToLoyaltyProgramRequest([
- 'contactId' => 1,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'program.subscribe_to_loyalty_program.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/config/programs/pid/subscriptions",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/RewardWireTest.php b/tests/Wire/RewardWireTest.php
deleted file mode 100644
index 9babcb7e..00000000
--- a/tests/Wire/RewardWireTest.php
+++ /dev/null
@@ -1,262 +0,0 @@
-client->reward->getCodeCount(
- 'pid',
- 'cpid',
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.get_code_count.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/offer/programs/pid/code-pools/cpid/codes-count",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetRewardPageApi(): void {
- $testId = 'reward.get_reward_page_api.0';
- $this->client->reward->getRewardPageApi(
- 'pid',
- new GetLoyaltyOfferProgramsPidOffersRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.get_reward_page_api.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/offer/programs/pid/offers",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateReward(): void {
- $testId = 'reward.create_reward.0';
- $this->client->reward->createReward(
- 'pid',
- new CreateRewardRequest([
- 'name' => 'name',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.create_reward.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/offer/programs/pid/offers",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateVoucher(): void {
- $testId = 'reward.create_voucher.0';
- $this->client->reward->createVoucher(
- 'pid',
- new CreateVoucherRequest([
- 'rewardId' => 'rewardId',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.create_voucher.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/offer/programs/pid/rewards/attribute",
- null,
- 1
- );
- }
-
- /**
- */
- public function testRedeemVoucher(): void {
- $testId = 'reward.redeem_voucher.0';
- $this->client->reward->redeemVoucher(
- 'pid',
- new RedeemVoucherRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.redeem_voucher.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/offer/programs/pid/rewards/redeem",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCompleteRedeemTransaction(): void {
- $testId = 'reward.complete_redeem_transaction.0';
- $this->client->reward->completeRedeemTransaction(
- 'pid',
- 'tid',
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.complete_redeem_transaction.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/offer/programs/pid/rewards/redeem/tid/complete",
- null,
- 1
- );
- }
-
- /**
- */
- public function testRevokeVouchers(): void {
- $testId = 'reward.revoke_vouchers.0';
- $this->client->reward->revokeVouchers(
- 'pid',
- new RevokeVouchersRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.revoke_vouchers.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/loyalty/offer/programs/pid/rewards/revoke",
- null,
- 1
- );
- }
-
- /**
- */
- public function testValidateReward(): void {
- $testId = 'reward.validate_reward.0';
- $this->client->reward->validateReward(
- 'pid',
- new ValidateRewardRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.validate_reward.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/offer/programs/pid/rewards/validate",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetRewardInformation(): void {
- $testId = 'reward.get_reward_information.0';
- $this->client->reward->getRewardInformation(
- 'pid',
- 'rid',
- new GetLoyaltyOfferProgramsPidRewardsRidRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.get_reward_information.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/offer/programs/pid/rewards/rid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetVoucherForAContact(): void {
- $testId = 'reward.get_voucher_for_a_contact.0';
- $this->client->reward->getVoucherForAContact(
- 'pid',
- new GetLoyaltyOfferProgramsPidVouchersRequest([
- 'contactId' => 1,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'reward.get_voucher_for_a_contact.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/offer/programs/pid/vouchers",
- ['contactId' => '1'],
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/SendersWireTest.php b/tests/Wire/SendersWireTest.php
deleted file mode 100644
index a4bc1b35..00000000
--- a/tests/Wire/SendersWireTest.php
+++ /dev/null
@@ -1,186 +0,0 @@
-client->senders->getSenders(
- new GetSendersRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'senders.get_senders.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/senders",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateSender(): void {
- $testId = 'senders.create_sender.0';
- $this->client->senders->createSender(
- new CreateSenderRequest([
- 'email' => 'support@example.com',
- 'name' => 'Support Team',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'senders.create_sender.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/senders",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetIps(): void {
- $testId = 'senders.get_ips.0';
- $this->client->senders->getIps(
- [
- 'headers' => [
- 'X-Test-Id' => 'senders.get_ips.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/senders/ips",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateSender(): void {
- $testId = 'senders.update_sender.0';
- $this->client->senders->updateSender(
- 1000000,
- new UpdateSenderRequest([
- 'name' => 'New Support Team',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'senders.update_sender.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/senders/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteSender(): void {
- $testId = 'senders.delete_sender.0';
- $this->client->senders->deleteSender(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'senders.delete_sender.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/senders/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetIpsFromSender(): void {
- $testId = 'senders.get_ips_from_sender.0';
- $this->client->senders->getIpsFromSender(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'senders.get_ips_from_sender.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/senders/1000000/ips",
- null,
- 1
- );
- }
-
- /**
- */
- public function testValidateSenderByOtp(): void {
- $testId = 'senders.validate_sender_by_otp.0';
- $this->client->senders->validateSenderByOtp(
- 1000000,
- new ValidateSenderByOtpRequest([
- 'otp' => 123456,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'senders.validate_sender_by_otp.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/senders/1000000/validate",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/SmsCampaignsWireTest.php b/tests/Wire/SmsCampaignsWireTest.php
deleted file mode 100644
index 4796c505..00000000
--- a/tests/Wire/SmsCampaignsWireTest.php
+++ /dev/null
@@ -1,270 +0,0 @@
-client->smsCampaigns->getSmsCampaigns(
- new GetSmsCampaignsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.get_sms_campaigns.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smsCampaigns",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateSmsCampaign(): void {
- $testId = 'sms_campaigns.create_sms_campaign.0';
- $this->client->smsCampaigns->createSmsCampaign(
- new CreateSmsCampaignRequest([
- 'content' => 'Get a discount by visiting our NY store and saying : Happy Spring!',
- 'name' => 'Spring Promo Code',
- 'sender' => 'MyShop',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.create_sms_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smsCampaigns",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSmsCampaign(): void {
- $testId = 'sms_campaigns.get_sms_campaign.0';
- $this->client->smsCampaigns->getSmsCampaign(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.get_sms_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smsCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateSmsCampaign(): void {
- $testId = 'sms_campaigns.update_sms_campaign.0';
- $this->client->smsCampaigns->updateSmsCampaign(
- 1000000,
- new UpdateSmsCampaignRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.update_sms_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/smsCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteSmsCampaign(): void {
- $testId = 'sms_campaigns.delete_sms_campaign.0';
- $this->client->smsCampaigns->deleteSmsCampaign(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.delete_sms_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/smsCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testRequestSmsRecipientExport(): void {
- $testId = 'sms_campaigns.request_sms_recipient_export.0';
- $this->client->smsCampaigns->requestSmsRecipientExport(
- 1000000,
- new RequestSmsRecipientExportRequest([
- 'recipientsType' => RequestSmsRecipientExportRequestRecipientsType::All->value,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.request_sms_recipient_export.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smsCampaigns/1000000/exportRecipients",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendSmsCampaignNow(): void {
- $testId = 'sms_campaigns.send_sms_campaign_now.0';
- $this->client->smsCampaigns->sendSmsCampaignNow(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.send_sms_campaign_now.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smsCampaigns/1000000/sendNow",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendSmsReport(): void {
- $testId = 'sms_campaigns.send_sms_report.0';
- $this->client->smsCampaigns->sendSmsReport(
- 1000000,
- new SendSmsReportRequest([
- 'body' => new SendReport([
- 'email' => new SendReportEmail([
- 'body' => 'Please find attached the report of our last email campaign.',
- 'to' => [
- 'jim.suehan@example.com',
- ],
- ]),
- ]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.send_sms_report.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smsCampaigns/1000000/sendReport",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendTestSms(): void {
- $testId = 'sms_campaigns.send_test_sms.0';
- $this->client->smsCampaigns->sendTestSms(
- 1000000,
- new SendTestSmsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.send_test_sms.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smsCampaigns/1000000/sendTest",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateSmsCampaignStatus(): void {
- $testId = 'sms_campaigns.update_sms_campaign_status.0';
- $this->client->smsCampaigns->updateSmsCampaignStatus(
- 1000000,
- new UpdateSmsCampaignStatusRequest([
- 'body' => new UpdateCampaignStatus([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_campaigns.update_sms_campaign_status.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/smsCampaigns/1000000/status",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/SmsTemplatesWireTest.php b/tests/Wire/SmsTemplatesWireTest.php
deleted file mode 100644
index 0c1ca230..00000000
--- a/tests/Wire/SmsTemplatesWireTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-client->smsTemplates->getSmsTemplates(
- new GetSmsTemplatesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'sms_templates.get_sms_templates.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/transactionalSMS/templates",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/TasksWireTest.php b/tests/Wire/TasksWireTest.php
deleted file mode 100644
index 03fdbbf8..00000000
--- a/tests/Wire/TasksWireTest.php
+++ /dev/null
@@ -1,163 +0,0 @@
-client->tasks->getAllTasks(
- new GetCrmTasksRequest([
- 'sortBy' => 'name',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tasks.get_all_tasks.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/tasks",
- ['sortBy' => 'name'],
- 1
- );
- }
-
- /**
- */
- public function testCreateATask(): void {
- $testId = 'tasks.create_a_task.0';
- $this->client->tasks->createATask(
- new PostCrmTasksRequest([
- 'date' => new DateTime('2021-11-01T17:44:54Z'),
- 'name' => 'Task: Connect with client_dev',
- 'taskTypeId' => '61a5cd07ca1347c82306ad09',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tasks.create_a_task.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/crm/tasks",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetATask(): void {
- $testId = 'tasks.get_a_task.0';
- $this->client->tasks->getATask(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'tasks.get_a_task.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/tasks/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteATask(): void {
- $testId = 'tasks.delete_a_task.0';
- $this->client->tasks->deleteATask(
- 'id',
- [
- 'headers' => [
- 'X-Test-Id' => 'tasks.delete_a_task.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/crm/tasks/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateATask(): void {
- $testId = 'tasks.update_a_task.0';
- $this->client->tasks->updateATask(
- 'id',
- new PatchCrmTasksIdRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tasks.update_a_task.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PATCH",
- "/crm/tasks/id",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAllTaskTypes(): void {
- $testId = 'tasks.get_all_task_types.0';
- $this->client->tasks->getAllTaskTypes(
- [
- 'headers' => [
- 'X-Test-Id' => 'tasks.get_all_task_types.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/crm/tasktypes",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/TierWireTest.php b/tests/Wire/TierWireTest.php
deleted file mode 100644
index e218e6ff..00000000
--- a/tests/Wire/TierWireTest.php
+++ /dev/null
@@ -1,286 +0,0 @@
-client->tier->addSubscriptionToTier(
- 'pid',
- 'cid',
- 'tid',
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.add_subscription_to_tier.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/tier/programs/pid/contacts/cid/tiers/tid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetListOfTierGroups(): void {
- $testId = 'tier.get_list_of_tier_groups.0';
- $this->client->tier->getListOfTierGroups(
- 'pid',
- new GetListOfTierGroupsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.get_list_of_tier_groups.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/tier/programs/pid/tier-groups",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateTierGroup(): void {
- $testId = 'tier.create_tier_group.0';
- $this->client->tier->createTierGroup(
- 'pid',
- new CreateTierGroupRequest([
- 'name' => 'name',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.create_tier_group.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/tier/programs/pid/tier-groups",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetTierGroup(): void {
- $testId = 'tier.get_tier_group.0';
- $this->client->tier->getTierGroup(
- 'pid',
- 'gid',
- new GetTierGroupRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.get_tier_group.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/tier/programs/pid/tier-groups/gid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateTierGroup(): void {
- $testId = 'tier.update_tier_group.0';
- $this->client->tier->updateTierGroup(
- 'pid',
- 'gid',
- new UpdateTierGroupRequest([
- 'downgradeStrategy' => UpdateTierGroupRequestDowngradeStrategy::RealTime->value,
- 'name' => 'name',
- 'tierOrder' => [
- 'tierOrder',
- ],
- 'upgradeStrategy' => UpdateTierGroupRequestUpgradeStrategy::RealTime->value,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.update_tier_group.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/loyalty/tier/programs/pid/tier-groups/gid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteTierGroup(): void {
- $testId = 'tier.delete_tier_group.0';
- $this->client->tier->deleteTierGroup(
- 'pid',
- 'gid',
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.delete_tier_group.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/loyalty/tier/programs/pid/tier-groups/gid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateTierForTierGroup(): void {
- $testId = 'tier.create_tier_for_tier_group.0';
- $this->client->tier->createTierForTierGroup(
- 'pid',
- 'gid',
- new CreateTierForTierGroupRequest([
- 'accessConditions' => [
- new CreateTierForTierGroupRequestAccessConditionsItem([]),
- ],
- 'name' => 'name',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.create_tier_for_tier_group.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/loyalty/tier/programs/pid/tier-groups/gid/tiers",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetLoyaltyProgramTier(): void {
- $testId = 'tier.get_loyalty_program_tier.0';
- $this->client->tier->getLoyaltyProgramTier(
- 'pid',
- new GetLoyaltyProgramTierRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.get_loyalty_program_tier.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/loyalty/tier/programs/pid/tiers",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateTier(): void {
- $testId = 'tier.update_tier.0';
- $this->client->tier->updateTier(
- 'pid',
- 'tid',
- new UpdateTierRequest([
- 'accessConditions' => [
- new UpdateTierRequestAccessConditionsItem([]),
- ],
- 'name' => 'name',
- 'tierRewards' => [
- new UpdateTierRequestTierRewardsItem([]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.update_tier.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/loyalty/tier/programs/pid/tiers/tid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteTier(): void {
- $testId = 'tier.delete_tier.0';
- $this->client->tier->deleteTier(
- 'pid',
- 'tid',
- [
- 'headers' => [
- 'X-Test-Id' => 'tier.delete_tier.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/loyalty/tier/programs/pid/tiers/tid",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/TransactionalEmailsWireTest.php b/tests/Wire/TransactionalEmailsWireTest.php
deleted file mode 100644
index 4d9ceef7..00000000
--- a/tests/Wire/TransactionalEmailsWireTest.php
+++ /dev/null
@@ -1,535 +0,0 @@
-client->transactionalEmails->getTransacBlockedContacts(
- new GetTransacBlockedContactsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_transac_blocked_contacts.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/blockedContacts",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUnblockOrResubscribeATransactionalContact(): void {
- $testId = 'transactional_emails.unblock_or_resubscribe_a_transactional_contact.0';
- $this->client->transactionalEmails->unblockOrResubscribeATransactionalContact(
- 'email',
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.unblock_or_resubscribe_a_transactional_contact.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/smtp/blockedContacts/email",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetBlockedDomains(): void {
- $testId = 'transactional_emails.get_blocked_domains.0';
- $this->client->transactionalEmails->getBlockedDomains(
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_blocked_domains.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/blockedDomains",
- null,
- 1
- );
- }
-
- /**
- */
- public function testBlockNewDomain(): void {
- $testId = 'transactional_emails.block_new_domain.0';
- $this->client->transactionalEmails->blockNewDomain(
- new BlockNewDomainRequest([
- 'domain' => 'example.com',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.block_new_domain.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smtp/blockedDomains",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteBlockedDomain(): void {
- $testId = 'transactional_emails.delete_blocked_domain.0';
- $this->client->transactionalEmails->deleteBlockedDomain(
- 'domain',
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.delete_blocked_domain.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/smtp/blockedDomains/domain",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteHardbounces(): void {
- $testId = 'transactional_emails.delete_hardbounces.0';
- $this->client->transactionalEmails->deleteHardbounces(
- new DeleteHardbouncesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.delete_hardbounces.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smtp/deleteHardbounces",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendTransacEmail(): void {
- $testId = 'transactional_emails.send_transac_email.0';
- $this->client->transactionalEmails->sendTransacEmail(
- new SendTransacEmailRequest([
- 'htmlContent' => 'Hello,
This is my first transactional email sent from Brevo.',
- 'sender' => new SendTransacEmailRequestSender([
- 'email' => 'hello@brevo.com',
- 'name' => 'Alex from Brevo',
- ]),
- 'subject' => 'Hello from Brevo!',
- 'to' => [
- new SendTransacEmailRequestToItem([
- 'email' => 'johndoe@example.com',
- 'name' => 'John Doe',
- ]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.send_transac_email.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smtp/email",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteScheduledEmailById(): void {
- $testId = 'transactional_emails.delete_scheduled_email_by_id.0';
- $this->client->transactionalEmails->deleteScheduledEmailById(
- '4320f270-a4e3-4a2e-b591-edfe30a5e627',
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.delete_scheduled_email_by_id.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/smtp/email/4320f270-a4e3-4a2e-b591-edfe30a5e627",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetScheduledEmailById(): void {
- $testId = 'transactional_emails.get_scheduled_email_by_id.0';
- $this->client->transactionalEmails->getScheduledEmailById(
- '4320f270-a4e3-4a2e-b591-edfe30a5e627',
- new GetScheduledEmailByIdRequest([
- 'startDate' => new DateTime('2022-02-02'),
- 'endDate' => new DateTime('2022-03-02'),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_scheduled_email_by_id.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/emailStatus/4320f270-a4e3-4a2e-b591-edfe30a5e627",
- ['startDate' => '2022-02-02', 'endDate' => '2022-03-02'],
- 1
- );
- }
-
- /**
- */
- public function testGetTransacEmailsList(): void {
- $testId = 'transactional_emails.get_transac_emails_list.0';
- $this->client->transactionalEmails->getTransacEmailsList(
- new GetTransacEmailsListRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_transac_emails_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/emails",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetTransacEmailContent(): void {
- $testId = 'transactional_emails.get_transac_email_content.0';
- $this->client->transactionalEmails->getTransacEmailContent(
- 'uuid',
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_transac_email_content.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/emails/uuid",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteAnSmtpTransactionalLog(): void {
- $testId = 'transactional_emails.delete_an_smtp_transactional_log.0';
- $this->client->transactionalEmails->deleteAnSmtpTransactionalLog(
- 'identifier',
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.delete_an_smtp_transactional_log.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/smtp/log/identifier",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetAggregatedSmtpReport(): void {
- $testId = 'transactional_emails.get_aggregated_smtp_report.0';
- $this->client->transactionalEmails->getAggregatedSmtpReport(
- new GetAggregatedSmtpReportRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_aggregated_smtp_report.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/statistics/aggregatedReport",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetEmailEventReport(): void {
- $testId = 'transactional_emails.get_email_event_report.0';
- $this->client->transactionalEmails->getEmailEventReport(
- new GetEmailEventReportRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_email_event_report.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/statistics/events",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSmtpReport(): void {
- $testId = 'transactional_emails.get_smtp_report.0';
- $this->client->transactionalEmails->getSmtpReport(
- new GetSmtpReportRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_smtp_report.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/statistics/reports",
- null,
- 1
- );
- }
-
- /**
- */
- public function testPostPreviewSmtpEmailTemplates(): void {
- $testId = 'transactional_emails.post_preview_smtp_email_templates.0';
- $this->client->transactionalEmails->postPreviewSmtpEmailTemplates(
- [
- 'key' => "value",
- ],
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.post_preview_smtp_email_templates.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smtp/template/preview",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSmtpTemplates(): void {
- $testId = 'transactional_emails.get_smtp_templates.0';
- $this->client->transactionalEmails->getSmtpTemplates(
- new GetSmtpTemplatesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_smtp_templates.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/templates",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateSmtpTemplate(): void {
- $testId = 'transactional_emails.create_smtp_template.0';
- $this->client->transactionalEmails->createSmtpTemplate(
- new CreateSmtpTemplateRequest([
- 'sender' => new CreateSmtpTemplateRequestSender([]),
- 'subject' => 'Thanks for your purchase !',
- 'templateName' => 'Order Confirmation - EN',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.create_smtp_template.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smtp/templates",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSmtpTemplate(): void {
- $testId = 'transactional_emails.get_smtp_template.0';
- $this->client->transactionalEmails->getSmtpTemplate(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.get_smtp_template.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/smtp/templates/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateSmtpTemplate(): void {
- $testId = 'transactional_emails.update_smtp_template.0';
- $this->client->transactionalEmails->updateSmtpTemplate(
- 1000000,
- new UpdateSmtpTemplateRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.update_smtp_template.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/smtp/templates/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteSmtpTemplate(): void {
- $testId = 'transactional_emails.delete_smtp_template.0';
- $this->client->transactionalEmails->deleteSmtpTemplate(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.delete_smtp_template.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/smtp/templates/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendTestTemplate(): void {
- $testId = 'transactional_emails.send_test_template.0';
- $this->client->transactionalEmails->sendTestTemplate(
- 1000000,
- new SendTestTemplateRequest([
- 'body' => new SendTestEmail([]),
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_emails.send_test_template.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/smtp/templates/1000000/sendTest",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/TransactionalSmsWireTest.php b/tests/Wire/TransactionalSmsWireTest.php
deleted file mode 100644
index c4e39c56..00000000
--- a/tests/Wire/TransactionalSmsWireTest.php
+++ /dev/null
@@ -1,142 +0,0 @@
-client->transactionalSms->sendAsyncTransactionalSms(
- new SendTransacSms([
- 'recipient' => '33689965433',
- 'sender' => 'MyShop',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_sms.send_async_transactional_sms.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/transactionalSMS/send",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendTransacSms(): void {
- $testId = 'transactional_sms.send_transac_sms.0';
- $this->client->transactionalSms->sendTransacSms(
- new SendTransacSms([
- 'recipient' => '33689965433',
- 'sender' => 'MyShop',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_sms.send_transac_sms.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/transactionalSMS/sms",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetTransacAggregatedSmsReport(): void {
- $testId = 'transactional_sms.get_transac_aggregated_sms_report.0';
- $this->client->transactionalSms->getTransacAggregatedSmsReport(
- new GetTransacAggregatedSmsReportRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_sms.get_transac_aggregated_sms_report.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/transactionalSMS/statistics/aggregatedReport",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetSmsEvents(): void {
- $testId = 'transactional_sms.get_sms_events.0';
- $this->client->transactionalSms->getSmsEvents(
- new GetSmsEventsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_sms.get_sms_events.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/transactionalSMS/statistics/events",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetTransacSmsReport(): void {
- $testId = 'transactional_sms.get_transac_sms_report.0';
- $this->client->transactionalSms->getTransacSmsReport(
- new GetTransacSmsReportRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_sms.get_transac_sms_report.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/transactionalSMS/statistics/reports",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/TransactionalWhatsAppWireTest.php b/tests/Wire/TransactionalWhatsAppWireTest.php
deleted file mode 100644
index c314a171..00000000
--- a/tests/Wire/TransactionalWhatsAppWireTest.php
+++ /dev/null
@@ -1,77 +0,0 @@
-client->transactionalWhatsApp->sendWhatsappMessage(
- new SendWhatsappMessageRequestParams([
- 'contactNumbers' => [
- 'contactNumbers',
- ],
- 'senderNumber' => 'senderNumber',
- 'templateId' => 123,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_whats_app.send_whatsapp_message.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/whatsapp/sendMessage",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetWhatsappEventReport(): void {
- $testId = 'transactional_whats_app.get_whatsapp_event_report.0';
- $this->client->transactionalWhatsApp->getWhatsappEventReport(
- new GetWhatsappEventReportRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'transactional_whats_app.get_whatsapp_event_report.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/whatsapp/statistics/events",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/UserWireTest.php b/tests/Wire/UserWireTest.php
deleted file mode 100644
index 1ec6df3b..00000000
--- a/tests/Wire/UserWireTest.php
+++ /dev/null
@@ -1,168 +0,0 @@
-client->user->getInvitedUsersList(
- [
- 'headers' => [
- 'X-Test-Id' => 'user.get_invited_users_list.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/organization/invited/users",
- null,
- 1
- );
- }
-
- /**
- */
- public function testPutRevokeUserPermission(): void {
- $testId = 'user.put_revoke_user_permission.0';
- $this->client->user->putRevokeUserPermission(
- 'email',
- [
- 'headers' => [
- 'X-Test-Id' => 'user.put_revoke_user_permission.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/organization/user/invitation/revoke/email",
- null,
- 1
- );
- }
-
- /**
- */
- public function testInviteuser(): void {
- $testId = 'user.inviteuser.0';
- $this->client->user->inviteuser(
- new Inviteuser([
- 'allFeaturesAccess' => true,
- 'email' => 'inviteuser@example.com',
- 'privileges' => [
- new InviteuserPrivilegesItem([]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'user.inviteuser.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/organization/user/invitation/send",
- null,
- 1
- );
- }
-
- /**
- */
- public function testPutresendcancelinvitation(): void {
- $testId = 'user.putresendcancelinvitation.0';
- $this->client->user->putresendcancelinvitation(
- PutresendcancelinvitationRequestAction::Resend->value,
- 'email',
- [
- 'headers' => [
- 'X-Test-Id' => 'user.putresendcancelinvitation.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/organization/user/invitation/resend/email",
- null,
- 1
- );
- }
-
- /**
- */
- public function testEditUserPermission(): void {
- $testId = 'user.edit_user_permission.0';
- $this->client->user->editUserPermission(
- new Inviteuser([
- 'allFeaturesAccess' => true,
- 'email' => 'inviteuser@example.com',
- 'privileges' => [
- new InviteuserPrivilegesItem([]),
- ],
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'user.edit_user_permission.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/organization/user/update/permissions",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetUserPermission(): void {
- $testId = 'user.get_user_permission.0';
- $this->client->user->getUserPermission(
- 'email',
- [
- 'headers' => [
- 'X-Test-Id' => 'user.get_user_permission.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/organization/user/email/permissions",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/WebhooksWireTest.php b/tests/Wire/WebhooksWireTest.php
deleted file mode 100644
index 699e9b7f..00000000
--- a/tests/Wire/WebhooksWireTest.php
+++ /dev/null
@@ -1,170 +0,0 @@
-client->webhooks->getWebhooks(
- new GetWebhooksRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'webhooks.get_webhooks.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/webhooks",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateWebhook(): void {
- $testId = 'webhooks.create_webhook.0';
- $this->client->webhooks->createWebhook(
- new CreateWebhookRequest([
- 'events' => [
- CreateWebhookRequestEventsItem::Sent->value,
- ],
- 'url' => 'http://requestb.in/173lyyx1',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'webhooks.create_webhook.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/webhooks",
- null,
- 1
- );
- }
-
- /**
- */
- public function testExportWebhooksHistory(): void {
- $testId = 'webhooks.export_webhooks_history.0';
- $this->client->webhooks->exportWebhooksHistory(
- new ExportWebhooksHistoryRequest([
- 'event' => ExportWebhooksHistoryRequestEvent::InvalidParameter->value,
- 'notifyUrl' => 'https://brevo.com',
- 'type' => ExportWebhooksHistoryRequestType::Transactional->value,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'webhooks.export_webhooks_history.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/webhooks/export",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetWebhook(): void {
- $testId = 'webhooks.get_webhook.0';
- $this->client->webhooks->getWebhook(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'webhooks.get_webhook.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/webhooks/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateWebhook(): void {
- $testId = 'webhooks.update_webhook.0';
- $this->client->webhooks->updateWebhook(
- 1000000,
- new UpdateWebhookRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'webhooks.update_webhook.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/webhooks/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteWebhook(): void {
- $testId = 'webhooks.delete_webhook.0';
- $this->client->webhooks->deleteWebhook(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'webhooks.delete_webhook.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/webhooks/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/WhatsAppCampaignsWireTest.php b/tests/Wire/WhatsAppCampaignsWireTest.php
deleted file mode 100644
index 82d1ce21..00000000
--- a/tests/Wire/WhatsAppCampaignsWireTest.php
+++ /dev/null
@@ -1,233 +0,0 @@
-client->whatsAppCampaigns->getWhatsAppCampaigns(
- new GetWhatsAppCampaignsRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.get_whats_app_campaigns.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/whatsappCampaigns",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateWhatsAppCampaign(): void {
- $testId = 'whats_app_campaigns.create_whats_app_campaign.0';
- $this->client->whatsAppCampaigns->createWhatsAppCampaign(
- new CreateWhatsAppCampaignRequest([
- 'name' => 'Test Campaign',
- 'recipients' => new CreateWhatsAppCampaignRequestRecipients([]),
- 'scheduledAt' => '2017-06-01T12:30:00+02:00',
- 'templateId' => 19,
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.create_whats_app_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/whatsappCampaigns",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetWhatsAppConfig(): void {
- $testId = 'whats_app_campaigns.get_whats_app_config.0';
- $this->client->whatsAppCampaigns->getWhatsAppConfig(
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.get_whats_app_config.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/whatsappCampaigns/config",
- null,
- 1
- );
- }
-
- /**
- */
- public function testCreateWhatsAppTemplate(): void {
- $testId = 'whats_app_campaigns.create_whats_app_template.0';
- $this->client->whatsAppCampaigns->createWhatsAppTemplate(
- new CreateWhatsAppTemplateRequest([
- 'bodyText' => 'making it look like readable English',
- 'category' => CreateWhatsAppTemplateRequestCategory::Marketing->value,
- 'language' => 'en',
- 'name' => 'Test template',
- ]),
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.create_whats_app_template.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/whatsappCampaigns/template",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetWhatsAppTemplates(): void {
- $testId = 'whats_app_campaigns.get_whats_app_templates.0';
- $this->client->whatsAppCampaigns->getWhatsAppTemplates(
- new GetWhatsAppTemplatesRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.get_whats_app_templates.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/whatsappCampaigns/template-list",
- null,
- 1
- );
- }
-
- /**
- */
- public function testSendWhatsAppTemplateApproval(): void {
- $testId = 'whats_app_campaigns.send_whats_app_template_approval.0';
- $this->client->whatsAppCampaigns->sendWhatsAppTemplateApproval(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.send_whats_app_template_approval.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "POST",
- "/whatsappCampaigns/template/approval/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testGetWhatsAppCampaign(): void {
- $testId = 'whats_app_campaigns.get_whats_app_campaign.0';
- $this->client->whatsAppCampaigns->getWhatsAppCampaign(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.get_whats_app_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "GET",
- "/whatsappCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testUpdateWhatsAppCampaign(): void {
- $testId = 'whats_app_campaigns.update_whats_app_campaign.0';
- $this->client->whatsAppCampaigns->updateWhatsAppCampaign(
- 1000000,
- new UpdateWhatsAppCampaignRequest([]),
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.update_whats_app_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "PUT",
- "/whatsappCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- public function testDeleteWhatsAppCampaign(): void {
- $testId = 'whats_app_campaigns.delete_whats_app_campaign.0';
- $this->client->whatsAppCampaigns->deleteWhatsAppCampaign(
- 1000000,
- [
- 'headers' => [
- 'X-Test-Id' => 'whats_app_campaigns.delete_whats_app_campaign.0',
- ],
- ],
- );
- $this->verifyRequestCount(
- $testId,
- "DELETE",
- "/whatsappCampaigns/1000000",
- null,
- 1
- );
- }
-
- /**
- */
- protected function setUp(): void {
- parent::setUp();
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $this->client = new Brevo(
- apiKey: 'test-apiKey',
- options: [
- 'baseUrl' => $wiremockUrl,
- ],
- );
- }
-}
diff --git a/tests/Wire/WireMockTestCase.php b/tests/Wire/WireMockTestCase.php
deleted file mode 100644
index 47d23071..00000000
--- a/tests/Wire/WireMockTestCase.php
+++ /dev/null
@@ -1,80 +0,0 @@
-|null $queryParams Query parameters to match
- * @param int $expected Expected number of requests
- */
- protected function verifyRequestCount(
- string $testId,
- string $method,
- string $urlPath,
- ?array $queryParams,
- int $expected
- ): void {
- $client = Psr18ClientDiscovery::find();
- $requestFactory = Psr17FactoryDiscovery::findRequestFactory();
- $streamFactory = Psr17FactoryDiscovery::findStreamFactory();
-
- $body = [
- 'method' => $method,
- 'urlPath' => $urlPath,
- 'headers' => [
- 'X-Test-Id' => ['equalTo' => $testId],
- ],
- ];
- if ($queryParams !== null && $queryParams !== []) {
- $body['queryParameters'] = [];
- foreach ($queryParams as $k => $v) {
- $body['queryParameters'][$k] = ['equalTo' => (string) $v];
- }
- }
-
- $wiremockUrl = getenv('WIREMOCK_URL') ?: 'http://localhost:8080';
- $request = $requestFactory->createRequest('POST', $wiremockUrl . '/__admin/requests/find')
- ->withHeader('Content-Type', 'application/json')
- ->withBody($streamFactory->createStream(JsonEncoder::encode($body)));
- $response = $client->sendRequest($request);
-
- $this->assertSame(200, $response->getStatusCode(), 'Failed to query WireMock requests');
-
- $json = json_decode((string) $response->getBody(), true);
-
- // Ensure we have an array; otherwise, fail the test.
- if (!is_array($json)) {
- $this->fail('Expected WireMock to return a JSON object.');
- }
-
- /** @var array $json */
- $requests = [];
- if (isset($json['requests']) && is_array($json['requests'])) {
- $requests = $json['requests'];
- }
-
- /** @var array $requests */
- $this->assertCount(
- $expected,
- $requests,
- sprintf('Expected %d requests, found %d', $expected, count($requests))
- );
- }
-}
diff --git a/tests/Wire/bootstrap.php b/tests/Wire/bootstrap.php
deleted file mode 100644
index 20026664..00000000
--- a/tests/Wire/bootstrap.php
+++ /dev/null
@@ -1,55 +0,0 @@
-&1',
- escapeshellarg($dockerComposeFile)
-);
-exec($cmd, $output, $exitCode);
-if ($exitCode !== 0) {
- throw new \RuntimeException("Failed to start WireMock: " . implode("\n", $output));
-}
-
-// Discover the dynamically assigned port
-$portCmd = sprintf(
- 'docker compose -f %s port wiremock 8080 2>&1',
- escapeshellarg($dockerComposeFile)
-);
-exec($portCmd, $portOutput, $portExitCode);
-if ($portExitCode === 0 && !empty($portOutput[0])) {
- $parts = explode(':', $portOutput[0]);
- $port = end($parts);
- putenv("WIREMOCK_URL=http://localhost:{$port}");
- echo "WireMock container is ready on port {$port}\n";
-} else {
- putenv('WIREMOCK_URL=http://localhost:8080');
- echo "WireMock container is ready (default port 8080)\n";
-}
-
-// Register shutdown function to stop the container after all tests complete
-register_shutdown_function(function () use ($dockerComposeFile) {
- echo "\nStopping WireMock container...\n";
- $cmd = sprintf(
- 'docker compose -f %s down -v 2>&1',
- escapeshellarg($dockerComposeFile)
- );
- exec($cmd);
-});
diff --git a/wiremock/docker-compose.test.yml b/wiremock/docker-compose.test.yml
deleted file mode 100644
index 58747d54..00000000
--- a/wiremock/docker-compose.test.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-services:
- wiremock:
- image: wiremock/wiremock:3.9.1
- ports:
- - "0:8080" # Use dynamic port to avoid conflicts with concurrent tests
- volumes:
- - ./wiremock-mappings.json:/home/wiremock/mappings/wiremock-mappings.json
- command: ["--global-response-templating", "--verbose"]
- healthcheck:
- test: ["CMD", "curl", "-f", "http://localhost:8080/__admin/health"]
- interval: 2s
- timeout: 5s
- retries: 15
- start_period: 5s