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

@@ -45,7 +45,7 @@ class CleanRoom:
45
45
  using the separate CreateCleanRoomOutputCatalog API."""
46
46
 
47
47
  owner: Optional[str] = None
48
- """This is Databricks username of the owner of the local clean room securable for permission
48
+ """This is the Databricks username of the owner of the local clean room securable for permission
49
49
  management."""
50
50
 
51
51
  remote_detailed_info: Optional[CleanRoomRemoteDetail] = None
@@ -142,7 +142,8 @@ class CleanRoomAsset:
142
142
  For UC securable assets (tables, volumes, etc.), the format is
143
143
  *shared_catalog*.*shared_schema*.*asset_name*
144
144
 
145
- For notebooks, the name is the notebook file name."""
145
+ For notebooks, the name is the notebook file name. For jar analyses, the name is the jar
146
+ analysis name."""
146
147
 
147
148
  asset_type: CleanRoomAssetAssetType
148
149
  """The type of the asset."""
@@ -351,13 +352,13 @@ class CleanRoomAssetNotebook:
351
352
  """Server generated etag that represents the notebook version."""
352
353
 
353
354
  review_state: Optional[CleanRoomNotebookReviewNotebookReviewState] = None
354
- """top-level status derived from all reviews"""
355
+ """Top-level status derived from all reviews"""
355
356
 
356
357
  reviews: Optional[List[CleanRoomNotebookReview]] = None
357
358
  """All existing approvals or rejections"""
358
359
 
359
360
  runner_collaborator_aliases: Optional[List[str]] = None
360
- """collaborators that can run the notebook"""
361
+ """Aliases of collaborators that can run the notebook."""
361
362
 
362
363
  def as_dict(self) -> dict:
363
364
  """Serializes the CleanRoomAssetNotebook into a dictionary suitable for use as a JSON request body."""
@@ -546,8 +547,12 @@ class CleanRoomAssetVolumeLocalDetails:
546
547
  @dataclass
547
548
  class CleanRoomAutoApprovalRule:
548
549
  author_collaborator_alias: Optional[str] = None
550
+ """Collaborator alias of the author covered by the rule. Only one of `author_collaborator_alias`
551
+ and `author_scope` can be set."""
549
552
 
550
553
  author_scope: Optional[CleanRoomAutoApprovalRuleAuthorScope] = None
554
+ """Scope of authors covered by the rule. Only one of `author_collaborator_alias` and `author_scope`
555
+ can be set."""
551
556
 
552
557
  clean_room_name: Optional[str] = None
553
558
  """The name of the clean room this auto-approval rule belongs to."""
@@ -562,6 +567,7 @@ class CleanRoomAutoApprovalRule:
562
567
  """The owner of the rule to whom the rule applies."""
563
568
 
564
569
  runner_collaborator_alias: Optional[str] = None
570
+ """Collaborator alias of the runner covered by the rule."""
565
571
 
566
572
  def as_dict(self) -> dict:
567
573
  """Serializes the CleanRoomAutoApprovalRule into a dictionary suitable for use as a JSON request body."""
@@ -637,7 +643,7 @@ class CleanRoomCollaborator:
637
643
  It is not restricted to these values and could change in the future"""
638
644
 
639
645
  global_metastore_id: Optional[str] = None
640
- """The global Unity Catalog metastore id of the collaborator. The identifier is of format
646
+ """The global Unity Catalog metastore ID of the collaborator. The identifier is of format
641
647
  cloud:region:metastore-uuid."""
642
648
 
643
649
  invite_recipient_email: Optional[str] = None
@@ -704,19 +710,19 @@ class CleanRoomCollaborator:
704
710
  @dataclass
705
711
  class CleanRoomNotebookReview:
706
712
  comment: Optional[str] = None
707
- """review comment"""
713
+ """Review comment"""
708
714
 
709
715
  created_at_millis: Optional[int] = None
