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

Modify Users Stream to pull data from new account filtered users endpoint #3

Merged
merged 1 commit into from
Aug 27, 2024
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
13 changes: 12 additions & 1 deletion tap_canvas_catalog/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,29 @@
from __future__ import annotations

from pathlib import Path
from typing import Any

from singer_sdk import typing as th # JSON Schema typing helpers

from tap_canvas_catalog.client import CanvasCatalogStream

class UsersStream(CanvasCatalogStream):
name = "users"
path = "/users"
path = "/integrations/hotglue/sources/users"
primary_keys = ["id"]
records_jsonpath = "$.users[*]"
replication_key = "updated_at"

def get_url_params(
self,
context: dict | None,
next_page_token: Any | None,
) -> dict[str, Any]:
params = super().get_url_params(context, next_page_token)
params["accountId"] = self.config.get("account_id", "")

return params

schema = th.PropertiesList(
th.Property(
"id",
Expand Down
7 changes: 7 additions & 0 deletions tap_canvas_catalog/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ class TapCanvasCatalog(Tap):
secret=False,
description="The URL for the Canvas Catalog API",
),
th.Property(
"account_id",
th.StringType,
required=False,
secret=False,
description="The sub-account id to pull data from",
),
).to_dict()

def discover_streams(self) -> list[streams.CanvasCatalogStream]:
Expand Down