# 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: 20260325

from __future__ import print_function
import click
import oci  # noqa: F401
import six  # noqa: F401
import sys  # noqa: F401
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
from services.generative_ai_data.src.oci_cli_generative_ai_data.generated import generative_ai_data_service_cli


@click.command(cli_util.override('generate_enrichment_job.generate_enrichment_job_root_group.command_name', 'generate-enrichment-job'), cls=CommandGroupWithAlias, help=cli_util.override('generate_enrichment_job.generate_enrichment_job_root_group.help', """A description of the ReferenceService API. in progress"""), short_help=cli_util.override('generate_enrichment_job.generate_enrichment_job_root_group.short_help', """Generative AI Service NL2SQL API"""))
@cli_util.help_option_group
def generate_enrichment_job_root_group():
    pass


@click.command(cli_util.override('generate_enrichment_job.enrichment_job_group.command_name', 'enrichment-job'), cls=CommandGroupWithAlias, help="""Object representing to EnrichmentJob. ocidEntityType: generativeaiEnrichmentJob adLocality: regional""")
@cli_util.help_option_group
def enrichment_job_group():
    pass


generative_ai_data_service_cli.generative_ai_data_service_group.add_command(generate_enrichment_job_root_group)
generate_enrichment_job_root_group.add_command(enrichment_job_group)


