// 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 agreement framing settings. */
@Fluent
public final class EdifactFramingSettings {
    /*
     * The service code list directory version.
     */
    @JsonProperty(value = "serviceCodeListDirectoryVersion")
    private String serviceCodeListDirectoryVersion;

    /*
     * The character encoding.
     */
    @JsonProperty(value = "characterEncoding")
    private String characterEncoding;

    /*
     * The protocol version.
     */
    @JsonProperty(value = "protocolVersion", required = true)
    private int protocolVersion;

    /*
     * 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 release indicator.
     */
    @JsonProperty(value = "releaseIndicator", required = true)
    private int releaseIndicator;

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

    /*
     * The EDIFACT frame setting characterSet.
     */
    @JsonProperty(value = "characterSet", required = true)
    private EdifactCharacterSet characterSet;

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

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

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

    /**
     * Get the serviceCodeListDirectoryVersion property: The service code list directory version.
     *
     * @return the serviceCodeListDirectoryVersion value.
     */
    public String serviceCodeListDirectoryVersion() {
        return this.serviceCodeListDirectoryVersion;
    }

    /**
     * Set the serviceCodeListDirectoryVersion property: The service code list directory version.
     *
     * @param serviceCodeListDirectoryVersion the serviceCodeListDirectoryVersion value to set.
     * @return the EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings withServiceCodeListDirectoryVersion(String serviceCodeListDirectoryVersion) {
        this.serviceCodeListDirectoryVersion = serviceCodeListDirectoryVersion;
        return this;
    }

    /**
     * Get the characterEncoding property: The character encoding.
     *
     * @return the characterEncoding value.
     */
    public String characterEncoding() {
        return this.characterEncoding;
    }

    /**
     * Set the characterEncoding property: The character encoding.
     *
     * @param characterEncoding the characterEncoding value to set.
     * @return the EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings withCharacterEncoding(String characterEncoding) {
        this.characterEncoding = characterEncoding;
        return this;
    }

    /**
     * Get the protocolVersion property: The protocol version.
     *
     * @return the protocolVersion value.
     */
    public int protocolVersion() {
        return this.protocolVersion;
    }

    /**
     * Set the protocolVersion property: The protocol version.
     *
     * @param protocolVersion the protocolVersion value to set.
     * @return the EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings withProtocolVersion(int protocolVersion) {
        this.protocolVersion = protocolVersion;
        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 EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings 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 EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings 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 EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings withSegmentTerminator(int segmentTerminator) {
        this.segmentTerminator = segmentTerminator;
        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 EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings withReleaseIndicator(int releaseIndicator) {
        this.releaseIndicator = releaseIndicator;
        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 EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings withRepetitionSeparator(int repetitionSeparator) {
        this.repetitionSeparator = repetitionSeparator;
        return this;
    }

    /**
     * Get the characterSet property: The EDIFACT frame setting characterSet.
     *
     * @return the characterSet value.
     */
    public EdifactCharacterSet characterSet() {
        return this.characterSet;
    }

    /**
     * Set the characterSet property: The EDIFACT frame setting characterSet.
     *
     * @param characterSet the characterSet value to set.
     * @return the EdifactFramingSettings object itself.
     */
    public EdifactFramingSettings withCharacterSet(EdifactCharacterSet characterSet) {
        this.characterSet = characterSet;
        return this;
    }

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

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

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

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

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

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