From 6296cdd14c5d574bc7edb6f232506ca912719dda Mon Sep 17 00:00:00 2001 From: "mc-ci-cd-app[bot]" <127546454+mc-ci-cd-app[bot]@users.noreply.github.com> Date: Fri, 23 Oct 2026 20:26:22 +0000 Subject: [PATCH] Regenerate from api-codegen b9fdacd68b --- .api-codegen-source.json | 12 ++++++------ docs/ConnectionOut.md | 2 +- docs/ConnectionPatch.md | 3 ++- docs/ConnectionsApi.md | 17 +++++++++++++---- pycarlo2/api/connections_api.py | 17 +++++++++++++---- pycarlo2/models/connection_out.py | 2 +- pycarlo2/models/connection_patch.py | 16 ++++++++++++---- 7 files changed, 48 insertions(+), 21 deletions(-) diff --git a/.api-codegen-source.json b/.api-codegen-source.json index 652cdd7..b4de80c 100644 --- a/.api-codegen-source.json +++ b/.api-codegen-source.json @@ -1,9 +1,9 @@ { - "api_codegen_commit": "b27f74ff3939c82958fe0c5cc0810ad45d9b4a75", - "api_codegen_run_id": 39868898264, - "generated_at": "2026-10-22T23:00:57Z", + "api_codegen_commit": "b9fdacd68be04eb9a5faaad578feddcd9473554f", + "api_codegen_run_id": 40019114408, + "generated_at": "2026-10-23T20:26:22Z", "generator_version": "7.23.0", - "monolith_commit": "faf363f752df13b6a4e63abb2a8f856eab1f7065", - "monolith_run_id": 39868208395, - "exported_at": "2026-10-22T22:57:41Z" + "monolith_commit": "a0f20333c2f99443f97e74076e78de04ad1e4598", + "monolith_run_id": 40018283606, + "exported_at": "2026-10-23T20:22:20Z" } diff --git a/docs/ConnectionOut.md b/docs/ConnectionOut.md index e2c16a9..3a97041 100644 --- a/docs/ConnectionOut.md +++ b/docs/ConnectionOut.md @@ -17,7 +17,7 @@ Name | Type | Description | Notes **etl_container_name** | **str** | Display name of that ETL container. Null when there is no ETL container. | **deployment_id** | **UUID** | The deployment the connection runs through, taken from its warehouse, BI container or ETL container. Null when that has no deployment, as an Airflow ETL container has none. The id may name a deployment on Monte Carlo's older collection platform, which the deployments endpoints do not list. | **deployment_name** | **str** | Display name of that deployment. Null when there is no deployment to name. | -**credentials_id** | **UUID** | The credentials the connection reads with. Null for a connection created before credentials became their own resource, and for one created outside this API. | +**credentials_id** | **UUID** | The credentials the connection reads with. Null for a connection created before credentials became their own resource, and for one created outside this API until an update sets `credentials_id`. | **credentials_storage_type** | [**CredentialsStorageType**](CredentialsStorageType.md) | Where that secret lives. Null when there are no credentials to describe. | **job_types** | **List[str]** | The jobs Monte Carlo runs on this connection, such as `metadata`. | **created_time** | **datetime** | When the connection was created. | diff --git a/docs/ConnectionPatch.md b/docs/ConnectionPatch.md index 3b12f90..5f09970 100644 --- a/docs/ConnectionPatch.md +++ b/docs/ConnectionPatch.md @@ -1,6 +1,6 @@ # ConnectionPatch -A change to an existing connection: a new name, ETL turned on or off, or new dbt Cloud settings. +A change to an existing connection: a new name, ETL turned on or off, new dbt Cloud settings, or other credentials. ## Properties @@ -9,6 +9,7 @@ Name | Type | Description | Notes **name** | **str** | New display name for the connection. Omit it to leave the name unchanged. An explicit null is ignored, the same as omitting the field. | [optional] **job_types** | **List[str]** | The connection's job types with `etl` added or removed. Adding `etl` turns on ETL collection for a Snowflake (Snowflake Tasks), Power BI (dataflows) or Salesforce Data Cloud connection, and creates the ETL container that `etl_container_id` then names. Removing it deletes that container. No other job can be added or removed. Omit it to leave the job types unchanged. | [optional] **dbt_cloud** | [**DbtCloudSettingsIn**](DbtCloudSettingsIn.md) | Which dbt Cloud runs a dbt Cloud webhook connection processes. A dbt Cloud webhook reports runs from every environment in the dbt account. These settings decide which of them Monte Carlo processes for the connection's warehouse. Only a dbt Cloud webhook connection takes it. An object replaces the settings whole. Null resets them to the defaults. Omit it to leave them unchanged. | [optional] +**credentials_id** | **UUID** | Credentials for the connection to read with from now on. They must be for the connection's own type, and may be stored by Monte Carlo or self-hosted. The previous credentials are kept, and can be deleted once nothing uses them. Omit it to keep the current credentials. An explicit null is ignored, the same as omitting the field. | [optional] ## Example diff --git a/docs/ConnectionsApi.md b/docs/ConnectionsApi.md index fb18e42..d679dc8 100644 --- a/docs/ConnectionsApi.md +++ b/docs/ConnectionsApi.md @@ -417,11 +417,19 @@ Name | Type | Description | Notes Update a connection -Rename a connection, turn its ETL on or off, or change its dbt Cloud settings. +Rename a connection, turn its ETL on or off, change its dbt Cloud settings, or point it +at other credentials. -The type, the warehouse, BI container or ETL container and the credentials are fixed when -the connection is created. Two connections on one warehouse or BI container cannot share a -name. +The type and the warehouse, BI container or ETL container are fixed when the connection is +created. Two connections on one warehouse or BI container cannot share a name. + +`credentials_id` points the connection at other credentials of its own type, in place. This +is how a connection created in the Monte Carlo app gets credentials this API manages, and +how a connection moves between credentials Monte Carlo stores and self-hosted ones. +Self-hosted credentials need a collection agent on the connection's deployment. The +credentials of a dbt Cloud webhook connection, or of one that runs through the Snowflake +agent, cannot be changed. The previous credentials are kept. Once a connection has +credentials, change its secret through those credentials, not in the app. `job_types` takes one change: `etl` added or removed. Adding it to a Snowflake, Power BI or Salesforce Data Cloud connection turns on Snowflake Tasks, Power BI dataflows or Data @@ -508,6 +516,7 @@ Name | Type | Description | Notes **409** | Conflict | - | **422** | Unprocessable Entity | - | **429** | Too Many Requests | - | +**503** | Service Unavailable | - | **401** | Authentication credentials are missing or invalid. | - | **403** | The request was authenticated, but the caller is not allowed to perform this operation. Read `code` to tell the reasons apart: `account_frozen` means the account is paused, rather than that the caller lacks permission. | - | **500** | An unexpected error prevented the request from being processed. | - | diff --git a/pycarlo2/api/connections_api.py b/pycarlo2/api/connections_api.py index 31d89d4..d4ca11d 100644 --- a/pycarlo2/api/connections_api.py +++ b/pycarlo2/api/connections_api.py @@ -714,11 +714,19 @@ def update_connection( ) -> ConnectionOut: """Update a connection - Rename a connection, turn its ETL on or off, or change its dbt Cloud settings. + Rename a connection, turn its ETL on or off, change its dbt Cloud settings, or point it + at other credentials. - The type, the warehouse, BI container or ETL container and the credentials are fixed when - the connection is created. Two connections on one warehouse or BI container cannot share a - name. + The type and the warehouse, BI container or ETL container are fixed when the connection is + created. Two connections on one warehouse or BI container cannot share a name. + + `credentials_id` points the connection at other credentials of its own type, in place. This + is how a connection created in the Monte Carlo app gets credentials this API manages, and + how a connection moves between credentials Monte Carlo stores and self-hosted ones. + Self-hosted credentials need a collection agent on the connection's deployment. The + credentials of a dbt Cloud webhook connection, or of one that runs through the Snowflake + agent, cannot be changed. The previous credentials are kept. Once a connection has + credentials, change its secret through those credentials, not in the app. `job_types` takes one change: `etl` added or removed. Adding it to a Snowflake, Power BI or Salesforce Data Cloud connection turns on Snowflake Tasks, Power BI dataflows or Data @@ -771,6 +779,7 @@ def update_connection( '409': "ProblemOut", '422': "ProblemOut", '429': "ProblemOut", + '503': "ProblemOut", '401': "ProblemOut", '403': "ProblemOut", '500': "ProblemOut", diff --git a/pycarlo2/models/connection_out.py b/pycarlo2/models/connection_out.py index 23c7b5e..82fed1d 100644 --- a/pycarlo2/models/connection_out.py +++ b/pycarlo2/models/connection_out.py @@ -39,7 +39,7 @@ class ConnectionOut(BaseModel): etl_container_name: Optional[StrictStr] = Field(description="Display name of that ETL container. Null when there is no ETL container.") deployment_id: Optional[UUID] = Field(description="The deployment the connection runs through, taken from its warehouse, BI container or ETL container. Null when that has no deployment, as an Airflow ETL container has none. The id may name a deployment on Monte Carlo's older collection platform, which the deployments endpoints do not list.") deployment_name: Optional[StrictStr] = Field(description="Display name of that deployment. Null when there is no deployment to name.") - credentials_id: Optional[UUID] = Field(description="The credentials the connection reads with. Null for a connection created before credentials became their own resource, and for one created outside this API.") + credentials_id: Optional[UUID] = Field(description="The credentials the connection reads with. Null for a connection created before credentials became their own resource, and for one created outside this API until an update sets `credentials_id`.") credentials_storage_type: Optional[CredentialsStorageType] = Field(description="Where that secret lives. Null when there are no credentials to describe.") job_types: List[StrictStr] = Field(description="The jobs Monte Carlo runs on this connection, such as `metadata`.") created_time: datetime = Field(description="When the connection was created.") diff --git a/pycarlo2/models/connection_patch.py b/pycarlo2/models/connection_patch.py index b95dc9b..10824cd 100644 --- a/pycarlo2/models/connection_patch.py +++ b/pycarlo2/models/connection_patch.py @@ -13,6 +13,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from uuid import UUID from pycarlo2.models.dbt_cloud_settings_in import DbtCloudSettingsIn from typing import Optional, Set from typing_extensions import Self @@ -20,13 +21,14 @@ class ConnectionPatch(BaseModel): """ - A change to an existing connection: a new name, ETL turned on or off, or new dbt Cloud - settings. + A change to an existing connection: a new name, ETL turned on or off, new dbt Cloud + settings, or other credentials. """ # noqa: E501 name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(default=None, description="New display name for the connection. Omit it to leave the name unchanged. An explicit null is ignored, the same as omitting the field.") job_types: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="The connection's job types with `etl` added or removed. Adding `etl` turns on ETL collection for a Snowflake (Snowflake Tasks), Power BI (dataflows) or Salesforce Data Cloud connection, and creates the ETL container that `etl_container_id` then names. Removing it deletes that container. No other job can be added or removed. Omit it to leave the job types unchanged.") dbt_cloud: Optional[DbtCloudSettingsIn] = Field(default=None, description="Which dbt Cloud runs a dbt Cloud webhook connection processes. A dbt Cloud webhook reports runs from every environment in the dbt account. These settings decide which of them Monte Carlo processes for the connection's warehouse. Only a dbt Cloud webhook connection takes it. An object replaces the settings whole. Null resets them to the defaults. Omit it to leave them unchanged.") - __properties: ClassVar[List[str]] = ["name", "job_types", "dbt_cloud"] + credentials_id: Optional[UUID] = Field(default=None, description="Credentials for the connection to read with from now on. They must be for the connection's own type, and may be stored by Monte Carlo or self-hosted. The previous credentials are kept, and can be deleted once nothing uses them. Omit it to keep the current credentials. An explicit null is ignored, the same as omitting the field.") + __properties: ClassVar[List[str]] = ["name", "job_types", "dbt_cloud", "credentials_id"] model_config = ConfigDict( validate_by_name=True, @@ -85,6 +87,11 @@ def to_dict(self) -> Dict[str, Any]: if self.dbt_cloud is None and "dbt_cloud" in self.model_fields_set: _dict['dbt_cloud'] = None + # set to None if credentials_id (nullable) is None + # and model_fields_set contains the field + if self.credentials_id is None and "credentials_id" in self.model_fields_set: + _dict['credentials_id'] = None + return _dict @classmethod @@ -99,7 +106,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), "job_types": obj.get("job_types"), - "dbt_cloud": DbtCloudSettingsIn.from_dict(obj["dbt_cloud"]) if obj.get("dbt_cloud") is not None else None + "dbt_cloud": DbtCloudSettingsIn.from_dict(obj["dbt_cloud"]) if obj.get("dbt_cloud") is not None else None, + "credentials_id": obj.get("credentials_id") }) return _obj