# coding: utf-8
# Copyright (c) 2016, 2026, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20230222

from __future__ import print_function
import click
import oci  # noqa: F401
import six  # noqa: F401
import sys  # noqa: F401
from oci_cli.cli_root import cli
from oci_cli import cli_constants  # noqa: F401
from oci_cli import cli_util
from oci_cli import json_skeleton_utils
from oci_cli import custom_types  # noqa: F401
from oci_cli.aliasing import CommandGroupWithAlias


@cli.command(cli_util.override('dbtools_runtime.dbtools_runtime_root_group.command_name', 'dbtools-runtime'), cls=CommandGroupWithAlias, help=cli_util.override('dbtools_runtime.dbtools_runtime_root_group.help', """Use the Database Tools Runtime API to connect to databases through Database Tools Connections."""), short_help=cli_util.override('dbtools_runtime.dbtools_runtime_root_group.short_help', """Database Tools Runtime API"""))
@cli_util.help_option_group
def dbtools_runtime_root_group():
    pass


@click.command(cli_util.override('dbtools_runtime.credential_execute_grantee_collection_group.command_name', 'credential-execute-grantee-collection'), cls=CommandGroupWithAlias, help="""List of `CredentialExecuteGranteeSummary` items.""")
@cli_util.help_option_group
def credential_execute_grantee_collection_group():
    pass


@click.command(cli_util.override('dbtools_runtime.property_set_group.command_name', 'property-set'), cls=CommandGroupWithAlias, help="""The base definition for a property set""")
@cli_util.help_option_group
def property_set_group():
    pass


@click.command(cli_util.override('dbtools_runtime.credential_execute_grantee_group.command_name', 'credential-execute-grantee'), cls=CommandGroupWithAlias, help="""Specifies the database user, the grantee, who is granted the execute privilege on the credential.""")
@cli_util.help_option_group
def credential_execute_grantee_group():
    pass


@click.command(cli_util.override('dbtools_runtime.database_tools_database_api_gateway_config_pool_auto_api_spec_group.command_name', 'database-tools-database-api-gateway-config-pool-auto-api-spec'), cls=CommandGroupWithAlias, help="""The content of a Database Tools database API gateway config auto API spec sub resource defined within a pool.""")
@cli_util.help_option_group
def database_tools_database_api_gateway_config_pool_auto_api_spec_group():
    pass


@click.command(cli_util.override('dbtools_runtime.credential_collection_group.command_name', 'credential-collection'), cls=CommandGroupWithAlias, help="""List of `CredentialSummary` items.""")
@cli_util.help_option_group
def credential_collection_group():
    pass


@click.command(cli_util.override('dbtools_runtime.credential_public_synonym_group.command_name', 'credential-public-synonym'), cls=CommandGroupWithAlias, help="""The public synonym information""")
@cli_util.help_option_group
def credential_public_synonym_group():
    pass


@click.command(cli_util.override('dbtools_runtime.database_tools_database_api_gateway_config_global_group.command_name', 'database-tools-database-api-gateway-config-global'), cls=CommandGroupWithAlias, help="""The content of a Database Tools database API gateway config global resource.""")
@cli_util.help_option_group
def database_tools_database_api_gateway_config_global_group():
    pass


@click.command(cli_util.override('dbtools_runtime.work_request_log_entry_group.command_name', 'work-request-log-entry'), cls=CommandGroupWithAlias, help="""A log message from the execution of a work request.""")
@cli_util.help_option_group
def work_request_log_entry_group():
    pass


@click.command(cli_util.override('dbtools_runtime.work_request_group.command_name', 'work-request'), cls=CommandGroupWithAlias, help="""An asynchronous work request.""")
@cli_util.help_option_group
def work_request_group():
    pass


@click.command(cli_util.override('dbtools_runtime.database_tools_database_api_gateway_config_pool_api_spec_group.command_name', 'database-tools-database-api-gateway-config-pool-api-spec'), cls=CommandGroupWithAlias, help="""The content of a Database Tools database API gateway config API spec sub resource defined within a pool.""")
@cli_util.help_option_group
def database_tools_database_api_gateway_config_pool_api_spec_group():
    pass


@click.command(cli_util.override('dbtools_runtime.database_tools_database_api_gateway_config_group.command_name', 'database-tools-database-api-gateway-config'), cls=CommandGroupWithAlias, help="""Simplified DatabaseToolsDatabaseApiGatewayConfig representation for splat usage only.""")
@cli_util.help_option_group
def database_tools_database_api_gateway_config_group():
    pass


@click.command(cli_util.override('dbtools_runtime.user_credential_group.command_name', 'user-credential'), cls=CommandGroupWithAlias, help="""Credential information""")
@cli_util.help_option_group
def user_credential_group():
    pass


@click.command(cli_util.override('dbtools_runtime.credential_group.command_name', 'credential'), cls=CommandGroupWithAlias, help="""Credential information""")
@cli_util.help_option_group
def credential_group():
    pass


@click.command(cli_util.override('dbtools_runtime.credential_public_synonym_collection_group.command_name', 'credential-public-synonym-collection'), cls=CommandGroupWithAlias, help="""List of `CredentialPublicSynonymSummary` items.""")
@cli_util.help_option_group
def credential_public_synonym_collection_group():
    pass


@click.command(cli_util.override('dbtools_runtime.user_credential_collection_group.command_name', 'user-credential-collection'), cls=CommandGroupWithAlias, help="""List of `UserCredentialSummary` items.""")
@cli_util.help_option_group
def user_credential_collection_group():
    pass


@click.command(cli_util.override('dbtools_runtime.database_tools_identity_group.command_name', 'database-tools-identity'), cls=CommandGroupWithAlias, help="""Manages credentials in a database to access service resources.""")
@cli_util.help_option_group
def database_tools_identity_group():
    pass


@click.command(cli_util.override('dbtools_runtime.work_request_error_group.command_name', 'work-request-error'), cls=CommandGroupWithAlias, help="""An error encountered while executing a work request.""")
@cli_util.help_option_group
def work_request_error_group():
    pass


@click.command(cli_util.override('dbtools_runtime.database_tools_database_api_gateway_config_advanced_property_summary_group.command_name', 'database-tools-database-api-gateway-config-advanced-property-summary'), cls=CommandGroupWithAlias, help="""Description of a database API gateway config setting to be provided as an advanced property.""")
@cli_util.help_option_group
def database_tools_database_api_gateway_config_advanced_property_summary_group():
    pass


@click.command(cli_util.override('dbtools_runtime.database_tools_connection_group.command_name', 'database-tools-connection'), cls=CommandGroupWithAlias, help="""Simplified DatabaseToolsConnection representation for splat usage only""")
@cli_util.help_option_group
def database_tools_connection_group():
    pass


@click.command(cli_util.override('dbtools_runtime.database_tools_database_api_gateway_config_pool_group.command_name', 'database-tools-database-api-gateway-config-pool'), cls=CommandGroupWithAlias, help="""The content of a Database Tools database API gateway config pool sub resource.""")
@cli_util.help_option_group
def database_tools_database_api_gateway_config_pool_group():
    pass


dbtools_runtime_root_group.add_command(credential_execute_grantee_collection_group)
dbtools_runtime_root_group.add_command(property_set_group)
dbtools_runtime_root_group.add_command(credential_execute_grantee_group)
dbtools_runtime_root_group.add_command(database_tools_database_api_gateway_config_pool_auto_api_spec_group)
dbtools_runtime_root_group.add_command(credential_collection_group)
dbtools_runtime_root_group.add_command(credential_public_synonym_group)
dbtools_runtime_root_group.add_command(database_tools_database_api_gateway_config_global_group)
dbtools_runtime_root_group.add_command(work_request_log_entry_group)
dbtools_runtime_root_group.add_command(work_request_group)
dbtools_runtime_root_group.add_command(database_tools_database_api_gateway_config_pool_api_spec_group)
dbtools_runtime_root_group.add_command(database_tools_database_api_gateway_config_group)
dbtools_runtime_root_group.add_command(user_credential_group)
dbtools_runtime_root_group.add_command(credential_group)
dbtools_runtime_root_group.add_command(credential_public_synonym_collection_group)
dbtools_runtime_root_group.add_command(user_credential_collection_group)
dbtools_runtime_root_group.add_command(database_tools_identity_group)
dbtools_runtime_root_group.add_command(work_request_error_group)
dbtools_runtime_root_group.add_command(database_tools_database_api_gateway_config_advanced_property_summary_group)
dbtools_runtime_root_group.add_command(database_tools_connection_group)
dbtools_runtime_root_group.add_command(database_tools_database_api_gateway_config_pool_group)


