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

package com.azure.resourcemanager.apimanagement.models;

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

/** Http message diagnostic settings. */
@Fluent
public final class HttpMessageDiagnostic {
    /*
     * Array of HTTP Headers to log.
     */
    @JsonProperty(value = "headers")
    private List<String> headers;

    /*
     * Body logging settings.
     */
    @JsonProperty(value = "body")
    private BodyDiagnosticSettings body;

    /*
     * Data masking settings.
     */
    @JsonProperty(value = "dataMasking")
    private DataMasking dataMasking;

    /**
     * Get the headers property: Array of HTTP Headers to log.
     *
     * @return the headers value.
     */
    public List<String> headers() {
        return this.headers;
    }

    /**
     * Set the headers property: Array of HTTP Headers to log.
     *
     * @param headers the headers value to set.
     * @return the HttpMessageDiagnostic object itself.
     */
    public HttpMessageDiagnostic withHeaders(List<String> headers) {
        this.headers = headers;
        return this;
    }

    /**
     * Get the body property: Body logging settings.
     *
     * @return the body value.
     */
    public BodyDiagnosticSettings body() {
        return this.body;
    }

    /**
     * Set the body property: Body logging settings.
     *
     * @param body the body value to set.
     * @return the HttpMessageDiagnostic object itself.
     */
    public HttpMessageDiagnostic withBody(BodyDiagnosticSettings body) {
        this.body = body;
        return this;
    }

    /**
     * Get the dataMasking property: Data masking settings.
     *
     * @return the dataMasking value.
     */
    public DataMasking dataMasking() {
        return this.dataMasking;
    }

    /**
     * Set the dataMasking property: Data masking settings.
     *
     * @param dataMasking the dataMasking value to set.
     * @return the HttpMessageDiagnostic object itself.
     */
    public HttpMessageDiagnostic withDataMasking(DataMasking dataMasking) {
        this.dataMasking = dataMasking;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (body() != null) {
            body().validate();
        }
        if (dataMasking() != null) {
            dataMasking().validate();
        }
    }
}
