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

package com.azure.resourcemanager.mobilenetwork.models;

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

/** Aggregate maximum bit rate. */
@Fluent
public final class Ambr {
    /*
     * Uplink bit rate.
     */
    @JsonProperty(value = "uplink", required = true)
    private String uplink;

    /*
     * Downlink bit rate.
     */
    @JsonProperty(value = "downlink", required = true)
    private String downlink;

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

    /**
     * Get the uplink property: Uplink bit rate.
     *
     * @return the uplink value.
     */
    public String uplink() {
        return this.uplink;
    }

    /**
     * Set the uplink property: Uplink bit rate.
     *
     * @param uplink the uplink value to set.
     * @return the Ambr object itself.
     */
    public Ambr withUplink(String uplink) {
        this.uplink = uplink;
        return this;
    }

    /**
     * Get the downlink property: Downlink bit rate.
     *
     * @return the downlink value.
     */
    public String downlink() {
        return this.downlink;
    }

    /**
     * Set the downlink property: Downlink bit rate.
     *
     * @param downlink the downlink value to set.
     * @return the Ambr object itself.
     */
    public Ambr withDownlink(String downlink) {
        this.downlink = downlink;
        return this;
    }

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

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