@enrichment_job_group.command(name=cli_util.override('generate_enrichment_job.generate_enrichment_job.command_name', 'generate'), help=u"""Creates a new asynchronous EnrichmentJob. \n[Command Reference](generateEnrichmentJob)""")
@cli_util.option('--enrichment-job-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL_BUILD", "PARTIAL_BUILD", "DELTA_REFRESH"]), help=u"""Enrichment job type. Currently supported Full Build (All supported objects in a given schema) and Partial Build (Selected tables and/or supported objects in a given schema).""")
@cli_util.option('--enrichment-job-configuration', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--semantic-store-id', required=True, help=u"""The OCID of the semantic store""")
@cli_util.option('--description', help=u"""An optional description of the EnrichmentJob.""")
@cli_util.option('--display-name', help=u"""A user-friendly display name. It does not have to be unique and can be modified. Avoid entering confidential information.""")
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({'enrichment-job-configuration': {'module': 'generative_ai_data', 'class': 'EnrichmentJobConfiguration'}, 'freeform-tags': {'module': 'generative_ai_data', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai_data', 'class': 'dict(str, dict(str, object))'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'enrichment-job-configuration': {'module': 'generative_ai_data', 'class': 'EnrichmentJobConfiguration'}, 'freeform-tags': {'module': 'generative_ai_data', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai_data', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai_data', 'class': 'EnrichmentJob'})
@cli_util.wrap_exceptions
def generate_enrichment_job(ctx, from_json, enrichment_job_type, enrichment_job_configuration, semantic_store_id, description, display_name, freeform_tags, defined_tags, if_match):

    if isinstance(semantic_store_id, six.string_types) and len(semantic_store_id.strip()) == 0:
        raise click.UsageError('Parameter --semantic-store-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['enrichmentJobType'] = enrichment_job_type
    _details['enrichmentJobConfiguration'] = cli_util.parse_json_parameter("enrichment_job_configuration", enrichment_job_configuration)

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

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

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

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

    client = cli_util.build_client('generative_ai_data', 'generate_enrichment_job', ctx)
    result = client.generate_enrichment_job(
        semantic_store_id=semantic_store_id,
        generate_enrichment_job_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@enrichment_job_group.command(name=cli_util.override('generate_enrichment_job.generate_enrichment_job_delta_refresh_enrichment_job_configuration.command_name', 'generate-enrichment-job-delta-refresh-enrichment-job-configuration'), help=u"""Creates a new asynchronous EnrichmentJob. \n[Command Reference](generateEnrichmentJob)""")
@cli_util.option('--enrichment-job-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL_BUILD", "PARTIAL_BUILD", "DELTA_REFRESH"]), help=u"""Enrichment job type. Currently supported Full Build (All supported objects in a given schema) and Partial Build (Selected tables and/or supported objects in a given schema).""")
@cli_util.option('--semantic-store-id', required=True, help=u"""The OCID of the semantic store""")
@cli_util.option('--enrichment-job-configuration-schema-name', required=True, help=u"""Name of the DB Schema to be enriched""")
@cli_util.option('--enrichment-job-configuration-delta-refresh-schedule', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Schedule for occurrences of Delta Refresh jobs""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--description', help=u"""An optional description of the EnrichmentJob.""")
@cli_util.option('--display-name', help=u"""A user-friendly display name. It does not have to be unique and can be modified. Avoid entering confidential information.""")
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'generative_ai_data', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai_data', 'class': 'dict(str, dict(str, object))'}, 'enrichment-job-configuration-delta-refresh-schedule': {'module': 'generative_ai_data', 'class': 'object'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'generative_ai_data', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai_data', 'class': 'dict(str, dict(str, object))'}, 'enrichment-job-configuration-delta-refresh-schedule': {'module': 'generative_ai_data', 'class': 'object'}}, output_type={'module': 'generative_ai_data', 'class': 'EnrichmentJob'})
@cli_util.wrap_exceptions
def generate_enrichment_job_delta_refresh_enrichment_job_configuration(ctx, from_json, enrichment_job_type, semantic_store_id, enrichment_job_configuration_schema_name, enrichment_job_configuration_delta_refresh_schedule, description, display_name, freeform_tags, defined_tags, if_match):

    if isinstance(semantic_store_id, six.string_types) and len(semantic_store_id.strip()) == 0:
        raise click.UsageError('Parameter --semantic-store-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['enrichmentJobConfiguration'] = {}
    _details['enrichmentJobType'] = enrichment_job_type
    _details['enrichmentJobConfiguration']['schemaName'] = enrichment_job_configuration_schema_name
    _details['enrichmentJobConfiguration']['deltaRefreshSchedule'] = cli_util.parse_json_parameter("enrichment_job_configuration_delta_refresh_schedule", enrichment_job_configuration_delta_refresh_schedule)

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

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

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

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

    _details['enrichmentJobConfiguration']['enrichmentJobType'] = 'DELTA_REFRESH'

    client = cli_util.build_client('generative_ai_data', 'generate_enrichment_job', ctx)
    result = client.generate_enrichment_job(
        semantic_store_id=semantic_store_id,
        generate_enrichment_job_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@enrichment_job_group.command(name=cli_util.override('generate_enrichment_job.generate_enrichment_job_partial_build_enrichment_job_configuration.command_name', 'generate-enrichment-job-partial-build-enrichment-job-configuration'), help=u"""Creates a new asynchronous EnrichmentJob. \n[Command Reference](generateEnrichmentJob)""")
@cli_util.option('--enrichment-job-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL_BUILD", "PARTIAL_BUILD", "DELTA_REFRESH"]), help=u"""Enrichment job type. Currently supported Full Build (All supported objects in a given schema) and Partial Build (Selected tables and/or supported objects in a given schema).""")
@cli_util.option('--semantic-store-id', required=True, help=u"""The OCID of the semantic store""")
@cli_util.option('--enrichment-job-configuration-schema-name', required=True, help=u"""Name of the DB Schema to be enriched""")
@cli_util.option('--enrichment-job-configuration-database-objects', required=True, type=custom_types.CLI_COMPLEX_TYPE, help=u"""Collection of the DatabaseObjects to be enriched for the given schema.""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--description', help=u"""An optional description of the EnrichmentJob.""")
@cli_util.option('--display-name', help=u"""A user-friendly display name. It does not have to be unique and can be modified. Avoid entering confidential information.""")
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'generative_ai_data', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai_data', 'class': 'dict(str, dict(str, object))'}, 'enrichment-job-configuration-database-objects': {'module': 'generative_ai_data', 'class': 'list[DatabaseObject]'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'generative_ai_data', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai_data', 'class': 'dict(str, dict(str, object))'}, 'enrichment-job-configuration-database-objects': {'module': 'generative_ai_data', 'class': 'list[DatabaseObject]'}}, output_type={'module': 'generative_ai_data', 'class': 'EnrichmentJob'})
@cli_util.wrap_exceptions
def generate_enrichment_job_partial_build_enrichment_job_configuration(ctx, from_json, enrichment_job_type, semantic_store_id, enrichment_job_configuration_schema_name, enrichment_job_configuration_database_objects, description, display_name, freeform_tags, defined_tags, if_match):

    if isinstance(semantic_store_id, six.string_types) and len(semantic_store_id.strip()) == 0:
        raise click.UsageError('Parameter --semantic-store-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['enrichmentJobConfiguration'] = {}
    _details['enrichmentJobType'] = enrichment_job_type
    _details['enrichmentJobConfiguration']['schemaName'] = enrichment_job_configuration_schema_name
    _details['enrichmentJobConfiguration']['databaseObjects'] = cli_util.parse_json_parameter("enrichment_job_configuration_database_objects", enrichment_job_configuration_database_objects)

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

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

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

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

    _details['enrichmentJobConfiguration']['enrichmentJobType'] = 'PARTIAL_BUILD'

    client = cli_util.build_client('generative_ai_data', 'generate_enrichment_job', ctx)
    result = client.generate_enrichment_job(
        semantic_store_id=semantic_store_id,
        generate_enrichment_job_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)


@enrichment_job_group.command(name=cli_util.override('generate_enrichment_job.generate_enrichment_job_full_build_enrichment_job_configuration.command_name', 'generate-enrichment-job-full-build-enrichment-job-configuration'), help=u"""Creates a new asynchronous EnrichmentJob. \n[Command Reference](generateEnrichmentJob)""")
@cli_util.option('--enrichment-job-type', required=True, type=custom_types.CliCaseInsensitiveChoice(["FULL_BUILD", "PARTIAL_BUILD", "DELTA_REFRESH"]), help=u"""Enrichment job type. Currently supported Full Build (All supported objects in a given schema) and Partial Build (Selected tables and/or supported objects in a given schema).""")
@cli_util.option('--semantic-store-id', required=True, help=u"""The OCID of the semantic store""")
@cli_util.option('--enrichment-job-configuration-schema-name', required=True, help=u"""Name of the DB Schema to be enriched""")
@cli_util.option('--description', help=u"""An optional description of the EnrichmentJob.""")
@cli_util.option('--display-name', help=u"""A user-friendly display name. It does not have to be unique and can be modified. Avoid entering confidential information.""")
@cli_util.option('--freeform-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{\"bar-key\": \"value\"}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--defined-tags', type=custom_types.CLI_COMPLEX_TYPE, help=u"""Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`""" + custom_types.cli_complex_type.COMPLEX_TYPE_HELP)
@cli_util.option('--if-match', help=u"""For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.""")
@json_skeleton_utils.get_cli_json_input_option({'freeform-tags': {'module': 'generative_ai_data', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai_data', 'class': 'dict(str, dict(str, object))'}})
@cli_util.help_option
@click.pass_context
@json_skeleton_utils.json_skeleton_generation_handler(input_params_to_complex_types={'freeform-tags': {'module': 'generative_ai_data', 'class': 'dict(str, string)'}, 'defined-tags': {'module': 'generative_ai_data', 'class': 'dict(str, dict(str, object))'}}, output_type={'module': 'generative_ai_data', 'class': 'EnrichmentJob'})
@cli_util.wrap_exceptions
def generate_enrichment_job_full_build_enrichment_job_configuration(ctx, from_json, enrichment_job_type, semantic_store_id, enrichment_job_configuration_schema_name, description, display_name, freeform_tags, defined_tags, if_match):

    if isinstance(semantic_store_id, six.string_types) and len(semantic_store_id.strip()) == 0:
        raise click.UsageError('Parameter --semantic-store-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['enrichmentJobConfiguration'] = {}
    _details['enrichmentJobType'] = enrichment_job_type
    _details['enrichmentJobConfiguration']['schemaName'] = enrichment_job_configuration_schema_name

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

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

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

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

    _details['enrichmentJobConfiguration']['enrichmentJobType'] = 'FULL_BUILD'

    client = cli_util.build_client('generative_ai_data', 'generate_enrichment_job', ctx)
    result = client.generate_enrichment_job(
        semantic_store_id=semantic_store_id,
        generate_enrichment_job_details=_details,
        **kwargs
    )
    cli_util.render_response(result, ctx)
