# -*- 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: Create a Plugin
    description: |-
      Create a plugin

      Note: The positional argument for Plugin ID is currently not supported.
      Please use the --plugin flag to specify the Plugin ID.
    examples: |-
      To create a plugin with the ID `my-plugin`, run:

      $ {command} --plugin=my-plugin --display-name="My Plugin" --type=apigee --project=my-project --location=us-central1
  arguments:
    params:
    - help_text: |-
        Identifier. The name of the plugin.
        Format: `projects/{project}/locations/{location}/plugins/{plugin}`
      is_positional: true
      is_primary_resource: true
      request_id_field: pluginId
      resource_spec: !REF googlecloudsdk.command_lib.apihub.v1_resources:projects_locations_plugins
      required: true
    - arg_name: display-name
      api_field: googleCloudApihubV1Plugin.displayName
      required: true
      repeated: false
      help_text: |-
        The display name of the plugin. Max length is 50 characters (Unicode code
        points).
    - group:
        api_field: googleCloudApihubV1Plugin.type
        required: false
        help_text: |-
          The attribute values associated with resource.
        params:
        - group:
            mutex: true
            help_text: |-
              Arguments for the Value.
            params:
            - group:
                api_field: googleCloudApihubV1Plugin.type.enumValues
                required: false
                help_text: |-
                  The attribute values of data type enum.
                params:
                - arg_name: enum-values
                  api_field: googleCloudApihubV1Plugin.type.enumValues.values
                  required: true
                  repeated: true
                  help_text: |-
                    The attribute values in case attribute data type is enum.
                  spec:
                  - api_field: id
                    help_text: |-
                      The ID of the allowed value.
                      * If provided, the same will be used. The service will throw an error if
                      the specified id is already used by another allowed value in the same
                      attribute resource.
                      * If not provided, a system generated id derived from the display name
                      will be used. In this case, the service will handle conflict resolution
                      by adding a system generated suffix in case of duplicates.

                      This value should be 4-63 characters, and valid characters
                      are /[a-z][0-9]-/.
                  - api_field: displayName
                    help_text: |-
                      The display name of the allowed value.
                  - api_field: description
                    help_text: |-
                      The detailed description of the allowed value.
                  - api_field: immutable
                    help_text: |-
                      When set to true, the allowed value cannot be updated or deleted by the
                      user. It can only be true for System defined attributes.
            - group:
                api_field: googleCloudApihubV1Plugin.type.stringValues
                required: false
                help_text: |-
                  The attribute values of data type string or JSON.
                params:
                - arg_name: string-values
                  api_field: googleCloudApihubV1Plugin.type.stringValues.values
                  required: true
                  repeated: true
                  help_text: |-
                    The attribute values in case attribute data type is string or JSON.
            - group:
                api_field: googleCloudApihubV1Plugin.type.jsonValues
                required: false
                help_text: |-
                  The attribute values of data type string or JSON.
                params:
                - arg_name: json-values
                  api_field: googleCloudApihubV1Plugin.type.jsonValues.values
                  required: true
                  repeated: true
                  help_text: |-
                    The attribute values in case attribute data type is string or JSON.
            - group:
                api_field: googleCloudApihubV1Plugin.type.uriValues
                required: false
                help_text: |-
                  The attribute values of data type string or JSON.
                params:
                - arg_name: uri-values
                  api_field: googleCloudApihubV1Plugin.type.uriValues.values
                  required: true
                  repeated: true
                  help_text: |-
                    The attribute values in case attribute data type is string or JSON.
    - arg_name: description
      api_field: googleCloudApihubV1Plugin.description
      required: false
      repeated: false
      help_text: |-
        The plugin description. Max length is 2000 characters (Unicode code
        points).
    - group:
        api_field: googleCloudApihubV1Plugin.hostingService
        required: false
        help_text: |-
          The information related to the service implemented by the plugin
          developer, used to invoke the plugin's functionality.
        params:
        - arg_name: hosting-service-uri
          api_field: googleCloudApihubV1Plugin.hostingService.serviceUri
          required: false
          repeated: false
          help_text: |-
            The URI of the service implemented by the plugin developer, used to
            invoke the plugin's functionality. This information is only required for
            user defined plugins.
    - arg_name: actions-config
      api_field: googleCloudApihubV1Plugin.actionsConfig
      required: false
      repeated: true
      help_text: |-
        The configuration of actions supported by the plugin.
        **REQUIRED**: This field must be provided when creating or updating a
        Plugin. The server will reject requests if this field is missing.
      spec:
      - api_field: id
        help_text: |-
          The id of the action.
      - api_field: displayName
        help_text: |-
          The display name of the action.
      - api_field: description
        help_text: |-
          The description of the operation performed by the action.
      - api_field: triggerMode
        help_text: |-
          The trigger mode supported by the action.
    - group:
        api_field: googleCloudApihubV1Plugin.documentation
        required: false
        help_text: |-
          Documentation details.
        params:
        - arg_name: documentation-external-uri
          api_field: googleCloudApihubV1Plugin.documentation.externalUri
          required: false
          repeated: false
          help_text: |-
            The uri of the externally hosted documentation.
    - arg_name: plugin-category
      api_field: googleCloudApihubV1Plugin.pluginCategory
      required: false
      help_text: |-
        The category of the plugin, identifying its primary category or purpose.
        This field is required for all plugins.
      choices:
      - arg_value: api-gateway
        enum_value: API_GATEWAY
        help_text: |-
          API_GATEWAY plugins represent plugins built for API Gateways like Apigee.
      - arg_value: api-producer
        enum_value: API_PRODUCER
        help_text: |-
          API_PRODUCER plugins represent plugins built for API Producers like
          Cloud Run, Application Integration etc.
    - group:
        api_field: googleCloudApihubV1Plugin.configTemplate
        required: false
        help_text: |-
          ConfigTemplate represents the configuration template for a plugin.
        params:
        - group:
            api_field: googleCloudApihubV1Plugin.configTemplate.authConfigTemplate
            required: false
            help_text: |-
              AuthConfigTemplate represents the authentication template for a plugin.
            params:
            - arg_name: auth-config-template-supported-types
              api_field: googleCloudApihubV1Plugin.configTemplate.authConfigTemplate.supportedAuthTypes
              required: true
              repeated: true
              help_text: |-
                The list of authentication types supported by the plugin.
              choices:
              - arg_value: no-auth
                enum_value: NO_AUTH
                help_text: |-
                  No authentication.
              - arg_value: google-service-account
                enum_value: GOOGLE_SERVICE_ACCOUNT
                help_text: |-
                  Google service account authentication.
              - arg_value: user-password
                enum_value: USER_PASSWORD
                help_text: |-
                  Username and password authentication.
              - arg_value: api-key
                enum_value: API_KEY
                help_text: |-
                  API Key authentication.
              - arg_value: oauth2-client-credentials
                enum_value: OAUTH2_CLIENT_CREDENTIALS
                help_text: |-
                  Oauth 2.0 client credentials grant authentication.
        - arg_name: config-template-additional
          api_field: googleCloudApihubV1Plugin.configTemplate.additionalConfigTemplate
          required: false
          repeated: true
          help_text: |-
            The list of additional configuration variables for the plugin's
            configuration.
          spec:
          - api_field: id
            help_text: |-
              ID of the config variable. Must be unique within the configuration.
          - api_field: valueType
            help_text: |-
              Type of the parameter: string, int, bool etc.
          - api_field: description
            help_text: |-
              Description.
          - api_field: validationRegex
            help_text: |-
              Regular expression in RE2 syntax used for validating the `value` of a
              `ConfigVariable`.
          - api_field: required
            help_text: |-
              Flag represents that this `ConfigVariable` must be provided for a
              PluginInstance.
          - api_field: enumOptions
            help_text: |-
              Enum options. To be populated if `ValueType` is `ENUM`.
            spec:
            - api_field: id
              help_text: |-
                Id of the option.
            - api_field: displayName
              help_text: |-
                Display name of the option.
            - api_field: description
              help_text: |-
                Description of the option.
          - api_field: multiSelectOptions
            help_text: |-
              Multi select options. To be populated if `ValueType` is `MULTI_SELECT`.
            spec:
            - api_field: id
              help_text: |-
                Id of the option.
            - api_field: displayName
              help_text: |-
                Display name of the option.
            - api_field: description
              help_text: |-
                Description of the option.
    - arg_name: gateway-type
      api_field: googleCloudApihubV1Plugin.gatewayType
      required: false
      help_text: |-
        The type of the gateway.
      choices:
      - arg_value: apigee-x-and-hybrid
        enum_value: APIGEE_X_AND_HYBRID
        help_text: |-
          The gateway type is Apigee X and Hybrid.
      - arg_value: apigee-edge-public-cloud
        enum_value: APIGEE_EDGE_PUBLIC_CLOUD
        help_text: |-
          The gateway type is Apigee Edge Public Cloud.
      - arg_value: apigee-edge-private-cloud
        enum_value: APIGEE_EDGE_PRIVATE_CLOUD
        help_text: |-
          The gateway type is Apigee Edge Private Cloud.
      - arg_value: cloud-api-gateway
        enum_value: CLOUD_API_GATEWAY
        help_text: |-
          The gateway type is Cloud API Gateway.
      - arg_value: cloud-endpoints
        enum_value: CLOUD_ENDPOINTS
        help_text: |-
          The gateway type is Cloud Endpoints.
      - arg_value: api-discovery
        enum_value: API_DISCOVERY
        help_text: |-
          The gateway type is API Discovery.
      - arg_value: others
        enum_value: OTHERS
        help_text: |-
          The gateway type for any other types of gateways.
  request:
    api_version: v1
    collection:
    - apihub.projects.locations.plugins
