Skip to content

Commit 4962188

Browse files
Merge pull request #294 from HubSpot/codegen/events
Codegen: Events
2 parents a092ac4 + 7619ceb commit 4962188

17 files changed

+558
-335
lines changed

hubspot/events/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# flake8: noqa
44

55
"""
6-
HubSpot Events API
6+
Events
77
88
API for accessing CRM object events. # noqa: E501
99
@@ -36,3 +36,4 @@
3636
from hubspot.events.models.external_unified_event import ExternalUnifiedEvent
3737
from hubspot.events.models.next_page import NextPage
3838
from hubspot.events.models.paging import Paging
39+
from hubspot.events.models.previous_page import PreviousPage

hubspot/events/api/events_api.py

Lines changed: 75 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
HubSpot Events API
4+
Events
55
66
API for accessing CRM object events. # noqa: E501
77
@@ -34,32 +34,42 @@ def __init__(self, api_client=None):
3434
self.api_client = api_client
3535

3636
def get_page(self, **kwargs): # noqa: E501
37-
"""Returns a collection of events matching a query. # noqa: E501
37+
"""get_page # noqa: E501
3838
3939
This method makes a synchronous HTTP request by default. To make an
4040
asynchronous HTTP request, please pass async_req=True
4141
4242
>>> thread = api.get_page(async_req=True)
4343
>>> result = thread.get()
4444
45-
:param occurred_after: The starting time as an ISO 8601 timestamp.
45+
:param object_type:
46+
:type object_type: str
47+
:param event_type:
48+
:type event_type: str
49+
:param occurred_after:
4650
:type occurred_after: datetime
47-
:param occurred_before: The ending time as an ISO 8601 timestamp.
51+
:param occurred_before:
4852
:type occurred_before: datetime
49-
:param object_type: The type of object being selected. Valid values are hubspot named object types (e.g. `contact`).
50-
:type object_type: str
51-
:param object_id: The id of the selected object. If not present, then the `objectProperty` parameter is required.
53+
:param object_id:
5254
:type object_id: int
53-
:param event_type: Limits the response to the specified event type. For example `&eventType=e_visited_page` returns only `e_visited_page` events. If not present all event types are returned.
54-
:type event_type: str
55-
:param after: An additional parameter that may be used to get the next `limit` set of results.
55+
:param index_table_name:
56+
:type index_table_name: str
57+
:param index_specific_metadata:
58+
:type index_specific_metadata: str
59+
:param after: The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
5660
:type after: str
5761
:param before:
5862
:type before: str
59-
:param limit: The maximum number of events to return, defaults to 20.
63+
:param limit: The maximum number of results to display per page.
6064
:type limit: int
61-
:param sort: Selects the sort field and order. Defaults to ascending, prefix with `-` for descending order. `occurredAt` is the only field supported for sorting.
65+
:param sort:
6266
:type sort: list[str]
67+
:param object_property_propname:
68+
:type object_property_propname: object
69+
:param property_propname:
70+
:type property_propname: object
71+
:param id:
72+
:type id: list[str]
6373
:param async_req: Whether to execute the request asynchronously.
6474
:type async_req: bool, optional
6575
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -79,32 +89,42 @@ def get_page(self, **kwargs): # noqa: E501
7989
return self.get_page_with_http_info(**kwargs) # noqa: E501
8090

8191
def get_page_with_http_info(self, **kwargs): # noqa: E501
82-
"""Returns a collection of events matching a query. # noqa: E501
92+
"""get_page # noqa: E501
8393
8494
This method makes a synchronous HTTP request by default. To make an
8595
asynchronous HTTP request, please pass async_req=True
8696
8797
>>> thread = api.get_page_with_http_info(async_req=True)
8898
>>> result = thread.get()
8999
90-
:param occurred_after: The starting time as an ISO 8601 timestamp.
100+
:param object_type:
101+
:type object_type: str
102+
:param event_type:
103+
:type event_type: str
104+
:param occurred_after:
91105
:type occurred_after: datetime
92-
:param occurred_before: The ending time as an ISO 8601 timestamp.
106+
:param occurred_before:
93107
:type occurred_before: datetime
94-
:param object_type: The type of object being selected. Valid values are hubspot named object types (e.g. `contact`).
95-
:type object_type: str
96-
:param object_id: The id of the selected object. If not present, then the `objectProperty` parameter is required.
108+
:param object_id:
97109
:type object_id: int
98-
:param event_type: Limits the response to the specified event type. For example `&eventType=e_visited_page` returns only `e_visited_page` events. If not present all event types are returned.
99-
:type event_type: str
100-
:param after: An additional parameter that may be used to get the next `limit` set of results.
110+
:param index_table_name:
111+
:type index_table_name: str
112+
:param index_specific_metadata:
113+
:type index_specific_metadata: str
114+
:param after: The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
101115
:type after: str
102116
:param before:
103117
:type before: str
104-
:param limit: The maximum number of events to return, defaults to 20.
118+
:param limit: The maximum number of results to display per page.
105119
:type limit: int
106-
:param sort: Selects the sort field and order. Defaults to ascending, prefix with `-` for descending order. `occurredAt` is the only field supported for sorting.
120+
:param sort:
107121
:type sort: list[str]
122+
:param object_property_propname:
123+
:type object_property_propname: object
124+
:param property_propname:
125+
:type property_propname: object
126+
:param id:
127+
:type id: list[str]
108128
:param async_req: Whether to execute the request asynchronously.
109129
:type async_req: bool, optional
110130
:param _return_http_data_only: response data without head status code
@@ -131,7 +151,22 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501
131151

132152
local_var_params = locals()
133153

134-
all_params = ["occurred_after", "occurred_before", "object_type", "object_id", "event_type", "after", "before", "limit", "sort"]
154+
all_params = [
155+
"object_type",
156+
"event_type",
157+
"occurred_after",
158+
"occurred_before",
159+
"object_id",
160+
"index_table_name",
161+
"index_specific_metadata",
162+
"after",
163+
"before",
164+
"limit",
165+
"sort",
166+
"object_property_propname",
167+
"property_propname",
168+
"id",
169+
]
135170
all_params.extend(["async_req", "_return_http_data_only", "_preload_content", "_request_timeout", "_request_auth", "_content_type", "_headers"])
136171

137172
for key, val in six.iteritems(local_var_params["kwargs"]):
@@ -145,16 +180,20 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501
145180
path_params = {}
146181

147182
query_params = []
183+
if local_var_params.get("object_type") is not None: # noqa: E501
184+
query_params.append(("objectType", local_var_params["object_type"])) # noqa: E501
185+
if local_var_params.get("event_type") is not None: # noqa: E501
186+
query_params.append(("eventType", local_var_params["event_type"])) # noqa: E501
148187
if local_var_params.get("occurred_after") is not None: # noqa: E501
149188
query_params.append(("occurredAfter", local_var_params["occurred_after"])) # noqa: E501
150189
if local_var_params.get("occurred_before") is not None: # noqa: E501
151190
query_params.append(("occurredBefore", local_var_params["occurred_before"])) # noqa: E501
152-
if local_var_params.get("object_type") is not None: # noqa: E501
153-
query_params.append(("objectType", local_var_params["object_type"])) # noqa: E501
154191
if local_var_params.get("object_id") is not None: # noqa: E501
155192
query_params.append(("objectId", local_var_params["object_id"])) # noqa: E501
156-
if local_var_params.get("event_type") is not None: # noqa: E501
157-
query_params.append(("eventType", local_var_params["event_type"])) # noqa: E501
193+
if local_var_params.get("index_table_name") is not None: # noqa: E501
194+
query_params.append(("indexTableName", local_var_params["index_table_name"])) # noqa: E501
195+
if local_var_params.get("index_specific_metadata") is not None: # noqa: E501
196+
query_params.append(("indexSpecificMetadata", local_var_params["index_specific_metadata"])) # noqa: E501
158197
if local_var_params.get("after") is not None: # noqa: E501
159198
query_params.append(("after", local_var_params["after"])) # noqa: E501
160199
if local_var_params.get("before") is not None: # noqa: E501
@@ -164,6 +203,13 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501
164203
if local_var_params.get("sort") is not None: # noqa: E501
165204
query_params.append(("sort", local_var_params["sort"])) # noqa: E501
166205
collection_formats["sort"] = "multi" # noqa: E501
206+
if local_var_params.get("object_property_propname") is not None: # noqa: E501
207+
query_params.append(("objectProperty.{propname}", local_var_params["object_property_propname"])) # noqa: E501
208+
if local_var_params.get("property_propname") is not None: # noqa: E501
209+
query_params.append(("property.{propname}", local_var_params["property_propname"])) # noqa: E501
210+
if local_var_params.get("id") is not None: # noqa: E501
211+
query_params.append(("id", local_var_params["id"])) # noqa: E501
212+
collection_formats["id"] = "multi" # noqa: E501
167213

168214
header_params = dict(local_var_params.get("_headers", {}))
169215

@@ -182,7 +228,7 @@ def get_page_with_http_info(self, **kwargs): # noqa: E501
182228
}
183229

184230
return self.api_client.call_api(
185-
"/events/v3/events",
231+
"/events/v3/events/",
186232
"GET",
187233
path_params,
188234
query_params,

hubspot/events/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding: utf-8
22
"""
3-
HubSpot Events API
3+
Events
44
55
API for accessing CRM object events. # noqa: E501
66

