- release_tracks: [ALPHA, BETA, GA]

  help_text:
    brief: Update a Game Server Cluster.
    description: |
      Update a Cloud Game Server Cluster.

      ## EXAMPLES

      To update labels for Game Server Cluster 'my-cluster' in project 'my-project', realm 'my-realm', and location in 'my-location' run:

        $ {command} my-cluster --project=my-project --realm=my-realm --location=my-location \
            --update-labels="key1=val1"  --no-dry-run

      To preview Game Server Cluster label update for 'my-cluster' in project 'my-project', realm 'my-realm', and location in 'my-location' run:

        $ {command} my-cluster --project=my-project --realm=my-realm --location=my-location \
            --update-labels="key1=val1"  --dry-run


  request:
    collection: gameservices.projects.locations.realms.gameServerClusters
    ALPHA:
      api_version: v1alpha
    BETA:
      api_version: v1beta
    GA:
      api_version: v1
    method: previewUpdate
    modify_method_hook:
      googlecloudsdk.command_lib.game.servers.clusters.update_hooks:ChooseUpdateOrPreviewMethod
    modify_request_hooks:
    - googlecloudsdk.command_lib.game.servers.clusters.update_hooks:SetUpdateMask

  arguments:
    resource:
      help_text: Cloud Game Server Cluster to update.
      spec: !REF googlecloudsdk.command_lib.game.resources:cluster
    params:
    - arg_name: description
      api_field: gameServerCluster.description
      help_text: |
        Description for the game server cluster.
    - arg_name: dry-run
      type: bool
      required: true
      help_text: |
        Validate the changes, but do not execute it.
    - arg_name: preview-time
      api_field: previewTime
      help_text: |
        This attribute is only relevant for preview (--dry-run). It is used to validate
        the state for a future time.
    - arg_name: allocation-weight
      release_tracks: [ALPHA]
      api_field: gameServerCluster.allocationWeight
      hidden: true
      help_text: |
        The Allocation weight assigned to the game server cluster.
        Allocation weight is used to control a single cluster's allocation load
        ratio, from 0 (allocation disabled) to 100 (its full expected load).

        For example, if there are two clusters in a realm where each expects to
        receive 500 units of allocations eventually. The ratio does not represent
        the load ratio across the realm (1000), but the percentage of traffic of
        the cluster (500). Any overflow is load balanced across the clusters
        according to the weight.
    labels:
      api_field: gameServerCluster.labels

  response:
    modify_response_hooks:
    - googlecloudsdk.command_lib.game.servers.clusters.update_hooks:ConvertOutput

  update:
    read_modify_update: true
