// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.analytics.purview.scanning.implementation;

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.exception.ClientAuthenticationException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in Triggers. */
public final class TriggersImpl {
    /** The proxy service used to perform REST calls. */
    private final TriggersService service;

    /** The service client containing this operation class. */
    private final PurviewScanningClientImpl client;

    /**
     * Initializes an instance of TriggersImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    TriggersImpl(PurviewScanningClientImpl client) {
        this.service = RestProxy.create(TriggersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for PurviewScanningClientTriggers to be used by the proxy service to
     * perform REST calls.
     */
    @Host("{Endpoint}")
    @ServiceInterface(name = "PurviewScanningClien")
    public interface TriggersService {
        @Get("/datasources/{dataSourceName}/scans/{scanName}/triggers/default")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> getTrigger(
                @HostParam("Endpoint") String endpoint,
                @PathParam("dataSourceName") String dataSourceName,
                @PathParam("scanName") String scanName,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Get("/datasources/{dataSourceName}/scans/{scanName}/triggers/default")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> getTriggerSync(
                @HostParam("Endpoint") String endpoint,
                @PathParam("dataSourceName") String dataSourceName,
                @PathParam("scanName") String scanName,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Put("/datasources/{dataSourceName}/scans/{scanName}/triggers/default")
        @ExpectedResponses({200, 201})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> createTrigger(
                @HostParam("Endpoint") String endpoint,
                @PathParam("dataSourceName") String dataSourceName,
                @PathParam("scanName") String scanName,
                @QueryParam("api-version") String apiVersion,
                @BodyParam("application/json") BinaryData body,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Put("/datasources/{dataSourceName}/scans/{scanName}/triggers/default")
        @ExpectedResponses({200, 201})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> createTriggerSync(
                @HostParam("Endpoint") String endpoint,
                @PathParam("dataSourceName") String dataSourceName,
                @PathParam("scanName") String scanName,
                @QueryParam("api-version") String apiVersion,
                @BodyParam("application/json") BinaryData body,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Delete("/datasources/{dataSourceName}/scans/{scanName}/triggers/default")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<BinaryData>> deleteTrigger(
                @HostParam("Endpoint") String endpoint,
                @PathParam("dataSourceName") String dataSourceName,
                @PathParam("scanName") String scanName,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);

        @Delete("/datasources/{dataSourceName}/scans/{scanName}/triggers/default")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(
                value = ClientAuthenticationException.class,
                code = {401})
        @UnexpectedResponseExceptionType(
                value = ResourceNotFoundException.class,
                code = {404})
        @UnexpectedResponseExceptionType(
                value = ResourceModifiedException.class,
                code = {409})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<BinaryData> deleteTriggerSync(
                @HostParam("Endpoint") String endpoint,
                @PathParam("dataSourceName") String dataSourceName,
                @PathParam("scanName") String scanName,
                @QueryParam("api-version") String apiVersion,
                @HeaderParam("Accept") String accept,
                RequestOptions requestOptions,
                Context context);
    }

    /**
     * Gets trigger information.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         recurrence (Optional): {
     *             frequency: String(Week/Month) (Optional)
     *             interval: Integer (Optional)
     *             startTime: OffsetDateTime (Optional)
     *             endTime: OffsetDateTime (Optional)
     *             schedule (Optional): {
     *                 additionalProperties (Optional): {
     *                     String: Object (Optional)
     *                 }
     *                 minutes (Optional): [
     *                     int (Optional)
     *                 ]
     *                 hours (Optional): [
     *                     int (Optional)
     *                 ]
     *                 weekDays (Optional): [
     *                     String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                 ]
     *                 monthDays (Optional): [
     *                     int (Optional)
     *                 ]
     *                 monthlyOccurrences (Optional): [
     *                      (Optional){
     *                         additionalProperties (Optional): {
     *                             String: Object (Optional)
     *                         }
     *                         day: String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                         occurrence: Integer (Optional)
     *                     }
     *                 ]
     *             }
     *             timeZone: String (Optional)
     *         }
     *         recurrenceInterval: String (Optional)
     *         createdAt: OffsetDateTime (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastScheduled: OffsetDateTime (Optional)
     *         scanLevel: String(Full/Incremental) (Optional)
     *         incrementalScanStartTime: OffsetDateTime (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param dataSourceName The dataSourceName parameter.
     * @param scanName The scanName parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return trigger information along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> getTriggerWithResponseAsync(
            String dataSourceName, String scanName, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getTrigger(
                                this.client.getEndpoint(),
                                dataSourceName,
                                scanName,
                                this.client.getServiceVersion().getVersion(),
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * Gets trigger information.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         recurrence (Optional): {
     *             frequency: String(Week/Month) (Optional)
     *             interval: Integer (Optional)
     *             startTime: OffsetDateTime (Optional)
     *             endTime: OffsetDateTime (Optional)
     *             schedule (Optional): {
     *                 additionalProperties (Optional): {
     *                     String: Object (Optional)
     *                 }
     *                 minutes (Optional): [
     *                     int (Optional)
     *                 ]
     *                 hours (Optional): [
     *                     int (Optional)
     *                 ]
     *                 weekDays (Optional): [
     *                     String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                 ]
     *                 monthDays (Optional): [
     *                     int (Optional)
     *                 ]
     *                 monthlyOccurrences (Optional): [
     *                      (Optional){
     *                         additionalProperties (Optional): {
     *                             String: Object (Optional)
     *                         }
     *                         day: String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                         occurrence: Integer (Optional)
     *                     }
     *                 ]
     *             }
     *             timeZone: String (Optional)
     *         }
     *         recurrenceInterval: String (Optional)
     *         createdAt: OffsetDateTime (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastScheduled: OffsetDateTime (Optional)
     *         scanLevel: String(Full/Incremental) (Optional)
     *         incrementalScanStartTime: OffsetDateTime (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param dataSourceName The dataSourceName parameter.
     * @param scanName The scanName parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return trigger information along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getTriggerWithResponse(
            String dataSourceName, String scanName, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.getTriggerSync(
                this.client.getEndpoint(),
                dataSourceName,
                scanName,
                this.client.getServiceVersion().getVersion(),
                accept,
                requestOptions,
                Context.NONE);
    }

    /**
     * Creates an instance of a trigger.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         recurrence (Optional): {
     *             frequency: String(Week/Month) (Optional)
     *             interval: Integer (Optional)
     *             startTime: OffsetDateTime (Optional)
     *             endTime: OffsetDateTime (Optional)
     *             schedule (Optional): {
     *                 additionalProperties (Optional): {
     *                     String: Object (Optional)
     *                 }
     *                 minutes (Optional): [
     *                     int (Optional)
     *                 ]
     *                 hours (Optional): [
     *                     int (Optional)
     *                 ]
     *                 weekDays (Optional): [
     *                     String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                 ]
     *                 monthDays (Optional): [
     *                     int (Optional)
     *                 ]
     *                 monthlyOccurrences (Optional): [
     *                      (Optional){
     *                         additionalProperties (Optional): {
     *                             String: Object (Optional)
     *                         }
     *                         day: String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                         occurrence: Integer (Optional)
     *                     }
     *                 ]
     *             }
     *             timeZone: String (Optional)
     *         }
     *         recurrenceInterval: String (Optional)
     *         createdAt: OffsetDateTime (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastScheduled: OffsetDateTime (Optional)
     *         scanLevel: String(Full/Incremental) (Optional)
     *         incrementalScanStartTime: OffsetDateTime (Optional)
     *     }
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         recurrence (Optional): {
     *             frequency: String(Week/Month) (Optional)
     *             interval: Integer (Optional)
     *             startTime: OffsetDateTime (Optional)
     *             endTime: OffsetDateTime (Optional)
     *             schedule (Optional): {
     *                 additionalProperties (Optional): {
     *                     String: Object (Optional)
     *                 }
     *                 minutes (Optional): [
     *                     int (Optional)
     *                 ]
     *                 hours (Optional): [
     *                     int (Optional)
     *                 ]
     *                 weekDays (Optional): [
     *                     String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                 ]
     *                 monthDays (Optional): [
     *                     int (Optional)
     *                 ]
     *                 monthlyOccurrences (Optional): [
     *                      (Optional){
     *                         additionalProperties (Optional): {
     *                             String: Object (Optional)
     *                         }
     *                         day: String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                         occurrence: Integer (Optional)
     *                     }
     *                 ]
     *             }
     *             timeZone: String (Optional)
     *         }
     *         recurrenceInterval: String (Optional)
     *         createdAt: OffsetDateTime (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastScheduled: OffsetDateTime (Optional)
     *         scanLevel: String(Full/Incremental) (Optional)
     *         incrementalScanStartTime: OffsetDateTime (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param dataSourceName The dataSourceName parameter.
     * @param scanName The scanName parameter.
     * @param body The body parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> createTriggerWithResponseAsync(
            String dataSourceName, String scanName, BinaryData body, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.createTrigger(
                                this.client.getEndpoint(),
                                dataSourceName,
                                scanName,
                                this.client.getServiceVersion().getVersion(),
                                body,
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * Creates an instance of a trigger.
     *
     * <p><strong>Request Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         recurrence (Optional): {
     *             frequency: String(Week/Month) (Optional)
     *             interval: Integer (Optional)
     *             startTime: OffsetDateTime (Optional)
     *             endTime: OffsetDateTime (Optional)
     *             schedule (Optional): {
     *                 additionalProperties (Optional): {
     *                     String: Object (Optional)
     *                 }
     *                 minutes (Optional): [
     *                     int (Optional)
     *                 ]
     *                 hours (Optional): [
     *                     int (Optional)
     *                 ]
     *                 weekDays (Optional): [
     *                     String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                 ]
     *                 monthDays (Optional): [
     *                     int (Optional)
     *                 ]
     *                 monthlyOccurrences (Optional): [
     *                      (Optional){
     *                         additionalProperties (Optional): {
     *                             String: Object (Optional)
     *                         }
     *                         day: String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                         occurrence: Integer (Optional)
     *                     }
     *                 ]
     *             }
     *             timeZone: String (Optional)
     *         }
     *         recurrenceInterval: String (Optional)
     *         createdAt: OffsetDateTime (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastScheduled: OffsetDateTime (Optional)
     *         scanLevel: String(Full/Incremental) (Optional)
     *         incrementalScanStartTime: OffsetDateTime (Optional)
     *     }
     * }
     * }</pre>
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         recurrence (Optional): {
     *             frequency: String(Week/Month) (Optional)
     *             interval: Integer (Optional)
     *             startTime: OffsetDateTime (Optional)
     *             endTime: OffsetDateTime (Optional)
     *             schedule (Optional): {
     *                 additionalProperties (Optional): {
     *                     String: Object (Optional)
     *                 }
     *                 minutes (Optional): [
     *                     int (Optional)
     *                 ]
     *                 hours (Optional): [
     *                     int (Optional)
     *                 ]
     *                 weekDays (Optional): [
     *                     String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                 ]
     *                 monthDays (Optional): [
     *                     int (Optional)
     *                 ]
     *                 monthlyOccurrences (Optional): [
     *                      (Optional){
     *                         additionalProperties (Optional): {
     *                             String: Object (Optional)
     *                         }
     *                         day: String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                         occurrence: Integer (Optional)
     *                     }
     *                 ]
     *             }
     *             timeZone: String (Optional)
     *         }
     *         recurrenceInterval: String (Optional)
     *         createdAt: OffsetDateTime (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastScheduled: OffsetDateTime (Optional)
     *         scanLevel: String(Full/Incremental) (Optional)
     *         incrementalScanStartTime: OffsetDateTime (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param dataSourceName The dataSourceName parameter.
     * @param scanName The scanName parameter.
     * @param body The body parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> createTriggerWithResponse(
            String dataSourceName, String scanName, BinaryData body, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.createTriggerSync(
                this.client.getEndpoint(),
                dataSourceName,
                scanName,
                this.client.getServiceVersion().getVersion(),
                body,
                accept,
                requestOptions,
                Context.NONE);
    }

    /**
     * Deletes the trigger associated with the scan.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         recurrence (Optional): {
     *             frequency: String(Week/Month) (Optional)
     *             interval: Integer (Optional)
     *             startTime: OffsetDateTime (Optional)
     *             endTime: OffsetDateTime (Optional)
     *             schedule (Optional): {
     *                 additionalProperties (Optional): {
     *                     String: Object (Optional)
     *                 }
     *                 minutes (Optional): [
     *                     int (Optional)
     *                 ]
     *                 hours (Optional): [
     *                     int (Optional)
     *                 ]
     *                 weekDays (Optional): [
     *                     String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                 ]
     *                 monthDays (Optional): [
     *                     int (Optional)
     *                 ]
     *                 monthlyOccurrences (Optional): [
     *                      (Optional){
     *                         additionalProperties (Optional): {
     *                             String: Object (Optional)
     *                         }
     *                         day: String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                         occurrence: Integer (Optional)
     *                     }
     *                 ]
     *             }
     *             timeZone: String (Optional)
     *         }
     *         recurrenceInterval: String (Optional)
     *         createdAt: OffsetDateTime (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastScheduled: OffsetDateTime (Optional)
     *         scanLevel: String(Full/Incremental) (Optional)
     *         incrementalScanStartTime: OffsetDateTime (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param dataSourceName The dataSourceName parameter.
     * @param scanName The scanName parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<BinaryData>> deleteTriggerWithResponseAsync(
            String dataSourceName, String scanName, RequestOptions requestOptions) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.deleteTrigger(
                                this.client.getEndpoint(),
                                dataSourceName,
                                scanName,
                                this.client.getServiceVersion().getVersion(),
                                accept,
                                requestOptions,
                                context));
    }

    /**
     * Deletes the trigger associated with the scan.
     *
     * <p><strong>Response Body Schema</strong>
     *
     * <pre>{@code
     * {
     *     id: String (Optional)
     *     name: String (Optional)
     *     properties (Optional): {
     *         recurrence (Optional): {
     *             frequency: String(Week/Month) (Optional)
     *             interval: Integer (Optional)
     *             startTime: OffsetDateTime (Optional)
     *             endTime: OffsetDateTime (Optional)
     *             schedule (Optional): {
     *                 additionalProperties (Optional): {
     *                     String: Object (Optional)
     *                 }
     *                 minutes (Optional): [
     *                     int (Optional)
     *                 ]
     *                 hours (Optional): [
     *                     int (Optional)
     *                 ]
     *                 weekDays (Optional): [
     *                     String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                 ]
     *                 monthDays (Optional): [
     *                     int (Optional)
     *                 ]
     *                 monthlyOccurrences (Optional): [
     *                      (Optional){
     *                         additionalProperties (Optional): {
     *                             String: Object (Optional)
     *                         }
     *                         day: String(Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday) (Optional)
     *                         occurrence: Integer (Optional)
     *                     }
     *                 ]
     *             }
     *             timeZone: String (Optional)
     *         }
     *         recurrenceInterval: String (Optional)
     *         createdAt: OffsetDateTime (Optional)
     *         lastModifiedAt: OffsetDateTime (Optional)
     *         lastScheduled: OffsetDateTime (Optional)
     *         scanLevel: String(Full/Incremental) (Optional)
     *         incrementalScanStartTime: OffsetDateTime (Optional)
     *     }
     * }
     * }</pre>
     *
     * @param dataSourceName The dataSourceName parameter.
     * @param scanName The scanName parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> deleteTriggerWithResponse(
            String dataSourceName, String scanName, RequestOptions requestOptions) {
        final String accept = "application/json";
        return service.deleteTriggerSync(
                this.client.getEndpoint(),
                dataSourceName,
                scanName,
                this.client.getServiceVersion().getVersion(),
                accept,
                requestOptions,
                Context.NONE);
    }
}
