-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from Datateer/add-asset-types
Add asset types
- Loading branch information
Showing
3 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Stream type classes for tap-freshservice.""" | ||
from singer_sdk import typing as th # JSON Schema typing helpers | ||
|
||
from tap_freshservice.client import FreshserviceStream | ||
|
||
class AssetTypesStream(FreshserviceStream): | ||
name = "asset_types" | ||
path = "/asset_types" | ||
records_jsonpath="$.asset_types[*]" | ||
|
||
def get_url(self, context: dict): | ||
url = super().get_url(context) | ||
return url | ||
|
||
def build_prepared_request(self, *args, **kwargs): | ||
req = super().build_prepared_request(*args, **kwargs) | ||
return req | ||
|
||
schema = th.PropertiesList( | ||
th.Property("id", th.IntegerType), | ||
th.Property("name", th.StringType), | ||
th.Property("parent_asset_type_id", th.IntegerType), | ||
th.Property("visible", th.BooleanType), | ||
th.Property("description", th.StringType), | ||
th.Property("created_at", th.DateTimeType), | ||
th.Property("updated_at", th.DateTimeType), | ||
).to_dict() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters