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
6 changes: 3 additions & 3 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cliVersion": "5.64.3",
"cliVersion": "5.92.1",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.64.1",
"generatorConfig": {
Expand All @@ -18,6 +18,6 @@
"skip_validation": true
}
},
"originGitCommit": "68600965b5cf1b4868a3929a76f0504425d951ad",
"sdkVersion": "5.0.1"
"originGitCommit": "f03678b950bc1ad4cb8f8de2037cc502935efaae",
"sdkVersion": "5.0.2"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

230 changes: 97 additions & 133 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "brevo-python"
version = "5.0.1"
version = "5.0.2"
description = ""
readme = "README.md"
authors = []
Expand Down
179 changes: 179 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6257,6 +6257,153 @@ client.custom_objects.batch_delete_object_records(
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.custom_objects.<a href="src/brevo/custom_objects/client.py">get_associated_records</a>(...) -> GetAssociatedRecordsResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

<Note title="Enterprise access only">Custom objects are only available to Enterprise plans.
This feature is in beta. These are subject to change.</Note>
Returns the records associated with a single source record. Associations of every type are returned together in one paginated list, ordered by association creation time with the most recently created association first.

**Identifying the source record**
Provide exactly one of `id`, `ext_id`, `email` or `sms`. Passing none of them, or more than one, returns `400`. `email` and `sms` are only accepted when `object_type` is `contact`; using either with any other object type returns `400`.

**Object types**
Use the object type exactly as it is defined in your account, for example `vehicle` for a custom object of that name, or `contact` for contacts. An object type that does not exist in your account returns `400`.

**Filtering by associated object type**
Use `type` to restrict the response to one or more associated object types, for example `?type=contact&type=garage`. Up to 5 types can be requested per call; more returns `400`. When `type` is omitted, associations of every type are returned.

**Pagination**
Results are returned 20 per page. The page size is fixed and cannot be changed. Increase `offset` by 20 to walk through the pages until `has_more` is `false`. An `offset` beyond the last record returns an empty `items` array with `has_more` set to `false`.

**Working with contacts**
- `contact` is supported both as the source `object_type` and as an associated object type.
- An `id`, `ext_id`, `email` or `sms` that matches no contact returns `404`.
- If several contacts share the same `ext_id`, `email` or `sms`, identify the contact by `id` to be sure of which one is used.
- Contacts returned in `items` carry all of the contact's attributes, with attribute keys in lowercase — `email`, `first_name`, `last_name`, `sms`, `ext_id`, and any other contact attribute lowercased.
- For contacts, `ext_id`, `created_at` and `updated_at` are not returned on `object`. A contact's external ID is available as `attributes.ext_id` when it is set.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```python
from brevo import Brevo
from brevo.environment import BrevoEnvironment

client = Brevo(
api_key="<value>",
environment=BrevoEnvironment.DEFAULT,
)

client.custom_objects.get_associated_records(
object_type="vehicle",
id=16789,
ext_id="507f1f77bc",
email="jane.doe@example.com",
sms="33612345678",
offset=0,
)

```
</dd>
</dl>
</dd>
</dl>

#### ⚙️ Parameters

<dl>
<dd>

<dl>
<dd>

**object_type:** `str` — Object type of the source record, exactly as defined in your account. Accepts any object type defined in the account, for example a custom object type or `contact`.

</dd>
</dl>

<dl>
<dd>

**id:** `typing.Optional[int]` — Internal Brevo ID of the source record. Must be a positive integer. Provide exactly one of `id`, `ext_id`, `email` or `sms`.

</dd>
</dl>

<dl>
<dd>

**ext_id:** `typing.Optional[str]` — External ID of the source record in your system. Provide exactly one of `id`, `ext_id`, `email` or `sms`.

</dd>
</dl>

<dl>
<dd>

**email:** `typing.Optional[str]` — Email address of the source contact. Only accepted when `object_type` is `contact`. Provide exactly one of `id`, `ext_id`, `email` or `sms`.

</dd>
</dl>

<dl>
<dd>

**sms:** `typing.Optional[str]` — Phone number of the source contact, including the country code. It may be given with or without a leading `+`; percent-encode the `+` as `%2B`, because a literal `+` in a query string is read as a space. Only accepted when `object_type` is `contact`. Provide exactly one of `id`, `ext_id`, `email` or `sms`.

</dd>
</dl>

<dl>
<dd>

**type:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — Restricts the response to the given associated object types. Repeat the parameter to request several types, for example `?type=contact&type=garage`. Maximum 5 types per call. Associations of every type are returned when omitted.

</dd>
</dl>

<dl>
<dd>

**offset:** `typing.Optional[int]` — Number of records to skip before the first record of the page. Defaults to 0. Increase by 20 to fetch the next page.

</dd>
</dl>

<dl>
<dd>

**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.

</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -19504,6 +19651,22 @@ client.email_campaigns.create_email_campaign(
<dl>
<dd>

**utm_content:** `typing.Optional[str]` — Customize the utm_content value. Appears on outgoing tracking links alongside utm_campaign. Only alphanumeric characters and spaces are allowed

</dd>
</dl>

<dl>
<dd>

**utm_term:** `typing.Optional[str]` — Customize the utm_term value. Appears on outgoing tracking links alongside utm_campaign. Only alphanumeric characters and spaces are allowed

</dd>
</dl>

<dl>
<dd>

**winner_criteria:** `typing.Optional[CreateEmailCampaignRequestWinnerCriteria]` — Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed

</dd>
Expand Down Expand Up @@ -20003,6 +20166,22 @@ client.email_campaigns.update_email_campaign(
<dl>
<dd>

**utm_content:** `typing.Optional[str]` — Customize the utm_content value. Appears on outgoing tracking links alongside utm_campaign. Only alphanumeric characters and spaces are allowed

</dd>
</dl>

<dl>
<dd>

**utm_term:** `typing.Optional[str]` — Customize the utm_term value. Appears on outgoing tracking links alongside utm_campaign. Only alphanumeric characters and spaces are allowed

</dd>
</dl>

<dl>
<dd>

**winner_criteria:** `typing.Optional[UpdateEmailCampaignRequestWinnerCriteria]` — Choose the metrics that will determinate the winning version. **Mandatory if _splitRule_ >= 1 and < 50**. If splitRule = 50, `winnerCriteria` is ignored if passed

</dd>
Expand Down
9 changes: 9 additions & 0 deletions src/brevo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@
BatchDeleteObjectRecordsRequestIdentifiersExtIds,
BatchDeleteObjectRecordsRequestIdentifiersIds,
BatchDeleteObjectRecordsResponse,
GetAssociatedRecordsResponse,
GetAssociatedRecordsResponseItemsItem,
GetAssociatedRecordsResponseItemsItemObject,
GetrecordsRequestAssociation,
GetrecordsRequestSort,
GetrecordsResponse,
Expand Down Expand Up @@ -1037,6 +1040,9 @@
"GetAllExternalFeedsResponseFeedsItem": ".external_feeds",
"GetAllExternalFeedsResponseFeedsItemAuthType": ".external_feeds",
"GetAllExternalFeedsResponseFeedsItemHeadersItem": ".external_feeds",
"GetAssociatedRecordsResponse": ".custom_objects",
"GetAssociatedRecordsResponseItemsItem": ".custom_objects",
"GetAssociatedRecordsResponseItemsItemObject": ".custom_objects",
"GetAttributesResponse": ".contacts",
"GetAttributesResponseAttributesItem": ".contacts",
"GetAttributesResponseAttributesItemCategory": ".contacts",
Expand Down Expand Up @@ -1851,6 +1857,9 @@ def __dir__():
"GetAllExternalFeedsResponseFeedsItem",
"GetAllExternalFeedsResponseFeedsItemAuthType",
"GetAllExternalFeedsResponseFeedsItemHeadersItem",
"GetAssociatedRecordsResponse",
"GetAssociatedRecordsResponseItemsItem",
"GetAssociatedRecordsResponseItemsItemObject",
"GetAttributesResponse",
"GetAttributesResponseAttributesItem",
"GetAttributesResponseAttributesItemCategory",
Expand Down
4 changes: 2 additions & 2 deletions src/brevo/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ def get_headers(self) -> typing.Dict[str, str]:
import platform

headers: typing.Dict[str, str] = {
"User-Agent": "brevo-python/5.0.1",
"User-Agent": "brevo-python/5.0.2",
"X-Fern-Language": "Python",
"X-Fern-Runtime": f"python/{platform.python_version()}",
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
"X-Fern-SDK-Name": "brevo-python",
"X-Fern-SDK-Version": "5.0.1",
"X-Fern-SDK-Version": "5.0.2",
**(self.get_custom_headers() or {}),
}
headers["api-key"] = self.api_key
Expand Down
9 changes: 9 additions & 0 deletions src/brevo/custom_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
BatchDeleteObjectRecordsRequestIdentifiersExtIds,
BatchDeleteObjectRecordsRequestIdentifiersIds,
BatchDeleteObjectRecordsResponse,
GetAssociatedRecordsResponse,
GetAssociatedRecordsResponseItemsItem,
GetAssociatedRecordsResponseItemsItemObject,
GetrecordsRequestAssociation,
GetrecordsRequestSort,
GetrecordsResponse,
Expand Down Expand Up @@ -42,6 +45,9 @@
"BatchDeleteObjectRecordsRequestIdentifiersExtIds": ".types",
"BatchDeleteObjectRecordsRequestIdentifiersIds": ".types",
"BatchDeleteObjectRecordsResponse": ".types",
"GetAssociatedRecordsResponse": ".types",
"GetAssociatedRecordsResponseItemsItem": ".types",
"GetAssociatedRecordsResponseItemsItemObject": ".types",
"GetrecordsRequestAssociation": ".types",
"GetrecordsRequestSort": ".types",
"GetrecordsResponse": ".types",
Expand Down Expand Up @@ -96,6 +102,9 @@ def __dir__():
"BatchDeleteObjectRecordsRequestIdentifiersExtIds",
"BatchDeleteObjectRecordsRequestIdentifiersIds",
"BatchDeleteObjectRecordsResponse",
"GetAssociatedRecordsResponse",
"GetAssociatedRecordsResponseItemsItem",
"GetAssociatedRecordsResponseItemsItemObject",
"GetrecordsRequestAssociation",
"GetrecordsRequestSort",
"GetrecordsResponse",
Expand Down
Loading
Loading