710
- """timestamp of when the review was submitted"""
716
+ """When the review was submitted, in epoch milliseconds"""
711
717
 
712
718
  review_state: Optional[CleanRoomNotebookReviewNotebookReviewState] = None
713
- """review outcome"""
719
+ """Review outcome"""
714
720
 
715
721
  review_sub_reason: Optional[CleanRoomNotebookReviewNotebookReviewSubReason] = None
716
- """specified when the review was not explicitly made by a user"""
722
+ """Specified when the review was not explicitly made by a user"""
717
723
 
718
724
  reviewer_collaborator_alias: Optional[str] = None
719
- """collaborator alias of the reviewer"""
725
+ """Collaborator alias of the reviewer"""
720
726
 
721
727
  def as_dict(self) -> dict:
722
728
  """Serializes the CleanRoomNotebookReview into a dictionary suitable for use as a JSON request body."""
@@ -1100,7 +1106,7 @@ class ComplianceSecurityProfile:
1100
1106
  @dataclass
1101
1107
  class CreateCleanRoomAssetReviewResponse:
1102
1108
  notebook_review_state: Optional[CleanRoomNotebookReviewNotebookReviewState] = None
1103
- """top-level status derived from all reviews"""
1109
+ """Top-level status derived from all reviews"""
1104
1110
 
1105
1111
  notebook_reviews: Optional[List[CleanRoomNotebookReview]] = None
1106
1112
  """All existing notebook approvals or rejections"""
@@ -1348,13 +1354,13 @@ class ListCleanRoomsResponse:
1348
1354
  @dataclass
1349
1355
  class NotebookVersionReview:
1350
1356
  etag: str
1351
- """etag that identifies the notebook version"""
1357
+ """Etag identifying the notebook version"""
1352
1358
 
1353
1359
  review_state: CleanRoomNotebookReviewNotebookReviewState
1354
- """review outcome"""
1360
+ """Review outcome"""
1355
1361
 
1356
1362
  comment: Optional[str] = None
1357
- """review comment"""
1363
+ """Review comment"""
1358
1364
 
1359
1365
  def as_dict(self) -> dict:
1360
1366
  """Serializes the NotebookVersionReview into a dictionary suitable for use as a JSON request body."""
@@ -1505,12 +1511,12 @@ class CleanRoomAssetsAPI:
1505
1511
  name: str,
1506
1512
  notebook_review: NotebookVersionReview,
1507
1513
  ) -> CreateCleanRoomAssetReviewResponse:
1508
- """submit an asset review
1514
+ """Submit an asset review
1509
1515
 
1510
1516
  :param clean_room_name: str
1511
1517
  Name of the clean room
1512
1518
  :param asset_type: :class:`CleanRoomAssetAssetType`
1513
- can only be NOTEBOOK_FILE for now
1519
+ Asset type. Can only be NOTEBOOK_FILE.
1514
1520
  :param name: str
1515
1521
  Name of the asset
1516
1522
  :param notebook_review: :class:`NotebookVersionReview`
@@ -1620,7 +1626,8 @@ class CleanRoomAssetsAPI:
1620
1626
  For UC securable assets (tables, volumes, etc.), the format is
1621
1627
  *shared_catalog*.*shared_schema*.*asset_name*
1622
1628
 
1623
- For notebooks, the name is the notebook file name.
1629
+ For notebooks, the name is the notebook file name. For jar analyses, the name is the jar analysis
1630
+ name.
1624
1631
  :param asset: :class:`CleanRoomAsset`
1625
1632
  The asset to update. The asset's `name` and `asset_type` fields are used to identify the asset to
1626
1633
  update.
@@ -3410,6 +3410,15 @@ class GcpAttributes:
3410
3410
  boot_disk_size: Optional[int] = None
3411
3411
  """Boot disk size in GB"""
3412
3412
 
