Skip to content

Commit

Permalink
Merge pull request #10 from Datateer/add-asset-types
Browse files Browse the repository at this point in the history
Add asset types
  • Loading branch information
cmarche2ti authored Nov 2, 2023
2 parents 55f4bf7 + 9ffe1fa commit 539b6ee
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
4 changes: 0 additions & 4 deletions config.json

This file was deleted.

27 changes: 27 additions & 0 deletions tap_freshservice/streams/asset_types.py
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()
3 changes: 2 additions & 1 deletion tap_freshservice/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from singer_sdk import Tap
from singer_sdk import typing as th # JSON schema typing helpers

from tap_freshservice.streams import (assets, groups, tickets)
from tap_freshservice.streams import (assets, asset_types, groups, tickets)


class TapFreshservice(Tap):
Expand Down Expand Up @@ -46,6 +46,7 @@ def discover_streams(self) -> list[tickets.FreshserviceStream]:
tickets.TicketsStream(self),
groups.GroupsStream(self),
assets.AssetsStream(self),
asset_types.AssetTypesStream(self),
]


Expand Down

0 comments on commit 539b6ee

Please sign in to comment.