# -*- 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
  hidden: true
  help_text:
    brief: Updates a PolicyPorter resource.
    description: |
      Updates a PolicyPorter resource. It can be helpful to first Create a PolicyPorter resource
      to see the parsed Principal/Resource keys, and use them to update the mappings in this
      command.
    examples: |-
      To update a PolicyPorter resource and identity mappings, run:

      $ {command} my-policy-porter --location=global --project=my-project \
        --update-aws-mappings-resource-mapping='{"my_aws_resource": "my_gcp_resource"}}' \
        --update-aws-mappings-principal-mapping='{"my_aws_identity": "my_gcp_identity"}}' \
  arguments:
    params:
    - help_text: |-
        Identifier. Name of resource.
        Format:
        projects/{project}/locations/{location}/policyPorters/{policy_porter}.
      is_positional: true
      is_primary_resource: true
      resource_spec: !REF googlecloudsdk.command_lib.iam.v3alpha_resources:projects_locations_policy_porters
      required: true
    - arg_name: labels
      api_field: googleIamV3alphaPolicyPorter.labels
      required: false
      repeated: true
      help_text: |-
        Resource labels as key value pairs, used for List API filtering.
      clearable: true
      spec:
      - api_field: key
      - api_field: value
    - arg_name: display-name
      api_field: googleIamV3alphaPolicyPorter.displayName
      required: false
      repeated: false
      help_text: |-
        An arbitrary user-provided name for policy porter.
        The display name should adhere to the following format:
        * Must be 6 to 63 characters in length.
        * Can only contain lowercase letters, numbers, and hyphens.
        * Must start with a letter.
    - arg_name: description
      api_field: googleIamV3alphaPolicyPorter.description
      required: false
      repeated: false
      help_text: |-
        Description about translation.
    - group:
        api_field: googleIamV3alphaPolicyPorter.policyConfig
        arg_name: policy-config
        clearable: true
        required: false
        help_text: |-
          Represents config for PolicyPorter such as policies, mappings, etc. required
          by PolicyPorter.
        params:
        - group:
            mutex: true
            help_text: |-
              Arguments for the policy json.
            params:
            - group:
                api_field: googleIamV3alphaPolicyPorter.policyConfig.inlinePolicyJson
                required: false
                help_text: |-
                  Inline representation of policy json that is being translated.
                params:
                - arg_name: inline-policy-json-file-name
                  api_field: googleIamV3alphaPolicyPorter.policyConfig.inlinePolicyJson.fileName
                  required: false
                  repeated: false
                  help_text: |-
                    Name of file from which policy json got imported. This helps user to
                    recognize the source of policies.
                - group:
                    mutex: true
                    required: true
                    params:
                    - arg_name: inline-policy-json-content-from-file
                      api_field: googleIamV3alphaPolicyPorter.policyConfig.inlinePolicyJson.content
                      json_name: contentFromFile
                      required: false
                      repeated: false
                      type: file_type
                      help_text: |-
                        Content of the file containing policies in json format.
                    - arg_name: inline-policy-json-content
                      api_field: googleIamV3alphaPolicyPorter.policyConfig.inlinePolicyJson.content
                      required: false
                      repeated: false
                      type: bytes
                      help_text: |-
                        Content of the file containing policies in json format.
        - group:
            mutex: true
            help_text: |-
              Arguments for the mappings.
            params:
            - group:
                api_field: googleIamV3alphaPolicyPorter.policyConfig.awsMappings
                required: false
                help_text: |-
                  Resource and principal mappings required for translating policies.
                params:
                - arg_name: aws-mappings-resource-mapping
                  api_field: googleIamV3alphaPolicyPorter.policyConfig.awsMappings.resourceMapping
                  required: false
                  repeated: true
                  help_text: |-
                    User provided resource mapping for keys in `resource_keys` field.
                    Keys format: [IAM JSON policy elements:
                    Resource](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_resource.html).
                    Values format: See [Resource
                    names](https://cloud.google.com/apis/design/resource_names).
                  clearable: true
                  spec:
                  - api_field: key
                  - api_field: value
                - arg_name: aws-mappings-principal-mapping
                  api_field: googleIamV3alphaPolicyPorter.policyConfig.awsMappings.principalMapping
                  required: false
                  repeated: true
                  help_text: |-
                    User provided principal mapping for keys in `principal_keys` field.
                    Keys format: [AWS JSON policy elements:
                    Principal](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html).
                    Values format: See [Members field in
                    bindings](https://cloud.google.com/iam/docs/reference/rest/v1/Policy#binding).
                  clearable: true
                  spec:
                  - api_field: key
                  - api_field: value
        - arg_name: policy-config-source-cloud
          api_field: googleIamV3alphaPolicyPorter.policyConfig.sourceCloud
          required: false
          help_text: |-
            Type of source cloud from which policies are being translated.
          choices:
          - arg_value: aws
            enum_value: AWS
            help_text: |-
              Represents AWS cloud.
    - 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).
  request:
    api_version: v3alpha
    collection:
    - iam.projects.locations.policyPorters
    static_fields:
      updateMask: '*'
  async:
    collection:
    - iam.projects.locations.operations
  update:
    read_modify_update: true
    disable_auto_field_mask: true