3413
+ first_on_demand: Optional[int] = None
3414
+ """The first `first_on_demand` nodes of the cluster will be placed on on-demand instances. This
3415
+ value should be greater than 0, to make sure the cluster driver node is placed on an on-demand
3416
+ instance. If this value is greater than or equal to the current cluster size, all nodes will be
3417
+ placed on on-demand instances. If this value is less than the current cluster size,
3418
+ `first_on_demand` nodes will be placed on on-demand instances and the remainder will be placed
3419
+ on `availability` instances. Note that this value does not affect cluster size and cannot
3420
+ currently be mutated over the lifetime of a cluster."""
3421
+
3413
3422
  google_service_account: Optional[str] = None
3414
3423
  """If provided, the cluster will impersonate the google service account when accessing gcloud
3415
3424
  services (like GCS). The google service account must have previously been added to the
@@ -3441,6 +3450,8 @@ class GcpAttributes:
3441
3450
  body["availability"] = self.availability.value
3442
3451
  if self.boot_disk_size is not None:
3443
3452
  body["boot_disk_size"] = self.boot_disk_size
3453
+ if self.first_on_demand is not None:
3454
+ body["first_on_demand"] = self.first_on_demand
3444
3455
  if self.google_service_account is not None:
3445
3456
  body["google_service_account"] = self.google_service_account
3446
3457
  if self.local_ssd_count is not None:
@@ -3458,6 +3469,8 @@ class GcpAttributes:
3458
3469
  body["availability"] = self.availability
3459
3470
  if self.boot_disk_size is not None:
3460
3471
  body["boot_disk_size"] = self.boot_disk_size
3472
+ if self.first_on_demand is not None:
3473
+ body["first_on_demand"] = self.first_on_demand
3461
3474
  if self.google_service_account is not None:
3462
3475
  body["google_service_account"] = self.google_service_account
3463
3476
  if self.local_ssd_count is not None:
@@ -3474,6 +3487,7 @@ class GcpAttributes:
3474
3487
  return cls(
3475
3488
  availability=_enum(d, "availability", GcpAvailability),
3476
3489
  boot_disk_size=d.get("boot_disk_size", None),
3490
+ first_on_demand=d.get("first_on_demand", None),
3477
3491
  google_service_account=d.get("google_service_account", None),
3478
3492
  local_ssd_count=d.get("local_ssd_count", None),
3479
3493
  use_preemptible_executors=d.get("use_preemptible_executors", None),
@@ -413,6 +413,14 @@ class GenieConversationSummary:
413
413
  )
414
414
 
415
415
 
416
+ class GenieFeedbackRating(Enum):
417
+ """Feedback rating for Genie messages"""
418
+
419
+ NEGATIVE = "NEGATIVE"
420
+ NONE = "NONE"
421
+ POSITIVE = "POSITIVE"
422
+
423
+
416
424
  @dataclass
417
425
  class GenieGetMessageQueryResultResponse:
418
426
  statement_response: Optional[sql.StatementResponse] = None
@@ -439,6 +447,38 @@ class GenieGetMessageQueryResultResponse:
439
447
  return cls(statement_response=_from_dict(d, "statement_response", sql.StatementResponse))
440
448
 
441
449
 
450
+ @dataclass
451
+ class GenieListConversationMessagesResponse:
452
+ messages: Optional[List[GenieMessage]] = None
453
+ """List of messages in the conversation."""
454
+
455
+ next_page_token: Optional[str] = None
456
+ """The token to use for retrieving the next page of results."""
457
+
458
+ def as_dict(self) -> dict:
459
+ """Serializes the GenieListConversationMessagesResponse into a dictionary suitable for use as a JSON request body."""
460
+ body = {}
461
+ if self.messages:
462
+ body["messages"] = [v.as_dict() for v in self.messages]
463
+ if self.next_page_token is not None:
464
+ body["next_page_token"] = self.next_page_token
465
+ return body
466
+
467
+ def as_shallow_dict(self) -> dict:
468
+ """Serializes the GenieListConversationMessagesResponse into a shallow dictionary of its immediate attributes."""
469
+ body = {}
470
+ if self.messages:
471
+ body["messages"] = self.messages
472
+ if self.next_page_token is not None:
473
+ body["next_page_token"] = self.next_page_token
474
+ return body
475
+
476
+ @classmethod
477
+ def from_dict(cls, d: Dict[str, Any]) -> GenieListConversationMessagesResponse:
478
+ """Deserializes the GenieListConversationMessagesResponse from a dictionary."""
479
+ return cls(messages=_repeated_dict(d, "messages", GenieMessage), next_page_token=d.get("next_page_token", None))
480
+
481
+
442
482
  @dataclass
443
483
  class GenieListConversationsResponse:
444
484
  conversations: Optional[List[GenieConversationSummary]] = None
@@ -1630,6 +1670,29 @@ class GenieAPI:
1630
1670
 
1631
1671
  self._api.do("DELETE", f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}", headers=headers)
1632
1672
 
1673
+ def delete_conversation_message(self, space_id: str, conversation_id: str, message_id: str):
1674
+ """Delete a conversation message.
1675
+
1676
+ :param space_id: str
1677
+ The ID associated with the Genie space where the message is located.
1678
+ :param conversation_id: str
1679
+ The ID associated with the conversation.
1680
+ :param message_id: str
1681
+ The ID associated with the message to delete.
1682
+
1683
+
1684
+ """
1685
+
1686
+ headers = {
1687
+ "Accept": "application/json",
1688
+ }
1689
+
1690
+ self._api.do(
1691
+ "DELETE",
1692
+ f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}",
1693
+ headers=headers,
1694
+ )
1695
+
1633
1696
  def execute_message_attachment_query(
1634
1697
  self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
1635
1698
  ) -> GenieGetMessageQueryResultResponse:
@@ -1662,7 +1725,8 @@ class GenieAPI:
1662
1725
  def execute_message_query(
1663
1726
  self, space_id: str, conversation_id: str, message_id: str
1664
1727
  ) -> GenieGetMessageQueryResultResponse:
1665
- """Execute the SQL query in the message.
1728
+ """DEPRECATED: Use [Execute Message Attachment Query](:method:genie/executemessageattachmentquery)
1729
+ instead.
1666
1730
 
1667
1731
  :param space_id: str
1668
1732
  Genie space ID
@@ -1741,8 +1805,8 @@ class GenieAPI:
1741
1805
  def get_message_query_result(
1742
1806
  self, space_id: str, conversation_id: str, message_id: str
1743
1807
  ) -> GenieGetMessageQueryResultResponse:
1744
- """Get the result of SQL query if the message has a query attachment. This is only available if a message
1745
- has a query attachment and the message status is `EXECUTING_QUERY`.
1808
+ """DEPRECATED: Use [Get Message Attachment Query Result](:method:genie/getmessageattachmentqueryresult)
1809
+ instead.
1746
1810
 
1747
1811
  :param space_id: str
1748
1812
  Genie space ID
@@ -1768,8 +1832,8 @@ class GenieAPI:
1768
1832
  def get_message_query_result_by_attachment(
1769
1833
  self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
1770
1834
  ) -> GenieGetMessageQueryResultResponse:
1771
- """Get the result of SQL query if the message has a query attachment. This is only available if a message
1772
- has a query attachment and the message status is `EXECUTING_QUERY` OR `COMPLETED`.
1835
+ """DEPRECATED: Use [Get Message Attachment Query Result](:method:genie/getmessageattachmentqueryresult)
1836
+ instead.
1773
1837
 
1774
1838
  :param space_id: str
1775
1839
  Genie space ID
@@ -1810,13 +1874,55 @@ class GenieAPI:
1810
1874
  res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}", headers=headers)
1811
1875
  return GenieSpace.from_dict(res)
1812
1876
 
1877
+ def list_conversation_messages(
1878
+ self, space_id: str, conversation_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
1879
+ ) -> GenieListConversationMessagesResponse:
1880
+ """List messages in a conversation
1881
+
1882
+ :param space_id: str
1883
+ The ID associated with the Genie space where the conversation is located
1884
+ :param conversation_id: str
1885
+ The ID of the conversation to list messages from
1886
+ :param page_size: int (optional)
1887
+ Maximum number of messages to return per page
1888
+ :param page_token: str (optional)
1889
+ Token to get the next page of results
1890
+
1891
+ :returns: :class:`GenieListConversationMessagesResponse`
1892
+ """
1893
+
1894
+ query = {}
1895
+ if page_size is not None:
1896
+ query["page_size"] = page_size
1897
+ if page_token is not None:
1898
+ query["page_token"] = page_token
1899
+ headers = {
1900
+ "Accept": "application/json",
1901
+ }
1902
+
1903
+ res = self._api.do(
1904
+ "GET",
1905
+ f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages",
1906
+ query=query,
1907
+ headers=headers,
1908
+ )
1909
+ return GenieListConversationMessagesResponse.from_dict(res)
1910
+
1813
1911
  def list_conversations(
1814
- self, space_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
1912
+ self,
1913
+ space_id: str,
1914
+ *,
1915
+ include_all: Optional[bool] = None,
1916
+ page_size: Optional[int] = None,
1917
+ page_token: Optional[str] = None,
1815
1918
  ) -> GenieListConversationsResponse:
1816
1919
  """Get a list of conversations in a Genie Space.
