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

com.azure.resourcemanager.orbital.fluent.models.ContactInner 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.orbital.models.ContactsPropertiesAntennaConfiguration;
import com.azure.resourcemanager.orbital.models.ContactsPropertiesContactProfile;
import com.azure.resourcemanager.orbital.models.ContactsPropertiesProvisioningState;
import com.azure.resourcemanager.orbital.models.ContactsStatus;
import java.io.IOException;
import java.time.OffsetDateTime;

/**
 * Customer creates a contact resource for a spacecraft resource.
 */
@Fluent
public final class ContactInner extends ProxyResource {
    /*
     * Properties of the Contact Resource.
     */
    private ContactsProperties innerProperties = new ContactsProperties();

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    private SystemData systemData;

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

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

    /**
     * Get the innerProperties property: Properties of the Contact Resource.
     * 
     * @return the innerProperties value.
     */
    private ContactsProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     * 
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the type property: The type of the resource.
     * 
     * @return the type value.
     */
    @Override
    public String type() {
        return this.type;
    }

    /**
     * Get the name property: The name of the resource.
     * 
     * @return the name value.
     */
    @Override
    public String name() {
        return this.name;
    }

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * Get the provisioningState property: The current state of the resource's creation, deletion, or modification.
     * 
     * @return the provisioningState value.
     */
    public ContactsPropertiesProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Set the provisioningState property: The current state of the resource's creation, deletion, or modification.
     * 
     * @param provisioningState the provisioningState value to set.
     * @return the ContactInner object itself.
     */
    public ContactInner withProvisioningState(ContactsPropertiesProvisioningState provisioningState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContactsProperties();
        }
        this.innerProperties().withProvisioningState(provisioningState);
        return this;
    }

    /**
     * Get the status property: Status of a contact.
     * 
     * @return the status value.
     */
    public ContactsStatus status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Get the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard).
     * 
     * @return the reservationStartTime value.
     */
    public OffsetDateTime reservationStartTime() {
        return this.innerProperties() == null ? null : this.innerProperties().reservationStartTime();
    }

    /**
     * Set the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard).
     * 
     * @param reservationStartTime the reservationStartTime value to set.
     * @return the ContactInner object itself.
     */
    public ContactInner withReservationStartTime(OffsetDateTime reservationStartTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContactsProperties();
        }
        this.innerProperties().withReservationStartTime(reservationStartTime);
        return this;
    }

    /**
     * Get the reservationEndTime property: Reservation end time of a contact (ISO 8601 UTC standard).
     * 
     * @return the reservationEndTime value.
     */
    public OffsetDateTime reservationEndTime() {
        return this.innerProperties() == null ? null : this.innerProperties().reservationEndTime();
    }

    /**
     * Set the reservationEndTime property: Reservation end time of a contact (ISO 8601 UTC standard).
     * 
     * @param reservationEndTime the reservationEndTime value to set.
     * @return the ContactInner object itself.
     */
    public ContactInner withReservationEndTime(OffsetDateTime reservationEndTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContactsProperties();
        }
        this.innerProperties().withReservationEndTime(reservationEndTime);
        return this;
    }

    /**
     * Get the rxStartTime property: Receive start time of a contact (ISO 8601 UTC standard).
     * 
     * @return the rxStartTime value.
     */
    public OffsetDateTime rxStartTime() {
        return this.innerProperties() == null ? null : this.innerProperties().rxStartTime();
    }

    /**
     * Get the rxEndTime property: Receive end time of a contact (ISO 8601 UTC standard).
     * 
     * @return the rxEndTime value.
     */
    public OffsetDateTime rxEndTime() {
        return this.innerProperties() == null ? null : this.innerProperties().rxEndTime();
    }

    /**
     * Get the txStartTime property: Transmit start time of a contact (ISO 8601 UTC standard).
     * 
     * @return the txStartTime value.
     */
    public OffsetDateTime txStartTime() {
        return this.innerProperties() == null ? null : this.innerProperties().txStartTime();
    }

    /**
     * Get the txEndTime property: Transmit end time of a contact (ISO 8601 UTC standard).
     * 
     * @return the txEndTime value.
     */
    public OffsetDateTime txEndTime() {
        return this.innerProperties() == null ? null : this.innerProperties().txEndTime();
    }

    /**
     * Get the errorMessage property: Any error message while scheduling a contact.
     * 
     * @return the errorMessage value.
     */
    public String errorMessage() {
        return this.innerProperties() == null ? null : this.innerProperties().errorMessage();
    }

    /**
     * Get the maximumElevationDegrees property: Maximum elevation of the antenna during the contact in decimal degrees.
     * 
     * @return the maximumElevationDegrees value.
     */
    public Float maximumElevationDegrees() {
        return this.innerProperties() == null ? null : this.innerProperties().maximumElevationDegrees();
    }

    /**
     * Get the startAzimuthDegrees property: Azimuth of the antenna at the start of the contact in decimal degrees.
     * 
     * @return the startAzimuthDegrees value.
     */
    public Float startAzimuthDegrees() {
        return this.innerProperties() == null ? null : this.innerProperties().startAzimuthDegrees();
    }

    /**
     * Get the endAzimuthDegrees property: Azimuth of the antenna at the end of the contact in decimal degrees.
     * 
     * @return the endAzimuthDegrees value.
     */
    public Float endAzimuthDegrees() {
        return this.innerProperties() == null ? null : this.innerProperties().endAzimuthDegrees();
    }

    /**
     * Get the groundStationName property: Azure Ground Station name.
     * 
     * @return the groundStationName value.
     */
    public String groundStationName() {
        return this.innerProperties() == null ? null : this.innerProperties().groundStationName();
    }

    /**
     * Set the groundStationName property: Azure Ground Station name.
     * 
     * @param groundStationName the groundStationName value to set.
     * @return the ContactInner object itself.
     */
    public ContactInner withGroundStationName(String groundStationName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContactsProperties();
        }
        this.innerProperties().withGroundStationName(groundStationName);
        return this;
    }

    /**
     * Get the startElevationDegrees property: Spacecraft elevation above the horizon at contact start.
     * 
     * @return the startElevationDegrees value.
     */
    public Float startElevationDegrees() {
        return this.innerProperties() == null ? null : this.innerProperties().startElevationDegrees();
    }

    /**
     * Get the endElevationDegrees property: Spacecraft elevation above the horizon at contact end.
     * 
     * @return the endElevationDegrees value.
     */
    public Float endElevationDegrees() {
        return this.innerProperties() == null ? null : this.innerProperties().endElevationDegrees();
    }

    /**
     * Get the antennaConfiguration property: The configuration associated with the allocated antenna.
     * 
     * @return the antennaConfiguration value.
     */
    public ContactsPropertiesAntennaConfiguration antennaConfiguration() {
        return this.innerProperties() == null ? null : this.innerProperties().antennaConfiguration();
    }

    /**
     * Get the contactProfile property: The reference to the contact profile resource.
     * 
     * @return the contactProfile value.
     */
    public ContactsPropertiesContactProfile contactProfile() {
        return this.innerProperties() == null ? null : this.innerProperties().contactProfile();
    }

    /**
     * Set the contactProfile property: The reference to the contact profile resource.
     * 
     * @param contactProfile the contactProfile value to set.
     * @return the ContactInner object itself.
     */
    public ContactInner withContactProfile(ContactsPropertiesContactProfile contactProfile) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContactsProperties();
        }
        this.innerProperties().withContactProfile(contactProfile);
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException("Missing required property innerProperties in model ContactInner"));
        } else {
            innerProperties().validate();
        }
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of ContactInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of ContactInner 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 ContactInner.
     */
    public static ContactInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            ContactInner deserializedContactInner = new ContactInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("id".equals(fieldName)) {
                    deserializedContactInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedContactInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedContactInner.type = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedContactInner.innerProperties = ContactsProperties.fromJson(reader);
                } else if ("systemData".equals(fieldName)) {
                    deserializedContactInner.systemData = SystemData.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedContactInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy