/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 */

package com.microsoft.azure.management.apimanagement.v2019_01_01.implementation;

import com.microsoft.azure.management.apimanagement.v2019_01_01.AlwaysLog;
import com.microsoft.azure.management.apimanagement.v2019_01_01.SamplingSettings;
import com.microsoft.azure.management.apimanagement.v2019_01_01.PipelineDiagnosticSettings;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.ProxyResource;

/**
 * Diagnostic details.
 */
@JsonFlatten
public class DiagnosticContractInner extends ProxyResource {
    /**
     * Specifies for what type of messages sampling settings should not apply.
     * Possible values include: 'allErrors'.
     */
    @JsonProperty(value = "properties.alwaysLog")
    private AlwaysLog alwaysLog;

    /**
     * Resource Id of a target logger.
     */
    @JsonProperty(value = "properties.loggerId", required = true)
    private String loggerId;

    /**
     * Sampling settings for Diagnostic.
     */
    @JsonProperty(value = "properties.sampling")
    private SamplingSettings sampling;

    /**
     * Diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
     */
    @JsonProperty(value = "properties.frontend")
    private PipelineDiagnosticSettings frontend;

    /**
     * Diagnostic settings for incoming/outgoing HTTP messages to the Backend.
     */
    @JsonProperty(value = "properties.backend")
    private PipelineDiagnosticSettings backend;

    /**
     * Whether to process Correlation Headers coming to Api Management Service.
     * Only applicable to Application Insights diagnostics. Default is true.
     */
    @JsonProperty(value = "properties.enableHttpCorrelationHeaders")
    private Boolean enableHttpCorrelationHeaders;

    /**
     * Get specifies for what type of messages sampling settings should not apply. Possible values include: 'allErrors'.
     *
     * @return the alwaysLog value
     */
    public AlwaysLog alwaysLog() {
        return this.alwaysLog;
    }

    /**
     * Set specifies for what type of messages sampling settings should not apply. Possible values include: 'allErrors'.
     *
     * @param alwaysLog the alwaysLog value to set
     * @return the DiagnosticContractInner object itself.
     */
    public DiagnosticContractInner withAlwaysLog(AlwaysLog alwaysLog) {
        this.alwaysLog = alwaysLog;
        return this;
    }

    /**
     * Get resource Id of a target logger.
     *
     * @return the loggerId value
     */
    public String loggerId() {
        return this.loggerId;
    }

    /**
     * Set resource Id of a target logger.
     *
     * @param loggerId the loggerId value to set
     * @return the DiagnosticContractInner object itself.
     */
    public DiagnosticContractInner withLoggerId(String loggerId) {
        this.loggerId = loggerId;
        return this;
    }

    /**
     * Get sampling settings for Diagnostic.
     *
     * @return the sampling value
     */
    public SamplingSettings sampling() {
        return this.sampling;
    }

    /**
     * Set sampling settings for Diagnostic.
     *
     * @param sampling the sampling value to set
     * @return the DiagnosticContractInner object itself.
     */
    public DiagnosticContractInner withSampling(SamplingSettings sampling) {
        this.sampling = sampling;
        return this;
    }

    /**
     * Get diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
     *
     * @return the frontend value
     */
    public PipelineDiagnosticSettings frontend() {
        return this.frontend;
    }

    /**
     * Set diagnostic settings for incoming/outgoing HTTP messages to the Gateway.
     *
     * @param frontend the frontend value to set
     * @return the DiagnosticContractInner object itself.
     */
    public DiagnosticContractInner withFrontend(PipelineDiagnosticSettings frontend) {
        this.frontend = frontend;
        return this;
    }

    /**
     * Get diagnostic settings for incoming/outgoing HTTP messages to the Backend.
     *
     * @return the backend value
     */
    public PipelineDiagnosticSettings backend() {
        return this.backend;
    }

    /**
     * Set diagnostic settings for incoming/outgoing HTTP messages to the Backend.
     *
     * @param backend the backend value to set
     * @return the DiagnosticContractInner object itself.
     */
    public DiagnosticContractInner withBackend(PipelineDiagnosticSettings backend) {
        this.backend = backend;
        return this;
    }

    /**
     * Get whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true.
     *
     * @return the enableHttpCorrelationHeaders value
     */
    public Boolean enableHttpCorrelationHeaders() {
        return this.enableHttpCorrelationHeaders;
    }

    /**
     * Set whether to process Correlation Headers coming to Api Management Service. Only applicable to Application Insights diagnostics. Default is true.
     *
     * @param enableHttpCorrelationHeaders the enableHttpCorrelationHeaders value to set
     * @return the DiagnosticContractInner object itself.
     */
    public DiagnosticContractInner withEnableHttpCorrelationHeaders(Boolean enableHttpCorrelationHeaders) {
        this.enableHttpCorrelationHeaders = enableHttpCorrelationHeaders;
        return this;
    }

}
