dex-connector-github 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dex_connector_github-0.1.0.dist-info/METADATA +39 -0
- dex_connector_github-0.1.0.dist-info/RECORD +21 -0
- dex_connector_github-0.1.0.dist-info/WHEEL +4 -0
- dex_connector_github-0.1.0.dist-info/licenses/LICENSE +21 -0
- dex_connectors/github/__init__.py +47 -0
- dex_connectors/github/_generated/__init__.py +2 -0
- dex_connectors/github/_generated/config.py +34 -0
- dex_connectors/github/_generated/connection.py +245 -0
- dex_connectors/github/_generated/definitions.py +143 -0
- dex_connectors/github/_generated/mock.py +665 -0
- dex_connectors/github/_generated/models.py +464 -0
- dex_connectors/github/_generated/refresh.py +9 -0
- dex_connectors/github/_generated/steps.py +385 -0
- dex_connectors/github/_generated/timestamps.py +60 -0
- dex_connectors/github/client.py +367 -0
- dex_connectors/github/connection.py +5 -0
- dex_connectors/github/dex-connector.json +304 -0
- dex_connectors/github/githubmock/__init__.py +6 -0
- dex_connectors/github/models.py +5 -0
- dex_connectors/github/operations.py +861 -0
- dex_connectors/github/steps.py +5 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
# Copyright (c) 2026 Super Durable
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# ruff: noqa
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass, field as _dataclass_field
|
|
6
|
+
from datetime import UTC, datetime
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from .timestamps import parse_go_datetime, validate_go_datetime
|
|
10
|
+
|
|
11
|
+
def _replace_nil_slices(value: Any, depth: int) -> Any:
|
|
12
|
+
if value is None:
|
|
13
|
+
return ()
|
|
14
|
+
if depth == 1:
|
|
15
|
+
return tuple(value)
|
|
16
|
+
return tuple(_replace_nil_slices(item, depth - 1) for item in value)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# GetAuthenticatedProfileInput contains the provider request fields for get authenticated profile.
|
|
20
|
+
@dataclass(frozen=True, slots=True)
|
|
21
|
+
class GetAuthenticatedProfileInput:
|
|
22
|
+
pass
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
setattr(GetAuthenticatedProfileInput, '__module__', 'dex_connectors.github.models')
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# AuthenticatedProfile represents the connector's authenticated profile data.
|
|
29
|
+
@dataclass(frozen=True, slots=True)
|
|
30
|
+
class AuthenticatedProfile:
|
|
31
|
+
# Subject is the message subject.
|
|
32
|
+
subject: str = ''
|
|
33
|
+
# Login is the login for authenticated profile.
|
|
34
|
+
login: str = ''
|
|
35
|
+
# Name is the name for authenticated profile.
|
|
36
|
+
name: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
37
|
+
# VerifiedEmail is the verified email for authenticated profile.
|
|
38
|
+
verified_email: str = _dataclass_field(default='', metadata={'dex_json_name': 'verifiedEmail'})
|
|
39
|
+
# AvatarURL is the avatar URL for authenticated profile.
|
|
40
|
+
avatar_url: str = _dataclass_field(default='', metadata={'dex_json_name': 'avatarUrl', 'dex_json_omit_default': True})
|
|
41
|
+
# ProfileURL is the profile URL for authenticated profile.
|
|
42
|
+
profile_url: str = _dataclass_field(default='', metadata={'dex_json_name': 'profileUrl', 'dex_json_omit_default': True})
|
|
43
|
+
# Company is the company for authenticated profile.
|
|
44
|
+
company: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
45
|
+
# BlogURL is the blog URL for authenticated profile.
|
|
46
|
+
blog_url: str = _dataclass_field(default='', metadata={'dex_json_name': 'blogUrl', 'dex_json_omit_default': True})
|
|
47
|
+
# Location is the location for authenticated profile.
|
|
48
|
+
location: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
49
|
+
# Bio is the bio for authenticated profile.
|
|
50
|
+
bio: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
51
|
+
# TwitterUsername is the twitter username for authenticated profile.
|
|
52
|
+
twitter_username: str = _dataclass_field(default='', metadata={'dex_json_name': 'twitterUsername', 'dex_json_omit_default': True})
|
|
53
|
+
# PublicRepos is the public repos for authenticated profile.
|
|
54
|
+
public_repos: int = _dataclass_field(default=0, metadata={'dex_json_name': 'publicRepos'})
|
|
55
|
+
# Followers is the followers for authenticated profile.
|
|
56
|
+
followers: int = 0
|
|
57
|
+
# Following is the following for authenticated profile.
|
|
58
|
+
following: int = 0
|
|
59
|
+
# CreatedAt is the created at for authenticated profile.
|
|
60
|
+
created_at: datetime | None = _dataclass_field(default=None, metadata={'dex_json_name': 'createdAt', 'dex_json_omit_default': True, 'dex_json_format': 'rfc3339'})
|
|
61
|
+
# UpdatedAt is the updated at for authenticated profile.
|
|
62
|
+
updated_at: datetime | None = _dataclass_field(default=None, metadata={'dex_json_name': 'updatedAt', 'dex_json_omit_default': True, 'dex_json_format': 'rfc3339'})
|
|
63
|
+
|
|
64
|
+
def __post_init__(self) -> None:
|
|
65
|
+
if isinstance(self.created_at, str):
|
|
66
|
+
object.__setattr__(self, 'created_at', parse_go_datetime(self.created_at, 'created_at'))
|
|
67
|
+
elif self.created_at is not None:
|
|
68
|
+
validate_go_datetime(self.created_at, 'created_at')
|
|
69
|
+
if isinstance(self.updated_at, str):
|
|
70
|
+
object.__setattr__(self, 'updated_at', parse_go_datetime(self.updated_at, 'updated_at'))
|
|
71
|
+
elif self.updated_at is not None:
|
|
72
|
+
validate_go_datetime(self.updated_at, 'updated_at')
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
setattr(AuthenticatedProfile, '__module__', 'dex_connectors.github.models')
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
# ListPublicRepositoriesInput contains the provider request fields for list public repositories.
|
|
79
|
+
@dataclass(frozen=True, slots=True)
|
|
80
|
+
class ListPublicRepositoriesInput:
|
|
81
|
+
# Login specifies login for list public repositories input.
|
|
82
|
+
login: str = ''
|
|
83
|
+
# Limit specifies limit for list public repositories input.
|
|
84
|
+
limit: int = _dataclass_field(default=0, metadata={'dex_json_omit_default': True})
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
setattr(ListPublicRepositoriesInput, '__module__', 'dex_connectors.github.models')
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# Repository represents the connector's repository data.
|
|
91
|
+
@dataclass(frozen=True, slots=True)
|
|
92
|
+
class Repository:
|
|
93
|
+
# ID is the stable provider identifier.
|
|
94
|
+
id: int = 0
|
|
95
|
+
# Name is the name for repository.
|
|
96
|
+
name: str = ''
|
|
97
|
+
# FullName is the full name for repository.
|
|
98
|
+
full_name: str = _dataclass_field(default='', metadata={'dex_json_name': 'fullName'})
|
|
99
|
+
# Description is the description for repository.
|
|
100
|
+
description: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
101
|
+
# ProfileURL is the profile URL for repository.
|
|
102
|
+
profile_url: str = _dataclass_field(default='', metadata={'dex_json_name': 'profileUrl', 'dex_json_omit_default': True})
|
|
103
|
+
# HomepageURL is the homepage URL for repository.
|
|
104
|
+
homepage_url: str = _dataclass_field(default='', metadata={'dex_json_name': 'homepageUrl', 'dex_json_omit_default': True})
|
|
105
|
+
# Language is the language for repository.
|
|
106
|
+
language: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
107
|
+
# Topics is the topics for repository.
|
|
108
|
+
topics: tuple[str, ...] = _dataclass_field(default=(), metadata={'dex_json_omit_default': True})
|
|
109
|
+
# Fork is the fork for repository.
|
|
110
|
+
fork: bool = False
|
|
111
|
+
# Archived is the archived for repository.
|
|
112
|
+
archived: bool = False
|
|
113
|
+
# Disabled is the disabled for repository.
|
|
114
|
+
disabled: bool = False
|
|
115
|
+
# StargazersCount is the stargazers count for repository.
|
|
116
|
+
stargazers_count: int = _dataclass_field(default=0, metadata={'dex_json_name': 'stargazersCount'})
|
|
117
|
+
# ForksCount is the forks count for repository.
|
|
118
|
+
forks_count: int = _dataclass_field(default=0, metadata={'dex_json_name': 'forksCount'})
|
|
119
|
+
# OpenIssuesCount is the open issues count for repository.
|
|
120
|
+
open_issues_count: int = _dataclass_field(default=0, metadata={'dex_json_name': 'openIssuesCount'})
|
|
121
|
+
# CreatedAt is the created at for repository.
|
|
122
|
+
created_at: datetime | None = _dataclass_field(default=None, metadata={'dex_json_name': 'createdAt', 'dex_json_omit_default': True, 'dex_json_format': 'rfc3339'})
|
|
123
|
+
# UpdatedAt is the updated at for repository.
|
|
124
|
+
updated_at: datetime | None = _dataclass_field(default=None, metadata={'dex_json_name': 'updatedAt', 'dex_json_omit_default': True, 'dex_json_format': 'rfc3339'})
|
|
125
|
+
# PushedAt is the pushed at for repository.
|
|
126
|
+
pushed_at: datetime | None = _dataclass_field(default=None, metadata={'dex_json_name': 'pushedAt', 'dex_json_omit_default': True, 'dex_json_format': 'rfc3339'})
|
|
127
|
+
|
|
128
|
+
def __post_init__(self) -> None:
|
|
129
|
+
if isinstance(self.created_at, str):
|
|
130
|
+
object.__setattr__(self, 'created_at', parse_go_datetime(self.created_at, 'created_at'))
|
|
131
|
+
elif self.created_at is not None:
|
|
132
|
+
validate_go_datetime(self.created_at, 'created_at')
|
|
133
|
+
if isinstance(self.updated_at, str):
|
|
134
|
+
object.__setattr__(self, 'updated_at', parse_go_datetime(self.updated_at, 'updated_at'))
|
|
135
|
+
elif self.updated_at is not None:
|
|
136
|
+
validate_go_datetime(self.updated_at, 'updated_at')
|
|
137
|
+
if isinstance(self.pushed_at, str):
|
|
138
|
+
object.__setattr__(self, 'pushed_at', parse_go_datetime(self.pushed_at, 'pushed_at'))
|
|
139
|
+
elif self.pushed_at is not None:
|
|
140
|
+
validate_go_datetime(self.pushed_at, 'pushed_at')
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
setattr(Repository, '__module__', 'dex_connectors.github.models')
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# PublicRepositories represents the connector's public repositories data.
|
|
147
|
+
@dataclass(frozen=True, slots=True)
|
|
148
|
+
class PublicRepositories:
|
|
149
|
+
# Repositories is the repositories for public repositories.
|
|
150
|
+
repositories: tuple[Repository, ...] = ()
|
|
151
|
+
# Truncated is the truncated for public repositories.
|
|
152
|
+
truncated: bool = False
|
|
153
|
+
|
|
154
|
+
def __post_init__(self) -> None:
|
|
155
|
+
object.__setattr__(self, 'repositories', _replace_nil_slices(self.repositories, 1))
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
PublicRepositories.__annotations__['repositories'] = tuple[Repository, ...] | None
|
|
159
|
+
PublicRepositories.__dataclass_fields__['repositories'].type = tuple[Repository, ...] | None
|
|
160
|
+
setattr(PublicRepositories, '__module__', 'dex_connectors.github.models')
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# ListMergedPullRequestsInput selects one page of pull requests merged within an inclusive time window.
|
|
164
|
+
@dataclass(frozen=True, slots=True)
|
|
165
|
+
class ListMergedPullRequestsInput:
|
|
166
|
+
# Owner is the GitHub login that owns the repository. Surrounding whitespace is ignored.
|
|
167
|
+
owner: str = ''
|
|
168
|
+
# Repository is the repository name without its owner, such as hello-world.
|
|
169
|
+
repository: str = ''
|
|
170
|
+
# MergedAfter is the inclusive window start. GitHub search receives it in UTC with second precision.
|
|
171
|
+
merged_after: datetime = _dataclass_field(default_factory=lambda: datetime.min.replace(tzinfo=UTC), metadata={'dex_json_name': 'mergedAfter', 'dex_json_format': 'rfc3339'})
|
|
172
|
+
# MergedBefore is the inclusive window end and must be after MergedAfter. GitHub search receives it in
|
|
173
|
+
# UTC with second precision.
|
|
174
|
+
merged_before: datetime = _dataclass_field(default_factory=lambda: datetime.min.replace(tzinfo=UTC), metadata={'dex_json_name': 'mergedBefore', 'dex_json_format': 'rfc3339'})
|
|
175
|
+
# PageSize is 1 through 100. Zero selects 30.
|
|
176
|
+
page_size: int = _dataclass_field(default=0, metadata={'dex_json_name': 'pageSize', 'dex_json_omit_default': True})
|
|
177
|
+
# Page is one-based. Zero selects 1.
|
|
178
|
+
page: int = _dataclass_field(default=0, metadata={'dex_json_omit_default': True})
|
|
179
|
+
|
|
180
|
+
def __post_init__(self) -> None:
|
|
181
|
+
if isinstance(self.merged_after, str):
|
|
182
|
+
object.__setattr__(self, 'merged_after', parse_go_datetime(self.merged_after, 'merged_after'))
|
|
183
|
+
elif self.merged_after is not None:
|
|
184
|
+
validate_go_datetime(self.merged_after, 'merged_after')
|
|
185
|
+
if isinstance(self.merged_before, str):
|
|
186
|
+
object.__setattr__(self, 'merged_before', parse_go_datetime(self.merged_before, 'merged_before'))
|
|
187
|
+
elif self.merged_before is not None:
|
|
188
|
+
validate_go_datetime(self.merged_before, 'merged_before')
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
setattr(ListMergedPullRequestsInput, '__module__', 'dex_connectors.github.models')
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
# MergedPullRequest is one merged pull request with bounded text.
|
|
195
|
+
@dataclass(frozen=True, slots=True)
|
|
196
|
+
class MergedPullRequest:
|
|
197
|
+
# Number is the pull request number within its repository.
|
|
198
|
+
number: int = 0
|
|
199
|
+
# Title is the trimmed pull request title, bounded to 1024 bytes.
|
|
200
|
+
title: str = ''
|
|
201
|
+
# Body is the beginning of the pull request body, bounded by the maxPullRequestBodyCharacters
|
|
202
|
+
# configuration field.
|
|
203
|
+
body: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
204
|
+
# BodyTruncated reports that Body omits the end of the pull request body.
|
|
205
|
+
body_truncated: bool = _dataclass_field(default=False, metadata={'dex_json_name': 'bodyTruncated'})
|
|
206
|
+
# URL is the pull request's GitHub web URL, or empty when GitHub returns an unsafe URL.
|
|
207
|
+
url: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
208
|
+
# AuthorLogin is the author's GitHub login, or empty when GitHub omits the author.
|
|
209
|
+
author_login: str = _dataclass_field(default='', metadata={'dex_json_name': 'authorLogin', 'dex_json_omit_default': True})
|
|
210
|
+
# MergedAt is the merge time in UTC.
|
|
211
|
+
merged_at: datetime = _dataclass_field(default_factory=lambda: datetime.min.replace(tzinfo=UTC), metadata={'dex_json_name': 'mergedAt', 'dex_json_format': 'rfc3339'})
|
|
212
|
+
# Labels holds up to 100 non-empty label names, each bounded to 256 bytes.
|
|
213
|
+
labels: tuple[str, ...] = _dataclass_field(default=(), metadata={'dex_json_omit_default': True})
|
|
214
|
+
|
|
215
|
+
def __post_init__(self) -> None:
|
|
216
|
+
if isinstance(self.merged_at, str):
|
|
217
|
+
object.__setattr__(self, 'merged_at', parse_go_datetime(self.merged_at, 'merged_at'))
|
|
218
|
+
elif self.merged_at is not None:
|
|
219
|
+
validate_go_datetime(self.merged_at, 'merged_at')
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
setattr(MergedPullRequest, '__module__', 'dex_connectors.github.models')
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
# MergedPullRequestPage is one bounded GitHub search page. NextPage is zero when no page follows.
|
|
226
|
+
@dataclass(frozen=True, slots=True)
|
|
227
|
+
class MergedPullRequestPage:
|
|
228
|
+
# PullRequests holds this page's merged pull requests, newest created first.
|
|
229
|
+
pull_requests: tuple[MergedPullRequest, ...] = _dataclass_field(default=(), metadata={'dex_json_name': 'pullRequests'})
|
|
230
|
+
# TotalCount is GitHub's count of every matching pull request. It can exceed the 1000 results that
|
|
231
|
+
# GitHub search serves; narrow the window to read them all.
|
|
232
|
+
total_count: int = _dataclass_field(default=0, metadata={'dex_json_name': 'totalCount'})
|
|
233
|
+
# IncompleteResults reports that GitHub search timed out before it found every match.
|
|
234
|
+
incomplete_results: bool = _dataclass_field(default=False, metadata={'dex_json_name': 'incompleteResults'})
|
|
235
|
+
# NextPage is the one-based page that follows, or zero when this is the last page.
|
|
236
|
+
next_page: int = _dataclass_field(default=0, metadata={'dex_json_name': 'nextPage'})
|
|
237
|
+
|
|
238
|
+
def __post_init__(self) -> None:
|
|
239
|
+
object.__setattr__(self, 'pull_requests', _replace_nil_slices(self.pull_requests, 1))
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
MergedPullRequestPage.__annotations__['pull_requests'] = tuple[MergedPullRequest, ...] | None
|
|
243
|
+
MergedPullRequestPage.__dataclass_fields__['pull_requests'].type = tuple[MergedPullRequest, ...] | None
|
|
244
|
+
setattr(MergedPullRequestPage, '__module__', 'dex_connectors.github.models')
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
# ListPullRequestFilesInput selects one page of files changed by one pull request.
|
|
248
|
+
@dataclass(frozen=True, slots=True)
|
|
249
|
+
class ListPullRequestFilesInput:
|
|
250
|
+
# Owner is the GitHub login that owns the repository. Surrounding whitespace is ignored.
|
|
251
|
+
owner: str = ''
|
|
252
|
+
# Repository is the repository name without its owner, such as hello-world.
|
|
253
|
+
repository: str = ''
|
|
254
|
+
# Number is the positive pull request number.
|
|
255
|
+
number: int = 0
|
|
256
|
+
# PageSize is 1 through 100. Zero selects 50.
|
|
257
|
+
page_size: int = _dataclass_field(default=0, metadata={'dex_json_name': 'pageSize', 'dex_json_omit_default': True})
|
|
258
|
+
# Page is one-based. Zero selects 1.
|
|
259
|
+
page: int = _dataclass_field(default=0, metadata={'dex_json_omit_default': True})
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
setattr(ListPullRequestFilesInput, '__module__', 'dex_connectors.github.models')
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
# PullRequestFile is one file changed by a pull request, with a bounded patch.
|
|
266
|
+
@dataclass(frozen=True, slots=True)
|
|
267
|
+
class PullRequestFile:
|
|
268
|
+
# Filename is the file's repository path after the change.
|
|
269
|
+
filename: str = ''
|
|
270
|
+
# PreviousFilename is the file's path before a rename, or empty.
|
|
271
|
+
previous_filename: str = _dataclass_field(default='', metadata={'dex_json_name': 'previousFilename', 'dex_json_omit_default': True})
|
|
272
|
+
# Status is GitHub's change status, such as added, modified, removed, or renamed.
|
|
273
|
+
status: str = ''
|
|
274
|
+
# Additions is the number of added lines.
|
|
275
|
+
additions: int = 0
|
|
276
|
+
# Deletions is the number of removed lines.
|
|
277
|
+
deletions: int = 0
|
|
278
|
+
# Changes is the number of changed lines.
|
|
279
|
+
changes: int = 0
|
|
280
|
+
# Patch is the beginning of the file's unified diff, bounded by the maxPatchCharacters configuration
|
|
281
|
+
# field. GitHub omits the patch for a binary or very large file, which leaves Patch empty.
|
|
282
|
+
patch: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
283
|
+
# PatchTruncated reports that Patch omits the end of GitHub's patch.
|
|
284
|
+
patch_truncated: bool = _dataclass_field(default=False, metadata={'dex_json_name': 'patchTruncated'})
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
setattr(PullRequestFile, '__module__', 'dex_connectors.github.models')
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
# PullRequestFilePage is one bounded page of changed files. NextPage is zero when no page follows.
|
|
291
|
+
@dataclass(frozen=True, slots=True)
|
|
292
|
+
class PullRequestFilePage:
|
|
293
|
+
# Files holds this page's changed files in GitHub's order.
|
|
294
|
+
files: tuple[PullRequestFile, ...] = ()
|
|
295
|
+
# NextPage is the one-based page that follows, or zero when this is the last page.
|
|
296
|
+
next_page: int = _dataclass_field(default=0, metadata={'dex_json_name': 'nextPage'})
|
|
297
|
+
|
|
298
|
+
def __post_init__(self) -> None:
|
|
299
|
+
object.__setattr__(self, 'files', _replace_nil_slices(self.files, 1))
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
PullRequestFilePage.__annotations__['files'] = tuple[PullRequestFile, ...] | None
|
|
303
|
+
PullRequestFilePage.__dataclass_fields__['files'].type = tuple[PullRequestFile, ...] | None
|
|
304
|
+
setattr(PullRequestFilePage, '__module__', 'dex_connectors.github.models')
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
# ListReleasesInput selects a single bounded page; date filtering is performed by the caller.
|
|
308
|
+
@dataclass(frozen=True, slots=True)
|
|
309
|
+
class ListReleasesInput:
|
|
310
|
+
# Owner is the GitHub login that owns the repository. Surrounding whitespace is ignored.
|
|
311
|
+
owner: str = ''
|
|
312
|
+
# Repository is the repository name without its owner.
|
|
313
|
+
repository: str = ''
|
|
314
|
+
# PageSize is 1 through 100. Zero selects 30.
|
|
315
|
+
page_size: int = _dataclass_field(default=0, metadata={'dex_json_name': 'pageSize', 'dex_json_omit_default': True})
|
|
316
|
+
# Page is one-based. Zero selects 1.
|
|
317
|
+
page: int = _dataclass_field(default=0, metadata={'dex_json_omit_default': True})
|
|
318
|
+
# MaxBodyCharacters bounds each release's notes to 1 through 16384 Unicode characters. Zero selects 4000.
|
|
319
|
+
max_body_characters: int = _dataclass_field(default=0, metadata={'dex_json_name': 'maxBodyCharacters', 'dex_json_omit_default': True})
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
setattr(ListReleasesInput, '__module__', 'dex_connectors.github.models')
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
# Release contains provider identity and bounded release notes, never credentials or asset contents.
|
|
326
|
+
@dataclass(frozen=True, slots=True)
|
|
327
|
+
class Release:
|
|
328
|
+
# ID is the stable GitHub release ID; a tag or title can be edited without changing it.
|
|
329
|
+
id: int = 0
|
|
330
|
+
# TagName is the release's tag, bounded to 255 bytes.
|
|
331
|
+
tag_name: str = _dataclass_field(default='', metadata={'dex_json_name': 'tagName'})
|
|
332
|
+
# Name is the optional release title, bounded to 1024 bytes.
|
|
333
|
+
name: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
334
|
+
# URL is the safe public web URL, or empty if GitHub returned an unsafe URL.
|
|
335
|
+
url: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
336
|
+
# Body is the beginning of the release notes, limited by MaxBodyCharacters.
|
|
337
|
+
body: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
338
|
+
# BodyTruncated reports whether the notes were shortened.
|
|
339
|
+
body_truncated: bool = _dataclass_field(default=False, metadata={'dex_json_name': 'bodyTruncated'})
|
|
340
|
+
# IsDraft reports an unpublished draft visible to this grant.
|
|
341
|
+
is_draft: bool = _dataclass_field(default=False, metadata={'dex_json_name': 'isDraft'})
|
|
342
|
+
# IsPrerelease reports GitHub's prerelease flag.
|
|
343
|
+
is_prerelease: bool = _dataclass_field(default=False, metadata={'dex_json_name': 'isPrerelease'})
|
|
344
|
+
# CreatedAt is GitHub's creation timestamp; it must not be used as publication time.
|
|
345
|
+
created_at: datetime = _dataclass_field(default_factory=lambda: datetime.min.replace(tzinfo=UTC), metadata={'dex_json_name': 'createdAt', 'dex_json_format': 'rfc3339'})
|
|
346
|
+
# PublishedAt is the publication time in UTC, absent for an unpublished draft.
|
|
347
|
+
published_at: datetime | None = _dataclass_field(default=None, metadata={'dex_json_name': 'publishedAt', 'dex_json_omit_default': True, 'dex_json_format': 'rfc3339'})
|
|
348
|
+
|
|
349
|
+
def __post_init__(self) -> None:
|
|
350
|
+
if isinstance(self.created_at, str):
|
|
351
|
+
object.__setattr__(self, 'created_at', parse_go_datetime(self.created_at, 'created_at'))
|
|
352
|
+
elif self.created_at is not None:
|
|
353
|
+
validate_go_datetime(self.created_at, 'created_at')
|
|
354
|
+
if isinstance(self.published_at, str):
|
|
355
|
+
object.__setattr__(self, 'published_at', parse_go_datetime(self.published_at, 'published_at'))
|
|
356
|
+
elif self.published_at is not None:
|
|
357
|
+
validate_go_datetime(self.published_at, 'published_at')
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
setattr(Release, '__module__', 'dex_connectors.github.models')
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
# ReleasePage contains one page in provider order, which is not necessarily publication-date order.
|
|
364
|
+
@dataclass(frozen=True, slots=True)
|
|
365
|
+
class ReleasePage:
|
|
366
|
+
# Releases holds the page, including drafts visible to the grant and prereleases.
|
|
367
|
+
releases: tuple[Release, ...] = ()
|
|
368
|
+
# NextPage is the following page number, or zero when GitHub provides no next link.
|
|
369
|
+
next_page: int = _dataclass_field(default=0, metadata={'dex_json_name': 'nextPage'})
|
|
370
|
+
|
|
371
|
+
def __post_init__(self) -> None:
|
|
372
|
+
object.__setattr__(self, 'releases', _replace_nil_slices(self.releases, 1))
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
ReleasePage.__annotations__['releases'] = tuple[Release, ...] | None
|
|
376
|
+
ReleasePage.__dataclass_fields__['releases'].type = tuple[Release, ...] | None
|
|
377
|
+
setattr(ReleasePage, '__module__', 'dex_connectors.github.models')
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
# ListCommitsInput selects one page of commits within a time window, optionally from one ref and path.
|
|
381
|
+
@dataclass(frozen=True, slots=True)
|
|
382
|
+
class ListCommitsInput:
|
|
383
|
+
# Owner is the GitHub login that owns the repository. Surrounding whitespace is ignored.
|
|
384
|
+
owner: str = ''
|
|
385
|
+
# Repository is the repository name without its owner, such as hello-world.
|
|
386
|
+
repository: str = ''
|
|
387
|
+
# Since is the window start. GitHub receives it as since, in UTC with second precision.
|
|
388
|
+
since: datetime = _dataclass_field(default_factory=lambda: datetime.min.replace(tzinfo=UTC), metadata={'dex_json_format': 'rfc3339'})
|
|
389
|
+
# Until is the window end and must be after Since. GitHub receives it as until, in UTC with second
|
|
390
|
+
# precision.
|
|
391
|
+
until: datetime = _dataclass_field(default_factory=lambda: datetime.min.replace(tzinfo=UTC), metadata={'dex_json_format': 'rfc3339'})
|
|
392
|
+
# Path limits commits to those that changed one file or directory path.
|
|
393
|
+
path: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
394
|
+
# Ref is a branch, tag, or commit SHA. Empty selects the repository default branch.
|
|
395
|
+
ref: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
396
|
+
# PageSize is 1 through 100. Zero selects 30.
|
|
397
|
+
page_size: int = _dataclass_field(default=0, metadata={'dex_json_name': 'pageSize', 'dex_json_omit_default': True})
|
|
398
|
+
# Page is one-based. Zero selects 1.
|
|
399
|
+
page: int = _dataclass_field(default=0, metadata={'dex_json_omit_default': True})
|
|
400
|
+
|
|
401
|
+
def __post_init__(self) -> None:
|
|
402
|
+
if isinstance(self.since, str):
|
|
403
|
+
object.__setattr__(self, 'since', parse_go_datetime(self.since, 'since'))
|
|
404
|
+
elif self.since is not None:
|
|
405
|
+
validate_go_datetime(self.since, 'since')
|
|
406
|
+
if isinstance(self.until, str):
|
|
407
|
+
object.__setattr__(self, 'until', parse_go_datetime(self.until, 'until'))
|
|
408
|
+
elif self.until is not None:
|
|
409
|
+
validate_go_datetime(self.until, 'until')
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
setattr(ListCommitsInput, '__module__', 'dex_connectors.github.models')
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
# CommitSummary is one commit with a bounded message. It never contains commit email addresses.
|
|
416
|
+
@dataclass(frozen=True, slots=True)
|
|
417
|
+
class CommitSummary:
|
|
418
|
+
# SHA is the commit's lowercase hexadecimal SHA-1 or SHA-256 object name.
|
|
419
|
+
sha: str = ''
|
|
420
|
+
# Message is the beginning of the commit message, bounded by the maxCommitMessageCharacters
|
|
421
|
+
# configuration field.
|
|
422
|
+
message: str = ''
|
|
423
|
+
# MessageTruncated reports that Message omits the end of the commit message.
|
|
424
|
+
message_truncated: bool = _dataclass_field(default=False, metadata={'dex_json_name': 'messageTruncated'})
|
|
425
|
+
# AuthorLogin is the GitHub login linked to the commit author, or empty when GitHub links none.
|
|
426
|
+
author_login: str = _dataclass_field(default='', metadata={'dex_json_name': 'authorLogin', 'dex_json_omit_default': True})
|
|
427
|
+
# AuthorName is the trimmed Git author name, bounded to 256 bytes.
|
|
428
|
+
author_name: str = _dataclass_field(default='', metadata={'dex_json_name': 'authorName', 'dex_json_omit_default': True})
|
|
429
|
+
# AuthoredAt is the Git author time in UTC.
|
|
430
|
+
authored_at: datetime = _dataclass_field(default_factory=lambda: datetime.min.replace(tzinfo=UTC), metadata={'dex_json_name': 'authoredAt', 'dex_json_format': 'rfc3339'})
|
|
431
|
+
# CommittedAt is the Git committer time in UTC.
|
|
432
|
+
committed_at: datetime = _dataclass_field(default_factory=lambda: datetime.min.replace(tzinfo=UTC), metadata={'dex_json_name': 'committedAt', 'dex_json_format': 'rfc3339'})
|
|
433
|
+
# URL is the commit's GitHub web URL, or empty when GitHub returns an unsafe URL.
|
|
434
|
+
url: str = _dataclass_field(default='', metadata={'dex_json_omit_default': True})
|
|
435
|
+
|
|
436
|
+
def __post_init__(self) -> None:
|
|
437
|
+
if isinstance(self.authored_at, str):
|
|
438
|
+
object.__setattr__(self, 'authored_at', parse_go_datetime(self.authored_at, 'authored_at'))
|
|
439
|
+
elif self.authored_at is not None:
|
|
440
|
+
validate_go_datetime(self.authored_at, 'authored_at')
|
|
441
|
+
if isinstance(self.committed_at, str):
|
|
442
|
+
object.__setattr__(self, 'committed_at', parse_go_datetime(self.committed_at, 'committed_at'))
|
|
443
|
+
elif self.committed_at is not None:
|
|
444
|
+
validate_go_datetime(self.committed_at, 'committed_at')
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
setattr(CommitSummary, '__module__', 'dex_connectors.github.models')
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
# CommitPage is one bounded page of commits. NextPage is zero when no page follows.
|
|
451
|
+
@dataclass(frozen=True, slots=True)
|
|
452
|
+
class CommitPage:
|
|
453
|
+
# Commits holds this page's commits in GitHub's order, newest first.
|
|
454
|
+
commits: tuple[CommitSummary, ...] = ()
|
|
455
|
+
# NextPage is the one-based page that follows, or zero when this is the last page.
|
|
456
|
+
next_page: int = _dataclass_field(default=0, metadata={'dex_json_name': 'nextPage'})
|
|
457
|
+
|
|
458
|
+
def __post_init__(self) -> None:
|
|
459
|
+
object.__setattr__(self, 'commits', _replace_nil_slices(self.commits, 1))
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
CommitPage.__annotations__['commits'] = tuple[CommitSummary, ...] | None
|
|
463
|
+
CommitPage.__dataclass_fields__['commits'].type = tuple[CommitSummary, ...] | None
|
|
464
|
+
setattr(CommitPage, '__module__', 'dex_connectors.github.models')
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Copyright (c) 2026 Super Durable
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
# ruff: noqa
|
|
4
|
+
|
|
5
|
+
# Validated manifest token grant declaration.
|
|
6
|
+
AUTHORIZATION = {'type': 'oauth2', 'fields': [{'name': 'oauth_client_id', 'type': 'string', 'required': True}, {'name': 'oauth_client_secret', 'type': 'secretString', 'required': True}, {'name': 'access_token', 'type': 'secretString', 'required': True}, {'name': 'refresh_token', 'type': 'secretString', 'required': False}], 'oauth2': {'tokenEndpoint': 'https://github.com/login/oauth/access_token', 'clientIDCredential': 'oauth_client_id', 'clientSecretCredential': 'oauth_client_secret', 'scopes': ['read:user', 'user:email', 'offline_access'], 'credentialMappings': [{'credential': 'access_token', 'source': 'access_token'}, {'credential': 'refresh_token', 'source': 'refresh_token'}], 'refresh': {'tokenExchangeTimeout': '15s', 'exactScopes': True, 'scopeSeparators': 'whitespaceAndComma', 'requiredScopes': ['read:user', 'user:email'], 'terminalErrorCodes': ['bad_refresh_token', 'incorrect_client_credentials', 'invalid_client', 'invalid_grant'], 'missingExpiry': 'reject'}}, 'refreshable': True}
|
|
7
|
+
|
|
8
|
+
# Stored credential names mapped to runtime dataclass fields.
|
|
9
|
+
CREDENTIAL_FIELDS = {'oauth_client_id': 'oauth_client_id', 'oauth_client_secret': 'oauth_client_secret', 'access_token': 'access_token', 'refresh_token': 'refresh_token'}
|