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

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Describes the response from the external server. */
@Fluent
public final class CodelessConnectorPollingResponseProperties {
    /*
     * Describes the path we should extract the data in the response
     */
    @JsonProperty(value = "eventsJsonPaths", required = true)
    private List<String> eventsJsonPaths;

    /*
     * Describes the path we should extract the status code in the response
     */
    @JsonProperty(value = "successStatusJsonPath")
    private String successStatusJsonPath;

    /*
     * Describes the path we should extract the status value in the response
     */
    @JsonProperty(value = "successStatusValue")
    private String successStatusValue;

    /*
     * Describes if the data in the response is Gzip
     */
    @JsonProperty(value = "isGzipCompressed")
    private Boolean isGzipCompressed;

    /**
     * Get the eventsJsonPaths property: Describes the path we should extract the data in the response.
     *
     * @return the eventsJsonPaths value.
     */
    public List<String> eventsJsonPaths() {
        return this.eventsJsonPaths;
    }

    /**
     * Set the eventsJsonPaths property: Describes the path we should extract the data in the response.
     *
     * @param eventsJsonPaths the eventsJsonPaths value to set.
     * @return the CodelessConnectorPollingResponseProperties object itself.
     */
    public CodelessConnectorPollingResponseProperties withEventsJsonPaths(List<String> eventsJsonPaths) {
        this.eventsJsonPaths = eventsJsonPaths;
        return this;
    }

    /**
     * Get the successStatusJsonPath property: Describes the path we should extract the status code in the response.
     *
     * @return the successStatusJsonPath value.
     */
    public String successStatusJsonPath() {
        return this.successStatusJsonPath;
    }

    /**
     * Set the successStatusJsonPath property: Describes the path we should extract the status code in the response.
     *
     * @param successStatusJsonPath the successStatusJsonPath value to set.
     * @return the CodelessConnectorPollingResponseProperties object itself.
     */
    public CodelessConnectorPollingResponseProperties withSuccessStatusJsonPath(String successStatusJsonPath) {
        this.successStatusJsonPath = successStatusJsonPath;
        return this;
    }

    /**
     * Get the successStatusValue property: Describes the path we should extract the status value in the response.
     *
     * @return the successStatusValue value.
     */
    public String successStatusValue() {
        return this.successStatusValue;
    }

    /**
     * Set the successStatusValue property: Describes the path we should extract the status value in the response.
     *
     * @param successStatusValue the successStatusValue value to set.
     * @return the CodelessConnectorPollingResponseProperties object itself.
     */
    public CodelessConnectorPollingResponseProperties withSuccessStatusValue(String successStatusValue) {
        this.successStatusValue = successStatusValue;
        return this;
    }

    /**
     * Get the isGzipCompressed property: Describes if the data in the response is Gzip.
     *
     * @return the isGzipCompressed value.
     */
    public Boolean isGzipCompressed() {
        return this.isGzipCompressed;
    }

    /**
     * Set the isGzipCompressed property: Describes if the data in the response is Gzip.
     *
     * @param isGzipCompressed the isGzipCompressed value to set.
     * @return the CodelessConnectorPollingResponseProperties object itself.
     */
    public CodelessConnectorPollingResponseProperties withIsGzipCompressed(Boolean isGzipCompressed) {
        this.isGzipCompressed = isGzipCompressed;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (eventsJsonPaths() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property eventsJsonPaths in model"
                            + " CodelessConnectorPollingResponseProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(CodelessConnectorPollingResponseProperties.class);
}
