// 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.azure.resourcemanager.apimanagement.fluent.models.LoggerUpdateParameters;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Logger update contract. */
@Fluent
public final class LoggerUpdateContract {
    /*
     * Logger entity update contract properties.
     */
    @JsonProperty(value = "properties")
    private LoggerUpdateParameters innerProperties;

    /**
     * Get the innerProperties property: Logger entity update contract properties.
     *
     * @return the innerProperties value.
     */
    private LoggerUpdateParameters innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the loggerType property: Logger type.
     *
     * @return the loggerType value.
     */
    public LoggerType loggerType() {
        return this.innerProperties() == null ? null : this.innerProperties().loggerType();
    }

    /**
     * Set the loggerType property: Logger type.
     *
     * @param loggerType the loggerType value to set.
     * @return the LoggerUpdateContract object itself.
     */
    public LoggerUpdateContract withLoggerType(LoggerType loggerType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LoggerUpdateParameters();
        }
        this.innerProperties().withLoggerType(loggerType);
        return this;
    }

    /**
     * Get the description property: Logger description.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Logger description.
     *
     * @param description the description value to set.
     * @return the LoggerUpdateContract object itself.
     */
    public LoggerUpdateContract withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LoggerUpdateParameters();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the credentials property: Logger credentials.
     *
     * @return the credentials value.
     */
    public Map<String, String> credentials() {
        return this.innerProperties() == null ? null : this.innerProperties().credentials();
    }

    /**
     * Set the credentials property: Logger credentials.
     *
     * @param credentials the credentials value to set.
     * @return the LoggerUpdateContract object itself.
     */
    public LoggerUpdateContract withCredentials(Map<String, String> credentials) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LoggerUpdateParameters();
        }
        this.innerProperties().withCredentials(credentials);
        return this;
    }

    /**
     * Get the isBuffered property: Whether records are buffered in the logger before publishing. Default is assumed to
     * be true.
     *
     * @return the isBuffered value.
     */
    public Boolean isBuffered() {
        return this.innerProperties() == null ? null : this.innerProperties().isBuffered();
    }

    /**
     * Set the isBuffered property: Whether records are buffered in the logger before publishing. Default is assumed to
     * be true.
     *
     * @param isBuffered the isBuffered value to set.
     * @return the LoggerUpdateContract object itself.
     */
    public LoggerUpdateContract withIsBuffered(Boolean isBuffered) {
        if (this.innerProperties() == null) {
            this.innerProperties = new LoggerUpdateParameters();
        }
        this.innerProperties().withIsBuffered(isBuffered);
        return this;
    }

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