- release_tracks: [ALPHA]

  help_text:
    brief: |
      Update Memorystore Cluster for Redis instance.
    description: |
      Update the metadata and/or configuration parameters of a Redis cluster.

      This command can fail for the following reasons:
        * The cluster specified does not exist.
        * The active account does not have permission to update the given
          cluster.
    examples: |
      To update a Redis cluster with the size to 48GB, run:

        $ {command} my-redis-cluster --size-gb=48

  arguments:
    resource:
      spec: !REF googlecloudsdk.command_lib.redis.resources:cluster
      help_text: |
        Arguments and flags that specify the Memorystore Redis cluster you want to update.
    params:
    - arg_name: display-name
      api_field: cluster.displayName
      help_text: |
        A human-readable name for the cluster.
    - arg_name: replica-count
      api_field: cluster.replicaCount
      type: int
      help_text: |
        The replica count of each shard.
    - arg_name: size-gb
      api_field: cluster.sizeGb
      help_text: |
        The memory size of the cluster in GiB.

  async:
    collection: redis.projects.locations.operations

  request:
    ALPHA:
      api_version: v1alpha1
      modify_request_hooks:
      - googlecloudsdk.command_lib.redis.clusters_update_util:UpdateDisplayName
      - googlecloudsdk.command_lib.redis.clusters_update_util:UpdateSizeGb
      - googlecloudsdk.command_lib.redis.clusters_update_util:UpdateReplicaCount
    collection: redis.projects.locations.clusters

  update:
    read_modify_update: true
    disable_auto_field_mask: true