1817
1920
 
1818
1921
  :param space_id: str
1819
1922
  The ID of the Genie space to retrieve conversations from.
1923
+ :param include_all: bool (optional)
1924
+ Include all conversations in the space across all users. Requires "Can Manage" permission on the
1925
+ space.
1820
1926
  :param page_size: int (optional)
1821
1927
  Maximum number of conversations to return per page
1822
1928
  :param page_token: str (optional)
@@ -1826,6 +1932,8 @@ class GenieAPI:
1826
1932
  """
1827
1933
 
1828
1934
  query = {}
1935
+ if include_all is not None:
1936
+ query["include_all"] = include_all
1829
1937
  if page_size is not None:
1830
1938
  query["page_size"] = page_size
1831
1939
  if page_token is not None:
@@ -1862,6 +1970,47 @@ class GenieAPI:
1862
1970
  res = self._api.do("GET", "/api/2.0/genie/spaces", query=query, headers=headers)
1863
1971
  return GenieListSpacesResponse.from_dict(res)
1864
1972
 
1973
+ def send_message_feedback(
1974
+ self,
1975
+ space_id: str,
1976
+ conversation_id: str,
1977
+ message_id: str,
1978
+ feedback_rating: GenieFeedbackRating,
1979
+ *,
1980
+ feedback_text: Optional[str] = None,
1981
+ ):
1982
+ """Send feedback for a message.
1983
+
1984
+ :param space_id: str
1985
+ The ID associated with the Genie space where the message is located.
1986
+ :param conversation_id: str
1987
+ The ID associated with the conversation.
1988
+ :param message_id: str
1989
+ The ID associated with the message to provide feedback for.
1990
+ :param feedback_rating: :class:`GenieFeedbackRating`
1991
+ The rating (POSITIVE, NEGATIVE, or NONE).
1992
+ :param feedback_text: str (optional)
1993
+ Optional text feedback that will be stored as a comment.
1994
+
1995
+
1996
+ """
1997
+ body = {}
1998
+ if feedback_rating is not None:
1999
+ body["feedback_rating"] = feedback_rating.value
2000
+ if feedback_text is not None:
2001
+ body["feedback_text"] = feedback_text
2002
+ headers = {
2003
+ "Accept": "application/json",
2004
+ "Content-Type": "application/json",
2005
+ }
2006
+
2007
+ self._api.do(
2008
+ "POST",
2009
+ f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/feedback",
2010
+ body=body,
2011
+ headers=headers,
2012
+ )
2013
+
1865
2014
  def start_conversation(self, space_id: str, content: str) -> Wait[GenieMessage]:
1866
2015
  """Start a new conversation.
