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

package com.azure.resourcemanager.logic.models;

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

/** The Edifact validation override settings. */
@Fluent
public final class EdifactValidationOverride {
    /*
     * The message id on which the validation settings has to be applied.
     */
    @JsonProperty(value = "messageId", required = true)
    private String messageId;

    /*
     * The value indicating whether to validate character Set.
     */
    @JsonProperty(value = "enforceCharacterSet", required = true)
    private boolean enforceCharacterSet;

    /*
     * The value indicating whether to validate EDI types.
     */
    @JsonProperty(value = "validateEDITypes", required = true)
    private boolean validateEdiTypes;

    /*
     * The value indicating whether to validate XSD types.
     */
    @JsonProperty(value = "validateXSDTypes", required = true)
    private boolean validateXsdTypes;

    /*
     * The value indicating whether to allow leading and trailing spaces and zeroes.
     */
    @JsonProperty(value = "allowLeadingAndTrailingSpacesAndZeroes", required = true)
    private boolean allowLeadingAndTrailingSpacesAndZeroes;

    /*
     * The trailing separator policy.
     */
    @JsonProperty(value = "trailingSeparatorPolicy", required = true)
    private TrailingSeparatorPolicy trailingSeparatorPolicy;

    /*
     * The value indicating whether to trim leading and trailing spaces and zeroes.
     */
    @JsonProperty(value = "trimLeadingAndTrailingSpacesAndZeroes", required = true)
    private boolean trimLeadingAndTrailingSpacesAndZeroes;

    /** Creates an instance of EdifactValidationOverride class. */
    public EdifactValidationOverride() {
    }

    /**
     * Get the messageId property: The message id on which the validation settings has to be applied.
     *
     * @return the messageId value.
     */
    public String messageId() {
        return this.messageId;
    }

    /**
     * Set the messageId property: The message id on which the validation settings has to be applied.
     *
     * @param messageId the messageId value to set.
     * @return the EdifactValidationOverride object itself.
     */
    public EdifactValidationOverride withMessageId(String messageId) {
        this.messageId = messageId;
        return this;
    }

    /**
     * Get the enforceCharacterSet property: The value indicating whether to validate character Set.
     *
     * @return the enforceCharacterSet value.
     */
    public boolean enforceCharacterSet() {
        return this.enforceCharacterSet;
    }

    /**
     * Set the enforceCharacterSet property: The value indicating whether to validate character Set.
     *
     * @param enforceCharacterSet the enforceCharacterSet value to set.
     * @return the EdifactValidationOverride object itself.
     */
    public EdifactValidationOverride withEnforceCharacterSet(boolean enforceCharacterSet) {
        this.enforceCharacterSet = enforceCharacterSet;
        return this;
    }

    /**
     * Get the validateEdiTypes property: The value indicating whether to validate EDI types.
     *
     * @return the validateEdiTypes value.
     */
    public boolean validateEdiTypes() {
        return this.validateEdiTypes;
    }

    /**
     * Set the validateEdiTypes property: The value indicating whether to validate EDI types.
     *
     * @param validateEdiTypes the validateEdiTypes value to set.
     * @return the EdifactValidationOverride object itself.
     */
    public EdifactValidationOverride withValidateEdiTypes(boolean validateEdiTypes) {
        this.validateEdiTypes = validateEdiTypes;
        return this;
    }

    /**
     * Get the validateXsdTypes property: The value indicating whether to validate XSD types.
     *
     * @return the validateXsdTypes value.
     */
    public boolean validateXsdTypes() {
        return this.validateXsdTypes;
    }

    /**
     * Set the validateXsdTypes property: The value indicating whether to validate XSD types.
     *
     * @param validateXsdTypes the validateXsdTypes value to set.
     * @return the EdifactValidationOverride object itself.
     */
    public EdifactValidationOverride withValidateXsdTypes(boolean validateXsdTypes) {
        this.validateXsdTypes = validateXsdTypes;
        return this;
    }

    /**
     * Get the allowLeadingAndTrailingSpacesAndZeroes property: The value indicating whether to allow leading and
     * trailing spaces and zeroes.
     *
     * @return the allowLeadingAndTrailingSpacesAndZeroes value.
     */
    public boolean allowLeadingAndTrailingSpacesAndZeroes() {
        return this.allowLeadingAndTrailingSpacesAndZeroes;
    }

    /**
     * Set the allowLeadingAndTrailingSpacesAndZeroes property: The value indicating whether to allow leading and
     * trailing spaces and zeroes.
     *
     * @param allowLeadingAndTrailingSpacesAndZeroes the allowLeadingAndTrailingSpacesAndZeroes value to set.
     * @return the EdifactValidationOverride object itself.
     */
    public EdifactValidationOverride withAllowLeadingAndTrailingSpacesAndZeroes(
        boolean allowLeadingAndTrailingSpacesAndZeroes) {
        this.allowLeadingAndTrailingSpacesAndZeroes = allowLeadingAndTrailingSpacesAndZeroes;
        return this;
    }

    /**
     * Get the trailingSeparatorPolicy property: The trailing separator policy.
     *
     * @return the trailingSeparatorPolicy value.
     */
    public TrailingSeparatorPolicy trailingSeparatorPolicy() {
        return this.trailingSeparatorPolicy;
    }

    /**
     * Set the trailingSeparatorPolicy property: The trailing separator policy.
     *
     * @param trailingSeparatorPolicy the trailingSeparatorPolicy value to set.
     * @return the EdifactValidationOverride object itself.
     */
    public EdifactValidationOverride withTrailingSeparatorPolicy(TrailingSeparatorPolicy trailingSeparatorPolicy) {
        this.trailingSeparatorPolicy = trailingSeparatorPolicy;
        return this;
    }

    /**
     * Get the trimLeadingAndTrailingSpacesAndZeroes property: The value indicating whether to trim leading and trailing
     * spaces and zeroes.
     *
     * @return the trimLeadingAndTrailingSpacesAndZeroes value.
     */
    public boolean trimLeadingAndTrailingSpacesAndZeroes() {
        return this.trimLeadingAndTrailingSpacesAndZeroes;
    }

    /**
     * Set the trimLeadingAndTrailingSpacesAndZeroes property: The value indicating whether to trim leading and trailing
     * spaces and zeroes.
     *
     * @param trimLeadingAndTrailingSpacesAndZeroes the trimLeadingAndTrailingSpacesAndZeroes value to set.
     * @return the EdifactValidationOverride object itself.
     */
    public EdifactValidationOverride withTrimLeadingAndTrailingSpacesAndZeroes(
        boolean trimLeadingAndTrailingSpacesAndZeroes) {
        this.trimLeadingAndTrailingSpacesAndZeroes = trimLeadingAndTrailingSpacesAndZeroes;
        return this;
    }

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

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