@work_request_group.command(name=cli_util.override('dbtools_runtime.cancel_work_request.command_name', 'cancel'), help=u"""Attempts to cancel the specified work request. \n[Command Reference](cancelWorkRequest)""")
@cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.confirm_delete_option
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
def cancel_work_request(ctx, from_json, work_request_id, if_match):

    if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
        raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.cancel_work_request(
        work_request_id=work_request_id,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.create_credential.command_name', 'create-credential'), help=u"""Creates a credential for the user specified by the key. \n[Command Reference](createCredential)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["BASIC"]), help=u"""The type of credential.""")
@cli_util.option('--credential-key', required=True, help=u"""The credential_name to be created""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'Credential'})
@cli_util.wrap_exceptions
def create_credential(ctx, from_json, connection_id, type, credential_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type
    _details['key'] = credential_key

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_credential(
        database_tools_connection_id=connection_id,
        create_credential_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.create_credential_create_credential_basic_details.command_name', 'create-credential-create-credential-basic-details'), help=u"""Creates a credential for the user specified by the key. \n[Command Reference](createCredential)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The credential_name to be created""")
@cli_util.option('--user-name', required=True, help=u"""The username for the new credential.""")
@cli_util.option('--password', required=True, help=u"""The password for the new credential.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'Credential'})
@cli_util.wrap_exceptions
def create_credential_create_credential_basic_details(ctx, from_json, connection_id, credential_key, user_name, password, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['key'] = credential_key
    _details['userName'] = user_name
    _details['password'] = password

    _details['type'] = 'BASIC'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_credential(
        database_tools_connection_id=connection_id,
        create_credential_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_execute_grantee_group.command(name=cli_util.override('dbtools_runtime.create_credential_execute_grantee.command_name', 'create'), help=u"""Grants the EXECUTE privilege on the credential to the user specified by the key. \n[Command Reference](createCredentialExecuteGrantee)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--execute-grantee-key', required=True, help=u"""The name of the user to grant the EXECUTE privilege on the credential.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'CredentialExecuteGrantee'})
@cli_util.wrap_exceptions
def create_credential_execute_grantee(ctx, from_json, connection_id, credential_key, execute_grantee_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['key'] = execute_grantee_key

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_credential_execute_grantee(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        create_credential_execute_grantee_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_public_synonym_group.command(name=cli_util.override('dbtools_runtime.create_credential_public_synonym.command_name', 'create'), help=u"""Creates a public synonym for the given credentials \n[Command Reference](createCredentialPublicSynonym)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--public-synonym-key', required=True, help=u"""The name of the public synonym for the credential""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'CredentialPublicSynonym'})
@cli_util.wrap_exceptions
def create_credential_public_synonym(ctx, from_json, connection_id, credential_key, public_synonym_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['key'] = public_synonym_key

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_credential_public_synonym(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        create_credential_public_synonym_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_group.command(name=cli_util.override('dbtools_runtime.create_database_tools_database_api_gateway_config_pool.command_name', 'create'), help=u"""Create a Database Tools database API gateway config pool resource \n[Command Reference](createDatabaseToolsDatabaseApiGatewayConfigPool)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DEFAULT"]), help=u"""The type of the Database Tools database API gateway config pool sub resource.""")
@cli_util.option('--display-name', required=True, help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--pool-route-value', required=True, help=u"""The pool route value provided in requests to target this pool.""")
@cli_util.option('--database-tools-connection-id', required=True, help=u"""The [OCID] of the related Database Tools connection. Specifies the OCI database tools connection ocid to build the connection pool from.""")
@cli_util.option('--max-pool-size', type=click.INT, help=u"""Specifies the maximum number of database connections allowed for the pool.""")
@cli_util.option('--min-pool-size', type=click.INT, help=u"""Specifies the minimum number of database connections allowed for the pool.""")
@cli_util.option('--initial-pool-size', type=click.INT, help=u"""Specifies the initial size for the number of database connections that will be created for the pool.""")
@cli_util.option('--jwt-profile-jwk-url', help=u"""Specifies the URL of the JSON Web Key (JWK) that is used to verify the signature of the JWT token.""")
@cli_util.option('--jwt-profile-issuer', help=u"""Specifies the issuer of the JWT token. This value is used to validate the iss claim in the JWT token.""")
@cli_util.option('--jwt-profile-audience', help=u"""Specifies the expected audience for the JWT token. This value is used to validate the aud claim in the JWT token.""")
@cli_util.option('--jwt-profile-role-claim-name', help=u"""Specifies the JSON pointer to the claim in the JWT token that contains the roles of the users.""")
@cli_util.option('--database-actions-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies to enable the Database Actions feature.""")
@cli_util.option('--rest-enabled-sql-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies whether the REST-Enabled SQL service is active.""")
@cli_util.option('--advanced-properties', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Advanced pool properties.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@json_skeleton_utils.get_cli_json_input_option({'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPool'})
@cli_util.wrap_exceptions
def create_database_tools_database_api_gateway_config_pool(ctx, from_json, database_api_gateway_config_id, type, display_name, pool_route_value, database_tools_connection_id, max_pool_size, min_pool_size, initial_pool_size, jwt_profile_jwk_url, jwt_profile_issuer, jwt_profile_audience, jwt_profile_role_claim_name, database_actions_status, rest_enabled_sql_status, advanced_properties):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    kwargs = {}
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type
    _details['displayName'] = display_name
    _details['poolRouteValue'] = pool_route_value
    _details['databaseToolsConnectionId'] = database_tools_connection_id

    if max_pool_size is not None:
        _details['maxPoolSize'] = max_pool_size

    if min_pool_size is not None:
        _details['minPoolSize'] = min_pool_size

    if initial_pool_size is not None:
        _details['initialPoolSize'] = initial_pool_size

    if jwt_profile_jwk_url is not None:
        _details['jwtProfileJwkUrl'] = jwt_profile_jwk_url

    if jwt_profile_issuer is not None:
        _details['jwtProfileIssuer'] = jwt_profile_issuer

    if jwt_profile_audience is not None:
        _details['jwtProfileAudience'] = jwt_profile_audience

    if jwt_profile_role_claim_name is not None:
        _details['jwtProfileRoleClaimName'] = jwt_profile_role_claim_name

    if database_actions_status is not None:
        _details['databaseActionsStatus'] = database_actions_status

    if rest_enabled_sql_status is not None:
        _details['restEnabledSqlStatus'] = rest_enabled_sql_status

    if advanced_properties is not None:
        _details['advancedProperties'] = cli_util.parse_json_parameter("advanced_properties", advanced_properties)

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_database_tools_database_api_gateway_config_pool(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        create_database_tools_database_api_gateway_config_pool_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_group.command(name=cli_util.override('dbtools_runtime.create_database_tools_database_api_gateway_config_pool_create_database_tools_database_api_gateway_config_pool_default_details.command_name', 'create-database-tools-database-api-gateway-config-pool-create-database-tools-database-api-gateway-config-pool-default-details'), help=u"""Create a Database Tools database API gateway config pool resource \n[Command Reference](createDatabaseToolsDatabaseApiGatewayConfigPool)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--display-name', required=True, help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--pool-route-value', required=True, help=u"""The pool route value provided in requests to target this pool.""")
@cli_util.option('--database-tools-connection-id', required=True, help=u"""The [OCID] of the related Database Tools connection. Specifies the OCI database tools connection ocid to build the connection pool from.""")
@cli_util.option('--max-pool-size', type=click.INT, help=u"""Specifies the maximum number of database connections allowed for the pool.""")
@cli_util.option('--min-pool-size', type=click.INT, help=u"""Specifies the minimum number of database connections allowed for the pool.""")
@cli_util.option('--initial-pool-size', type=click.INT, help=u"""Specifies the initial size for the number of database connections that will be created for the pool.""")
@cli_util.option('--jwt-profile-jwk-url', help=u"""Specifies the URL of the JSON Web Key (JWK) that is used to verify the signature of the JWT token.""")
@cli_util.option('--jwt-profile-issuer', help=u"""Specifies the issuer of the JWT token. This value is used to validate the iss claim in the JWT token.""")
@cli_util.option('--jwt-profile-audience', help=u"""Specifies the expected audience for the JWT token. This value is used to validate the aud claim in the JWT token.""")
@cli_util.option('--jwt-profile-role-claim-name', help=u"""Specifies the JSON pointer to the claim in the JWT token that contains the roles of the users.""")
@cli_util.option('--database-actions-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies to enable the Database Actions feature.""")
@cli_util.option('--rest-enabled-sql-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies whether the REST-Enabled SQL service is active.""")
@cli_util.option('--advanced-properties', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Advanced pool properties.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@json_skeleton_utils.get_cli_json_input_option({'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPool'})
@cli_util.wrap_exceptions
def create_database_tools_database_api_gateway_config_pool_create_database_tools_database_api_gateway_config_pool_default_details(ctx, from_json, database_api_gateway_config_id, display_name, pool_route_value, database_tools_connection_id, max_pool_size, min_pool_size, initial_pool_size, jwt_profile_jwk_url, jwt_profile_issuer, jwt_profile_audience, jwt_profile_role_claim_name, database_actions_status, rest_enabled_sql_status, advanced_properties):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    kwargs = {}
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['displayName'] = display_name
    _details['poolRouteValue'] = pool_route_value
    _details['databaseToolsConnectionId'] = database_tools_connection_id

    if max_pool_size is not None:
        _details['maxPoolSize'] = max_pool_size

    if min_pool_size is not None:
        _details['minPoolSize'] = min_pool_size

    if initial_pool_size is not None:
        _details['initialPoolSize'] = initial_pool_size

    if jwt_profile_jwk_url is not None:
        _details['jwtProfileJwkUrl'] = jwt_profile_jwk_url

    if jwt_profile_issuer is not None:
        _details['jwtProfileIssuer'] = jwt_profile_issuer

    if jwt_profile_audience is not None:
        _details['jwtProfileAudience'] = jwt_profile_audience

    if jwt_profile_role_claim_name is not None:
        _details['jwtProfileRoleClaimName'] = jwt_profile_role_claim_name

    if database_actions_status is not None:
        _details['databaseActionsStatus'] = database_actions_status

    if rest_enabled_sql_status is not None:
        _details['restEnabledSqlStatus'] = rest_enabled_sql_status

    if advanced_properties is not None:
        _details['advancedProperties'] = cli_util.parse_json_parameter("advanced_properties", advanced_properties)

    _details['type'] = 'DEFAULT'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_database_tools_database_api_gateway_config_pool(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        create_database_tools_database_api_gateway_config_pool_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_api_spec_group.command(name=cli_util.override('dbtools_runtime.create_database_tools_database_api_gateway_config_pool_api_spec.command_name', 'create'), help=u"""Create a Database Tools database API gateway config API spec resource \n[Command Reference](createDatabaseToolsDatabaseApiGatewayConfigPoolApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DEFAULT"]), help=u"""The type of the Database Tools database API gateway config API spec sub resource.""")
@cli_util.option('--display-name', required=True, help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--content', required=True, help=u"""The content of a string-escaped Open API spec in JSON format.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolApiSpec'})
@cli_util.wrap_exceptions
def create_database_tools_database_api_gateway_config_pool_api_spec(ctx, from_json, database_api_gateway_config_id, pool_key, type, display_name, content):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    kwargs = {}
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type
    _details['displayName'] = display_name
    _details['content'] = content

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_database_tools_database_api_gateway_config_pool_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        create_database_tools_database_api_gateway_config_pool_api_spec_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_api_spec_group.command(name=cli_util.override('dbtools_runtime.create_database_tools_database_api_gateway_config_pool_api_spec_create_database_tools_database_api_gateway_config_pool_api_spec_default_details.command_name', 'create-database-tools-database-api-gateway-config-pool-api-spec-create-database-tools-database-api-gateway-config-pool-api-spec-default-details'), help=u"""Create a Database Tools database API gateway config API spec resource \n[Command Reference](createDatabaseToolsDatabaseApiGatewayConfigPoolApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--display-name', required=True, help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--content', required=True, help=u"""The content of a string-escaped Open API spec in JSON format.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolApiSpec'})
@cli_util.wrap_exceptions
def create_database_tools_database_api_gateway_config_pool_api_spec_create_database_tools_database_api_gateway_config_pool_api_spec_default_details(ctx, from_json, database_api_gateway_config_id, pool_key, display_name, content):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    kwargs = {}
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['displayName'] = display_name
    _details['content'] = content

    _details['type'] = 'DEFAULT'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_database_tools_database_api_gateway_config_pool_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        create_database_tools_database_api_gateway_config_pool_api_spec_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_auto_api_spec_group.command(name=cli_util.override('dbtools_runtime.create_database_tools_database_api_gateway_config_pool_auto_api_spec.command_name', 'create'), help=u"""Create a Database Tools database API gateway config auto API spec resource \n[Command Reference](createDatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DEFAULT"]), help=u"""The type of the Database Tools database API gateway config auto API spec sub resource.""")
@cli_util.option('--display-name', required=True, help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--database-object-name', required=True, help=u"""The name of the database object.""")
@cli_util.option('--database-object-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FUNCTION", "MVIEW", "PACKAGE", "PROCEDURE", "TABLE", "VIEW", "DUALITYVIEW"]), help=u"""The type of the database object.""")
@cli_util.option('--description', help=u"""Description of the autoApiSpec.""")
@cli_util.option('--alias', help=u"""Used as the URI path element for this object. When not specified the objectName lowercase is the default value.""")
@cli_util.option('--operations', type=custom_types.CliCaseInsensitiveChoice(["READ", "WRITE"]), help=u"""The operations to limit access to this resource. If not specified then the default is [\"READ\",\"WRITE\"].""")
@cli_util.option('--security-schemes', type=custom_types.CliCaseInsensitiveChoice(["BASIC", "BEARER"]), help=u"""The security schemes that can access this resource. If not specified then the resource is public.""")
@cli_util.option('--scope', help=u"""The name of the database API gateway config privilege protecting the resource. Only valid for SCOPE JWT Profile pools and BEARER securitySchemes.""")
@cli_util.option('--roles', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The name of the database API gateway config roles protecting the resource. Only valid for RBAC JWT Profile pools and BEARER securitySchemes.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@json_skeleton_utils.get_cli_json_input_option({'roles': {'module': 'database_tools_runtime', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'roles': {'module': 'database_tools_runtime', 'class': 'list[string]'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec'})
@cli_util.wrap_exceptions
def create_database_tools_database_api_gateway_config_pool_auto_api_spec(ctx, from_json, database_api_gateway_config_id, pool_key, type, display_name, database_object_name, database_object_type, description, alias, operations, security_schemes, scope, roles):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    kwargs = {}
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type
    _details['displayName'] = display_name
    _details['databaseObjectName'] = database_object_name
    _details['databaseObjectType'] = database_object_type

    if description is not None:
        _details['description'] = description

    if alias is not None:
        _details['alias'] = alias

    if operations is not None:
        _details['operations'] = cli_util.parse_json_parameter("operations", operations)

    if security_schemes is not None:
        _details['securitySchemes'] = cli_util.parse_json_parameter("security_schemes", security_schemes)

    if scope is not None:
        _details['scope'] = scope

    if roles is not None:
        _details['roles'] = cli_util.parse_json_parameter("roles", roles)

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_database_tools_database_api_gateway_config_pool_auto_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        create_database_tools_database_api_gateway_config_pool_auto_api_spec_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_auto_api_spec_group.command(name=cli_util.override('dbtools_runtime.create_database_tools_database_api_gateway_config_pool_auto_api_spec_create_database_tools_database_api_gateway_config_pool_auto_api_spec_default_details.command_name', 'create-database-tools-database-api-gateway-config-pool-auto-api-spec-create-database-tools-database-api-gateway-config-pool-auto-api-spec-default-details'), help=u"""Create a Database Tools database API gateway config auto API spec resource \n[Command Reference](createDatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--display-name', required=True, help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--database-object-name', required=True, help=u"""The name of the database object.""")
@cli_util.option('--database-object-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FUNCTION", "MVIEW", "PACKAGE", "PROCEDURE", "TABLE", "VIEW", "DUALITYVIEW"]), help=u"""The type of the database object.""")
@cli_util.option('--description', help=u"""Description of the autoApiSpec.""")
@cli_util.option('--alias', help=u"""Used as the URI path element for this object. When not specified the objectName lowercase is the default value.""")
@cli_util.option('--operations', type=custom_types.CliCaseInsensitiveChoice(["READ", "WRITE"]), help=u"""The operations to limit access to this resource. If not specified then the default is [\"READ\",\"WRITE\"].""")
@cli_util.option('--security-schemes', type=custom_types.CliCaseInsensitiveChoice(["BASIC", "BEARER"]), help=u"""The security schemes that can access this resource. If not specified then the resource is public.""")
@cli_util.option('--scope', help=u"""The name of the database API gateway config privilege protecting the resource. Only valid for SCOPE JWT Profile pools and BEARER securitySchemes.""")
@cli_util.option('--roles', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The name of the database API gateway config roles protecting the resource. Only valid for RBAC JWT Profile pools and BEARER securitySchemes.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@json_skeleton_utils.get_cli_json_input_option({'roles': {'module': 'database_tools_runtime', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'roles': {'module': 'database_tools_runtime', 'class': 'list[string]'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec'})
@cli_util.wrap_exceptions
def create_database_tools_database_api_gateway_config_pool_auto_api_spec_create_database_tools_database_api_gateway_config_pool_auto_api_spec_default_details(ctx, from_json, database_api_gateway_config_id, pool_key, display_name, database_object_name, database_object_type, description, alias, operations, security_schemes, scope, roles):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    kwargs = {}
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['displayName'] = display_name
    _details['databaseObjectName'] = database_object_name
    _details['databaseObjectType'] = database_object_type

    if description is not None:
        _details['description'] = description

    if alias is not None:
        _details['alias'] = alias

    if operations is not None:
        _details['operations'] = cli_util.parse_json_parameter("operations", operations)

    if security_schemes is not None:
        _details['securitySchemes'] = cli_util.parse_json_parameter("security_schemes", security_schemes)

    if scope is not None:
        _details['scope'] = scope

    if roles is not None:
        _details['roles'] = cli_util.parse_json_parameter("roles", roles)

    _details['type'] = 'DEFAULT'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.create_database_tools_database_api_gateway_config_pool_auto_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        create_database_tools_database_api_gateway_config_pool_auto_api_spec_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_group.command(name=cli_util.override('dbtools_runtime.delete_credential.command_name', 'delete'), help=u"""Delete credential \n[Command Reference](deleteCredential)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.confirm_delete_option
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
def delete_credential(ctx, from_json, connection_id, credential_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.delete_credential(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_execute_grantee_group.command(name=cli_util.override('dbtools_runtime.delete_credential_execute_grantee.command_name', 'delete'), help=u"""Delete execute grantee \n[Command Reference](deleteCredentialExecuteGrantee)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--execute-grantee-key', required=True, help=u"""The name of the user granted the EXECUTE privilege on the credential.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.confirm_delete_option
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
def delete_credential_execute_grantee(ctx, from_json, connection_id, credential_key, execute_grantee_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    if isinstance(execute_grantee_key, six.string_types) and len(execute_grantee_key.strip()) == 0:
        raise click.UsageError('Parameter --execute-grantee-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.delete_credential_execute_grantee(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        execute_grantee_key=execute_grantee_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_public_synonym_group.command(name=cli_util.override('dbtools_runtime.delete_credential_public_synonym.command_name', 'delete'), help=u"""Deletes the public synonym \n[Command Reference](deleteCredentialPublicSynonym)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--public-synonym-key', required=True, help=u"""The name of the public synonym for the credential""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.confirm_delete_option
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
def delete_credential_public_synonym(ctx, from_json, connection_id, credential_key, public_synonym_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    if isinstance(public_synonym_key, six.string_types) and len(public_synonym_key.strip()) == 0:
        raise click.UsageError('Parameter --public-synonym-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.delete_credential_public_synonym(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        public_synonym_key=public_synonym_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_group.command(name=cli_util.override('dbtools_runtime.delete_database_tools_database_api_gateway_config_pool.command_name', 'delete-database-tools-database-api-gateway-config-pool'), help=u"""Deletes the specified Database Tools database API gateway config pool resource. \n[Command Reference](deleteDatabaseToolsDatabaseApiGatewayConfigPool)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.confirm_delete_option
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
def delete_database_tools_database_api_gateway_config_pool(ctx, from_json, database_api_gateway_config_id, pool_key, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.delete_database_tools_database_api_gateway_config_pool(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_group.command(name=cli_util.override('dbtools_runtime.delete_database_tools_database_api_gateway_config_pool_api_spec.command_name', 'delete-database-tools-database-api-gateway-config-pool-api-spec'), help=u"""Deletes the specified Database Tools database API gateway config API spec resource. \n[Command Reference](deleteDatabaseToolsDatabaseApiGatewayConfigPoolApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--api-spec-key', required=True, help=u"""The key of the API spec config.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.confirm_delete_option
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
def delete_database_tools_database_api_gateway_config_pool_api_spec(ctx, from_json, database_api_gateway_config_id, pool_key, api_spec_key, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    if isinstance(api_spec_key, six.string_types) and len(api_spec_key.strip()) == 0:
        raise click.UsageError('Parameter --api-spec-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.delete_database_tools_database_api_gateway_config_pool_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        api_spec_key=api_spec_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_group.command(name=cli_util.override('dbtools_runtime.delete_database_tools_database_api_gateway_config_pool_auto_api_spec.command_name', 'delete-database-tools-database-api-gateway-config-pool-auto-api-spec'), help=u"""Deletes the specified Database Tools database API gateway config auto API spec resource. \n[Command Reference](deleteDatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--auto-api-spec-key', required=True, help=u"""The key of the auto API spec config.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.confirm_delete_option
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
def delete_database_tools_database_api_gateway_config_pool_auto_api_spec(ctx, from_json, database_api_gateway_config_id, pool_key, auto_api_spec_key, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    if isinstance(auto_api_spec_key, six.string_types) and len(auto_api_spec_key.strip()) == 0:
        raise click.UsageError('Parameter --auto-api-spec-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.delete_database_tools_database_api_gateway_config_pool_auto_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        auto_api_spec_key=auto_api_spec_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.execute_sql_database_tools_connection.command_name', 'execute-sql'), help=u"""Execute statements on a database tools connection. \n[Command Reference](executeSqlDatabaseToolsConnection)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["SYNCHRONOUS", "ASYNCHRONOUS"]), help=u"""The request execution type.""")
@cli_util.option('--output-parameterconflict', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "WAITING"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state WAITING would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
@json_skeleton_utils.get_cli_json_input_option({'output-parameterconflict': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlOutputDetails'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'output-parameterconflict': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlOutputDetails'}}, output_type={'module': 'database_tools_runtime', 'class': 'ExecuteSqlResponse'})
@cli_util.wrap_exceptions
def execute_sql_database_tools_connection(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, connection_id, type, output_parameterconflict, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type

    if output_parameterconflict is not None:
        _details['output'] = cli_util.parse_json_parameter("output_parameterconflict", output_parameterconflict)

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.execute_sql_database_tools_connection(
        database_tools_connection_id=connection_id,
        execute_sql_database_tools_connection_details=_details,
        **kwargs
    )
    if wait_for_state:

        if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
            try:
                wait_period_kwargs = {}
                if max_wait_seconds is not None:
                    wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
                if wait_interval_seconds is not None:
                    wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
                if 'opc-work-request-id' not in result.headers:
                    click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
                    cli_util.render_response(result, ctx)
                    return

                click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
                result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
            except oci.exceptions.MaximumWaitTimeExceeded as e:
                # If we fail, we should show an error, but we should still provide the information to the customer
                click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
                cli_util.render_response(result, ctx)
                sys.exit(2)
            except Exception:
                click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
                cli_util.render_response(result, ctx)
                raise
        else:
            click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.execute_sql_database_tools_connection_execute_sql_database_tools_connection_asynchronous_details.command_name', 'execute-sql-database-tools-connection-execute-sql-database-tools-connection-asynchronous-details'), help=u"""Execute statements on a database tools connection. \n[Command Reference](executeSqlDatabaseToolsConnection)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--input', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--output-parameterconflict', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--timeout-in-seconds', type=click.INT, help=u"""Maximum time in seconds allowed for the request to complete, measured from submission.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "WAITING"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state WAITING would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
@json_skeleton_utils.get_cli_json_input_option({'output-parameterconflict': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlOutputDetails'}, 'input': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlAsynchronousInputDetails'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'output-parameterconflict': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlOutputDetails'}, 'input': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlAsynchronousInputDetails'}}, output_type={'module': 'database_tools_runtime', 'class': 'ExecuteSqlResponse'})
@cli_util.wrap_exceptions
def execute_sql_database_tools_connection_execute_sql_database_tools_connection_asynchronous_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, connection_id, input, output_parameterconflict, timeout_in_seconds, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['input'] = cli_util.parse_json_parameter("input", input)

    if output_parameterconflict is not None:
        _details['output'] = cli_util.parse_json_parameter("output_parameterconflict", output_parameterconflict)

    if timeout_in_seconds is not None:
        _details['timeoutInSeconds'] = timeout_in_seconds

    _details['type'] = 'ASYNCHRONOUS'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.execute_sql_database_tools_connection(
        database_tools_connection_id=connection_id,
        execute_sql_database_tools_connection_details=_details,
        **kwargs
    )
    if wait_for_state:

        if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
            try:
                wait_period_kwargs = {}
                if max_wait_seconds is not None:
                    wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
                if wait_interval_seconds is not None:
                    wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
                if 'opc-work-request-id' not in result.headers:
                    click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
                    cli_util.render_response(result, ctx)
                    return

                click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
                result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
            except oci.exceptions.MaximumWaitTimeExceeded as e:
                # If we fail, we should show an error, but we should still provide the information to the customer
                click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
                cli_util.render_response(result, ctx)
                sys.exit(2)
            except Exception:
                click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
                cli_util.render_response(result, ctx)
                raise
        else:
            click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.execute_sql_database_tools_connection_execute_sql_database_tools_connection_synchronous_details.command_name', 'execute-sql-database-tools-connection-execute-sql-database-tools-connection-synchronous-details'), help=u"""Execute statements on a database tools connection. \n[Command Reference](executeSqlDatabaseToolsConnection)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--input', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--output-parameterconflict', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "WAITING"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state WAITING would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
@json_skeleton_utils.get_cli_json_input_option({'output-parameterconflict': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlOutputDetails'}, 'input': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlInputDetails'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'output-parameterconflict': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlOutputDetails'}, 'input': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlInputDetails'}}, output_type={'module': 'database_tools_runtime', 'class': 'ExecuteSqlResponse'})
@cli_util.wrap_exceptions
def execute_sql_database_tools_connection_execute_sql_database_tools_connection_synchronous_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, connection_id, input, output_parameterconflict, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['input'] = cli_util.parse_json_parameter("input", input)

    if output_parameterconflict is not None:
        _details['output'] = cli_util.parse_json_parameter("output_parameterconflict", output_parameterconflict)

    _details['type'] = 'SYNCHRONOUS'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.execute_sql_database_tools_connection(
        database_tools_connection_id=connection_id,
        execute_sql_database_tools_connection_details=_details,
        **kwargs
    )
    if wait_for_state:

        if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
            try:
                wait_period_kwargs = {}
                if max_wait_seconds is not None:
                    wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
                if wait_interval_seconds is not None:
                    wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
                if 'opc-work-request-id' not in result.headers:
                    click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
                    cli_util.render_response(result, ctx)
                    return

                click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
                result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
            except oci.exceptions.MaximumWaitTimeExceeded as e:
                # If we fail, we should show an error, but we should still provide the information to the customer
                click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
                cli_util.render_response(result, ctx)
                sys.exit(2)
            except Exception:
                click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
                cli_util.render_response(result, ctx)
                raise
        else:
            click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.execute_sql_database_tools_connection_execute_sql_output_object_storage_details.command_name', 'execute-sql-database-tools-connection-execute-sql-output-object-storage-details'), help=u"""Execute statements on a database tools connection. \n[Command Reference](executeSqlDatabaseToolsConnection)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--output-object', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--output-result-disposition-templates', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defines how the result of commands in a script should be stored. If the command does not match any template filter, the result will be inline.

This option is a JSON list with items of type ExecuteSqlOutputResultDispositionTemplate.  For documentation on ExecuteSqlOutputResultDispositionTemplate please see our API reference: https://docs.oracle.com/en-us/iaas/api/#/en/databasetoolsruntime/20230222/datatypes/ExecuteSqlOutputResultDispositionTemplate.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--output-time-of-deletion', type=custom_types.CLI_DATETIME, help=u"""The time when the object becomes eligible for deletion, expressed as an RFC 3339 date-time string.""" + custom_types.CLI_DATETIME.VALID_DATETIME_CLI_HELP_MESSAGE)
@cli_util.option('--wait-for-state', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "WAITING"]), multiple=True, help="""This operation asynchronously creates, modifies or deletes a resource and uses a work request to track the progress of the operation. Specify this option to perform the action and then wait until the work request reaches a certain state. Multiple states can be specified, returning on the first state. For example, --wait-for-state ACCEPTED --wait-for-state WAITING would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.""")
@cli_util.option('--max-wait-seconds', type=click.INT, help="""The maximum time to wait for the work request to reach the state defined by --wait-for-state. Defaults to 1200 seconds.""")
@cli_util.option('--wait-interval-seconds', type=click.INT, help="""Check every --wait-interval-seconds to see whether the work request has reached the state defined by --wait-for-state. Defaults to 30 seconds.""")
@json_skeleton_utils.get_cli_json_input_option({'output-parameterconflict-result-disposition-templates': {'module': 'database_tools_runtime', 'class': 'list[ExecuteSqlOutputResultDispositionTemplate]'}, 'output-parameterconflict-object': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlObjectStorageLocation'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'output-parameterconflict-result-disposition-templates': {'module': 'database_tools_runtime', 'class': 'list[ExecuteSqlOutputResultDispositionTemplate]'}, 'output-parameterconflict-object': {'module': 'database_tools_runtime', 'class': 'ExecuteSqlObjectStorageLocation'}}, output_type={'module': 'database_tools_runtime', 'class': 'ExecuteSqlResponse'})
@cli_util.wrap_exceptions
def execute_sql_database_tools_connection_execute_sql_output_object_storage_details(ctx, from_json, wait_for_state, max_wait_seconds, wait_interval_seconds, connection_id, output_object, if_match, output_result_disposition_templates, output_time_of_deletion):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['output'] = {}
    _details['output']['object'] = cli_util.parse_json_parameter("output_object", output_object)

    if output_result_disposition_templates is not None:
        _details['output']['resultDispositionTemplates'] = cli_util.parse_json_parameter("output_result_disposition_templates", output_result_disposition_templates)

    if output_time_of_deletion is not None:
        _details['output']['timeOfDeletion'] = output_time_of_deletion

    _details['output']['type'] = 'OBJECT_STORAGE'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.execute_sql_database_tools_connection(
        database_tools_connection_id=connection_id,
        execute_sql_database_tools_connection_details=_details,
        **kwargs
    )
    if wait_for_state:

        if hasattr(client, 'get_work_request') and callable(getattr(client, 'get_work_request')):
            try:
                wait_period_kwargs = {}
                if max_wait_seconds is not None:
                    wait_period_kwargs['max_wait_seconds'] = max_wait_seconds
                if wait_interval_seconds is not None:
                    wait_period_kwargs['max_interval_seconds'] = wait_interval_seconds
                if 'opc-work-request-id' not in result.headers:
                    click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state')
                    cli_util.render_response(result, ctx)
                    return

                click.echo('Action completed. Waiting until the work request has entered state: {}'.format(wait_for_state), file=sys.stderr)
                result = oci.wait_until(client, client.get_work_request(result.headers['opc-work-request-id']), 'status', wait_for_state, **wait_period_kwargs)
            except oci.exceptions.MaximumWaitTimeExceeded as e:
                # If we fail, we should show an error, but we should still provide the information to the customer
                click.echo('Failed to wait until the work request entered the specified state. Outputting last known resource state', file=sys.stderr)
                cli_util.render_response(result, ctx)
                sys.exit(2)
            except Exception:
                click.echo('Encountered error while waiting for work request to enter the specified state. Outputting last known resource state', file=sys.stderr)
                cli_util.render_response(result, ctx)
                raise
        else:
            click.echo('Unable to wait for the work request to enter the specified state', file=sys.stderr)
    cli_util.render_response(result, ctx)


@credential_group.command(name=cli_util.override('dbtools_runtime.get_credential.command_name', 'get'), help=u"""Get a credential \n[Command Reference](getCredential)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'Credential'})
@cli_util.wrap_exceptions
def get_credential(ctx, from_json, connection_id, credential_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_credential(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_execute_grantee_group.command(name=cli_util.override('dbtools_runtime.get_credential_execute_grantee.command_name', 'get'), help=u"""Get a credential execute grantee \n[Command Reference](getCredentialExecuteGrantee)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--execute-grantee-key', required=True, help=u"""The name of the user granted the EXECUTE privilege on the credential.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'CredentialExecuteGrantee'})
@cli_util.wrap_exceptions
def get_credential_execute_grantee(ctx, from_json, connection_id, credential_key, execute_grantee_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    if isinstance(execute_grantee_key, six.string_types) and len(execute_grantee_key.strip()) == 0:
        raise click.UsageError('Parameter --execute-grantee-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_credential_execute_grantee(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        execute_grantee_key=execute_grantee_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_public_synonym_group.command(name=cli_util.override('dbtools_runtime.get_credential_public_synonym.command_name', 'get'), help=u"""Get a public synonym \n[Command Reference](getCredentialPublicSynonym)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--public-synonym-key', required=True, help=u"""The name of the public synonym for the credential""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'CredentialPublicSynonym'})
@cli_util.wrap_exceptions
def get_credential_public_synonym(ctx, from_json, connection_id, credential_key, public_synonym_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    if isinstance(public_synonym_key, six.string_types) and len(public_synonym_key.strip()) == 0:
        raise click.UsageError('Parameter --public-synonym-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_credential_public_synonym(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        public_synonym_key=public_synonym_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_group.command(name=cli_util.override('dbtools_runtime.get_database_tools_database_api_gateway_config_content.command_name', 'get-database-tools-database-api-gateway-config-content'), help=u"""Get the content of a Database Tools database API gateway config \n[Command Reference](getDatabaseToolsDatabaseApiGatewayConfigContent)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--file', type=click.File(mode='wb'), required=True, help="The name of the file that will receive the response data, or '-' to write to STDOUT.")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--if-none-match', help=u"""For conditional requests. In the GET call for a resource, set the `If-None-Match` header to the value of the ETag from a previous GET (or POST or PUT) response for that resource. The server will return with either a 304 Not Modified response if the resource has not changed, or a 200 OK response with the updated representation.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={})
@cli_util.wrap_exceptions
def get_database_tools_database_api_gateway_config_content(ctx, from_json, file, database_api_gateway_config_id, if_match, if_none_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    if if_none_match is not None:
        kwargs['if_none_match'] = if_none_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_database_tools_database_api_gateway_config_content(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        **kwargs
    )

    # If outputting to stdout we don't want to print a progress bar because it will get mixed up with the output
    # Also we need a non-zero Content-Length in order to display a meaningful progress bar
    bar = None
    if hasattr(file, 'name') and file.name != '<stdout>' and 'Content-Length' in result.headers:
        content_length = int(result.headers['Content-Length'])
        if content_length > 0:
            bar = click.progressbar(length=content_length, label='Downloading file')

    try:
        if bar:
            bar.__enter__()

        # TODO: Make the download size a configurable option
        # use decode_content=True to automatically unzip service responses (this should be overridden for object storage)
        for chunk in result.data.raw.stream(cli_constants.MEBIBYTE, decode_content=True):
            if bar:
                bar.update(len(chunk))
            file.write(chunk)
    finally:
        if bar:
            bar.render_finish()
        file.close()


@database_tools_database_api_gateway_config_global_group.command(name=cli_util.override('dbtools_runtime.get_database_tools_database_api_gateway_config_global.command_name', 'get'), help=u"""Get a Database Tools database API gateway config global resource \n[Command Reference](getDatabaseToolsDatabaseApiGatewayConfigGlobal)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--global-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["SETTINGS"]), help=u"""The key of the global config.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigGlobal'})
@cli_util.wrap_exceptions
def get_database_tools_database_api_gateway_config_global(ctx, from_json, database_api_gateway_config_id, global_key, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(global_key, six.string_types) and len(global_key.strip()) == 0:
        raise click.UsageError('Parameter --global-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_database_tools_database_api_gateway_config_global(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        global_key=global_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_group.command(name=cli_util.override('dbtools_runtime.get_database_tools_database_api_gateway_config_pool.command_name', 'get'), help=u"""Get a Database Tools database API gateway config pool resource \n[Command Reference](getDatabaseToolsDatabaseApiGatewayConfigPool)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPool'})
@cli_util.wrap_exceptions
def get_database_tools_database_api_gateway_config_pool(ctx, from_json, database_api_gateway_config_id, pool_key, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_database_tools_database_api_gateway_config_pool(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_api_spec_group.command(name=cli_util.override('dbtools_runtime.get_database_tools_database_api_gateway_config_pool_api_spec.command_name', 'get'), help=u"""Get a Database Tools database API gateway config API spec resource \n[Command Reference](getDatabaseToolsDatabaseApiGatewayConfigPoolApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--api-spec-key', required=True, help=u"""The key of the API spec config.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolApiSpec'})
@cli_util.wrap_exceptions
def get_database_tools_database_api_gateway_config_pool_api_spec(ctx, from_json, database_api_gateway_config_id, pool_key, api_spec_key, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    if isinstance(api_spec_key, six.string_types) and len(api_spec_key.strip()) == 0:
        raise click.UsageError('Parameter --api-spec-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_database_tools_database_api_gateway_config_pool_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        api_spec_key=api_spec_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_auto_api_spec_group.command(name=cli_util.override('dbtools_runtime.get_database_tools_database_api_gateway_config_pool_auto_api_spec.command_name', 'get'), help=u"""Get a Database Tools database API gateway config auto API spec resource \n[Command Reference](getDatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--auto-api-spec-key', required=True, help=u"""The key of the auto API spec config.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec'})
@cli_util.wrap_exceptions
def get_database_tools_database_api_gateway_config_pool_auto_api_spec(ctx, from_json, database_api_gateway_config_id, pool_key, auto_api_spec_key, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    if isinstance(auto_api_spec_key, six.string_types) and len(auto_api_spec_key.strip()) == 0:
        raise click.UsageError('Parameter --auto-api-spec-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_database_tools_database_api_gateway_config_pool_auto_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        auto_api_spec_key=auto_api_spec_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@property_set_group.command(name=cli_util.override('dbtools_runtime.get_property_set.command_name', 'get'), help=u"""Get a property set \n[Command Reference](getPropertySet)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--property-set-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["APEX_DOCUMENT_GENERATOR", "APEX", "APEX_FA_INTEGRATION", "ORACLE_DATABASE_EXTERNAL_AUTHENTICATION"]), help=u"""The name of the property set""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'PropertySet'})
@cli_util.wrap_exceptions
def get_property_set(ctx, from_json, connection_id, property_set_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(property_set_key, six.string_types) and len(property_set_key.strip()) == 0:
        raise click.UsageError('Parameter --property-set-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_property_set(
        database_tools_connection_id=connection_id,
        property_set_key=property_set_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@user_credential_group.command(name=cli_util.override('dbtools_runtime.get_user_credential.command_name', 'get'), help=u"""Get a user credential \n[Command Reference](getUserCredential)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--user-key', required=True, help=u"""The name of the database user.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'UserCredential'})
@cli_util.wrap_exceptions
def get_user_credential(ctx, from_json, connection_id, user_key, credential_key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(user_key, six.string_types) and len(user_key.strip()) == 0:
        raise click.UsageError('Parameter --user-key cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_user_credential(
        database_tools_connection_id=connection_id,
        user_key=user_key,
        credential_key=credential_key,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@work_request_group.command(name=cli_util.override('dbtools_runtime.get_work_request.command_name', 'get'), help=u"""Gets the status of the specified work request. \n[Command Reference](getWorkRequest)""")
@cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'WorkRequest'})
@cli_util.wrap_exceptions
def get_work_request(ctx, from_json, work_request_id):

    if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
        raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')

    kwargs = {}
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.get_work_request(
        work_request_id=work_request_id,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_execute_grantee_collection_group.command(name=cli_util.override('dbtools_runtime.list_credential_execute_grantees.command_name', 'list-credential-execute-grantees'), help=u"""Get a list of all execute grantees \n[Command Reference](listCredentialExecuteGrantees)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'CredentialExecuteGranteeCollection'})
@cli_util.wrap_exceptions
def list_credential_execute_grantees(ctx, from_json, all_pages, page_size, connection_id, credential_key, if_match, limit, page, sort_order):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    if limit is not None:
        kwargs['limit'] = limit
    if page is not None:
        kwargs['page'] = page
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_credential_execute_grantees,
            database_tools_connection_id=connection_id,
            credential_key=credential_key,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_credential_execute_grantees,
            limit,
            page_size,
            database_tools_connection_id=connection_id,
            credential_key=credential_key,
            **kwargs
        )
    else:
        result = client.list_credential_execute_grantees(
            database_tools_connection_id=connection_id,
            credential_key=credential_key,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@credential_public_synonym_collection_group.command(name=cli_util.override('dbtools_runtime.list_credential_public_synonyms.command_name', 'list-credential-public-synonyms'), help=u"""Get a list of all public synonyms for the given credential \n[Command Reference](listCredentialPublicSynonyms)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'CredentialPublicSynonymCollection'})
@cli_util.wrap_exceptions
def list_credential_public_synonyms(ctx, from_json, all_pages, page_size, connection_id, credential_key, if_match, limit, page, sort_order):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    if limit is not None:
        kwargs['limit'] = limit
    if page is not None:
        kwargs['page'] = page
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_credential_public_synonyms,
            database_tools_connection_id=connection_id,
            credential_key=credential_key,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_credential_public_synonyms,
            limit,
            page_size,
            database_tools_connection_id=connection_id,
            credential_key=credential_key,
            **kwargs
        )
    else:
        result = client.list_credential_public_synonyms(
            database_tools_connection_id=connection_id,
            credential_key=credential_key,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@credential_collection_group.command(name=cli_util.override('dbtools_runtime.list_credentials.command_name', 'list-credentials'), help=u"""Returns a paginated list of `CredentialSummary` for the specified request. \n[Command Reference](listCredentials)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'CredentialCollection'})
@cli_util.wrap_exceptions
def list_credentials(ctx, from_json, all_pages, page_size, connection_id, if_match, limit, page, sort_order):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    if limit is not None:
        kwargs['limit'] = limit
    if page is not None:
        kwargs['page'] = page
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_credentials,
            database_tools_connection_id=connection_id,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_credentials,
            limit,
            page_size,
            database_tools_connection_id=connection_id,
            **kwargs
        )
    else:
        result = client.list_credentials(
            database_tools_connection_id=connection_id,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_advanced_property_summary_group.command(name=cli_util.override('dbtools_runtime.list_database_tools_database_api_gateway_config_advanced_properties.command_name', 'list-database-tools-database-api-gateway-config-advanced-properties'), help=u"""Returns list of database API gateway config setting descriptions to be provided as advanced properties. \n[Command Reference](listDatabaseToolsDatabaseApiGatewayConfigAdvancedProperties)""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigAdvancedPropertySummaryCollection'})
@cli_util.wrap_exceptions
def list_database_tools_database_api_gateway_config_advanced_properties(ctx, from_json, all_pages, ):

    kwargs = {}
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.list_database_tools_database_api_gateway_config_advanced_properties(
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_group.command(name=cli_util.override('dbtools_runtime.list_database_tools_database_api_gateway_config_pool_api_specs.command_name', 'list-database-tools-database-api-gateway-config-pool-api-specs'), help=u"""Returns a list of Database Tools database API gateway config API spec resources \n[Command Reference](listDatabaseToolsDatabaseApiGatewayConfigPoolApiSpecs)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolApiSpecCollection'})
@cli_util.wrap_exceptions
def list_database_tools_database_api_gateway_config_pool_api_specs(ctx, from_json, all_pages, page_size, database_api_gateway_config_id, pool_key, display_name, limit, page, sort_order, sort_by):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    kwargs = {}
    if display_name is not None:
        kwargs['display_name'] = display_name
    if limit is not None:
        kwargs['limit'] = limit
    if page is not None:
        kwargs['page'] = page
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    if sort_by is not None:
        kwargs['sort_by'] = sort_by
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_database_tools_database_api_gateway_config_pool_api_specs,
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            pool_key=pool_key,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_database_tools_database_api_gateway_config_pool_api_specs,
            limit,
            page_size,
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            pool_key=pool_key,
            **kwargs
        )
    else:
        result = client.list_database_tools_database_api_gateway_config_pool_api_specs(
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            pool_key=pool_key,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_group.command(name=cli_util.override('dbtools_runtime.list_database_tools_database_api_gateway_config_pool_auto_api_specs.command_name', 'list-database-tools-database-api-gateway-config-pool-auto-api-specs'), help=u"""Returns a list of Database Tools database API gateway config auto API spec resources \n[Command Reference](listDatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpecs)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpecCollection'})
@cli_util.wrap_exceptions
def list_database_tools_database_api_gateway_config_pool_auto_api_specs(ctx, from_json, all_pages, page_size, database_api_gateway_config_id, pool_key, display_name, limit, page, sort_order, sort_by):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    kwargs = {}
    if display_name is not None:
        kwargs['display_name'] = display_name
    if limit is not None:
        kwargs['limit'] = limit
    if page is not None:
        kwargs['page'] = page
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    if sort_by is not None:
        kwargs['sort_by'] = sort_by
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_database_tools_database_api_gateway_config_pool_auto_api_specs,
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            pool_key=pool_key,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_database_tools_database_api_gateway_config_pool_auto_api_specs,
            limit,
            page_size,
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            pool_key=pool_key,
            **kwargs
        )
    else:
        result = client.list_database_tools_database_api_gateway_config_pool_auto_api_specs(
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            pool_key=pool_key,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_group.command(name=cli_util.override('dbtools_runtime.list_database_tools_database_api_gateway_config_pools.command_name', 'list-database-tools-database-api-gateway-config-pools'), help=u"""Returns a list of Database Tools database API gateway config pool resources \n[Command Reference](listDatabaseToolsDatabaseApiGatewayConfigPools)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--display-name', help=u"""A filter to return only resources that match the entire specified display name.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolCollection'})
@cli_util.wrap_exceptions
def list_database_tools_database_api_gateway_config_pools(ctx, from_json, all_pages, page_size, database_api_gateway_config_id, display_name, limit, page, sort_order, sort_by):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    kwargs = {}
    if display_name is not None:
        kwargs['display_name'] = display_name
    if limit is not None:
        kwargs['limit'] = limit
    if page is not None:
        kwargs['page'] = page
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    if sort_by is not None:
        kwargs['sort_by'] = sort_by
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_database_tools_database_api_gateway_config_pools,
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_database_tools_database_api_gateway_config_pools,
            limit,
            page_size,
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            **kwargs
        )
    else:
        result = client.list_database_tools_database_api_gateway_config_pools(
            database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@user_credential_collection_group.command(name=cli_util.override('dbtools_runtime.list_user_credentials.command_name', 'list-user-credentials'), help=u"""Returns a paginated list of user `UserCredentialSummary` for the specified request. \n[Command Reference](listUserCredentials)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--user-key', required=True, help=u"""The name of the database user.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'UserCredentialCollection'})
@cli_util.wrap_exceptions
def list_user_credentials(ctx, from_json, all_pages, page_size, connection_id, user_key, if_match, limit, page, sort_order):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(user_key, six.string_types) and len(user_key.strip()) == 0:
        raise click.UsageError('Parameter --user-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    if limit is not None:
        kwargs['limit'] = limit
    if page is not None:
        kwargs['page'] = page
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_user_credentials,
            database_tools_connection_id=connection_id,
            user_key=user_key,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_user_credentials,
            limit,
            page_size,
            database_tools_connection_id=connection_id,
            user_key=user_key,
            **kwargs
        )
    else:
        result = client.list_user_credentials(
            database_tools_connection_id=connection_id,
            user_key=user_key,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@work_request_error_group.command(name=cli_util.override('dbtools_runtime.list_work_request_errors.command_name', 'list'), help=u"""Returns a paginated list of errors for the specified work request. \n[Command Reference](listWorkRequestErrors)""")
@cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'WorkRequestErrorCollection'})
@cli_util.wrap_exceptions
def list_work_request_errors(ctx, from_json, all_pages, page_size, work_request_id, sort_order, sort_by, page, limit):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
        raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')

    kwargs = {}
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    if sort_by is not None:
        kwargs['sort_by'] = sort_by
    if page is not None:
        kwargs['page'] = page
    if limit is not None:
        kwargs['limit'] = limit
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_work_request_errors,
            work_request_id=work_request_id,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_work_request_errors,
            limit,
            page_size,
            work_request_id=work_request_id,
            **kwargs
        )
    else:
        result = client.list_work_request_errors(
            work_request_id=work_request_id,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@work_request_log_entry_group.command(name=cli_util.override('dbtools_runtime.list_work_request_logs.command_name', 'list-work-request-logs'), help=u"""Returns a paginated list of logs for the specified work request. \n[Command Reference](listWorkRequestLogs)""")
@cli_util.option('--work-request-id', required=True, help=u"""The ID of the asynchronous request.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeCreated", "displayName"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for displayName is ascending. If no value is specified timeCreated is default.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'WorkRequestLogEntryCollection'})
@cli_util.wrap_exceptions
def list_work_request_logs(ctx, from_json, all_pages, page_size, work_request_id, sort_order, sort_by, page, limit):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    if isinstance(work_request_id, six.string_types) and len(work_request_id.strip()) == 0:
        raise click.UsageError('Parameter --work-request-id cannot be whitespace or empty string')

    kwargs = {}
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    if sort_by is not None:
        kwargs['sort_by'] = sort_by
    if page is not None:
        kwargs['page'] = page
    if limit is not None:
        kwargs['limit'] = limit
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_work_request_logs,
            work_request_id=work_request_id,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_work_request_logs,
            limit,
            page_size,
            work_request_id=work_request_id,
            **kwargs
        )
    else:
        result = client.list_work_request_logs(
            work_request_id=work_request_id,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@work_request_group.command(name=cli_util.override('dbtools_runtime.list_work_requests.command_name', 'list'), help=u"""Lists the work requests in a compartment. \n[Command Reference](listWorkRequests)""")
@cli_util.option('--compartment-id', required=True, help=u"""The ID of the compartment in which to list resources.""")
@cli_util.option('--resource-identifier', help=u"""The [OCID] of the resource.""")
@cli_util.option('--sort-order', type=custom_types.CliCaseInsensitiveChoice(["ASC", "DESC"]), help=u"""The sort order to use, either 'asc' or 'desc'.""")
@cli_util.option('--sort-by', type=custom_types.CliCaseInsensitiveChoice(["timeAccepted", "timeUpdated", "timeFinished"]), help=u"""The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. If no value is specified timeAccepted is default.""")
@cli_util.option('--page', help=u"""The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.""")
@cli_util.option('--limit', type=click.INT, help=u"""The maximum number of items to return.""")
@cli_util.option('--operation-type', type=custom_types.CliCaseInsensitiveChoice(["EXECUTE_SQL", "EXECUTE_SQL_SCHEDULED_DELETION"]), multiple=True, help=u"""The work request operation type.""")
@cli_util.option('--created-by-principal-id', help=u"""A filter to return only work requests initiated by the specified principal OCID.""")
@cli_util.option('--status', type=custom_types.CliCaseInsensitiveChoice(["ACCEPTED", "IN_PROGRESS", "FAILED", "SUCCEEDED", "CANCELING", "CANCELED", "WAITING"]), multiple=True, help=u"""A filter to return only work requests with one of the specified status values.""")
@cli_util.option('--all', 'all_pages', is_flag=True, help="""Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.""")
@cli_util.option('--page-size', type=click.INT, help="""When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'WorkRequestCollection'})
@cli_util.wrap_exceptions
def list_work_requests(ctx, from_json, all_pages, page_size, compartment_id, resource_identifier, sort_order, sort_by, page, limit, operation_type, created_by_principal_id, status):

    if all_pages and limit:
        raise click.UsageError('If you provide the --all option you cannot provide the --limit option')

    kwargs = {}
    if resource_identifier is not None:
        kwargs['resource_identifier'] = resource_identifier
    if sort_order is not None:
        kwargs['sort_order'] = sort_order
    if sort_by is not None:
        kwargs['sort_by'] = sort_by
    if page is not None:
        kwargs['page'] = page
    if limit is not None:
        kwargs['limit'] = limit
    if operation_type is not None and len(operation_type) > 0:
        kwargs['operation_type'] = operation_type
    if created_by_principal_id is not None:
        kwargs['created_by_principal_id'] = created_by_principal_id
    if status is not None and len(status) > 0:
        kwargs['status'] = status
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])
    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    if all_pages:
        if page_size:
            kwargs['limit'] = page_size

        result = cli_util.list_call_get_all_results(
            client.list_work_requests,
            compartment_id=compartment_id,
            **kwargs
        )
    elif limit is not None:
        result = cli_util.list_call_get_up_to_limit(
            client.list_work_requests,
            limit,
            page_size,
            compartment_id=compartment_id,
            **kwargs
        )
    else:
        result = client.list_work_requests(
            compartment_id=compartment_id,
            **kwargs
        )
    cli_util.render_response(result, ctx)


@credential_group.command(name=cli_util.override('dbtools_runtime.update_credential.command_name', 'update'), help=u"""Update a credential \n[Command Reference](updateCredential)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["BASIC"]), help=u"""The type of credential.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'Credential'})
@cli_util.wrap_exceptions
def update_credential(ctx, from_json, connection_id, credential_key, type, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_credential(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        update_credential_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@credential_group.command(name=cli_util.override('dbtools_runtime.update_credential_update_credential_basic_details.command_name', 'update-credential-update-credential-basic-details'), help=u"""Update a credential \n[Command Reference](updateCredential)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--credential-key', required=True, help=u"""The name of the credential""")
@cli_util.option('--user-name', help=u"""The username for the new credential.""")
@cli_util.option('--password', help=u"""The password for the new credential.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'Credential'})
@cli_util.wrap_exceptions
def update_credential_update_credential_basic_details(ctx, from_json, connection_id, credential_key, user_name, password, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(credential_key, six.string_types) and len(credential_key.strip()) == 0:
        raise click.UsageError('Parameter --credential-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    if user_name is not None:
        _details['userName'] = user_name

    if password is not None:
        _details['password'] = password

    _details['type'] = 'BASIC'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_credential(
        database_tools_connection_id=connection_id,
        credential_key=credential_key,
        update_credential_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_global_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_global.command_name', 'update'), help=u"""Update a Database Tools database API gateway config global resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigGlobal)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--global-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["SETTINGS"]), help=u"""The key of the global config.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DEFAULT"]), help=u"""The type of the Database Tools database API gateway config global settings resource.""")
@cli_util.option('--pool-route', type=custom_types.CliCaseInsensitiveChoice(["PATH", "HEADER"]), help=u"""How the target pool route value is determined for a HTTP request.""")
@cli_util.option('--pool-routing-header', help=u"""The request header name providing the pool route value.""")
@cli_util.option('--database-api-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""ORDS database API is a database management and monitoring REST API. Database Actions requires this feature.""")
@cli_util.option('--http-port', type=click.INT, help=u"""Specifies the HTTP listen port. 0 disables HTTP. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024\u201365535) is recommended.""")
@cli_util.option('--https-port', type=click.INT, help=u"""Specifies the HTTPS listen port. 0 disables HTTPS. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024\u201365535) is recommended. ORDS will use a self-signed certificate if a certificate bundle is not provided.""")
@cli_util.option('--certificate-bundle', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--document-root', help=u"""The location of the static resources to be served under the / root server path.""")
@cli_util.option('--advanced-properties', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Advanced global properties.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'certificate-bundle': {'module': 'database_tools_runtime', 'class': 'DatabaseApiGatewayConfigCertificateBundle'}, 'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'certificate-bundle': {'module': 'database_tools_runtime', 'class': 'DatabaseApiGatewayConfigCertificateBundle'}, 'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigGlobal'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_global(ctx, from_json, force, database_api_gateway_config_id, global_key, type, pool_route, pool_routing_header, database_api_status, http_port, https_port, certificate_bundle, document_root, advanced_properties, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(global_key, six.string_types) and len(global_key.strip()) == 0:
        raise click.UsageError('Parameter --global-key cannot be whitespace or empty string')
    if not force:
        if certificate_bundle or advanced_properties:
            if not click.confirm("WARNING: Updates to certificate-bundle and advanced-properties will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type

    if pool_route is not None:
        _details['poolRoute'] = pool_route

    if pool_routing_header is not None:
        _details['poolRoutingHeader'] = pool_routing_header

    if database_api_status is not None:
        _details['databaseApiStatus'] = database_api_status

    if http_port is not None:
        _details['httpPort'] = http_port

    if https_port is not None:
        _details['httpsPort'] = https_port

    if certificate_bundle is not None:
        _details['certificateBundle'] = cli_util.parse_json_parameter("certificate_bundle", certificate_bundle)

    if document_root is not None:
        _details['documentRoot'] = document_root

    if advanced_properties is not None:
        _details['advancedProperties'] = cli_util.parse_json_parameter("advanced_properties", advanced_properties)

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_global(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        global_key=global_key,
        update_database_tools_database_api_gateway_config_global_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_global_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_global_update_database_tools_database_api_gateway_config_global_default_details.command_name', 'update-database-tools-database-api-gateway-config-global-update-database-tools-database-api-gateway-config-global-default-details'), help=u"""Update a Database Tools database API gateway config global resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigGlobal)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--global-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["SETTINGS"]), help=u"""The key of the global config.""")
@cli_util.option('--pool-route', type=custom_types.CliCaseInsensitiveChoice(["PATH", "HEADER"]), help=u"""How the target pool route value is determined for a HTTP request.""")
@cli_util.option('--pool-routing-header', help=u"""The request header name providing the pool route value.""")
@cli_util.option('--database-api-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""ORDS database API is a database management and monitoring REST API. Database Actions requires this feature.""")
@cli_util.option('--http-port', type=click.INT, help=u"""Specifies the HTTP listen port. 0 disables HTTP. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024\u201365535) is recommended.""")
@cli_util.option('--https-port', type=click.INT, help=u"""Specifies the HTTPS listen port. 0 disables HTTPS. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024\u201365535) is recommended. ORDS will use a self-signed certificate if a certificate bundle is not provided.""")
@cli_util.option('--certificate-bundle', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--document-root', help=u"""The location of the static resources to be served under the / root server path.""")
@cli_util.option('--advanced-properties', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Advanced global properties.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'certificate-bundle': {'module': 'database_tools_runtime', 'class': 'DatabaseApiGatewayConfigCertificateBundle'}, 'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'certificate-bundle': {'module': 'database_tools_runtime', 'class': 'DatabaseApiGatewayConfigCertificateBundle'}, 'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigGlobal'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_global_update_database_tools_database_api_gateway_config_global_default_details(ctx, from_json, force, database_api_gateway_config_id, global_key, pool_route, pool_routing_header, database_api_status, http_port, https_port, certificate_bundle, document_root, advanced_properties, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(global_key, six.string_types) and len(global_key.strip()) == 0:
        raise click.UsageError('Parameter --global-key cannot be whitespace or empty string')
    if not force:
        if certificate_bundle or advanced_properties:
            if not click.confirm("WARNING: Updates to certificate-bundle and advanced-properties will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    if pool_route is not None:
        _details['poolRoute'] = pool_route

    if pool_routing_header is not None:
        _details['poolRoutingHeader'] = pool_routing_header

    if database_api_status is not None:
        _details['databaseApiStatus'] = database_api_status

    if http_port is not None:
        _details['httpPort'] = http_port

    if https_port is not None:
        _details['httpsPort'] = https_port

    if certificate_bundle is not None:
        _details['certificateBundle'] = cli_util.parse_json_parameter("certificate_bundle", certificate_bundle)

    if document_root is not None:
        _details['documentRoot'] = document_root

    if advanced_properties is not None:
        _details['advancedProperties'] = cli_util.parse_json_parameter("advanced_properties", advanced_properties)

    _details['type'] = 'DEFAULT'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_global(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        global_key=global_key,
        update_database_tools_database_api_gateway_config_global_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_global_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_global_database_api_gateway_config_certificate_bundle_file_name.command_name', 'update-database-tools-database-api-gateway-config-global-database-api-gateway-config-certificate-bundle-file-name'), help=u"""Update a Database Tools database API gateway config global resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigGlobal)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--global-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["SETTINGS"]), help=u"""The key of the global config.""")
@cli_util.option('--pool-route', type=custom_types.CliCaseInsensitiveChoice(["PATH", "HEADER"]), help=u"""How the target pool route value is determined for a HTTP request.""")
@cli_util.option('--pool-routing-header', help=u"""The request header name providing the pool route value.""")
@cli_util.option('--database-api-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""ORDS database API is a database management and monitoring REST API. Database Actions requires this feature.""")
@cli_util.option('--http-port', type=click.INT, help=u"""Specifies the HTTP listen port. 0 disables HTTP. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024\u201365535) is recommended.""")
@cli_util.option('--https-port', type=click.INT, help=u"""Specifies the HTTPS listen port. 0 disables HTTPS. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024\u201365535) is recommended. ORDS will use a self-signed certificate if a certificate bundle is not provided.""")
@cli_util.option('--document-root', help=u"""The location of the static resources to be served under the / root server path.""")
@cli_util.option('--advanced-properties', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Advanced global properties.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--certificate-bundle-certificate-public', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--certificate-bundle-certificate-private-key', type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}, 'certificate-bundle-certificate-public': {'module': 'database_tools_runtime', 'class': 'DatabaseApiGatewayConfigCertificatePublicFileName'}, 'certificate-bundle-certificate-private-key': {'module': 'database_tools_runtime', 'class': 'DatabaseApiGatewayConfigCertificatePrivateKeyFileName'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}, 'certificate-bundle-certificate-public': {'module': 'database_tools_runtime', 'class': 'DatabaseApiGatewayConfigCertificatePublicFileName'}, 'certificate-bundle-certificate-private-key': {'module': 'database_tools_runtime', 'class': 'DatabaseApiGatewayConfigCertificatePrivateKeyFileName'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigGlobal'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_global_database_api_gateway_config_certificate_bundle_file_name(ctx, from_json, force, database_api_gateway_config_id, global_key, pool_route, pool_routing_header, database_api_status, http_port, https_port, document_root, advanced_properties, if_match, certificate_bundle_certificate_public, certificate_bundle_certificate_private_key):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(global_key, six.string_types) and len(global_key.strip()) == 0:
        raise click.UsageError('Parameter --global-key cannot be whitespace or empty string')
    if not force:
        if advanced_properties:
            if not click.confirm("WARNING: Updates to advanced-properties will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['certificateBundle'] = {}

    if pool_route is not None:
        _details['poolRoute'] = pool_route

    if pool_routing_header is not None:
        _details['poolRoutingHeader'] = pool_routing_header

    if database_api_status is not None:
        _details['databaseApiStatus'] = database_api_status

    if http_port is not None:
        _details['httpPort'] = http_port

    if https_port is not None:
        _details['httpsPort'] = https_port

    if document_root is not None:
        _details['documentRoot'] = document_root

    if advanced_properties is not None:
        _details['advancedProperties'] = cli_util.parse_json_parameter("advanced_properties", advanced_properties)

    if certificate_bundle_certificate_public is not None:
        _details['certificateBundle']['certificatePublic'] = cli_util.parse_json_parameter("certificate_bundle_certificate_public", certificate_bundle_certificate_public)

    if certificate_bundle_certificate_private_key is not None:
        _details['certificateBundle']['certificatePrivateKey'] = cli_util.parse_json_parameter("certificate_bundle_certificate_private_key", certificate_bundle_certificate_private_key)

    _details['certificateBundle']['type'] = 'FILENAME'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_global(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        global_key=global_key,
        update_database_tools_database_api_gateway_config_global_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_global_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_global_database_api_gateway_config_certificate_bundle_self_signed.command_name', 'update-database-tools-database-api-gateway-config-global-database-api-gateway-config-certificate-bundle-self-signed'), help=u"""Update a Database Tools database API gateway config global resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigGlobal)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--global-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["SETTINGS"]), help=u"""The key of the global config.""")
@cli_util.option('--pool-route', type=custom_types.CliCaseInsensitiveChoice(["PATH", "HEADER"]), help=u"""How the target pool route value is determined for a HTTP request.""")
@cli_util.option('--pool-routing-header', help=u"""The request header name providing the pool route value.""")
@cli_util.option('--database-api-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""ORDS database API is a database management and monitoring REST API. Database Actions requires this feature.""")
@cli_util.option('--http-port', type=click.INT, help=u"""Specifies the HTTP listen port. 0 disables HTTP. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024\u201365535) is recommended.""")
@cli_util.option('--https-port', type=click.INT, help=u"""Specifies the HTTPS listen port. 0 disables HTTPS. Use of ports below 1024 requires elevated (root) privileges and is generally discouraged; deployment on non-privileged ports (1024\u201365535) is recommended. ORDS will use a self-signed certificate if a certificate bundle is not provided.""")
@cli_util.option('--document-root', help=u"""The location of the static resources to be served under the / root server path.""")
@cli_util.option('--advanced-properties', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Advanced global properties.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigGlobal'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_global_database_api_gateway_config_certificate_bundle_self_signed(ctx, from_json, force, database_api_gateway_config_id, global_key, pool_route, pool_routing_header, database_api_status, http_port, https_port, document_root, advanced_properties, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(global_key, six.string_types) and len(global_key.strip()) == 0:
        raise click.UsageError('Parameter --global-key cannot be whitespace or empty string')
    if not force:
        if advanced_properties:
            if not click.confirm("WARNING: Updates to advanced-properties will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['certificateBundle'] = {}

    if pool_route is not None:
        _details['poolRoute'] = pool_route

    if pool_routing_header is not None:
        _details['poolRoutingHeader'] = pool_routing_header

    if database_api_status is not None:
        _details['databaseApiStatus'] = database_api_status

    if http_port is not None:
        _details['httpPort'] = http_port

    if https_port is not None:
        _details['httpsPort'] = https_port

    if document_root is not None:
        _details['documentRoot'] = document_root

    if advanced_properties is not None:
        _details['advancedProperties'] = cli_util.parse_json_parameter("advanced_properties", advanced_properties)

    _details['certificateBundle']['type'] = 'SELF_SIGNED'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_global(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        global_key=global_key,
        update_database_tools_database_api_gateway_config_global_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_pool.command_name', 'update'), help=u"""Update a Database Tools database API gateway config pool resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigPool)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DEFAULT"]), help=u"""The type of the Database Tools database API gateway config pool sub resource.""")
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--pool-route-value', help=u"""The pool route value provided in requests to target this pool.""")
@cli_util.option('--database-tools-connection-id', help=u"""The [OCID] of the related Database Tools connection. Specifies the OCI database tools connection ocid to build the connection pool from.""")
@cli_util.option('--max-pool-size', type=click.INT, help=u"""Specifies the maximum number of database connections allowed for the pool.""")
@cli_util.option('--min-pool-size', type=click.INT, help=u"""Specifies the minimum number of database connections allowed for the pool.""")
@cli_util.option('--initial-pool-size', type=click.INT, help=u"""Specifies the initial size for the number of database connections that will be created for the pool.""")
@cli_util.option('--jwt-profile-jwk-url', help=u"""Specifies the URL of the JSON Web Key (JWK) that is used to verify the signature of the JWT token.""")
@cli_util.option('--jwt-profile-issuer', help=u"""Specifies the issuer of the JWT token. This value is used to validate the iss claim in the JWT token.""")
@cli_util.option('--jwt-profile-audience', help=u"""Specifies the expected audience for the JWT token. This value is used to validate the aud claim in the JWT token.""")
@cli_util.option('--jwt-profile-role-claim-name', help=u"""Specifies the JSON pointer to the claim in the JWT token that contains the roles of the users.""")
@cli_util.option('--database-actions-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies to enable the Database Actions feature.""")
@cli_util.option('--rest-enabled-sql-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies whether the REST-Enabled SQL service is active.""")
@cli_util.option('--advanced-properties', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Advanced pool properties.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPool'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_pool(ctx, from_json, force, database_api_gateway_config_id, pool_key, type, display_name, pool_route_value, database_tools_connection_id, max_pool_size, min_pool_size, initial_pool_size, jwt_profile_jwk_url, jwt_profile_issuer, jwt_profile_audience, jwt_profile_role_claim_name, database_actions_status, rest_enabled_sql_status, advanced_properties, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')
    if not force:
        if advanced_properties:
            if not click.confirm("WARNING: Updates to advanced-properties will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type

    if display_name is not None:
        _details['displayName'] = display_name

    if pool_route_value is not None:
        _details['poolRouteValue'] = pool_route_value

    if database_tools_connection_id is not None:
        _details['databaseToolsConnectionId'] = database_tools_connection_id

    if max_pool_size is not None:
        _details['maxPoolSize'] = max_pool_size

    if min_pool_size is not None:
        _details['minPoolSize'] = min_pool_size

    if initial_pool_size is not None:
        _details['initialPoolSize'] = initial_pool_size

    if jwt_profile_jwk_url is not None:
        _details['jwtProfileJwkUrl'] = jwt_profile_jwk_url

    if jwt_profile_issuer is not None:
        _details['jwtProfileIssuer'] = jwt_profile_issuer

    if jwt_profile_audience is not None:
        _details['jwtProfileAudience'] = jwt_profile_audience

    if jwt_profile_role_claim_name is not None:
        _details['jwtProfileRoleClaimName'] = jwt_profile_role_claim_name

    if database_actions_status is not None:
        _details['databaseActionsStatus'] = database_actions_status

    if rest_enabled_sql_status is not None:
        _details['restEnabledSqlStatus'] = rest_enabled_sql_status

    if advanced_properties is not None:
        _details['advancedProperties'] = cli_util.parse_json_parameter("advanced_properties", advanced_properties)

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_pool(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        update_database_tools_database_api_gateway_config_pool_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_pool_update_database_tools_database_api_gateway_config_pool_default_details.command_name', 'update-database-tools-database-api-gateway-config-pool-update-database-tools-database-api-gateway-config-pool-default-details'), help=u"""Update a Database Tools database API gateway config pool resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigPool)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--pool-route-value', help=u"""The pool route value provided in requests to target this pool.""")
@cli_util.option('--database-tools-connection-id', help=u"""The [OCID] of the related Database Tools connection. Specifies the OCI database tools connection ocid to build the connection pool from.""")
@cli_util.option('--max-pool-size', type=click.INT, help=u"""Specifies the maximum number of database connections allowed for the pool.""")
@cli_util.option('--min-pool-size', type=click.INT, help=u"""Specifies the minimum number of database connections allowed for the pool.""")
@cli_util.option('--initial-pool-size', type=click.INT, help=u"""Specifies the initial size for the number of database connections that will be created for the pool.""")
@cli_util.option('--jwt-profile-jwk-url', help=u"""Specifies the URL of the JSON Web Key (JWK) that is used to verify the signature of the JWT token.""")
@cli_util.option('--jwt-profile-issuer', help=u"""Specifies the issuer of the JWT token. This value is used to validate the iss claim in the JWT token.""")
@cli_util.option('--jwt-profile-audience', help=u"""Specifies the expected audience for the JWT token. This value is used to validate the aud claim in the JWT token.""")
@cli_util.option('--jwt-profile-role-claim-name', help=u"""Specifies the JSON pointer to the claim in the JWT token that contains the roles of the users.""")
@cli_util.option('--database-actions-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies to enable the Database Actions feature.""")
@cli_util.option('--rest-enabled-sql-status', type=custom_types.CliCaseInsensitiveChoice(["ENABLED", "DISABLED"]), help=u"""Specifies whether the REST-Enabled SQL service is active.""")
@cli_util.option('--advanced-properties', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Advanced pool properties.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'advanced-properties': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPool'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_pool_update_database_tools_database_api_gateway_config_pool_default_details(ctx, from_json, force, database_api_gateway_config_id, pool_key, display_name, pool_route_value, database_tools_connection_id, max_pool_size, min_pool_size, initial_pool_size, jwt_profile_jwk_url, jwt_profile_issuer, jwt_profile_audience, jwt_profile_role_claim_name, database_actions_status, rest_enabled_sql_status, advanced_properties, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')
    if not force:
        if advanced_properties:
            if not click.confirm("WARNING: Updates to advanced-properties will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    if display_name is not None:
        _details['displayName'] = display_name

    if pool_route_value is not None:
        _details['poolRouteValue'] = pool_route_value

    if database_tools_connection_id is not None:
        _details['databaseToolsConnectionId'] = database_tools_connection_id

    if max_pool_size is not None:
        _details['maxPoolSize'] = max_pool_size

    if min_pool_size is not None:
        _details['minPoolSize'] = min_pool_size

    if initial_pool_size is not None:
        _details['initialPoolSize'] = initial_pool_size

    if jwt_profile_jwk_url is not None:
        _details['jwtProfileJwkUrl'] = jwt_profile_jwk_url

    if jwt_profile_issuer is not None:
        _details['jwtProfileIssuer'] = jwt_profile_issuer

    if jwt_profile_audience is not None:
        _details['jwtProfileAudience'] = jwt_profile_audience

    if jwt_profile_role_claim_name is not None:
        _details['jwtProfileRoleClaimName'] = jwt_profile_role_claim_name

    if database_actions_status is not None:
        _details['databaseActionsStatus'] = database_actions_status

    if rest_enabled_sql_status is not None:
        _details['restEnabledSqlStatus'] = rest_enabled_sql_status

    if advanced_properties is not None:
        _details['advancedProperties'] = cli_util.parse_json_parameter("advanced_properties", advanced_properties)

    _details['type'] = 'DEFAULT'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_pool(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        update_database_tools_database_api_gateway_config_pool_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_api_spec_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_pool_api_spec.command_name', 'update'), help=u"""Update a Database Tools database API gateway config API spec resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigPoolApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--api-spec-key', required=True, help=u"""The key of the API spec config.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DEFAULT"]), help=u"""The type of the Database Tools database API gateway config API spec sub resource.""")
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--content', help=u"""The content of a string-escaped Open API spec in JSON format.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolApiSpec'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_pool_api_spec(ctx, from_json, database_api_gateway_config_id, pool_key, api_spec_key, type, display_name, content, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    if isinstance(api_spec_key, six.string_types) and len(api_spec_key.strip()) == 0:
        raise click.UsageError('Parameter --api-spec-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type

    if display_name is not None:
        _details['displayName'] = display_name

    if content is not None:
        _details['content'] = content

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_pool_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        api_spec_key=api_spec_key,
        update_database_tools_database_api_gateway_config_pool_api_spec_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_api_spec_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_pool_api_spec_update_database_tools_database_api_gateway_config_pool_api_spec_default_details.command_name', 'update-database-tools-database-api-gateway-config-pool-api-spec-update-database-tools-database-api-gateway-config-pool-api-spec-default-details'), help=u"""Update a Database Tools database API gateway config API spec resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigPoolApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--api-spec-key', required=True, help=u"""The key of the API spec config.""")
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--content', help=u"""The content of a string-escaped Open API spec in JSON format.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolApiSpec'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_pool_api_spec_update_database_tools_database_api_gateway_config_pool_api_spec_default_details(ctx, from_json, database_api_gateway_config_id, pool_key, api_spec_key, display_name, content, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    if isinstance(api_spec_key, six.string_types) and len(api_spec_key.strip()) == 0:
        raise click.UsageError('Parameter --api-spec-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    if display_name is not None:
        _details['displayName'] = display_name

    if content is not None:
        _details['content'] = content

    _details['type'] = 'DEFAULT'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_pool_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        api_spec_key=api_spec_key,
        update_database_tools_database_api_gateway_config_pool_api_spec_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_auto_api_spec_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_pool_auto_api_spec.command_name', 'update'), help=u"""Update a Database Tools database API gateway config auto API spec resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--auto-api-spec-key', required=True, help=u"""The key of the auto API spec config.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["DEFAULT"]), help=u"""The type of the Database Tools database API gateway config auto API spec sub resource.""")
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--database-object-name', help=u"""The name of the database object.""")
@cli_util.option('--database-object-type', type=custom_types.CliCaseInsensitiveChoice(["FUNCTION", "MVIEW", "PACKAGE", "PROCEDURE", "TABLE", "VIEW", "DUALITYVIEW"]), help=u"""The type of the database object.""")
@cli_util.option('--description', help=u"""Description of the autoApiSpec.""")
@cli_util.option('--alias', help=u"""Used as the URI path element for this object. When not specified the objectName lowercase is the default value.""")
@cli_util.option('--operations', type=custom_types.CliCaseInsensitiveChoice(["READ", "WRITE"]), help=u"""The operations to limit access to this resource. If not specified then the default is [\"READ\",\"WRITE\"].""")
@cli_util.option('--security-schemes', type=custom_types.CliCaseInsensitiveChoice(["BASIC", "BEARER"]), help=u"""The security schemes that can access this resource. If not specified then the resource is public.""")
@cli_util.option('--scope', help=u"""The name of the database API gateway config privilege protecting the resource. Only valid for SCOPE JWT Profile pools and BEARER securitySchemes.""")
@cli_util.option('--roles', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The name of the database API gateway config roles protecting the resource. Only valid for RBAC JWT Profile pools and BEARER securitySchemes.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'roles': {'module': 'database_tools_runtime', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'roles': {'module': 'database_tools_runtime', 'class': 'list[string]'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_pool_auto_api_spec(ctx, from_json, force, database_api_gateway_config_id, pool_key, auto_api_spec_key, type, display_name, database_object_name, database_object_type, description, alias, operations, security_schemes, scope, roles, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    if isinstance(auto_api_spec_key, six.string_types) and len(auto_api_spec_key.strip()) == 0:
        raise click.UsageError('Parameter --auto-api-spec-key cannot be whitespace or empty string')
    if not force:
        if operations or security_schemes or roles:
            if not click.confirm("WARNING: Updates to operations and security-schemes and roles will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type

    if display_name is not None:
        _details['displayName'] = display_name

    if database_object_name is not None:
        _details['databaseObjectName'] = database_object_name

    if database_object_type is not None:
        _details['databaseObjectType'] = database_object_type

    if description is not None:
        _details['description'] = description

    if alias is not None:
        _details['alias'] = alias

    if operations is not None:
        _details['operations'] = cli_util.parse_json_parameter("operations", operations)

    if security_schemes is not None:
        _details['securitySchemes'] = cli_util.parse_json_parameter("security_schemes", security_schemes)

    if scope is not None:
        _details['scope'] = scope

    if roles is not None:
        _details['roles'] = cli_util.parse_json_parameter("roles", roles)

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_pool_auto_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        auto_api_spec_key=auto_api_spec_key,
        update_database_tools_database_api_gateway_config_pool_auto_api_spec_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_database_api_gateway_config_pool_auto_api_spec_group.command(name=cli_util.override('dbtools_runtime.update_database_tools_database_api_gateway_config_pool_auto_api_spec_update_database_tools_database_api_gateway_config_pool_auto_api_spec_default_details.command_name', 'update-database-tools-database-api-gateway-config-pool-auto-api-spec-update-database-tools-database-api-gateway-config-pool-auto-api-spec-default-details'), help=u"""Update a Database Tools database API gateway config auto API spec resource \n[Command Reference](updateDatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec)""")
@cli_util.option('--database-api-gateway-config-id', required=True, help=u"""The [OCID] of a Database Tools database API gateway config.""")
@cli_util.option('--pool-key', required=True, help=u"""The key of the pool config.""")
@cli_util.option('--auto-api-spec-key', required=True, help=u"""The key of the auto API spec config.""")
@cli_util.option('--display-name', help=u"""A user-friendly name. Does not have to be unique, and it\u2019s changeable. Avoid entering confidential information.""")
@cli_util.option('--database-object-name', help=u"""The name of the database object.""")
@cli_util.option('--database-object-type', type=custom_types.CliCaseInsensitiveChoice(["FUNCTION", "MVIEW", "PACKAGE", "PROCEDURE", "TABLE", "VIEW", "DUALITYVIEW"]), help=u"""The type of the database object.""")
@cli_util.option('--description', help=u"""Description of the autoApiSpec.""")
@cli_util.option('--alias', help=u"""Used as the URI path element for this object. When not specified the objectName lowercase is the default value.""")
@cli_util.option('--operations', type=custom_types.CliCaseInsensitiveChoice(["READ", "WRITE"]), help=u"""The operations to limit access to this resource. If not specified then the default is [\"READ\",\"WRITE\"].""")
@cli_util.option('--security-schemes', type=custom_types.CliCaseInsensitiveChoice(["BASIC", "BEARER"]), help=u"""The security schemes that can access this resource. If not specified then the resource is public.""")
@cli_util.option('--scope', help=u"""The name of the database API gateway config privilege protecting the resource. Only valid for SCOPE JWT Profile pools and BEARER securitySchemes.""")
@cli_util.option('--roles', type=custom_types.CLI_COMPLEX_TYPE, help=u"""The name of the database API gateway config roles protecting the resource. Only valid for RBAC JWT Profile pools and BEARER securitySchemes.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'roles': {'module': 'database_tools_runtime', 'class': 'list[string]'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'roles': {'module': 'database_tools_runtime', 'class': 'list[string]'}}, output_type={'module': 'database_tools_runtime', 'class': 'DatabaseToolsDatabaseApiGatewayConfigPoolAutoApiSpec'})
@cli_util.wrap_exceptions
def update_database_tools_database_api_gateway_config_pool_auto_api_spec_update_database_tools_database_api_gateway_config_pool_auto_api_spec_default_details(ctx, from_json, force, database_api_gateway_config_id, pool_key, auto_api_spec_key, display_name, database_object_name, database_object_type, description, alias, operations, security_schemes, scope, roles, if_match):

    if isinstance(database_api_gateway_config_id, six.string_types) and len(database_api_gateway_config_id.strip()) == 0:
        raise click.UsageError('Parameter --database-api-gateway-config-id cannot be whitespace or empty string')

    if isinstance(pool_key, six.string_types) and len(pool_key.strip()) == 0:
        raise click.UsageError('Parameter --pool-key cannot be whitespace or empty string')

    if isinstance(auto_api_spec_key, six.string_types) and len(auto_api_spec_key.strip()) == 0:
        raise click.UsageError('Parameter --auto-api-spec-key cannot be whitespace or empty string')
    if not force:
        if operations or security_schemes or roles:
            if not click.confirm("WARNING: Updates to operations and security-schemes and roles will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    if display_name is not None:
        _details['displayName'] = display_name

    if database_object_name is not None:
        _details['databaseObjectName'] = database_object_name

    if database_object_type is not None:
        _details['databaseObjectType'] = database_object_type

    if description is not None:
        _details['description'] = description

    if alias is not None:
        _details['alias'] = alias

    if operations is not None:
        _details['operations'] = cli_util.parse_json_parameter("operations", operations)

    if security_schemes is not None:
        _details['securitySchemes'] = cli_util.parse_json_parameter("security_schemes", security_schemes)

    if scope is not None:
        _details['scope'] = scope

    if roles is not None:
        _details['roles'] = cli_util.parse_json_parameter("roles", roles)

    _details['type'] = 'DEFAULT'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_database_tools_database_api_gateway_config_pool_auto_api_spec(
        database_tools_database_api_gateway_config_id=database_api_gateway_config_id,
        pool_key=pool_key,
        auto_api_spec_key=auto_api_spec_key,
        update_database_tools_database_api_gateway_config_pool_auto_api_spec_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@property_set_group.command(name=cli_util.override('dbtools_runtime.update_property_set.command_name', 'update'), help=u"""Update a property set \n[Command Reference](updatePropertySet)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--property-set-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["APEX_DOCUMENT_GENERATOR", "APEX", "APEX_FA_INTEGRATION", "ORACLE_DATABASE_EXTERNAL_AUTHENTICATION"]), help=u"""The name of the property set""")
@cli_util.option('--key', required=True, type=custom_types.CliCaseInsensitiveChoice(["APEX_DOCUMENT_GENERATOR", "APEX", "APEX_FA_INTEGRATION", "ORACLE_DATABASE_EXTERNAL_AUTHENTICATION"]), help=u"""The name of the property set""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'PropertySet'})
@cli_util.wrap_exceptions
def update_property_set(ctx, from_json, connection_id, property_set_key, key, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(property_set_key, six.string_types) and len(property_set_key.strip()) == 0:
        raise click.UsageError('Parameter --property-set-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['key'] = key

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_property_set(
        database_tools_connection_id=connection_id,
        property_set_key=property_set_key,
        update_property_set_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@property_set_group.command(name=cli_util.override('dbtools_runtime.update_property_set_update_property_set_apex_document_generator_details.command_name', 'update-property-set-update-property-set-apex-document-generator-details'), help=u"""Update a property set \n[Command Reference](updatePropertySet)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--property-set-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["APEX_DOCUMENT_GENERATOR", "APEX", "APEX_FA_INTEGRATION", "ORACLE_DATABASE_EXTERNAL_AUTHENTICATION"]), help=u"""The name of the property set""")
@cli_util.option('--print-server-type', help=u"""The print server type""")
@cli_util.option('--credential-key', help=u"""The name of the credential used by APEX to manage Object Storage Buckets and Objects as well as invoke the Document Generator function.""")
@cli_util.option('--autonomous-database-resource-principal-status', help=u"""The status of the Autonomous Database Serverless Resource Principal (OCI$RESOURCE_PRINCIPAL)""")
@cli_util.option('--object-storage-namespace', help=u"""The Object Storage Namespace containing the Object Storage Buckets managed by APEX""")
@cli_util.option('--object-storage-bucket-compartment-id', help=u"""The [OCID] of the compartment containing the Object Storage Buckets managed by APEX""")
@cli_util.option('--object-storage-endpoint', help=u"""Object Storage Endpoint""")
@cli_util.option('--function-id', help=u"""The [OCID] of the Document Generator function""")
@cli_util.option('--invoke-endpoint', help=u"""The base endpoint URL to use to invoke the Document Generator function""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'PropertySet'})
@cli_util.wrap_exceptions
def update_property_set_update_property_set_apex_document_generator_details(ctx, from_json, connection_id, property_set_key, print_server_type, credential_key, autonomous_database_resource_principal_status, object_storage_namespace, object_storage_bucket_compartment_id, object_storage_endpoint, function_id, invoke_endpoint, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(property_set_key, six.string_types) and len(property_set_key.strip()) == 0:
        raise click.UsageError('Parameter --property-set-key cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    if print_server_type is not None:
        _details['printServerType'] = print_server_type

    if credential_key is not None:
        _details['credentialKey'] = credential_key

    if autonomous_database_resource_principal_status is not None:
        _details['autonomousDatabaseResourcePrincipalStatus'] = autonomous_database_resource_principal_status

    if object_storage_namespace is not None:
        _details['objectStorageNamespace'] = object_storage_namespace

    if object_storage_bucket_compartment_id is not None:
        _details['objectStorageBucketCompartmentId'] = object_storage_bucket_compartment_id

    if object_storage_endpoint is not None:
        _details['objectStorageEndpoint'] = object_storage_endpoint

    if function_id is not None:
        _details['functionId'] = function_id

    if invoke_endpoint is not None:
        _details['invokeEndpoint'] = invoke_endpoint

    _details['key'] = 'APEX_DOCUMENT_GENERATOR'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_property_set(
        database_tools_connection_id=connection_id,
        property_set_key=property_set_key,
        update_property_set_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@property_set_group.command(name=cli_util.override('dbtools_runtime.update_property_set_update_property_set_oracle_database_external_authentication_details.command_name', 'update-property-set-update-property-set-oracle-database-external-authentication-details'), help=u"""Update a property set \n[Command Reference](updatePropertySet)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--property-set-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["APEX_DOCUMENT_GENERATOR", "APEX", "APEX_FA_INTEGRATION", "ORACLE_DATABASE_EXTERNAL_AUTHENTICATION"]), help=u"""The name of the property set""")
@cli_util.option('--identity-provider', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'identity-provider': {'module': 'database_tools_runtime', 'class': 'PropertySetOracleDatabaseExternalAuthenticationIdentityProvider'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'identity-provider': {'module': 'database_tools_runtime', 'class': 'PropertySetOracleDatabaseExternalAuthenticationIdentityProvider'}}, output_type={'module': 'database_tools_runtime', 'class': 'PropertySet'})
@cli_util.wrap_exceptions
def update_property_set_update_property_set_oracle_database_external_authentication_details(ctx, from_json, force, connection_id, property_set_key, identity_provider, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(property_set_key, six.string_types) and len(property_set_key.strip()) == 0:
        raise click.UsageError('Parameter --property-set-key cannot be whitespace or empty string')
    if not force:
        if identity_provider:
            if not click.confirm("WARNING: Updates to identity-provider will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['identityProvider'] = cli_util.parse_json_parameter("identity_provider", identity_provider)

    _details['key'] = 'ORACLE_DATABASE_EXTERNAL_AUTHENTICATION'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_property_set(
        database_tools_connection_id=connection_id,
        property_set_key=property_set_key,
        update_property_set_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@property_set_group.command(name=cli_util.override('dbtools_runtime.update_property_set_update_property_set_apex_fa_integration_details.command_name', 'update-property-set-update-property-set-apex-fa-integration-details'), help=u"""Update a property set \n[Command Reference](updatePropertySet)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--property-set-key', required=True, type=custom_types.CliCaseInsensitiveChoice(["APEX_DOCUMENT_GENERATOR", "APEX", "APEX_FA_INTEGRATION", "ORACLE_DATABASE_EXTERNAL_AUTHENTICATION"]), help=u"""The name of the property set""")
@cli_util.option('--authentication-substitutions', type=custom_types.CLI_COMPLEX_TYPE, help=u"""APEX FA Integration key-value pairs.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--instance-dbms-credential-enabled', help=u"""Specifies whether database credentials can be used in all workspaces on the APEX instance. Supported values include: \"Y\", \"N\" and empty string.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@cli_util.option('--force', help="""Perform update without prompting for confirmation.""", is_flag=True)
@json_skeleton_utils.get_cli_json_input_option({'authentication-substitutions': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'authentication-substitutions': {'module': 'database_tools_runtime', 'class': 'dict(str, string)'}}, output_type={'module': 'database_tools_runtime', 'class': 'PropertySet'})
@cli_util.wrap_exceptions
def update_property_set_update_property_set_apex_fa_integration_details(ctx, from_json, force, connection_id, property_set_key, authentication_substitutions, instance_dbms_credential_enabled, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    if isinstance(property_set_key, six.string_types) and len(property_set_key.strip()) == 0:
        raise click.UsageError('Parameter --property-set-key cannot be whitespace or empty string')
    if not force:
        if authentication_substitutions:
            if not click.confirm("WARNING: Updates to authentication-substitutions will replace any existing values. Are you sure you want to continue?"):
                ctx.abort()

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    if authentication_substitutions is not None:
        _details['authenticationSubstitutions'] = cli_util.parse_json_parameter("authentication_substitutions", authentication_substitutions)

    if instance_dbms_credential_enabled is not None:
        _details['instanceDbmsCredentialEnabled'] = instance_dbms_credential_enabled

    _details['key'] = 'APEX_FA_INTEGRATION'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.update_property_set(
        database_tools_connection_id=connection_id,
        property_set_key=property_set_key,
        update_property_set_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.validate_database_tools_connection.command_name', 'validate'), help=u"""Validates the specified Database Tools connection. \n[Command Reference](validateDatabaseToolsConnection)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_DATABASE", "MYSQL", "POSTGRESQL"]), help=u"""The `DatabaseToolsConnection` type.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'ValidateDatabaseToolsConnectionResult'})
@cli_util.wrap_exceptions
def validate_database_tools_connection(ctx, from_json, connection_id, type, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.validate_database_tools_connection(
        database_tools_connection_id=connection_id,
        validate_database_tools_connection_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.validate_database_tools_connection_validate_database_tools_connection_postgresql_details.command_name', 'validate-database-tools-connection-validate-database-tools-connection-postgresql-details'), help=u"""Validates the specified Database Tools connection. \n[Command Reference](validateDatabaseToolsConnection)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'ValidateDatabaseToolsConnectionResult'})
@cli_util.wrap_exceptions
def validate_database_tools_connection_validate_database_tools_connection_postgresql_details(ctx, from_json, connection_id, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    _details['type'] = 'POSTGRESQL'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.validate_database_tools_connection(
        database_tools_connection_id=connection_id,
        validate_database_tools_connection_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.validate_database_tools_connection_validate_database_tools_connection_my_sql_details.command_name', 'validate-database-tools-connection-validate-database-tools-connection-my-sql-details'), help=u"""Validates the specified Database Tools connection. \n[Command Reference](validateDatabaseToolsConnection)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'ValidateDatabaseToolsConnectionResult'})
@cli_util.wrap_exceptions
def validate_database_tools_connection_validate_database_tools_connection_my_sql_details(ctx, from_json, connection_id, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    _details['type'] = 'MYSQL'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.validate_database_tools_connection(
        database_tools_connection_id=connection_id,
        validate_database_tools_connection_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_connection_group.command(name=cli_util.override('dbtools_runtime.validate_database_tools_connection_validate_database_tools_connection_oracle_database_details.command_name', 'validate-database-tools-connection-validate-database-tools-connection-oracle-database-details'), help=u"""Validates the specified Database Tools connection. \n[Command Reference](validateDatabaseToolsConnection)""")
@cli_util.option('--connection-id', required=True, help=u"""The [OCID] of a Database Tools connection.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'ValidateDatabaseToolsConnectionResult'})
@cli_util.wrap_exceptions
def validate_database_tools_connection_validate_database_tools_connection_oracle_database_details(ctx, from_json, connection_id, if_match):

    if isinstance(connection_id, six.string_types) and len(connection_id.strip()) == 0:
        raise click.UsageError('Parameter --connection-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    _details['type'] = 'ORACLE_DATABASE'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.validate_database_tools_connection(
        database_tools_connection_id=connection_id,
        validate_database_tools_connection_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_identity_group.command(name=cli_util.override('dbtools_runtime.validate_database_tools_identity_credential.command_name', 'validate-database-tools-identity-credential'), help=u"""Validates the Database Tools identity credentials by establishing a connection to the customer database and executing the dbms_cloud.send_request to validate the credential. \n[Command Reference](validateDatabaseToolsIdentityCredential)""")
@cli_util.option('--identity-id', required=True, help=u"""The [OCID] of a Database Tools identity.""")
@cli_util.option('--type', required=True, type=custom_types.CliCaseInsensitiveChoice(["ORACLE_DATABASE_RESOURCE_PRINCIPAL"]), help=u"""The Database Tools identity type.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'ValidateDatabaseToolsIdentityCredentialResult'})
@cli_util.wrap_exceptions
def validate_database_tools_identity_credential(ctx, from_json, identity_id, type, if_match):

    if isinstance(identity_id, six.string_types) and len(identity_id.strip()) == 0:
        raise click.UsageError('Parameter --identity-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}
    _details['type'] = type

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.validate_database_tools_identity_credential(
        database_tools_identity_id=identity_id,
        validate_database_tools_identity_credential_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@database_tools_identity_group.command(name=cli_util.override('dbtools_runtime.validate_database_tools_identity_credential_validate_database_tools_identity_credential_oracle_database_resource_principal_details.command_name', 'validate-database-tools-identity-credential-validate-database-tools-identity-credential-oracle-database-resource-principal-details'), help=u"""Validates the Database Tools identity credentials by establishing a connection to the customer database and executing the dbms_cloud.send_request to validate the credential. \n[Command Reference](validateDatabaseToolsIdentityCredential)""")
@cli_util.option('--identity-id', required=True, help=u"""The [OCID] of a Database Tools identity.""")
@cli_util.option('--if-match', help=u"""If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agentss might be acting in parallel on the same resource (i.e., to prevent the \"lost update\" problem). In general, it can be used with any method that involves the selection or modification of a representation to abort the request if the selected representation's current entity tag is not a member within the If-Match field value. When specified on an action-specific subresource, the ETag value of the resource on which the action is requested should be provided.""")
@json_skeleton_utils.get_cli_json_input_option({})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={}, output_type={'module': 'database_tools_runtime', 'class': 'ValidateDatabaseToolsIdentityCredentialResult'})
@cli_util.wrap_exceptions
def validate_database_tools_identity_credential_validate_database_tools_identity_credential_oracle_database_resource_principal_details(ctx, from_json, identity_id, if_match):

    if isinstance(identity_id, six.string_types) and len(identity_id.strip()) == 0:
        raise click.UsageError('Parameter --identity-id cannot be whitespace or empty string')

    kwargs = {}
    if if_match is not None:
        kwargs['if_match'] = if_match
    kwargs['opc_request_id'] = cli_util.use_or_generate_request_id(ctx.obj['request_id'])

    _details = {}

    _details['type'] = 'ORACLE_DATABASE_RESOURCE_PRINCIPAL'

    client = cli_util.build_client('database_tools_runtime', 'database_tools_runtime', ctx)
    result = client.validate_database_tools_identity_credential(
        database_tools_identity_id=identity_id,
        validate_database_tools_identity_credential_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)