hubspot/events/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
HubSpot Events API
4+
Events
55
66
API for accessing CRM object events. # noqa: E501
77

hubspot/events/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
HubSpot Events API
4+
Events
55
66
API for accessing CRM object events. # noqa: E501
77

hubspot/events/models/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# flake8: noqa
44
"""
5-
HubSpot Events API
5+
Events
66
77
API for accessing CRM object events. # noqa: E501
88
@@ -20,3 +20,4 @@
2020
from hubspot.events.models.external_unified_event import ExternalUnifiedEvent
2121
from hubspot.events.models.next_page import NextPage
2222
from hubspot.events.models.paging import Paging
23+
from hubspot.events.models.previous_page import PreviousPage

hubspot/events/models/collection_response_external_unified_event.py

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
"""
4-
HubSpot Events API
4+
Events
55
66
API for accessing CRM object events. # noqa: E501
77
@@ -35,28 +35,50 @@ class CollectionResponseExternalUnifiedEvent(object):
3535
attribute_map (dict): The key is attribute name
3636
and the value is json key in definition.
3737
"""
38-
openapi_types = {"results": "list[ExternalUnifiedEvent]", "paging": "Paging"}
38+
openapi_types = {"paging": "Paging", "results": "list[ExternalUnifiedEvent]"}
3939

40-
attribute_map = {"results": "results", "paging": "paging"}
40+
attribute_map = {"paging": "paging", "results": "results"}
4141

42-
def __init__(self, results=None, paging=None, local_vars_configuration=None): # noqa: E501
42+
def __init__(self, paging=None, results=None, local_vars_configuration=None): # noqa: E501
4343
"""CollectionResponseExternalUnifiedEvent - a model defined in OpenAPI""" # noqa: E501
4444
if local_vars_configuration is None:
4545
local_vars_configuration = Configuration.get_default_copy()
4646
self.local_vars_configuration = local_vars_configuration
4747

48-
self._results = None
4948
self._paging = None
49+
self._results = None
5050
self.discriminator = None
5151

52-
self.results = results
5352
if paging is not None:
5453
self.paging = paging
54+
self.results = results
55+
56+
@property
57+
def paging(self):
58+
"""Gets the paging of this CollectionResponseExternalUnifiedEvent. # noqa: E501
59+
60+
61+
:return: The paging of this CollectionResponseExternalUnifiedEvent. # noqa: E501
62+
:rtype: Paging
63+
"""
64+
return self._paging
65+
66+
@paging.setter
67+
def paging(self, paging):
68+
"""Sets the paging of this CollectionResponseExternalUnifiedEvent.
69+
70+
71+
:param paging: The paging of this CollectionResponseExternalUnifiedEvent. # noqa: E501
72+
:type paging: Paging
73+
"""
74+
75+
self._paging = paging
5576

5677
@property
5778
def results(self):
5879
"""Gets the results of this CollectionResponseExternalUnifiedEvent. # noqa: E501
5980
81+
# noqa: E501
6082
6183
:return: The results of this CollectionResponseExternalUnifiedEvent. # noqa: E501
6284
:rtype: list[ExternalUnifiedEvent]
@@ -67,6 +89,7 @@ def results(self):
6789
def results(self, results):
6890
"""Sets the results of this CollectionResponseExternalUnifiedEvent.
6991
92+
# noqa: E501
7093
7194
:param results: The results of this CollectionResponseExternalUnifiedEvent. # noqa: E501
7295
:type results: list[ExternalUnifiedEvent]
@@ -76,27 +99,6 @@ def results(self, results):
7699

77100
self._results = results
78101

79-
@property
80-
def paging(self):
81-
"""Gets the paging of this CollectionResponseExternalUnifiedEvent. # noqa: E501
82-
83-
84-
:return: The paging of this CollectionResponseExternalUnifiedEvent. # noqa: E501
85-
:rtype: Paging
86-
"""
87-
return self._paging
88-
89-
@paging.setter
90-
def paging(self, paging):
91-
"""Sets the paging of this CollectionResponseExternalUnifiedEvent.
92-
93-
94-
:param paging: The paging of this CollectionResponseExternalUnifiedEvent. # noqa: E501
95-
:type paging: Paging
96-
"""
97-
98-
self._paging = paging
99-
100102
def to_dict(self, serialize=False):
101103
"""Returns the model properties as a dict"""
102104
result = {}

0 commit comments

Comments
 (0)