# -*- coding: utf-8 -*- #
# Copyright 2025 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# NOTE: This file is autogenerated and should not be edited by hand.
# AUTOGEN_CLI_VERSION: HEAD
- release_tracks:
  - ALPHA
  auto_generated: true
  help_text:
    brief: Update the parameters of a single connection
    description: |
      Update a connection.
    examples: |-
      To update the labels of a connection `my-connection` in location `us-central1` run:

      $ {command} my-connection --labels=key1=value1 --location=us-central1
  arguments:
    params:
    - group:
        mutex: true
        help_text: |-
          Arguments for the connection config.
        params:
        - group:
            api_field: connection.githubConfig
            arg_name: github-config
            clearable: true
            required: false
            help_text: |-
              Configuration for connections to github.com.
            params:
            - group:
                api_field: connection.githubConfig.authorizerCredential
                required: false
                help_text: |-
                  Represents an OAuth token of the account that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: github-config-authorizer-credential-oauth-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the OAuth token that authorizes
                    the connection. Format: `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.githubConfig.authorizerCredential.oauthTokenSecretVersion: '{__relative_name__}'
                  required: false
            - arg_name: github-config-app-installation-id
              api_field: connection.githubConfig.appInstallationId
              required: false
              repeated: false
              type: long
              help_text: |-
                GitHub App installation id.
        - group:
            api_field: connection.githubEnterpriseConfig
            arg_name: github-enterprise-config
            clearable: true
            required: false
            help_text: |-
              Configuration for connections to an instance of GitHub Enterprise.
            params:
            - arg_name: github-enterprise-config-host-uri
              api_field: connection.githubEnterpriseConfig.hostUri
              required: false
              repeated: false
              help_text: |-
                The URI of the GitHub Enterprise host this connection is for.
            - arg_name: github-enterprise-config-app-id
              api_field: connection.githubEnterpriseConfig.appId
              required: false
              repeated: false
              type: long
              help_text: |-
                ID of the GitHub App created from the manifest.
            - arg_name: github-enterprise-config-private-key-secret-version
              help_text: |-
                SecretManager resource containing the private key of the GitHub App,
                formatted as `projects/*/secrets/*/versions/*`.
              is_positional: false
              is_primary_resource: false
              resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
              resource_method_params:
                connection.githubEnterpriseConfig.privateKeySecretVersion: '{__relative_name__}'
              required: false
              clearable: true
            - arg_name: github-enterprise-config-webhook-secret-version
              help_text: |-
                SecretManager resource containing the webhook secret of the GitHub App,
                formatted as `projects/*/secrets/*/versions/*`.
              is_positional: false
              is_primary_resource: false
              resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
              resource_method_params:
                connection.githubEnterpriseConfig.webhookSecretSecretVersion: '{__relative_name__}'
              required: false
              clearable: true
            - arg_name: github-enterprise-config-app-installation-id
              api_field: connection.githubEnterpriseConfig.appInstallationId
              required: false
              repeated: false
              type: long
              help_text: |-
                ID of the installation of the GitHub App.
            - group:
                api_field: connection.githubEnterpriseConfig.serviceDirectoryConfig
                required: false
                help_text: |-
                  ServiceDirectoryConfig represents Service Directory configuration for a
                  connection.
                params:
                - arg_name: github-enterprise-config-service-directory
                  help_text: |-
                    The Service Directory service name.
                    Format:
                    projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_locations_namespaces_services
                  resource_method_params:
                    connection.githubEnterpriseConfig.serviceDirectoryConfig.service: '{__relative_name__}'
                  required: false
            - arg_name: github-enterprise-config-ssl-ca-certificate
              api_field: connection.githubEnterpriseConfig.sslCaCertificate
              required: false
              repeated: false
              help_text: |-
                SSL certificate to use for requests to GitHub Enterprise.
        - group:
            api_field: connection.gitlabConfig
            arg_name: gitlab-config
            clearable: true
            required: false
            help_text: |-
              Configuration for connections to gitlab.com.
            params:
            - group:
                api_field: connection.gitlabConfig.readAuthorizerCredential
                required: false
                help_text: |-
                  Represents a personal access token that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: gitlab-config-read-authorizer-credential-user-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the user token that authorizes
                    the Developer Connect connection. Format:
                    `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.gitlabConfig.readAuthorizerCredential.userTokenSecretVersion: '{__relative_name__}'
                  required: false
            - group:
                api_field: connection.gitlabConfig.authorizerCredential
                required: false
                help_text: |-
                  Represents a personal access token that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: gitlab-config-authorizer-credential-user-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the user token that authorizes
                    the Developer Connect connection. Format:
                    `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.gitlabConfig.authorizerCredential.userTokenSecretVersion: '{__relative_name__}'
                  required: false
        - group:
            api_field: connection.gitlabEnterpriseConfig
            arg_name: gitlab-enterprise-config
            clearable: true
            required: false
            help_text: |-
              Configuration for connections to an instance of GitLab Enterprise.
            params:
            - arg_name: gitlab-enterprise-config-host-uri
              api_field: connection.gitlabEnterpriseConfig.hostUri
              required: false
              repeated: false
              help_text: |-
                The URI of the GitLab Enterprise host this connection is for.
            - group:
                api_field: connection.gitlabEnterpriseConfig.readAuthorizerCredential
                required: false
                help_text: |-
                  Represents a personal access token that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: gitlab-enterprise-config-read-authorizer-credential-user-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the user token that authorizes
                    the Developer Connect connection. Format:
                    `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.gitlabEnterpriseConfig.readAuthorizerCredential.userTokenSecretVersion: '{__relative_name__}'
                  required: false
            - group:
                api_field: connection.gitlabEnterpriseConfig.authorizerCredential
                required: false
                help_text: |-
                  Represents a personal access token that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: gitlab-enterprise-config-authorizer-credential-user-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the user token that authorizes
                    the Developer Connect connection. Format:
                    `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.gitlabEnterpriseConfig.authorizerCredential.userTokenSecretVersion: '{__relative_name__}'
                  required: false
            - group:
                api_field: connection.gitlabEnterpriseConfig.serviceDirectoryConfig
                required: false
                help_text: |-
                  ServiceDirectoryConfig represents Service Directory configuration for a
                  connection.
                params:
                - arg_name: gitlab-enterprise-config-service-directory
                  help_text: |-
                    The Service Directory service name.
                    Format:
                    projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_locations_namespaces_services
                  resource_method_params:
                    connection.gitlabEnterpriseConfig.serviceDirectoryConfig.service: '{__relative_name__}'
                  required: false
            - arg_name: gitlab-enterprise-config-ssl-ca-certificate
              api_field: connection.gitlabEnterpriseConfig.sslCaCertificate
              required: false
              repeated: false
              help_text: |-
                SSL Certificate Authority certificate to use for requests to GitLab
                Enterprise instance.
        - group:
            api_field: connection.bitbucketDataCenterConfig
            arg_name: bitbucket-data-center-config
            clearable: true
            required: false
            help_text: |-
              Configuration for connections to an instance of Bitbucket Data Center.
            params:
            - arg_name: bitbucket-data-center-config-host-uri
              api_field: connection.bitbucketDataCenterConfig.hostUri
              required: false
              repeated: false
              help_text: |-
                The URI of the Bitbucket Data Center host this connection is for.
            - group:
                api_field: connection.bitbucketDataCenterConfig.readAuthorizerCredential
                required: false
                help_text: |-
                  Represents a personal access token that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: bitbucket-data-center-config-read-authorizer-credential-user-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the user token that authorizes
                    the Developer Connect connection. Format:
                    `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.bitbucketDataCenterConfig.readAuthorizerCredential.userTokenSecretVersion: '{__relative_name__}'
                  required: false
            - group:
                api_field: connection.bitbucketDataCenterConfig.authorizerCredential
                required: false
                help_text: |-
                  Represents a personal access token that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: bitbucket-data-center-config-authorizer-credential-user-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the user token that authorizes
                    the Developer Connect connection. Format:
                    `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.bitbucketDataCenterConfig.authorizerCredential.userTokenSecretVersion: '{__relative_name__}'
                  required: false
            - group:
                api_field: connection.bitbucketDataCenterConfig.serviceDirectoryConfig
                required: false
                help_text: |-
                  ServiceDirectoryConfig represents Service Directory configuration for a
                  connection.
                params:
                - arg_name: bitbucket-data-center-config-service-directory
                  help_text: |-
                    The Service Directory service name.
                    Format:
                    projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_locations_namespaces_services
                  resource_method_params:
                    connection.bitbucketDataCenterConfig.serviceDirectoryConfig.service: '{__relative_name__}'
                  required: false
            - arg_name: bitbucket-data-center-config-ssl-ca-certificate
              api_field: connection.bitbucketDataCenterConfig.sslCaCertificate
              required: false
              repeated: false
              help_text: |-
                SSL certificate authority to trust when making requests to Bitbucket Data
                Center.
        - group:
            api_field: connection.bitbucketCloudConfig
            arg_name: bitbucket-cloud-config
            clearable: true
            required: false
            help_text: |-
              Configuration for connections to an instance of Bitbucket Cloud.
            params:
            - arg_name: bitbucket-cloud-config-workspace
              api_field: connection.bitbucketCloudConfig.workspace
              required: false
              repeated: false
              help_text: |-
                The Bitbucket Cloud Workspace ID to be connected to Google Cloud Platform.
            - group:
                api_field: connection.bitbucketCloudConfig.readAuthorizerCredential
                required: false
                help_text: |-
                  Represents a personal access token that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: bitbucket-cloud-config-read-authorizer-credential-user-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the user token that authorizes
                    the Developer Connect connection. Format:
                    `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.bitbucketCloudConfig.readAuthorizerCredential.userTokenSecretVersion: '{__relative_name__}'
                  required: false
            - group:
                api_field: connection.bitbucketCloudConfig.authorizerCredential
                required: false
                help_text: |-
                  Represents a personal access token that authorized the Connection,
                  and associated metadata.
                params:
                - arg_name: bitbucket-cloud-config-authorizer-credential-user-token-secret-version
                  help_text: |-
                    A SecretManager resource containing the user token that authorizes
                    the Developer Connect connection. Format:
                    `projects/*/secrets/*/versions/*`.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                  resource_method_params:
                    connection.bitbucketCloudConfig.authorizerCredential.userTokenSecretVersion: '{__relative_name__}'
                  required: false
        - group:
            api_field: connection.httpConfig
            arg_name: http-config
            clearable: true
            required: false
            hidden: true
            help_text: |-
              Configuration for connections to an HTTP service provider.
            params:
            - group:
                mutex: true
                help_text: |-
                  Arguments for the authentication.
                params:
                - group:
                    api_field: connection.httpConfig.basicAuthentication
                    required: false
                    help_text: |-
                      Basic authentication with username and password.
                    params:
                    - group:
                        mutex: true
                        help_text: |-
                          Arguments for the password.
                        params:
                        - arg_name: http-config-basic-authentication-password-secret-version
                          help_text: |-
                            The password SecretManager secret version to authenticate as.
                          is_positional: false
                          is_primary_resource: false
                          resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                          resource_method_params:
                            connection.httpConfig.basicAuthentication.passwordSecretVersion: '{__relative_name__}'
                          required: false
                          clearable: true
                    - arg_name: http-config-basic-authentication-username
                      api_field: connection.httpConfig.basicAuthentication.username
                      required: false
                      repeated: false
                      help_text: |-
                        The username to authenticate as.
                - group:
                    api_field: connection.httpConfig.bearerTokenAuthentication
                    required: false
                    help_text: |-
                      Bearer token authentication with a token.
                    params:
                    - group:
                        mutex: true
                        help_text: |-
                          Arguments for the token.
                        params:
                        - arg_name: http-config-bearer-token-authentication-secret-version
                          help_text: |-
                            The token SecretManager secret version to authenticate as.
                          is_positional: false
                          is_primary_resource: false
                          resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_secrets_versions
                          resource_method_params:
                            connection.httpConfig.bearerTokenAuthentication.tokenSecretVersion: '{__relative_name__}'
                          required: false
                          clearable: true
            - group:
                api_field: connection.httpConfig.serviceDirectoryConfig
                required: false
                help_text: |-
                  ServiceDirectoryConfig represents Service Directory configuration for a
                  connection.
                params:
                - arg_name: http-config-service-directory
                  help_text: |-
                    The Service Directory service name.
                    Format:
                    projects/{project}/locations/{location}/namespaces/{namespace}/services/{service}.
                  is_positional: false
                  is_primary_resource: false
                  resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_locations_namespaces_services
                  resource_method_params:
                    connection.httpConfig.serviceDirectoryConfig.service: '{__relative_name__}'
                  required: false
            - arg_name: http-config-ssl-ca-certificate
              api_field: connection.httpConfig.sslCaCertificate
              required: false
              repeated: false
              help_text: |-
                The SSL certificate to use for requests to the HTTP service provider.
    - help_text: |-
        Identifier. The resource name of the connection, in the format
        `projects/{project}/locations/{location}/connections/{connection_id}`.
      is_positional: true
      is_primary_resource: true
      resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_locations_connections
      required: true
    - arg_name: labels
      api_field: connection.labels
      required: false
      repeated: true
      help_text: |-
        Labels as key value pairs
      clearable: true
      spec:
      - api_field: key
      - api_field: value
    - arg_name: disabled
      api_field: connection.disabled
      action: store_true_false
      required: false
      type: bool
      help_text: |-
        If disabled is set to true, functionality is disabled for this connection.
        Repository based API methods and webhooks processing for repositories in
        this connection will be disabled.
    - arg_name: annotations
      api_field: connection.annotations
      required: false
      repeated: true
      help_text: |-
        Allows clients to store small amounts of arbitrary data.
      clearable: true
      spec:
      - api_field: key
      - api_field: value
    - arg_name: etag
      api_field: connection.etag
      required: false
      repeated: false
      help_text: |-
        This checksum is computed by the server based on the value of other
        fields, and may be sent on update and delete requests to ensure the
        client has an up-to-date value before proceeding.
    - group:
        api_field: connection.cryptoKeyConfig
        arg_name: crypto-key-config
        clearable: true
        required: false
        help_text: |-
          The crypto key configuration. This field is used by the Customer-managed
          encryption keys (CMEK) feature.
        params:
        - arg_name: crypto-key-config-reference
          help_text: |-
            The name of the key which is used to encrypt/decrypt customer data. For key
            in Cloud KMS, the key should be in the format of
            `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
          is_positional: false
          is_primary_resource: false
          resource_spec: !REF googlecloudsdk.command_lib.developer_connect.v1_resources:projects_locations_key_rings_crypto_keys
          resource_method_params:
            connection.cryptoKeyConfig.keyReference: '{__relative_name__}'
          required: false
    - group:
        api_field: connection.gitProxyConfig
        arg_name: git-proxy-config
        clearable: true
        required: false
        help_text: |-
          The git proxy configuration.
        params:
        - arg_name: git-proxy-config-enabled
          api_field: connection.gitProxyConfig.enabled
          action: store_true_false
          required: false
          type: bool
          help_text: |-
            Setting this to true allows the git proxy to be used for performing git
            operations on the repositories linked in the connection.
    - arg_name: request-id
      api_field: requestId
      required: false
      repeated: false
      help_text: |-
        An optional request ID to identify requests. Specify a unique request ID
        so that if you must retry your request, the server will know to ignore
        the request if it has already been completed. The server will guarantee
        that for at least 60 minutes since the first request.

        For example, consider a situation where you make an initial request and the
        request times out. If you make the request again with the same request
        ID, the server can check if original operation with the same request ID
        was received, and if so, will ignore the second request. This prevents
        clients from accidentally creating duplicate commitments.

        The request ID must be a valid UUID with the exception that zero UUID is
        not supported (00000000-0000-0000-0000-000000000000).
    - arg_name: allow-missing
      api_field: allowMissing
      action: store_true_false
      required: false
      type: bool
      help_text: |-
        If set to true, and the connection is not found a new connection
        will be created. In this situation `update_mask` is ignored.
        The creation will succeed only if the input connection has all the
        necessary information (e.g a github_config with both  user_oauth_token and
        installation_id properties).
    - arg_name: validate-only
      api_field: validateOnly
      action: store_true_false
      required: false
      type: bool
      help_text: |-
        If set, validate the request, but do not actually post it.
  request:
    api_version: v1
    collection:
    - developerconnect.projects.locations.connections
    static_fields:
      updateMask: '*'
  async:
    collection:
    - developerconnect.projects.locations.operations
  update:
    read_modify_update: true
    disable_auto_field_mask: true
