All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.orbital.models.ContactProfileLink Maven / Gradle / Ivy

// 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.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.List;

/**
 * Contact Profile Link.
 */
@Fluent
public final class ContactProfileLink implements JsonSerializable {
    /*
     * Link name.
     */
    private String name;

    /*
     * Polarization. e.g. (RHCP, LHCP).
     */
    private Polarization polarization;

    /*
     * Direction (Uplink or Downlink).
     */
    private Direction direction;

    /*
     * Gain to noise temperature in db/K. It is the required G/T by the customer. Not used yet.
     */
    private Float gainOverTemperature;

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

    /*
     * Contact Profile Link Channel.
     */
    private List 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 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 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.atError()
                .log(new IllegalArgumentException("Missing required property name in model ContactProfileLink"));
        }
        if (polarization() == null) {
            throw LOGGER.atError()
                .log(
                    new IllegalArgumentException("Missing required property polarization in model ContactProfileLink"));
        }
        if (direction() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException("Missing required property direction in model ContactProfileLink"));
        }
        if (channels() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException("Missing required property channels in model ContactProfileLink"));
        } else {
            channels().forEach(e -> e.validate());
        }
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("name", this.name);
        jsonWriter.writeStringField("polarization", this.polarization == null ? null : this.polarization.toString());
        jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString());
        jsonWriter.writeArrayField("channels", this.channels, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeNumberField("gainOverTemperature", this.gainOverTemperature);
        jsonWriter.writeNumberField("eirpdBW", this.eirpdBW);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of ContactProfileLink from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ContactProfileLink if the JsonReader was pointing to an instance of it, or null if it was
     * pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the ContactProfileLink.
     */
    public static ContactProfileLink fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ContactProfileLink deserializedContactProfileLink = new ContactProfileLink();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("name".equals(fieldName)) {
                    deserializedContactProfileLink.name = reader.getString();
                } else if ("polarization".equals(fieldName)) {
                    deserializedContactProfileLink.polarization = Polarization.fromString(reader.getString());
                } else if ("direction".equals(fieldName)) {
                    deserializedContactProfileLink.direction = Direction.fromString(reader.getString());
                } else if ("channels".equals(fieldName)) {
                    List channels
                        = reader.readArray(reader1 -> ContactProfileLinkChannel.fromJson(reader1));
                    deserializedContactProfileLink.channels = channels;
                } else if ("gainOverTemperature".equals(fieldName)) {
                    deserializedContactProfileLink.gainOverTemperature = reader.getNullable(JsonReader::getFloat);
                } else if ("eirpdBW".equals(fieldName)) {
                    deserializedContactProfileLink.eirpdBW = reader.getNullable(JsonReader::getFloat);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedContactProfileLink;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy