airbyte-source-iterable 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/PKG-INFO +1 -1
  2. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/pyproject.toml +1 -1
  3. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/manifest.yaml +14 -1
  4. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/streams.py +18 -1
  5. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/.airbyte-pypi-readme.md +0 -0
  6. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/__init__.py +0 -0
  7. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/components.py +0 -0
  8. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/run.py +0 -0
  9. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/campaigns.json +0 -0
  10. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/campaigns_metrics.json +0 -0
  11. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/channels.json +0 -0
  12. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/email_bounce.json +0 -0
  13. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/email_click.json +0 -0
  14. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/email_complaint.json +0 -0
  15. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/email_open.json +0 -0
  16. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/email_send.json +0 -0
  17. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/email_send_skip.json +0 -0
  18. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/email_subscribe.json +0 -0
  19. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/email_unsubscribe.json +0 -0
  20. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/events.json +0 -0
  21. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/list_users.json +0 -0
  22. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/lists.json +0 -0
  23. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/message_types.json +0 -0
  24. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/metadata.json +0 -0
  25. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/templates.json +0 -0
  26. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/schemas/users.json +0 -0
  27. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/slice_generators.py +0 -0
  28. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/source.py +0 -0
  29. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/spec.json +0 -0
  30. {airbyte_source_iterable-1.0.1 → airbyte_source_iterable-1.0.2}/source_iterable/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-source-iterable
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Source implementation for Iterable.
5
5
  Home-page: https://airbyte.com
6
6
  License: ELv2
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
3
3
  build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
- version = "1.0.1"
6
+ version = "1.0.2"
7
7
  name = "airbyte-source-iterable"
8
8
  description = "Source implementation for Iterable."
9
9
  authors = [ "Airbyte <contact@airbyte.io>",]
@@ -173,7 +173,20 @@ streams:
173
173
  retriever:
174
174
  type: SimpleRetriever
175
175
  paginator:
176
- type: NoPagination
176
+ type: DefaultPaginator
177
+ page_size_option:
178
+ type: RequestOption
179
+ field_name: pageSize
180
+ inject_into: request_parameter
181
+ page_token_option:
182
+ type: RequestOption
183
+ field_name: page
184
+ inject_into: request_parameter
185
+ pagination_strategy:
186
+ type: PageIncrement
187
+ page_size: 1000
188
+ start_from_page: 1
189
+ inject_on_first_request: true
177
190
  requester:
178
191
  path: campaigns
179
192
  type: HttpRequester
@@ -70,7 +70,7 @@ class IterableStream(HttpStream, ABC):
70
70
 
71
71
  def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]:
72
72
  """
73
- Iterable API does not support pagination
73
+ Most Iterable endpoints do not support pagination; streams that do override this.
74
74
  """
75
75
  return None
76
76
 
@@ -388,10 +388,27 @@ class IterableExportEventsStreamAdjustableRange(IterableExportStreamAdjustableRa
388
388
 
389
389
  class Campaigns(IterableStream):
390
390
  data_field = "campaigns"
391
+ page_size = 1000
392
+
393
+ def __init__(self, authenticator, region: str = "US"):
394
+ self._page = 1
395
+ super().__init__(authenticator, region)
391
396
 
392
397
  def path(self, **kwargs) -> str:
393
398
  return "campaigns"
394
399
 
400
+ def request_params(self, stream_slice: Optional[Mapping[str, Any]] = None, **kwargs) -> MutableMapping[str, Any]:
401
+ next_page_token = kwargs.get("next_page_token")
402
+ page = next_page_token["page"] if next_page_token else 1
403
+ self._page = page
404
+ return {"page": page, "pageSize": self.page_size}
405
+
406
+ def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]:
407
+ response_json = response.json() or {}
408
+ if len(response_json.get(self.data_field, [])) < self.page_size:
409
+ return None
410
+ return {"page": self._page + 1}
411
+
395
412
 
396
413
  class CampaignsMetrics(IterableStream):
397
414
  name = "campaigns_metrics"