Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cliVersion": "4.46.0",
"cliVersion": "4.65.2",
"generatorName": "fernapi/fern-php-sdk",
"generatorVersion": "2.2.3",
"generatorVersion": "2.4.0",
"generatorConfig": {
"clientName": "Brevo",
"namespace": "Brevo",
Expand All @@ -20,6 +20,6 @@
"generateClientInterfaces": true,
"useDefaultRequestParameterValues": true
},
"originGitCommit": "f25a5c52b4f8c7fb0eab7532cf4d3032bce1c05c",
"sdkVersion": "4.0.12"
"originGitCommit": "d2e18d0bd27160206c8251e11269b139a3b4ea10",
"sdkVersion": "4.0.13"
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "getbrevo/brevo-php",
"version": "4.0.12",
"version": "4.0.13",
"description": "Official PHP SDK for the Brevo API.",
"keywords": [
"brevo",
Expand Down
4 changes: 2 additions & 2 deletions src/Brevo.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ public function __construct(
'api-key' => $apiKey,
'X-Fern-Language' => 'PHP',
'X-Fern-SDK-Name' => 'Brevo',
'X-Fern-SDK-Version' => '4.0.12',
'User-Agent' => 'getbrevo/brevo-php/4.0.12',
'X-Fern-SDK-Version' => '4.0.13',
'User-Agent' => 'getbrevo/brevo-php/4.0.13',
];

$this->options = $options ?? [];
Expand Down
4 changes: 3 additions & 1 deletion src/Contacts/Requests/CreateContactRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ class CreateContactRequest extends JsonSerializableType
/**
* @var ?array<string, (
* float
* |int
* |string
* |bool
* |array<string>
* )> $attributes Pass the set of attributes and their values. The attribute's parameter should be passed in capital letter while creating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored. **These attributes must be present in your Brevo account**. For eg: **{"FNAME":"Elly", "LNAME":"Roger", "COUNTRIES": ["India","China"]}**
*/
#[JsonProperty('attributes'), ArrayType(['string' => new Union('float', 'string', 'bool', ['string'])])]
#[JsonProperty('attributes'), ArrayType(['string' => new Union('float', 'integer', 'string', 'bool', ['string'])])]
public ?array $attributes;

/**
Expand Down Expand Up @@ -66,6 +67,7 @@ class CreateContactRequest extends JsonSerializableType
* @param array{
* attributes?: ?array<string, (
* float
* |int
* |string
* |bool
* |array<string>
Expand Down
4 changes: 3 additions & 1 deletion src/Contacts/Requests/UpdateContactRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ class UpdateContactRequest extends JsonSerializableType
/**
* @var ?array<string, (
* float
* |int
* |string
* |bool
* |array<string>
* )> $attributes Pass the set of attributes to be updated. **These attributes must be present in your account**. To update existing email address of a contact with the new one please pass EMAIL in attributes. For example, **{ "EMAIL":"[email protected]", "FNAME":"Ellie", "LNAME":"Roger", "COUNTRIES":["India","China"]}**. The attribute's parameter should be passed in capital letter while updating a contact. Values that don't match the attribute type (e.g. text or string in a date attribute) will be ignored .Keep in mind transactional attributes can be updated the same way as normal attributes. Mobile Number in **SMS** field should be passed with proper country code. For example: **{"SMS":"+91xxxxxxxxxx"} or {"SMS":"0091xxxxxxxxxx"}**
*/
#[JsonProperty('attributes'), ArrayType(['string' => new Union('float', 'string', 'bool', ['string'])])]
#[JsonProperty('attributes'), ArrayType(['string' => new Union('float', 'integer', 'string', 'bool', ['string'])])]
public ?array $attributes;

/**
Expand Down Expand Up @@ -67,6 +68,7 @@ class UpdateContactRequest extends JsonSerializableType
* identifierType?: ?value-of<UpdateContactRequestIdentifierType>,
* attributes?: ?array<string, (
* float
* |int
* |string
* |bool
* |array<string>
Expand Down
14 changes: 7 additions & 7 deletions src/Core/Json/JsonDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function decodeString(string $json): string
{
$decoded = self::decode($json);
if (!is_string($decoded)) {
throw new JsonException("Unexpected non-string json value: " . $json);
throw new JsonException("Unexpected non-string json value: $json");
}
return $decoded;
}
Expand All @@ -36,7 +36,7 @@ public static function decodeBool(string $json): bool
{
$decoded = self::decode($json);
if (!is_bool($decoded)) {
throw new JsonException("Unexpected non-boolean json value: " . $json);
throw new JsonException("Unexpected non-boolean json value: $json");
}
return $decoded;
}
Expand All @@ -52,7 +52,7 @@ public static function decodeDateTime(string $json): DateTime
{
$decoded = self::decode($json);
if (!is_string($decoded)) {
throw new JsonException("Unexpected non-string json value for datetime: " . $json);
throw new JsonException("Unexpected non-string json value for datetime: $json");
}
return JsonDeserializer::deserializeDateTime($decoded);
}
Expand All @@ -68,7 +68,7 @@ public static function decodeDate(string $json): DateTime
{
$decoded = self::decode($json);
if (!is_string($decoded)) {
throw new JsonException("Unexpected non-string json value for date: " . $json);
throw new JsonException("Unexpected non-string json value for date: $json");
}
return JsonDeserializer::deserializeDate($decoded);
}
Expand All @@ -84,7 +84,7 @@ public static function decodeFloat(string $json): float
{
$decoded = self::decode($json);
if (!is_float($decoded)) {
throw new JsonException("Unexpected non-float json value: " . $json);
throw new JsonException("Unexpected non-float json value: $json");
}
return $decoded;
}
Expand All @@ -100,7 +100,7 @@ public static function decodeInt(string $json): int
{
$decoded = self::decode($json);
if (!is_int($decoded)) {
throw new JsonException("Unexpected non-integer json value: " . $json);
throw new JsonException("Unexpected non-integer json value: $json");
}
return $decoded;
}
Expand All @@ -117,7 +117,7 @@ public static function decodeArray(string $json, array $type): array
{
$decoded = self::decode($json);
if (!is_array($decoded)) {
throw new JsonException("Unexpected non-array json value: " . $json);
throw new JsonException("Unexpected non-array json value: $json");
}
return JsonDeserializer::deserializeArray($decoded, $type);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Json/JsonDeserializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public static function deserializeUnion(mixed $data, Union $type): mixed
}
$readableType = Utils::getReadableType($data);
throw new JsonException(
"Cannot deserialize value of type $readableType with any of the union types: " . $type
"Cannot deserialize value of type $readableType with any of the union types: $type"
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Json/JsonSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static function serializeUnion(mixed $data, Union $unionType): mixed
}
$readableType = Utils::getReadableType($data);
throw new JsonException(
"Cannot serialize value of type $readableType with any of the union types: " . $unionType
"Cannot serialize value of type $readableType with any of the union types: $unionType"
);
}

Expand Down
14 changes: 7 additions & 7 deletions src/Ecommerce/Types/CreateBatchOrderResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
class CreateBatchOrderResponse extends JsonSerializableType
{
/**
* @var ?int $count Number of orders
* @var float $batchId Batch ID of the request
*/
#[JsonProperty('count')]
public ?int $count;
#[JsonProperty('batchId')]
public float $batchId;

/**
* @var float $batchId Batch ID of the request
* @var ?int $count Number of orders
*/
#[JsonProperty('batch_id')]
public float $batchId;
#[JsonProperty('count')]
public ?int $count;

/**
* @param array{
Expand All @@ -28,8 +28,8 @@ class CreateBatchOrderResponse extends JsonSerializableType
public function __construct(
array $values,
) {
$this->count = $values['count'] ?? null;
$this->batchId = $values['batchId'];
$this->count = $values['count'] ?? null;
}

/**
Expand Down
8 changes: 6 additions & 2 deletions src/Event/Requests/CreateEventRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ class CreateEventRequest extends JsonSerializableType
* @var ?array<string, (
* string
* |int
* |bool
* )> $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')])]
#[JsonProperty('contact_properties'), ArrayType(['string' => new Union('string', 'integer', 'bool')])]
public ?array $contactProperties;

/**
Expand All @@ -36,11 +37,12 @@ class CreateEventRequest extends JsonSerializableType
* @var ?array<string, (
* string
* |int
* |bool
* |array<string, mixed>
* |array<mixed>
* )> $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'])])]
#[JsonProperty('event_properties'), ArrayType(['string' => new Union('string', 'integer', 'bool', ['string' => 'mixed'], ['mixed'])])]
public ?array $eventProperties;

/**
Expand All @@ -62,11 +64,13 @@ class CreateEventRequest extends JsonSerializableType
* contactProperties?: ?array<string, (
* string
* |int
* |bool
* )>,
* eventDate?: ?string,
* eventProperties?: ?array<string, (
* string
* |int
* |bool
* |array<string, mixed>
* |array<mixed>
* )>,
Expand Down
8 changes: 6 additions & 2 deletions src/Event/Types/CreateBatchEventsRequestItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ class CreateBatchEventsRequestItem extends JsonSerializableType
* @var ?array<string, (
* string
* |int
* |bool
* )> $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')])]
#[JsonProperty('contact_properties'), ArrayType(['string' => new Union('string', 'integer', 'bool')])]
public ?array $contactProperties;

/**
Expand All @@ -34,11 +35,12 @@ class CreateBatchEventsRequestItem extends JsonSerializableType
* @var ?array<string, (
* string
* |int
* |bool
* |array<string, mixed>
* |array<mixed>
* )> $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'])])]
#[JsonProperty('event_properties'), ArrayType(['string' => new Union('string', 'integer', 'bool', ['string' => 'mixed'], ['mixed'])])]
public ?array $eventProperties;

/**
Expand All @@ -60,11 +62,13 @@ class CreateBatchEventsRequestItem extends JsonSerializableType
* contactProperties?: ?array<string, (
* string
* |int
* |bool
* )>,
* eventDate?: ?string,
* eventProperties?: ?array<string, (
* string
* |int
* |bool
* |array<string, mixed>
* |array<mixed>
* )>,
Expand Down
6 changes: 3 additions & 3 deletions src/Process/Types/GetProcessResponseInfoImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class GetProcessResponseInfoImport extends JsonSerializableType
public ?int $duplicateExtId;

/**
* @var ?int $duplicateEmailId Number of duplicate email IDs
* @var ?string $duplicateEmailId URL to CSV file containing duplicate email IDs, or null if none
*/
#[JsonProperty('duplicate_email_id')]
public ?int $duplicateEmailId;
public ?string $duplicateEmailId;

/**
* @var ?int $duplicatePhoneId Number of duplicate phone numbers
Expand All @@ -57,7 +57,7 @@ class GetProcessResponseInfoImport extends JsonSerializableType
* invalidEmails?: ?int,
* duplicateContactId?: ?int,
* duplicateExtId?: ?int,
* duplicateEmailId?: ?int,
* duplicateEmailId?: ?string,
* duplicatePhoneId?: ?int,
* duplicateWhatsappId?: ?int,
* duplicateLandlineNumberId?: ?int,
Expand Down
1 change: 1 addition & 0 deletions src/Process/Types/GetProcessResponseStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
enum GetProcessResponseStatus: string
{
case Queued = "queued";
case InProcess = "in_process";
case Processing = "processing";
case Completed = "completed";
case Failed = "failed";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class GetProcessesResponseProcessesItemInfoImport extends JsonSerializableType
public ?int $duplicateExtId;

/**
* @var ?int $duplicateEmailId Number of duplicate email IDs
* @var ?string $duplicateEmailId URL to CSV file containing duplicate email IDs, or null if none
*/
#[JsonProperty('duplicate_email_id')]
public ?int $duplicateEmailId;
public ?string $duplicateEmailId;

/**
* @var ?int $duplicatePhoneId Number of duplicate phone numbers
Expand All @@ -57,7 +57,7 @@ class GetProcessesResponseProcessesItemInfoImport extends JsonSerializableType
* invalidEmails?: ?int,
* duplicateContactId?: ?int,
* duplicateExtId?: ?int,
* duplicateEmailId?: ?int,
* duplicateEmailId?: ?string,
* duplicatePhoneId?: ?int,
* duplicateWhatsappId?: ?int,
* duplicateLandlineNumberId?: ?int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
enum GetProcessesResponseProcessesItemStatus: string
{
case Queued = "queued";
case InProcess = "in_process";
case Processing = "processing";
case Completed = "completed";
case Failed = "failed";
Expand Down
Loading