databricks-sdk 0.32.3__py3-none-any.whl → 0.33.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.

Potentially problematic release.


This version of databricks-sdk might be problematic. Click here for more details.

@@ -64,11 +64,11 @@ class AzureKeyVaultSecretScopeMetadata:
64
64
 
65
65
 
66
66
  @dataclass
67
- class CreateCredentials:
67
+ class CreateCredentialsRequest:
68
68
  git_provider: str
69
- """Git provider. This field is case-insensitive. The available Git providers are gitHub,
70
- bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
71
- gitLabEnterpriseEdition and awsCodeCommit."""
69
+ """Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
70
+ `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
71
+ `gitLabEnterpriseEdition` and `awsCodeCommit`."""
72
72
 
73
73
  git_username: Optional[str] = None
74
74
  """The username or email provided with your Git provider account, depending on which provider you
@@ -79,13 +79,12 @@ class CreateCredentials:
79
79
 
80
80
  personal_access_token: Optional[str] = None
81
81
  """The personal access token used to authenticate to the corresponding Git provider. For certain
82
- providers, support may exist for other types of scoped access tokens. [Learn more]. The personal
83
- access token used to authenticate to the corresponding Git
82
+ providers, support may exist for other types of scoped access tokens. [Learn more].
84
83
 
85
84
  [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html"""
86
85
 
87
86
  def as_dict(self) -> dict:
88
- """Serializes the CreateCredentials into a dictionary suitable for use as a JSON request body."""
87
+ """Serializes the CreateCredentialsRequest into a dictionary suitable for use as a JSON request body."""
89
88
  body = {}
90
89
  if self.git_provider is not None: body['git_provider'] = self.git_provider
91
90
  if self.git_username is not None: body['git_username'] = self.git_username
@@ -93,8 +92,8 @@ class CreateCredentials:
93
92
  return body
94
93
 
95
94
  @classmethod
96
- def from_dict(cls, d: Dict[str, any]) -> CreateCredentials:
97
- """Deserializes the CreateCredentials from a dictionary."""
95
+ def from_dict(cls, d: Dict[str, any]) -> CreateCredentialsRequest:
96
+ """Deserializes the CreateCredentialsRequest from a dictionary."""
98
97
  return cls(git_provider=d.get('git_provider', None),
99
98
  git_username=d.get('git_username', None),
100
99
  personal_access_token=d.get('personal_access_token', None))
@@ -102,20 +101,15 @@ class CreateCredentials:
102
101
 
103
102
  @dataclass
104
103
  class CreateCredentialsResponse:
105
- credential_id: Optional[int] = None
104
+ credential_id: int
106
105
  """ID of the credential object in the workspace."""
107
106
 
108
- git_provider: Optional[str] = None
109
- """Git provider. This field is case-insensitive. The available Git providers are gitHub,
110
- bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
111
- gitLabEnterpriseEdition and awsCodeCommit."""
107
+ git_provider: str
108
+ """The Git provider associated with the credential."""
112
109
 
113
110
  git_username: Optional[str] = None
114
- """The username or email provided with your Git provider account, depending on which provider you
115
- are using. For GitHub, GitHub Enterprise Server, or Azure DevOps Services, either email or
116
- username may be used. For GitLab, GitLab Enterprise Edition, email must be used. For AWS
117
- CodeCommit, BitBucket or BitBucket Server, username must be used. For all other providers please
118
- see your provider's Personal Access Token authentication documentation to see what is supported."""
111
+ """The username or email provided with your Git provider account and associated with the
112
+ credential."""
119
113
 
120
114
  def as_dict(self) -> dict:
121
115
  """Serializes the CreateCredentialsResponse into a dictionary suitable for use as a JSON request body."""
@@ -134,25 +128,25 @@ class CreateCredentialsResponse:
134
128
 
135
129
 
136
130
  @dataclass
137
- class CreateRepo:
131
+ class CreateRepoRequest:
138
132
  url: str
139
133
  """URL of the Git repository to be linked."""
140
134
 
141
135
  provider: str
142
- """Git provider. This field is case-insensitive. The available Git providers are gitHub,
143
- bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
144
- gitLabEnterpriseEdition and awsCodeCommit."""
136
+ """Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
137
+ `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
138
+ `gitLabEnterpriseEdition` and `awsCodeCommit`."""
145
139
 
146
140
  path: Optional[str] = None
147
141
  """Desired path for the repo in the workspace. Almost any path in the workspace can be chosen. If
148
- repo is created in /Repos, path must be in the format /Repos/{folder}/{repo-name}."""
142
+ repo is created in `/Repos`, path must be in the format `/Repos/{folder}/{repo-name}`."""
149
143
 
150
144
  sparse_checkout: Optional[SparseCheckout] = None
151
145
  """If specified, the repo will be created with sparse checkout enabled. You cannot enable/disable
152
146
  sparse checkout after the repo is created."""
153
147
 
154
148
  def as_dict(self) -> dict:
155
- """Serializes the CreateRepo into a dictionary suitable for use as a JSON request body."""
149
+ """Serializes the CreateRepoRequest into a dictionary suitable for use as a JSON request body."""
156
150
  body = {}
157
151
  if self.path is not None: body['path'] = self.path
158
152
  if self.provider is not None: body['provider'] = self.provider
@@ -161,14 +155,61 @@ class CreateRepo:
161
155
  return body
162
156
 
163
157
  @classmethod
164
- def from_dict(cls, d: Dict[str, any]) -> CreateRepo:
165
- """Deserializes the CreateRepo from a dictionary."""
158
+ def from_dict(cls, d: Dict[str, any]) -> CreateRepoRequest:
159
+ """Deserializes the CreateRepoRequest from a dictionary."""
166
160
  return cls(path=d.get('path', None),
167
161
  provider=d.get('provider', None),
168
162
  sparse_checkout=_from_dict(d, 'sparse_checkout', SparseCheckout),
169
163
  url=d.get('url', None))
170
164
 
171
165
 
166
+ @dataclass
167
+ class CreateRepoResponse:
168
+ branch: Optional[str] = None
169
+ """Branch that the Git folder (repo) is checked out to."""
170
+
171
+ head_commit_id: Optional[str] = None
172
+ """SHA-1 hash representing the commit ID of the current HEAD of the Git folder (repo)."""
173
+
174
+ id: Optional[int] = None
175
+ """ID of the Git folder (repo) object in the workspace."""
176
+
177
+ path: Optional[str] = None
178
+ """Path of the Git folder (repo) in the workspace."""
179
+
180
+ provider: Optional[str] = None
181
+ """Git provider of the linked Git repository."""
182
+
183
+ sparse_checkout: Optional[SparseCheckout] = None
184
+ """Sparse checkout settings for the Git folder (repo)."""
185
+
186
+ url: Optional[str] = None
187
+ """URL of the linked Git repository."""
188
+
189
+ def as_dict(self) -> dict:
190
+ """Serializes the CreateRepoResponse into a dictionary suitable for use as a JSON request body."""
191
+ body = {}
192
+ if self.branch is not None: body['branch'] = self.branch
193
+ if self.head_commit_id is not None: body['head_commit_id'] = self.head_commit_id
194
+ if self.id is not None: body['id'] = self.id
195
+ if self.path is not None: body['path'] = self.path
196
+ if self.provider is not None: body['provider'] = self.provider
197
+ if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout.as_dict()
198
+ if self.url is not None: body['url'] = self.url
199
+ return body
200
+
201
+ @classmethod
202
+ def from_dict(cls, d: Dict[str, any]) -> CreateRepoResponse:
203
+ """Deserializes the CreateRepoResponse from a dictionary."""
204
+ return cls(branch=d.get('branch', None),
205
+ head_commit_id=d.get('head_commit_id', None),
206
+ id=d.get('id', None),
207
+ path=d.get('path', None),
208
+ provider=d.get('provider', None),
209
+ sparse_checkout=_from_dict(d, 'sparse_checkout', SparseCheckout),
210
+ url=d.get('url', None))
211
+
212
+
172
213
  @dataclass
173
214
  class CreateScope:
174
215
  scope: str
@@ -219,20 +260,15 @@ class CreateScopeResponse:
219
260
 
220
261
  @dataclass
221
262
  class CredentialInfo:
222
- credential_id: Optional[int] = None
263
+ credential_id: int
223
264
  """ID of the credential object in the workspace."""
224
265
 
225
266
  git_provider: Optional[str] = None
226
- """Git provider. This field is case-insensitive. The available Git providers are gitHub,
227
- gitHubOAuth, bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
228
- gitLabEnterpriseEdition and awsCodeCommit."""
267
+ """The Git provider associated with the credential."""
229
268
 
230
269
  git_username: Optional[str] = None
231
- """The username or email provided with your Git provider account, depending on which provider you
232
- are using. For GitHub, GitHub Enterprise Server, or Azure DevOps Services, either email or
233
- username may be used. For GitLab, GitLab Enterprise Edition, email must be used. For AWS
234
- CodeCommit, BitBucket or BitBucket Server, username must be used. For all other providers please
235
- see your provider's Personal Access Token authentication documentation to see what is supported."""
270
+ """The username or email provided with your Git provider account and associated with the
271
+ credential."""
236
272
 
237
273
  def as_dict(self) -> dict:
238
274
  """Serializes the CredentialInfo into a dictionary suitable for use as a JSON request body."""
@@ -308,6 +344,34 @@ class DeleteAclResponse:
308
344
  return cls()
309
345
 
310
346
 
347
+ @dataclass
348
+ class DeleteCredentialsResponse:
349
+
350
+ def as_dict(self) -> dict:
351
+ """Serializes the DeleteCredentialsResponse into a dictionary suitable for use as a JSON request body."""
352
+ body = {}
353
+ return body
354
+
355
+ @classmethod
356
+ def from_dict(cls, d: Dict[str, any]) -> DeleteCredentialsResponse:
357
+ """Deserializes the DeleteCredentialsResponse from a dictionary."""
358
+ return cls()
359
+
360
+
361
+ @dataclass
362
+ class DeleteRepoResponse:
363
+
364
+ def as_dict(self) -> dict:
365
+ """Serializes the DeleteRepoResponse into a dictionary suitable for use as a JSON request body."""
366
+ body = {}
367
+ return body
368
+
369
+ @classmethod
370
+ def from_dict(cls, d: Dict[str, any]) -> DeleteRepoResponse:
371
+ """Deserializes the DeleteRepoResponse from a dictionary."""
372
+ return cls()
373
+
374
+
311
375
  @dataclass
312
376
  class DeleteResponse:
313
377
 
@@ -422,18 +486,30 @@ class ExportResponse:
422
486
 
423
487
  @dataclass
424
488
  class GetCredentialsResponse:
425
- credentials: Optional[List[CredentialInfo]] = None
489
+ credential_id: int
490
+ """ID of the credential object in the workspace."""
491
+
492
+ git_provider: Optional[str] = None
493
+ """The Git provider associated with the credential."""
494
+
495
+ git_username: Optional[str] = None
496
+ """The username or email provided with your Git provider account and associated with the
497
+ credential."""
426
498
 
427
499
  def as_dict(self) -> dict:
428
500
  """Serializes the GetCredentialsResponse into a dictionary suitable for use as a JSON request body."""
429
501
  body = {}
430
- if self.credentials: body['credentials'] = [v.as_dict() for v in self.credentials]
502
+ if self.credential_id is not None: body['credential_id'] = self.credential_id
503
+ if self.git_provider is not None: body['git_provider'] = self.git_provider
504
+ if self.git_username is not None: body['git_username'] = self.git_username
431
505
  return body
432
506
 
433
507
  @classmethod
434
508
  def from_dict(cls, d: Dict[str, any]) -> GetCredentialsResponse:
435
509
  """Deserializes the GetCredentialsResponse from a dictionary."""
436
- return cls(credentials=_repeated_dict(d, 'credentials', CredentialInfo))
510
+ return cls(credential_id=d.get('credential_id', None),
511
+ git_provider=d.get('git_provider', None),
512
+ git_username=d.get('git_username', None))
437
513
 
438
514
 
439
515
  @dataclass
@@ -453,6 +529,53 @@ class GetRepoPermissionLevelsResponse:
453
529
  return cls(permission_levels=_repeated_dict(d, 'permission_levels', RepoPermissionsDescription))
454
530
 
455
531
 
532
+ @dataclass
533
+ class GetRepoResponse:
534
+ branch: Optional[str] = None
535
+ """Branch that the local version of the repo is checked out to."""
536
+
537
+ head_commit_id: Optional[str] = None
538
+ """SHA-1 hash representing the commit ID of the current HEAD of the repo."""
539
+
540
+ id: Optional[int] = None
541
+ """ID of the Git folder (repo) object in the workspace."""
542
+
543
+ path: Optional[str] = None
544
+ """Path of the Git folder (repo) in the workspace."""
545
+
546
+ provider: Optional[str] = None
547
+ """Git provider of the linked Git repository."""
548
+
549
+ sparse_checkout: Optional[SparseCheckout] = None
550
+ """Sparse checkout settings for the Git folder (repo)."""
551
+
552
+ url: Optional[str] = None
553
+ """URL of the linked Git repository."""
554
+
555
+ def as_dict(self) -> dict:
556
+ """Serializes the GetRepoResponse into a dictionary suitable for use as a JSON request body."""
557
+ body = {}
558
+ if self.branch is not None: body['branch'] = self.branch
559
+ if self.head_commit_id is not None: body['head_commit_id'] = self.head_commit_id
560
+ if self.id is not None: body['id'] = self.id
561
+ if self.path is not None: body['path'] = self.path
562
+ if self.provider is not None: body['provider'] = self.provider
563
+ if self.sparse_checkout: body['sparse_checkout'] = self.sparse_checkout.as_dict()
564
+ if self.url is not None: body['url'] = self.url
565
+ return body
566
+
567
+ @classmethod
568
+ def from_dict(cls, d: Dict[str, any]) -> GetRepoResponse:
569
+ """Deserializes the GetRepoResponse from a dictionary."""
570
+ return cls(branch=d.get('branch', None),
571
+ head_commit_id=d.get('head_commit_id', None),
572
+ id=d.get('id', None),
573
+ path=d.get('path', None),
574
+ provider=d.get('provider', None),
575
+ sparse_checkout=_from_dict(d, 'sparse_checkout', SparseCheckout),
576
+ url=d.get('url', None))
577
+
578
+
456
579
  @dataclass
457
580
  class GetSecretResponse:
458
581
  key: Optional[str] = None
@@ -605,13 +728,31 @@ class ListAclsResponse:
605
728
  return cls(items=_repeated_dict(d, 'items', AclItem))
606
729
 
607
730
 
731
+ @dataclass
732
+ class ListCredentialsResponse:
733
+ credentials: Optional[List[CredentialInfo]] = None
734
+ """List of credentials."""
735
+
736
+ def as_dict(self) -> dict:
737
+ """Serializes the ListCredentialsResponse into a dictionary suitable for use as a JSON request body."""
738
+ body = {}
739
+ if self.credentials: body['credentials'] = [v.as_dict() for v in self.credentials]
740
+ return body
741
+
742
+ @classmethod
743
+ def from_dict(cls, d: Dict[str, any]) -> ListCredentialsResponse:
744
+ """Deserializes the ListCredentialsResponse from a dictionary."""
745
+ return cls(credentials=_repeated_dict(d, 'credentials', CredentialInfo))
746
+
747
+
608
748
  @dataclass
609
749
  class ListReposResponse:
610
750
  next_page_token: Optional[str] = None
611
- """Token that can be specified as a query parameter to the GET /repos endpoint to retrieve the next
612
- page of results."""
751
+ """Token that can be specified as a query parameter to the `GET /repos` endpoint to retrieve the
752
+ next page of results."""
613
753
 
614
754
  repos: Optional[List[RepoInfo]] = None
755
+ """List of Git folders (repos)."""
615
756
 
616
757
  def as_dict(self) -> dict:
617
758
  """Serializes the ListReposResponse into a dictionary suitable for use as a JSON request body."""
@@ -940,28 +1081,28 @@ class RepoAccessControlResponse:
940
1081
 
941
1082
  @dataclass
942
1083
  class RepoInfo:
1084
+ """Git folder (repo) information."""
1085
+
943
1086
  branch: Optional[str] = None
944
- """Branch that the local version of the repo is checked out to."""
1087
+ """Name of the current git branch of the git folder (repo)."""
945
1088
 
946
1089
  head_commit_id: Optional[str] = None
947
- """SHA-1 hash representing the commit ID of the current HEAD of the repo."""
1090
+ """Current git commit id of the git folder (repo)."""
948
1091
 
949
1092
  id: Optional[int] = None
950
- """ID of the repo object in the workspace."""
1093
+ """Id of the git folder (repo) in the Workspace."""
951
1094
 
952
1095
  path: Optional[str] = None
953
- """Desired path for the repo in the workspace. Almost any path in the workspace can be chosen. If
954
- repo is created in /Repos, path must be in the format /Repos/{folder}/{repo-name}."""
1096
+ """Root path of the git folder (repo) in the Workspace."""
955
1097
 
956
1098
  provider: Optional[str] = None
957
- """Git provider. This field is case-insensitive. The available Git providers are gitHub,
958
- bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
959
- gitLabEnterpriseEdition and awsCodeCommit."""
1099
+ """Git provider of the remote git repository, e.g. `gitHub`."""
960
1100
 
961
1101
  sparse_checkout: Optional[SparseCheckout] = None
1102
+ """Sparse checkout config for the git folder (repo)."""
962
1103
 
963
1104
  url: Optional[str] = None
964
- """URL of the Git repository to be linked."""
1105
+ """URL of the remote git repository."""
965
1106
 
966
1107
  def as_dict(self) -> dict:
967
1108
  """Serializes the RepoInfo into a dictionary suitable for use as a JSON request body."""
@@ -1146,8 +1287,12 @@ class SecretScope:
1146
1287
 
1147
1288
  @dataclass
1148
1289
  class SparseCheckout:
1290
+ """Sparse checkout configuration, it contains options like cone patterns."""
1291
+
1149
1292
  patterns: Optional[List[str]] = None
1150
- """List of patterns to include for sparse checkout."""
1293
+ """List of sparse checkout cone patterns, see [cone mode handling] for details.
1294
+
1295
+ [cone mode handling]: https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling"""
1151
1296
 
1152
1297
  def as_dict(self) -> dict:
1153
1298
  """Serializes the SparseCheckout into a dictionary suitable for use as a JSON request body."""
@@ -1163,8 +1308,12 @@ class SparseCheckout:
1163
1308
 
1164
1309
  @dataclass
1165
1310
  class SparseCheckoutUpdate:
1311
+ """Sparse checkout configuration, it contains options like cone patterns."""
1312
+
1166
1313
  patterns: Optional[List[str]] = None
1167
- """List of patterns to include for sparse checkout."""
1314
+ """List of sparse checkout cone patterns, see [cone mode handling] for details.
1315
+
1316
+ [cone mode handling]: https://git-scm.com/docs/git-sparse-checkout#_internalscone_mode_handling"""
1168
1317
 
1169
1318
  def as_dict(self) -> dict:
1170
1319
  """Serializes the SparseCheckoutUpdate into a dictionary suitable for use as a JSON request body."""
@@ -1179,15 +1328,15 @@ class SparseCheckoutUpdate:
1179
1328
 
1180
1329
 
1181
1330
  @dataclass
1182
- class UpdateCredentials:
1331
+ class UpdateCredentialsRequest:
1332
+ git_provider: str
1333
+ """Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
1334
+ `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
1335
+ `gitLabEnterpriseEdition` and `awsCodeCommit`."""
1336
+
1183
1337
  credential_id: Optional[int] = None
1184
1338
  """The ID for the corresponding credential to access."""
1185
1339
 
1186
- git_provider: Optional[str] = None
1187
- """Git provider. This field is case-insensitive. The available Git providers are gitHub,
1188
- bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
1189
- gitLabEnterpriseEdition and awsCodeCommit."""
1190
-
1191
1340
  git_username: Optional[str] = None
1192
1341
  """The username or email provided with your Git provider account, depending on which provider you
1193
1342
  are using. For GitHub, GitHub Enterprise Server, or Azure DevOps Services, either email or
@@ -1197,13 +1346,12 @@ class UpdateCredentials:
1197
1346
 
1198
1347
  personal_access_token: Optional[str] = None
1199
1348
  """The personal access token used to authenticate to the corresponding Git provider. For certain
1200
- providers, support may exist for other types of scoped access tokens. [Learn more]. The personal
1201
- access token used to authenticate to the corresponding Git
1349
+ providers, support may exist for other types of scoped access tokens. [Learn more].
1202
1350
 
1203
1351
  [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html"""
1204
1352
 
1205
1353
  def as_dict(self) -> dict:
1206
- """Serializes the UpdateCredentials into a dictionary suitable for use as a JSON request body."""
1354
+ """Serializes the UpdateCredentialsRequest into a dictionary suitable for use as a JSON request body."""
1207
1355
  body = {}
1208
1356
  if self.credential_id is not None: body['credential_id'] = self.credential_id
1209
1357
  if self.git_provider is not None: body['git_provider'] = self.git_provider
@@ -1212,8 +1360,8 @@ class UpdateCredentials:
1212
1360
  return body
1213
1361
 
1214
1362
  @classmethod
1215
- def from_dict(cls, d: Dict[str, any]) -> UpdateCredentials:
1216
- """Deserializes the UpdateCredentials from a dictionary."""
1363
+ def from_dict(cls, d: Dict[str, any]) -> UpdateCredentialsRequest:
1364
+ """Deserializes the UpdateCredentialsRequest from a dictionary."""
1217
1365
  return cls(credential_id=d.get('credential_id', None),
1218
1366
  git_provider=d.get('git_provider', None),
1219
1367
  git_username=d.get('git_username', None),
@@ -1221,12 +1369,26 @@ class UpdateCredentials:
1221
1369
 
1222
1370
 
1223
1371
  @dataclass
1224
- class UpdateRepo:
1372
+ class UpdateCredentialsResponse:
1373
+
1374
+ def as_dict(self) -> dict:
1375
+ """Serializes the UpdateCredentialsResponse into a dictionary suitable for use as a JSON request body."""
1376
+ body = {}
1377
+ return body
1378
+
1379
+ @classmethod
1380
+ def from_dict(cls, d: Dict[str, any]) -> UpdateCredentialsResponse:
1381
+ """Deserializes the UpdateCredentialsResponse from a dictionary."""
1382
+ return cls()
1383
+
1384
+
1385
+ @dataclass
1386
+ class UpdateRepoRequest:
1225
1387
  branch: Optional[str] = None
1226
1388
  """Branch that the local version of the repo is checked out to."""
1227
1389
 
1228
1390
  repo_id: Optional[int] = None
1229
- """The ID for the corresponding repo to access."""
1391
+ """ID of the Git folder (repo) object in the workspace."""
1230
1392
 
1231
1393
  sparse_checkout: Optional[SparseCheckoutUpdate] = None
1232
1394
  """If specified, update the sparse checkout settings. The update will fail if sparse checkout is
@@ -1238,7 +1400,7 @@ class UpdateRepo:
1238
1400
  branch instead of the detached HEAD."""
1239
1401
 
1240
1402
  def as_dict(self) -> dict:
1241
- """Serializes the UpdateRepo into a dictionary suitable for use as a JSON request body."""
1403
+ """Serializes the UpdateRepoRequest into a dictionary suitable for use as a JSON request body."""
1242
1404
  body = {}
1243
1405
  if self.branch is not None: body['branch'] = self.branch
1244
1406
  if self.repo_id is not None: body['repo_id'] = self.repo_id
@@ -1247,8 +1409,8 @@ class UpdateRepo:
1247
1409
  return body
1248
1410
 
1249
1411
  @classmethod
1250
- def from_dict(cls, d: Dict[str, any]) -> UpdateRepo:
1251
- """Deserializes the UpdateRepo from a dictionary."""
1412
+ def from_dict(cls, d: Dict[str, any]) -> UpdateRepoRequest:
1413
+ """Deserializes the UpdateRepoRequest from a dictionary."""
1252
1414
  return cls(branch=d.get('branch', None),
1253
1415
  repo_id=d.get('repo_id', None),
1254
1416
  sparse_checkout=_from_dict(d, 'sparse_checkout', SparseCheckoutUpdate),
@@ -1256,16 +1418,16 @@ class UpdateRepo:
1256
1418
 
1257
1419
 
1258
1420
  @dataclass
1259
- class UpdateResponse:
1421
+ class UpdateRepoResponse:
1260
1422
 
1261
1423
  def as_dict(self) -> dict:
1262
- """Serializes the UpdateResponse into a dictionary suitable for use as a JSON request body."""
1424
+ """Serializes the UpdateRepoResponse into a dictionary suitable for use as a JSON request body."""
1263
1425
  body = {}
1264
1426
  return body
1265
1427
 
1266
1428
  @classmethod
1267
- def from_dict(cls, d: Dict[str, any]) -> UpdateResponse:
1268
- """Deserializes the UpdateResponse from a dictionary."""
1429
+ def from_dict(cls, d: Dict[str, any]) -> UpdateRepoResponse:
1430
+ """Deserializes the UpdateRepoResponse from a dictionary."""
1269
1431
  return cls()
1270
1432
 
1271
1433
 
@@ -1471,9 +1633,9 @@ class GitCredentialsAPI:
1471
1633
  existing credentials, or the DELETE endpoint to delete existing credentials.
1472
1634
 
1473
1635
  :param git_provider: str
1474
- Git provider. This field is case-insensitive. The available Git providers are gitHub,
1475
- bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
1476
- gitLabEnterpriseEdition and awsCodeCommit.
1636
+ Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
1637
+ `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
1638
+ `gitLabEnterpriseEdition` and `awsCodeCommit`.
1477
1639
  :param git_username: str (optional)
1478
1640
  The username or email provided with your Git provider account, depending on which provider you are
1479
1641
  using. For GitHub, GitHub Enterprise Server, or Azure DevOps Services, either email or username may
@@ -1482,8 +1644,7 @@ class GitCredentialsAPI:
1482
1644
  Access Token authentication documentation to see what is supported.
1483
1645
  :param personal_access_token: str (optional)
1484
1646
  The personal access token used to authenticate to the corresponding Git provider. For certain
1485
- providers, support may exist for other types of scoped access tokens. [Learn more]. The personal
1486
- access token used to authenticate to the corresponding Git
1647
+ providers, support may exist for other types of scoped access tokens. [Learn more].
1487
1648
 
1488
1649
  [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html
1489
1650
 
@@ -1509,11 +1670,11 @@ class GitCredentialsAPI:
1509
1670
 
1510
1671
  """
1511
1672
 
1512
- headers = {}
1673
+ headers = {'Accept': 'application/json', }
1513
1674
 
1514
1675
  self._api.do('DELETE', f'/api/2.0/git-credentials/{credential_id}', headers=headers)
1515
1676
 
1516
- def get(self, credential_id: int) -> CredentialInfo:
1677
+ def get(self, credential_id: int) -> GetCredentialsResponse:
1517
1678
  """Get a credential entry.
1518
1679
 
1519
1680
  Gets the Git credential with the specified credential ID.
@@ -1521,13 +1682,13 @@ class GitCredentialsAPI:
1521
1682
  :param credential_id: int
1522
1683
  The ID for the corresponding credential to access.
1523
1684
 
1524
- :returns: :class:`CredentialInfo`
1685
+ :returns: :class:`GetCredentialsResponse`
1525
1686
  """
1526
1687
 
1527
1688
  headers = {'Accept': 'application/json', }
1528
1689
 
1529
1690
  res = self._api.do('GET', f'/api/2.0/git-credentials/{credential_id}', headers=headers)
1530
- return CredentialInfo.from_dict(res)
1691
+ return GetCredentialsResponse.from_dict(res)
1531
1692
 
1532
1693
  def list(self) -> Iterator[CredentialInfo]:
1533
1694
  """Get Git credentials.
@@ -1540,13 +1701,13 @@ class GitCredentialsAPI:
1540
1701
  headers = {'Accept': 'application/json', }
1541
1702
 
1542
1703
  json = self._api.do('GET', '/api/2.0/git-credentials', headers=headers)
1543
- parsed = GetCredentialsResponse.from_dict(json).credentials
1704
+ parsed = ListCredentialsResponse.from_dict(json).credentials
1544
1705
  return parsed if parsed is not None else []
1545
1706
 
1546
1707
  def update(self,
1547
1708
  credential_id: int,
1709
+ git_provider: str,
1548
1710
  *,
1549
- git_provider: Optional[str] = None,
1550
1711
  git_username: Optional[str] = None,
1551
1712
  personal_access_token: Optional[str] = None):
1552
1713
  """Update a credential.
@@ -1555,10 +1716,10 @@ class GitCredentialsAPI:
1555
1716
 
1556
1717
  :param credential_id: int
1557
1718
  The ID for the corresponding credential to access.
1558
- :param git_provider: str (optional)
1559
- Git provider. This field is case-insensitive. The available Git providers are gitHub,
1560
- bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
1561
- gitLabEnterpriseEdition and awsCodeCommit.
1719
+ :param git_provider: str
1720
+ Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
1721
+ `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
1722
+ `gitLabEnterpriseEdition` and `awsCodeCommit`.
1562
1723
  :param git_username: str (optional)
1563
1724
  The username or email provided with your Git provider account, depending on which provider you are
1564
1725
  using. For GitHub, GitHub Enterprise Server, or Azure DevOps Services, either email or username may
@@ -1567,8 +1728,7 @@ class GitCredentialsAPI:
1567
1728
  Access Token authentication documentation to see what is supported.
1568
1729
  :param personal_access_token: str (optional)
1569
1730
  The personal access token used to authenticate to the corresponding Git provider. For certain
1570
- providers, support may exist for other types of scoped access tokens. [Learn more]. The personal
1571
- access token used to authenticate to the corresponding Git
1731
+ providers, support may exist for other types of scoped access tokens. [Learn more].
1572
1732
 
1573
1733
  [Learn more]: https://docs.databricks.com/repos/get-access-tokens-from-git-provider.html
1574
1734
 
@@ -1602,7 +1762,7 @@ class ReposAPI:
1602
1762
  provider: str,
1603
1763
  *,
1604
1764
  path: Optional[str] = None,
1605
- sparse_checkout: Optional[SparseCheckout] = None) -> RepoInfo:
1765
+ sparse_checkout: Optional[SparseCheckout] = None) -> CreateRepoResponse:
1606
1766
  """Create a repo.
1607
1767
 
1608
1768
  Creates a repo in the workspace and links it to the remote Git repo specified. Note that repos created
@@ -1611,17 +1771,17 @@ class ReposAPI:
1611
1771
  :param url: str
1612
1772
  URL of the Git repository to be linked.
1613
1773
  :param provider: str
1614
- Git provider. This field is case-insensitive. The available Git providers are gitHub,
1615
- bitbucketCloud, gitLab, azureDevOpsServices, gitHubEnterprise, bitbucketServer,
1616
- gitLabEnterpriseEdition and awsCodeCommit.
1774
+ Git provider. This field is case-insensitive. The available Git providers are `gitHub`,
1775
+ `bitbucketCloud`, `gitLab`, `azureDevOpsServices`, `gitHubEnterprise`, `bitbucketServer`,
1776
+ `gitLabEnterpriseEdition` and `awsCodeCommit`.
1617
1777
  :param path: str (optional)
1618
1778
  Desired path for the repo in the workspace. Almost any path in the workspace can be chosen. If repo
1619
- is created in /Repos, path must be in the format /Repos/{folder}/{repo-name}.
1779
+ is created in `/Repos`, path must be in the format `/Repos/{folder}/{repo-name}`.
1620
1780
  :param sparse_checkout: :class:`SparseCheckout` (optional)
1621
1781
  If specified, the repo will be created with sparse checkout enabled. You cannot enable/disable
1622
1782
  sparse checkout after the repo is created.
1623
1783
 
1624
- :returns: :class:`RepoInfo`
1784
+ :returns: :class:`CreateRepoResponse`
1625
1785
  """
1626
1786
  body = {}
1627
1787
  if path is not None: body['path'] = path
@@ -1631,7 +1791,7 @@ class ReposAPI:
1631
1791
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1632
1792
 
1633
1793
  res = self._api.do('POST', '/api/2.0/repos', body=body, headers=headers)
1634
- return RepoInfo.from_dict(res)
1794
+ return CreateRepoResponse.from_dict(res)
1635
1795
 
1636
1796
  def delete(self, repo_id: int):
1637
1797
  """Delete a repo.
@@ -1639,30 +1799,30 @@ class ReposAPI:
1639
1799
  Deletes the specified repo.
1640
1800
 
1641
1801
  :param repo_id: int
1642
- The ID for the corresponding repo to access.
1802
+ ID of the Git folder (repo) object in the workspace.
1643
1803
 
1644
1804
 
1645
1805
  """
1646
1806
 
1647
- headers = {}
1807
+ headers = {'Accept': 'application/json', }
1648
1808
 
1649
1809
  self._api.do('DELETE', f'/api/2.0/repos/{repo_id}', headers=headers)
1650
1810
 
1651
- def get(self, repo_id: int) -> RepoInfo:
1811
+ def get(self, repo_id: int) -> GetRepoResponse:
1652
1812
  """Get a repo.
1653
1813
 
1654
1814
  Returns the repo with the given repo ID.
1655
1815
 
1656
1816
  :param repo_id: int
1657
- The ID for the corresponding repo to access.
1817
+ ID of the Git folder (repo) object in the workspace.
1658
1818
 
1659
- :returns: :class:`RepoInfo`
1819
+ :returns: :class:`GetRepoResponse`
1660
1820
  """
1661
1821
 
1662
1822
  headers = {'Accept': 'application/json', }
1663
1823
 
1664
1824
  res = self._api.do('GET', f'/api/2.0/repos/{repo_id}', headers=headers)
1665
- return RepoInfo.from_dict(res)
1825
+ return GetRepoResponse.from_dict(res)
1666
1826
 
1667
1827
  def get_permission_levels(self, repo_id: str) -> GetRepoPermissionLevelsResponse:
1668
1828
  """Get repo permission levels.
@@ -1709,8 +1869,9 @@ class ReposAPI:
1709
1869
  Token used to get the next page of results. If not specified, returns the first page of results as
1710
1870
  well as a next page token if there are more results.
1711
1871
  :param path_prefix: str (optional)
1712
- Filters repos that have paths starting with the given path prefix. If not provided repos from /Repos
1713
- will be served.
1872
+ Filters repos that have paths starting with the given path prefix. If not provided or when provided
1873
+ an effectively empty prefix (`/` or `/Workspace`) Git folders (repos) from `/Workspace/Repos` will
1874
+ be served.
1714
1875
 
1715
1876
  :returns: Iterator over :class:`RepoInfo`
1716
1877
  """
@@ -1764,7 +1925,7 @@ class ReposAPI:
1764
1925
  branch.
1765
1926
 
1766
1927
  :param repo_id: int
1767
- The ID for the corresponding repo to access.
1928
+ ID of the Git folder (repo) object in the workspace.
1768
1929
  :param branch: str (optional)
1769
1930
  Branch that the local version of the repo is checked out to.
1770
1931
  :param sparse_checkout: :class:`SparseCheckoutUpdate` (optional)