1867
2016
 
@@ -589,6 +589,40 @@ class DeltaTableSyncInfo:
589
589
  )
590
590
 
591
591
 
592
+ @dataclass
593
+ class ListDatabaseCatalogsResponse:
594
+ database_catalogs: Optional[List[DatabaseCatalog]] = None
595
+
596
+ next_page_token: Optional[str] = None
597
+ """Pagination token to request the next page of database catalogs."""
598
+
599
+ def as_dict(self) -> dict:
600
+ """Serializes the ListDatabaseCatalogsResponse into a dictionary suitable for use as a JSON request body."""
601
+ body = {}
602
+ if self.database_catalogs:
603
+ body["database_catalogs"] = [v.as_dict() for v in self.database_catalogs]
604
+ if self.next_page_token is not None:
605
+ body["next_page_token"] = self.next_page_token
606
+ return body
607
+
608
+ def as_shallow_dict(self) -> dict:
609
+ """Serializes the ListDatabaseCatalogsResponse into a shallow dictionary of its immediate attributes."""
610
+ body = {}
611
+ if self.database_catalogs:
612
+ body["database_catalogs"] = self.database_catalogs
613
+ if self.next_page_token is not None:
614
+ body["next_page_token"] = self.next_page_token
615
+ return body
616
+
617
+ @classmethod
618
+ def from_dict(cls, d: Dict[str, Any]) -> ListDatabaseCatalogsResponse:
619
+ """Deserializes the ListDatabaseCatalogsResponse from a dictionary."""
620
+ return cls(
621
+ database_catalogs=_repeated_dict(d, "database_catalogs", DatabaseCatalog),
622
+ next_page_token=d.get("next_page_token", None),
623
+ )
624
+
625
+
592
626
  @dataclass
