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

package com.azure.resourcemanager.orbital.models;

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

/** Contact Profile Link. */
@Fluent
public final class ContactProfileLink {
    /*
     * Link name.
     */
    @JsonProperty(value = "name", required = true)
    private String name;

    /*
     * Polarization. e.g. (RHCP, LHCP).
     */
    @JsonProperty(value = "polarization", required = true)
    private Polarization polarization;

    /*
     * Direction (Uplink or Downlink).
     */
    @JsonProperty(value = "direction", required = true)
    private Direction direction;

    /*
     * Gain to noise temperature in db/K. It is the required G/T by the customer. Not used yet.
     */
    @JsonProperty(value = "gainOverTemperature")
    private Float gainOverTemperature;

    /*
     * Effective Isotropic Radiated Power (EIRP) in dBW. It is the required EIRP by the customer. Not used yet.
     */
    @JsonProperty(value = "eirpdBW")
    private Float eirpdBW;

    /*
     * Contact Profile Link Channel.
     */
    @JsonProperty(value = "channels", required = true)
    private List<ContactProfileLinkChannel> channels;

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

    /**
     * Get the name property: Link name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Link name.
     *
     * @param name the name value to set.
     * @return the ContactProfileLink object itself.
     */
    public ContactProfileLink withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the polarization property: Polarization. e.g. (RHCP, LHCP).
     *
     * @return the polarization value.
     */
    public Polarization polarization() {
        return this.polarization;
    }

    /**
     * Set the polarization property: Polarization. e.g. (RHCP, LHCP).
     *
     * @param polarization the polarization value to set.
     * @return the ContactProfileLink object itself.
     */
    public ContactProfileLink withPolarization(Polarization polarization) {
        this.polarization = polarization;
        return this;
    }

    /**
     * Get the direction property: Direction (Uplink or Downlink).
     *
     * @return the direction value.
     */
    public Direction direction() {
        return this.direction;
    }

    /**
     * Set the direction property: Direction (Uplink or Downlink).
     *
     * @param direction the direction value to set.
     * @return the ContactProfileLink object itself.
     */
    public ContactProfileLink withDirection(Direction direction) {
        this.direction = direction;
        return this;
    }

    /**
     * Get the gainOverTemperature property: Gain to noise temperature in db/K. It is the required G/T by the customer.
     * Not used yet.
     *
     * @return the gainOverTemperature value.
     */
    public Float gainOverTemperature() {
        return this.gainOverTemperature;
    }

    /**
     * Set the gainOverTemperature property: Gain to noise temperature in db/K. It is the required G/T by the customer.
     * Not used yet.
     *
     * @param gainOverTemperature the gainOverTemperature value to set.
     * @return the ContactProfileLink object itself.
     */
    public ContactProfileLink withGainOverTemperature(Float gainOverTemperature) {
        this.gainOverTemperature = gainOverTemperature;
        return this;
    }

    /**
     * Get the eirpdBW property: Effective Isotropic Radiated Power (EIRP) in dBW. It is the required EIRP by the
     * customer. Not used yet.
     *
     * @return the eirpdBW value.
     */
    public Float eirpdBW() {
        return this.eirpdBW;
    }

    /**
     * Set the eirpdBW property: Effective Isotropic Radiated Power (EIRP) in dBW. It is the required EIRP by the
     * customer. Not used yet.
     *
     * @param eirpdBW the eirpdBW value to set.
     * @return the ContactProfileLink object itself.
     */
    public ContactProfileLink withEirpdBW(Float eirpdBW) {
        this.eirpdBW = eirpdBW;
        return this;
    }

    /**
     * Get the channels property: Contact Profile Link Channel.
     *
     * @return the channels value.
     */
    public List<ContactProfileLinkChannel> channels() {
        return this.channels;
    }

    /**
     * Set the channels property: Contact Profile Link Channel.
     *
     * @param channels the channels value to set.
     * @return the ContactProfileLink object itself.
     */
    public ContactProfileLink withChannels(List<ContactProfileLinkChannel> channels) {
        this.channels = channels;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (name() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property name in model ContactProfileLink"));
        }
        if (polarization() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property polarization in model ContactProfileLink"));
        }
        if (direction() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property direction in model ContactProfileLink"));
        }
        if (channels() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property channels in model ContactProfileLink"));
        } else {
            channels().forEach(e -> e.validate());
        }
    }

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