@@ -26,6 +26,15 @@ def default(cls) -> RepositoryPermissions:
2626 return cls (pull = False , push = False )
2727
2828
29+ @dataclass (frozen = True , eq = True , kw_only = True )
30+ class RepositoryProviderData :
31+ """Repository provider match data."""
32+
33+ provider : ProviderData
34+ connection : ProviderConnection | None
35+ repository_metadata : RepositoryMetadata | None
36+
37+
2938@dataclass (frozen = True , eq = True , kw_only = True )
3039class RepositoryMetadata :
3140 """Repository metadata."""
@@ -34,6 +43,7 @@ class RepositoryMetadata:
3443 git_http_url : str
3544 web_url : str
3645 permissions : RepositoryPermissions
46+ visibility : RepositoryVisibility
3747
3848
3949@dataclass (frozen = True , eq = True , kw_only = True )
@@ -73,13 +83,15 @@ def fromORM(cls, e: OAuth2ClientORM) -> ProviderData:
7383 return ProviderData (id = e .id , name = e .display_name , url = e .url )
7484
7585
76- @dataclass (frozen = True , eq = True , kw_only = True )
77- class RepositoryProviderData :
78- """Repository provider match data."""
86+ class RepositoryVisibility (StrEnum ):
87+ """The visibility of a repository.
7988
80- provider : ProviderData
81- connection : ProviderConnection | None
82- repository_metadata : RepositoryMetadata | None
89+ public: the repository can be pulled without credentials
90+ private: the repository requires credentials to be pulled
91+ """
92+
93+ public = "public"
94+ private = "private"
8395
8496
8597@dataclass (frozen = True , eq = True , kw_only = True )
@@ -91,6 +103,7 @@ class Metadata:
91103 web_url : str | None = None
92104 pull_permission : bool
93105 push_permission : bool | None = None
106+ visibility : RepositoryVisibility = RepositoryVisibility .private
94107
95108 @classmethod
96109 def fromRepoMeta (cls , rm : RepositoryMetadata ) -> Metadata :
@@ -101,6 +114,7 @@ def fromRepoMeta(cls, rm: RepositoryMetadata) -> Metadata:
101114 web_url = rm .web_url ,
102115 pull_permission = rm .permissions .pull ,
103116 push_permission = rm .permissions .push ,
117+ visibility = rm .visibility ,
104118 )
105119
106120
0 commit comments