diff --git a/tap_github/repository_streams.py b/tap_github/repository_streams.py index de8371e8..d2942695 100644 --- a/tap_github/repository_streams.py +++ b/tap_github/repository_streams.py @@ -2441,3 +2441,25 @@ class TrafficPageViewsStream(TrafficRestStream): th.Property("count", th.IntegerType), th.Property("uniques", th.IntegerType), ).to_dict() + + +class CustomPropertiesStream(GitHubRestStream): + """Defines 'custom_properties' stream.""" + + name = "custom_properties" + path = "/repos/{org}/{repo}/properties/values" + primary_keys = ["repo", "org", "property_name"] + replication_key = None + parent_stream_type = RepositoryStream + ignore_parent_replication_key = True + state_partitioning_keys = ["repo", "org"] + + schema = th.PropertiesList( + # Parent Keys + th.Property("repo", th.StringType), + th.Property("org", th.StringType), + th.Property("repo_id", th.IntegerType), + # Custom Property Keys + th.Property("property_name", th.StringType), + th.Property("value", th.StringType), + ).to_dict() diff --git a/tap_github/streams.py b/tap_github/streams.py index e1b05e58..64ae392a 100644 --- a/tap_github/streams.py +++ b/tap_github/streams.py @@ -17,6 +17,7 @@ CommitsStream, CommunityProfileStream, ContributorsStream, + CustomPropertiesStream, DependenciesStream, DependentsStream, EventsStream, @@ -74,6 +75,7 @@ def __init__(self, valid_queries: Set[str], streams: List[Type[Stream]]): CommitsStream, CommunityProfileStream, ContributorsStream, + CustomPropertiesStream, DependenciesStream, DependentsStream, EventsStream, @@ -117,7 +119,13 @@ def __init__(self, valid_queries: Set[str], streams: List[Type[Stream]]): ) ORGANIZATIONS = ( {"organizations"}, - [OrganizationStream, TeamMembersStream, TeamRolesStream, TeamsStream], + [ + CustomPropertiesStream, + OrganizationStream, + TeamMembersStream, + TeamRolesStream, + TeamsStream, + ], ) @classmethod