593
627
  class ListDatabaseInstanceRolesResponse:
594
628
  database_instance_roles: Optional[List[DatabaseInstanceRole]] = None
@@ -659,6 +693,40 @@ class ListDatabaseInstancesResponse:
659
693
  )
660
694
 
661
695
 
696
+ @dataclass
697
+ class ListSyncedDatabaseTablesResponse:
698
+ next_page_token: Optional[str] = None
699
+ """Pagination token to request the next page of synced tables."""
700
+
701
+ synced_tables: Optional[List[SyncedDatabaseTable]] = None
702
+
703
+ def as_dict(self) -> dict:
704
+ """Serializes the ListSyncedDatabaseTablesResponse into a dictionary suitable for use as a JSON request body."""
705
+ body = {}
706
+ if self.next_page_token is not None:
707
+ body["next_page_token"] = self.next_page_token
708
+ if self.synced_tables:
709
+ body["synced_tables"] = [v.as_dict() for v in self.synced_tables]
710
+ return body
711
+
712
+ def as_shallow_dict(self) -> dict:
713
+ """Serializes the ListSyncedDatabaseTablesResponse into a shallow dictionary of its immediate attributes."""
714
+ body = {}
715
+ if self.next_page_token is not None:
716
+ body["next_page_token"] = self.next_page_token
717
+ if self.synced_tables:
718
+ body["synced_tables"] = self.synced_tables
719
+ return body
720
+
721
+ @classmethod
722
+ def from_dict(cls, d: Dict[str, Any]) -> ListSyncedDatabaseTablesResponse:
723
+ """Deserializes the ListSyncedDatabaseTablesResponse from a dictionary."""
724
+ return cls(
725
+ next_page_token=d.get("next_page_token", None),
726
+ synced_tables=_repeated_dict(d, "synced_tables", SyncedDatabaseTable),
727
+ )
728
+
729
+
662
730
  @dataclass
