// 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 delimiter override settings. */
@Fluent
public final class EdifactDelimiterOverride {
    /*
     * The message id.
     */
    @JsonProperty(value = "messageId")
    private String messageId;

    /*
     * The message version.
     */
    @JsonProperty(value = "messageVersion")
    private String messageVersion;

    /*
     * The message release.
     */
    @JsonProperty(value = "messageRelease")
    private String messageRelease;

    /*
     * The data element separator.
     */
    @JsonProperty(value = "dataElementSeparator", required = true)
    private int dataElementSeparator;

    /*
     * The component separator.
     */
    @JsonProperty(value = "componentSeparator", required = true)
    private int componentSeparator;

    /*
     * The segment terminator.
     */
    @JsonProperty(value = "segmentTerminator", required = true)
    private int segmentTerminator;

    /*
     * The repetition separator.
     */
    @JsonProperty(value = "repetitionSeparator", required = true)
    private int repetitionSeparator;

    /*
     * The segment terminator suffix.
     */
    @JsonProperty(value = "segmentTerminatorSuffix", required = true)
    private SegmentTerminatorSuffix segmentTerminatorSuffix;

    /*
     * The decimal point indicator.
     */
    @JsonProperty(value = "decimalPointIndicator", required = true)
    private EdifactDecimalIndicator decimalPointIndicator;

    /*
     * The release indicator.
     */
    @JsonProperty(value = "releaseIndicator", required = true)
    private int releaseIndicator;

    /*
     * The message association assigned code.
     */
    @JsonProperty(value = "messageAssociationAssignedCode")
    private String messageAssociationAssignedCode;

    /*
     * The target namespace on which this delimiter settings has to be applied.
     */
    @JsonProperty(value = "targetNamespace")
    private String targetNamespace;

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

    /**
     * Get the messageId property: The message id.
     *
     * @return the messageId value.
     */
    public String messageId() {
        return this.messageId;
    }

    /**
     * Set the messageId property: The message id.
     *
     * @param messageId the messageId value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withMessageId(String messageId) {
        this.messageId = messageId;
        return this;
    }

    /**
     * Get the messageVersion property: The message version.
     *
     * @return the messageVersion value.
     */
    public String messageVersion() {
        return this.messageVersion;
    }

    /**
     * Set the messageVersion property: The message version.
     *
     * @param messageVersion the messageVersion value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withMessageVersion(String messageVersion) {
        this.messageVersion = messageVersion;
        return this;
    }

    /**
     * Get the messageRelease property: The message release.
     *
     * @return the messageRelease value.
     */
    public String messageRelease() {
        return this.messageRelease;
    }

    /**
     * Set the messageRelease property: The message release.
     *
     * @param messageRelease the messageRelease value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withMessageRelease(String messageRelease) {
        this.messageRelease = messageRelease;
        return this;
    }

    /**
     * Get the dataElementSeparator property: The data element separator.
     *
     * @return the dataElementSeparator value.
     */
    public int dataElementSeparator() {
        return this.dataElementSeparator;
    }

    /**
     * Set the dataElementSeparator property: The data element separator.
     *
     * @param dataElementSeparator the dataElementSeparator value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withDataElementSeparator(int dataElementSeparator) {
        this.dataElementSeparator = dataElementSeparator;
        return this;
    }

    /**
     * Get the componentSeparator property: The component separator.
     *
     * @return the componentSeparator value.
     */
    public int componentSeparator() {
        return this.componentSeparator;
    }

    /**
     * Set the componentSeparator property: The component separator.
     *
     * @param componentSeparator the componentSeparator value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withComponentSeparator(int componentSeparator) {
        this.componentSeparator = componentSeparator;
        return this;
    }

    /**
     * Get the segmentTerminator property: The segment terminator.
     *
     * @return the segmentTerminator value.
     */
    public int segmentTerminator() {
        return this.segmentTerminator;
    }

    /**
     * Set the segmentTerminator property: The segment terminator.
     *
     * @param segmentTerminator the segmentTerminator value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withSegmentTerminator(int segmentTerminator) {
        this.segmentTerminator = segmentTerminator;
        return this;
    }

    /**
     * Get the repetitionSeparator property: The repetition separator.
     *
     * @return the repetitionSeparator value.
     */
    public int repetitionSeparator() {
        return this.repetitionSeparator;
    }

    /**
     * Set the repetitionSeparator property: The repetition separator.
     *
     * @param repetitionSeparator the repetitionSeparator value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withRepetitionSeparator(int repetitionSeparator) {
        this.repetitionSeparator = repetitionSeparator;
        return this;
    }

    /**
     * Get the segmentTerminatorSuffix property: The segment terminator suffix.
     *
     * @return the segmentTerminatorSuffix value.
     */
    public SegmentTerminatorSuffix segmentTerminatorSuffix() {
        return this.segmentTerminatorSuffix;
    }

    /**
     * Set the segmentTerminatorSuffix property: The segment terminator suffix.
     *
     * @param segmentTerminatorSuffix the segmentTerminatorSuffix value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withSegmentTerminatorSuffix(SegmentTerminatorSuffix segmentTerminatorSuffix) {
        this.segmentTerminatorSuffix = segmentTerminatorSuffix;
        return this;
    }

    /**
     * Get the decimalPointIndicator property: The decimal point indicator.
     *
     * @return the decimalPointIndicator value.
     */
    public EdifactDecimalIndicator decimalPointIndicator() {
        return this.decimalPointIndicator;
    }

    /**
     * Set the decimalPointIndicator property: The decimal point indicator.
     *
     * @param decimalPointIndicator the decimalPointIndicator value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withDecimalPointIndicator(EdifactDecimalIndicator decimalPointIndicator) {
        this.decimalPointIndicator = decimalPointIndicator;
        return this;
    }

    /**
     * Get the releaseIndicator property: The release indicator.
     *
     * @return the releaseIndicator value.
     */
    public int releaseIndicator() {
        return this.releaseIndicator;
    }

    /**
     * Set the releaseIndicator property: The release indicator.
     *
     * @param releaseIndicator the releaseIndicator value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withReleaseIndicator(int releaseIndicator) {
        this.releaseIndicator = releaseIndicator;
        return this;
    }

    /**
     * Get the messageAssociationAssignedCode property: The message association assigned code.
     *
     * @return the messageAssociationAssignedCode value.
     */
    public String messageAssociationAssignedCode() {
        return this.messageAssociationAssignedCode;
    }

    /**
     * Set the messageAssociationAssignedCode property: The message association assigned code.
     *
     * @param messageAssociationAssignedCode the messageAssociationAssignedCode value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withMessageAssociationAssignedCode(String messageAssociationAssignedCode) {
        this.messageAssociationAssignedCode = messageAssociationAssignedCode;
        return this;
    }

    /**
     * Get the targetNamespace property: The target namespace on which this delimiter settings has to be applied.
     *
     * @return the targetNamespace value.
     */
    public String targetNamespace() {
        return this.targetNamespace;
    }

    /**
     * Set the targetNamespace property: The target namespace on which this delimiter settings has to be applied.
     *
     * @param targetNamespace the targetNamespace value to set.
     * @return the EdifactDelimiterOverride object itself.
     */
    public EdifactDelimiterOverride withTargetNamespace(String targetNamespace) {
        this.targetNamespace = targetNamespace;
        return this;
    }

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

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