# 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('cancel_enrichment_job.cancel_enrichment_job_root_group.command_name', 'cancel-enrichment-job'), cls=CommandGroupWithAlias, help=cli_util.override('cancel_enrichment_job.cancel_enrichment_job_root_group.help', """A description of the ReferenceService API. in progress"""), short_help=cli_util.override('cancel_enrichment_job.cancel_enrichment_job_root_group.short_help', """Generative AI Service NL2SQL API"""))
@cli_util.help_option_group
def cancel_enrichment_job_root_group():
    pass


@click.command(cli_util.override('cancel_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(cancel_enrichment_job_root_group)
cancel_enrichment_job_root_group.add_command(enrichment_job_group)


@enrichment_job_group.command(name=cli_util.override('cancel_enrichment_job.cancel_enrichment_job.command_name', 'cancel'), help=u"""Cancels an EnrichmentJob resource by identifier. \n[Command Reference](cancelEnrichmentJob)""")
@cli_util.option('--semantic-store-id', required=True, help=u"""The OCID of the semantic store""")
@cli_util.option('--enrichment-job-id', required=True, help=u"""The OCID of the enrichment job""")
@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({})
@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_enrichment_job(ctx, from_json, semantic_store_id, enrichment_job_id, 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')

    if isinstance(enrichment_job_id, six.string_types) and len(enrichment_job_id.strip()) == 0:
        raise click.UsageError('Parameter --enrichment-job-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('generative_ai_data', 'cancel_enrichment_job', ctx)
    result = client.cancel_enrichment_job(
        semantic_store_id=semantic_store_id,
        enrichment_job_id=enrichment_job_id,
        **kwargs
    )
    cli_util.render_response(result, ctx)