663
731
  class NewPipelineSpec:
664
732
  """Custom fields that user can set for pipeline while creating SyncedDatabaseTable. Note that other
@@ -1733,10 +1801,47 @@ class DatabaseAPI:
1733
1801
  res = self._api.do("GET", f"/api/2.0/database/synced_tables/{name}", headers=headers)
1734
1802
  return SyncedDatabaseTable.from_dict(res)
1735
1803
 
1804
+ def list_database_catalogs(
1805
+ self, instance_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
1806
+ ) -> Iterator[DatabaseCatalog]:
1807
+ """This API is currently unimplemented, but exposed for Terraform support.
1808
+
1809
+ :param instance_name: str
1810
+ Name of the instance to get database catalogs for.
1811
+ :param page_size: int (optional)
1812
+ Upper bound for items returned.
1813
+ :param page_token: str (optional)
1814
+ Pagination token to go to the next page of synced database tables. Requests first page if absent.
1815
+
1816
+ :returns: Iterator over :class:`DatabaseCatalog`
1817
+ """
1818
+
1819
+ query = {}
1820
+ if page_size is not None:
1821
+ query["page_size"] = page_size
1822
+ if page_token is not None:
1823
+ query["page_token"] = page_token
1824
+ headers = {
1825
+ "Accept": "application/json",
1826
+ }
1827
+
1828
+ while True:
1829
+ json = self._api.do(
1830
+ "GET", f"/api/2.0/database/instances/{instance_name}/catalogs", query=query, headers=headers
1831
+ )
1832
+ if "database_catalogs" in json:
1833
+ for v in json["database_catalogs"]:
1834
+ yield DatabaseCatalog.from_dict(v)
1835
+ if "next_page_token" not in json or not json["next_page_token"]:
1836
+ return
1837
+ query["page_token"] = json["next_page_token"]
1838
+
1736
1839
  def list_database_instance_roles(
1737
1840
  self, instance_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
1738
1841
  ) -> Iterator[DatabaseInstanceRole]:
1739
- """START OF PG ROLE APIs Section
1842
+ """START OF PG ROLE APIs Section These APIs are marked a PUBLIC with stage < PUBLIC_PREVIEW. With more
1843
+ recent Lakebase V2 plans, we don't plan to ever advance these to PUBLIC_PREVIEW. These APIs will
1844
+ remain effectively undocumented/UI-only and we'll aim for a new public roles API as part of V2 PuPr.
1740
1845
 
1741
1846
  :param instance_name: str
1742
1847
  :param page_size: int (optional)
@@ -1798,6 +1903,67 @@ class DatabaseAPI:
1798
1903
  return
1799
1904
  query["page_token"] = json["next_page_token"]
1800
1905
 
1906
+ def list_synced_database_tables(
1907
+ self, instance_name: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
1908
+ ) -> Iterator[SyncedDatabaseTable]:
1909
+ """This API is currently unimplemented, but exposed for Terraform support.
1910
+
1911
+ :param instance_name: str
1912
+ Name of the instance to get synced tables for.
1913
+ :param page_size: int (optional)
1914
+ Upper bound for items returned.
1915
+ :param page_token: str (optional)
1916
+ Pagination token to go to the next page of synced database tables. Requests first page if absent.
1917
+
1918
+ :returns: Iterator over :class:`SyncedDatabaseTable`
1919
+ """
1920
+
1921
+ query = {}
1922
+ if page_size is not None:
1923
+ query["page_size"] = page_size
1924
+ if page_token is not None:
1925
+ query["page_token"] = page_token
1926
+ headers = {
1927
+ "Accept": "application/json",
1928
+ }
1929
+
1930
+ while True:
1931
+ json = self._api.do(
1932
+ "GET", f"/api/2.0/database/instances/{instance_name}/synced_tables", query=query, headers=headers
1933
+ )
1934
+ if "synced_tables" in json:
1935
+ for v in json["synced_tables"]:
1936
+ yield SyncedDatabaseTable.from_dict(v)
1937
+ if "next_page_token" not in json or not json["next_page_token"]:
1938
+ return
1939
+ query["page_token"] = json["next_page_token"]
1940
+
1941
+ def update_database_catalog(
1942
+ self, name: str, database_catalog: DatabaseCatalog, update_mask: str
1943
+ ) -> DatabaseCatalog:
1944
+ """This API is currently unimplemented, but exposed for Terraform support.
1945
+
1946
+ :param name: str
1947
+ The name of the catalog in UC.
1948
+ :param database_catalog: :class:`DatabaseCatalog`
1949
+ Note that updating a database catalog is not yet supported.
1950
+ :param update_mask: str
1951
+ The list of fields to update. Setting this field is not yet supported.
1952
+
1953
+ :returns: :class:`DatabaseCatalog`
1954
+ """
1955
+ body = database_catalog.as_dict()
1956
+ query = {}
1957
+ if update_mask is not None:
1958
+ query["update_mask"] = update_mask
1959
+ headers = {
1960
+ "Accept": "application/json",
1961
+ "Content-Type": "application/json",
1962
+ }
1963
+
1964
+ res = self._api.do("PATCH", f"/api/2.0/database/catalogs/{name}", query=query, body=body, headers=headers)
1965
+ return DatabaseCatalog.from_dict(res)
1966
+
1801
1967
  def update_database_instance(
1802
1968
  self, name: str, database_instance: DatabaseInstance, update_mask: str
1803
1969
  ) -> DatabaseInstance:
@@ -1807,7 +1973,8 @@ class DatabaseAPI:
1807
1973
  The name of the instance. This is the unique identifier for the instance.
1808
1974
  :param database_instance: :class:`DatabaseInstance`
1809
1975
  :param update_mask: str
1810
- The list of fields to update. This field is not yet supported, and is ignored by the server.
1976
+ The list of fields to update. If unspecified, all fields will be updated when possible. To wipe out
1977
+ custom_tags, specify custom_tags in the update_mask with an empty custom_tags map.
1811
1978
 
1812
1979
  :returns: :class:`DatabaseInstance`
1813
1980
  """
