Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

11.0.0 #363

Merged
merged 27 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a78ea84
Update required Python version in README.md
ericbn Mar 22, 2024
46a2709
Codegen: Marketing Events
alzheltkovskiy-hubspot Oct 16, 2024
ef27cc9
Enhance DiscoveryBase
alzheltkovskiy-hubspot Oct 17, 2024
d9a6753
Merge pull request #351 from HubSpot/feature/enhanceDiscoveryBase
alzheltkovskiy-hubspot Oct 21, 2024
670ebd1
Merge pull request #350 from HubSpot/codegenMarketingEvents
alzheltkovskiy-hubspot Oct 22, 2024
103ae7c
add Request class
alzheltkovskiy-hubspot Oct 22, 2024
40a706c
Merge pull request #302 from ericbn/update-readme-md
alzheltkovskiy-hubspot Oct 22, 2024
e031d49
Merge branch '11.0.0' into feature/add-request-class
alzheltkovskiy-hubspot Oct 22, 2024
12ffb46
Enhance method
alzheltkovskiy-hubspot Oct 23, 2024
2e1a281
add request_api
alzheltkovskiy-hubspot Oct 24, 2024
755a27c
Merge pull request #352 from HubSpot/feature/add-request-class
alzheltkovskiy-hubspot Oct 24, 2024
76f321d
Update Readme
alzheltkovskiy-hubspot Oct 24, 2024
9f981ba
Clean up
alzheltkovskiy-hubspot Oct 24, 2024
615260f
Merge pull request #355 from HubSpot/update-readme
alzheltkovskiy-hubspot Oct 25, 2024
7a6e25c
Fix tickets discovery
alzheltkovskiy-hubspot Oct 28, 2024
4be7b0f
Merge pull request #356 from HubSpot/fix-tickets-discovery
alzheltkovskiy-hubspot Oct 28, 2024
3f71b6a
Merge pull request #353 from HubSpot/feature/enhance-fetch-all
alzheltkovskiy-hubspot Nov 6, 2024
2c3241f
Codegen: Crm Associations
alzheltkovskiy-hubspot Nov 18, 2024
ba0d48d
regen missing file
alzheltkovskiy-hubspot Nov 18, 2024
77beb38
Merge pull request #358 from HubSpot/codegen-crm-associations
alzheltkovskiy-hubspot Nov 18, 2024
bd1dc42
update Makefile
alzheltkovskiy-hubspot Nov 18, 2024
9a93a90
Merge pull request #359 from HubSpot/feature/update-makefile
alzheltkovskiy-hubspot Nov 18, 2024
19e81ad
Update discoveries, Clean up
alzheltkovskiy-hubspot Nov 18, 2024
8ace27d
Merge pull request #360 from HubSpot/feature/update-discovery
alzheltkovskiy-hubspot Nov 18, 2024
7dda5bd
Update changelog and version
alzheltkovskiy-hubspot Nov 27, 2024
bc2ee87
Merge pull request #362 from HubSpot/feature/update-changelog
alzheltkovskiy-hubspot Nov 27, 2024
2c2a1a6
update discovery tests
alzheltkovskiy-hubspot Nov 27, 2024
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
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v10.0.0...HEAD)
## [Unreleased](https://github.com/HubSpot/hubspot-api-python/compare/v11.0.0...HEAD)

## [11.0.0](https://github.com/HubSpot/hubspot-api-python/compare/v10.0.0...v11.0.0) - 2024-11-27

## Associations

- Added `assiciations.v4.report_api` Api.
- Added `assiciations.v4.schema.definition_configurations_api` Api.

## Marketing Events

- Added `marketing.events.list_associations_api` Api.
- Renamed method `create_by_contact_email` to `record_by_contact_emails` in `marketing.events.attendance_subscriber_state_changes_api`.
- Renamed method `create_by_contact_id` to `record_by_contact_ids` in `marketing.events.attendance_subscriber_state_changes_api`.
- Remove parameters `attendance_state_calculation_timestamp` and `import_status` to `marketing.events.models.marketing_event_update_request_params`.

## Other changes

- Added `api_request` Api(for requests by curl).
- Enhance `get_all` method.
- Added possibility change all configuration params("proxy", "proxy_headers" and ect.).
- Fix call `crm.tickets.merge_api`.
- Update README.
- Update requires.
- Update Makefile.

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

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
VENV_NAME?=venv
VENV_NAME ?= venv

venv: $(VENV_NAME)/bin/activate

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

test: venv
Expand Down
65 changes: 61 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pip install --upgrade hubspot-api-client

### Requirements

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


## Quickstart
Expand Down Expand Up @@ -162,7 +162,66 @@ try:
except ApiException as e:
print("Exception when calling cards_api->create: %s\n" % e)
```
## Not wrapped endpoint(s)

It is possible to access the hubspot request method directly,
it could be handy if client doesn't have implementation for some endpoint yet.
Exposed request method benefits by having all configured client params.

```python
client.api_request({
"method": "PUT",
"path": "/some/api/not/wrapped/yet",
"body": {"key": "value"}
})
```

### {Example} for `GET` request

```python
import hubspot
from pprint import pprint
from hubspot.crm.contacts import ApiException

client = hubspot.Client.create(access_token="your_access_token")

try:
response = client.api_request(
{"path": "/crm/v3/objects/contacts"}
)
pprint(response)
except ApiException as e:
print(e)
```

### {Example} for `POST` request

```python
import hubspot
from pprint import pprint
from hubspot.crm.contacts import ApiException

client = hubspot.Client.create(access_token="your_access_token")

try:
response = client.api_request(
{
"path": "/crm/v3/objects/contacts",
"method": "POST",
"body": {
"properties":
{
"email": "[email protected]",
"lastname": "some_last_name"
},
}
}

)
pprint(response.json())
except ApiException as e:
print(e)
```
### Using utils

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

```python
import os

from datetime import datetime
from flask import request
from hubspot.utils.signature import Signature

Expand All @@ -194,7 +251,7 @@ Signature.is_valid(
request_body=request.data.decode("utf-8"),
http_uri=request.base_url,
signature_version=request.headers["X-HubSpot-Signature-Version"],
timestamp=datetime.now().timestamp()
timestamp=request.headers["X-HubSpot-Request-Timestamp"]
)
```

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.0.0
11.0.0
6 changes: 6 additions & 0 deletions hubspot/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from urllib3.util.retry import Retry


class Client:
def __init__(
self,
Expand Down Expand Up @@ -86,3 +87,8 @@ def settings(self):
def webhooks(self):
from .discovery.webhooks.discovery import Discovery as WebhooksDiscovery
return WebhooksDiscovery(self.config)

def api_request(self, options):
from .utils.requests.http_request_builder import Request
request = Request(self.config, options)
return request.send()
2 changes: 1 addition & 1 deletion hubspot/crm/associations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# flake8: noqa

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/api/batch_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/api_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8
"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/configuration.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# flake8: noqa
"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/associated_id.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/error.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/error_detail.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/next_page.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/paging.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/previous_page.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/public_association.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/public_object_id.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/models/standard_error.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/rest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations
Associations

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# flake8: noqa

"""
CRM Associations Schema
Associations Schema

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/schema/api/types_api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding: utf-8

"""
CRM Associations Schema
Associations Schema

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
2 changes: 1 addition & 1 deletion hubspot/crm/associations/schema/api_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8
"""
CRM Associations Schema
Associations Schema

Associations define the relationships between objects in HubSpot. These endpoints allow you to create, read, and remove associations. # noqa: E501

Expand Down
Loading