Skip to content

Commit 3bb25a3

Browse files
Merge pull request #363 from HubSpot/11.0.0
11.0.0
2 parents fbaa458 + 2c2a1a6 commit 3bb25a3

File tree

92 files changed

+6082
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+6082
-234
lines changed

Diff for: CHANGELOG.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,31 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v10.0.0...HEAD)
8+
## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v11.0.0...HEAD)
9+
10+
## [11.0.0](https://github.com/HubSpot/hubspot-api-python/compare/v10.0.0...v11.0.0) - 2024-11-27
11+
12+
## Associations
13+
14+
- Added `assiciations.v4.report_api` Api.
15+
- Added `assiciations.v4.schema.definition_configurations_api` Api.
16+
17+
## Marketing Events
18+
19+
- Added `marketing.events.list_associations_api` Api.
20+
- Renamed method `create_by_contact_email` to `record_by_contact_emails` in `marketing.events.attendance_subscriber_state_changes_api`.
21+
- Renamed method `create_by_contact_id` to `record_by_contact_ids` in `marketing.events.attendance_subscriber_state_changes_api`.
22+
- Remove parameters `attendance_state_calculation_timestamp` and `import_status` to `marketing.events.models.marketing_event_update_request_params`.
23+
24+
## Other changes
25+
26+
- Added `api_request` Api(for requests by curl).
27+
- Enhance `get_all` method.
28+
- Added possibility change all configuration params("proxy", "proxy_headers" and ect.).
29+
- Fix call `crm.tickets.merge_api`.
30+
- Update README.
31+
- Update requires.
32+
- Update Makefile.
933

1034
## [10.0.0](https://github.com/HubSpot/hubspot-api-python/compare/v9.0.0...v10.0.0) - 2024-10-10
1135

Diff for: Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
VENV_NAME?=venv
1+
VENV_NAME ?= venv
22

33
venv: $(VENV_NAME)/bin/activate
44

55
$(VENV_NAME)/bin/activate: setup.py
6-
pip3 install --upgrade pip virtualenv
7-
@test -d $(VENV_NAME) || python3 -m virtualenv --clear $(VENV_NAME)
8-
${VENV_NAME}/bin/python -m pip install -e .[dev]
6+
@test -d $(VENV_NAME) || python3 -m venv $(VENV_NAME)
7+
@${VENV_NAME}/bin/python -m pip install --upgrade pip
8+
@${VENV_NAME}/bin/python -m pip install -e .[dev]
99
@touch $(VENV_NAME)/bin/activate
1010

1111
test: venv

Diff for: README.md

+61-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pip install --upgrade hubspot-api-client
1818

1919
### Requirements
2020

21-
Make sure you have [Python 3.5+](https://docs.python.org/3/) and [pip](https://pypi.org/project/pip/) installed.
21+
Make sure you have [Python 3.7+](https://docs.python.org/3/) and [pip](https://pypi.org/project/pip/) installed.
2222

2323

2424
## Quickstart
@@ -162,7 +162,66 @@ try:
162162
except ApiException as e:
163163
print("Exception when calling cards_api->create: %s\n" % e)
164164
```
165+
## Not wrapped endpoint(s)
165166

167+
It is possible to access the hubspot request method directly,
168+
it could be handy if client doesn't have implementation for some endpoint yet.
169+
Exposed request method benefits by having all configured client params.
170+
171+
```python
172+
client.api_request({
173+
"method": "PUT",
174+
"path": "/some/api/not/wrapped/yet",
175+
"body": {"key": "value"}
176+
})
177+
```
178+
179+
### {Example} for `GET` request
180+
181+
```python
182+
import hubspot
183+
from pprint import pprint
184+
from hubspot.crm.contacts import ApiException
185+
186+
client = hubspot.Client.create(access_token="your_access_token")
187+
188+
try:
189+
response = client.api_request(
190+
{"path": "/crm/v3/objects/contacts"}
191+
)
192+
pprint(response)
193+
except ApiException as e:
194+
print(e)
195+
```
196+
197+
### {Example} for `POST` request
198+
199+
```python
200+
import hubspot
201+
from pprint import pprint
202+
from hubspot.crm.contacts import ApiException
203+
204+
client = hubspot.Client.create(access_token="your_access_token")
205+
206+
try:
207+
response = client.api_request(
208+
{
209+
"path": "/crm/v3/objects/contacts",
210+
"method": "POST",
211+
"body": {
212+
"properties":
213+
{
214+
"email": "[email protected]",
215+
"lastname": "some_last_name"
216+
},
217+
}
218+
}
219+
220+
)
221+
pprint(response.json())
222+
except ApiException as e:
223+
print(e)
224+
```
166225
### Using utils
167226

168227
#### Get OAuth url:
@@ -183,8 +242,6 @@ auth_url = get_auth_url(
183242

184243
```python
185244
import os
186-
187-
from datetime import datetime
188245
from flask import request
189246
from hubspot.utils.signature import Signature
190247

@@ -194,7 +251,7 @@ Signature.is_valid(
194251
request_body=request.data.decode("utf-8"),
195252
http_uri=request.base_url,
196253
signature_version=request.headers["X-HubSpot-Signature-Version"],
197-
timestamp=datetime.now().timestamp()
254+
timestamp=request.headers["X-HubSpot-Request-Timestamp"]
198255
)
199256
```
200257

Diff for: VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.0.0
1+
11.0.0

Diff for: hubspot/client.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from urllib3.util.retry import Retry
22

3+
34
class Client:
45
def __init__(
56
self,
@@ -86,3 +87,8 @@ def settings(self):
8687
def webhooks(self):
8788
from .discovery.webhooks.discovery import Discovery as WebhooksDiscovery
8889
return WebhooksDiscovery(self.config)
90+
91+
def api_request(self, options):
92+
from .utils.requests.http_request_builder import Request
93+
request = Request(self.config, options)
94+
return request.send()

Diff for: hubspot/crm/associations/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# flake8: noqa
44

55
"""
6-
CRM Associations
6+
Associations
77
88
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
99

Diff for: hubspot/crm/associations/api/batch_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/api_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding: utf-8
22
"""
3-
CRM Associations
3+
Associations
44
55
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
66

Diff for: hubspot/crm/associations/configuration.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# flake8: noqa
44
"""
5-
CRM Associations
5+
Associations
66
77
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
88

Diff for: hubspot/crm/associations/models/associated_id.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/batch_input_public_association.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/batch_input_public_object_id.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/batch_response_public_association.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/batch_response_public_association_multi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/batch_response_public_association_multi_with_errors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/batch_response_public_association_with_errors.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/error.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/error_detail.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/next_page.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/paging.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/previous_page.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/public_association.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/public_association_multi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/public_object_id.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/models/standard_error.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/rest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations
4+
Associations
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/schema/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# flake8: noqa
44

55
"""
6-
CRM Associations Schema
6+
Associations Schema
77
88
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
99

Diff for: hubspot/crm/associations/schema/api/types_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
CRM Associations Schema
4+
Associations Schema
55
66
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
77

Diff for: hubspot/crm/associations/schema/api_client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding: utf-8
22
"""
3-
CRM Associations Schema
3+
Associations Schema
44
55
Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501
66

0 commit comments

Comments
 (0)