@@ -1822,3 +1989,29 @@ class DatabaseAPI:
1822
1989
 
1823
1990
  res = self._api.do("PATCH", f"/api/2.0/database/instances/{name}", query=query, body=body, headers=headers)
1824
1991
  return DatabaseInstance.from_dict(res)
1992
+
1993
+ def update_synced_database_table(
1994
+ self, name: str, synced_table: SyncedDatabaseTable, update_mask: str
1995
+ ) -> SyncedDatabaseTable:
1996
+ """This API is currently unimplemented, but exposed for Terraform support.
1997
+
1998
+ :param name: str
1999
+ Full three-part (catalog, schema, table) name of the table.
2000
+ :param synced_table: :class:`SyncedDatabaseTable`
2001
+ Note that updating a synced database table is not yet supported.
2002
+ :param update_mask: str
2003
+ The list of fields to update. Setting this field is not yet supported.
2004
+
2005
+ :returns: :class:`SyncedDatabaseTable`
2006
+ """
2007
+ body = synced_table.as_dict()
2008
+ query = {}
2009
+ if update_mask is not None:
2010
+ query["update_mask"] = update_mask
2011
+ headers = {
2012
+ "Accept": "application/json",
2013
+ "Content-Type": "application/json",
2014
+ }
2015
+
2016
+ res = self._api.do("PATCH", f"/api/2.0/database/synced_tables/{name}", query=query, body=body, headers=headers)
2017
+ return SyncedDatabaseTable.from_dict(res)