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

com.azure.messaging.eventgrid.systemevents.MediaLiveEventEncoderConnectedEventData Maven / Gradle / Ivy

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

package com.azure.messaging.eventgrid.systemevents;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Encoder connect event data. Schema of the data property of an EventGridEvent for a
 * Microsoft.Media.LiveEventEncoderConnected event.
 */
@Immutable
public final class MediaLiveEventEncoderConnectedEventData
    implements JsonSerializable {
    /*
     * Gets the ingest URL provided by the live event.
     */
    private String ingestUrl;

    /*
     * Gets the stream Id.
     */
    private String streamId;

    /*
     * Gets the remote IP.
     */
    private String encoderIp;

    /*
     * Gets the remote port.
     */
    private String encoderPort;

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

    /**
     * Get the ingestUrl property: Gets the ingest URL provided by the live event.
     * 
     * @return the ingestUrl value.
     */
    public String getIngestUrl() {
        return this.ingestUrl;
    }

    /**
     * Get the streamId property: Gets the stream Id.
     * 
     * @return the streamId value.
     */
    public String getStreamId() {
        return this.streamId;
    }

    /**
     * Get the encoderIp property: Gets the remote IP.
     * 
     * @return the encoderIp value.
     */
    public String getEncoderIp() {
        return this.encoderIp;
    }

    /**
     * Get the encoderPort property: Gets the remote port.
     * 
     * @return the encoderPort value.
     */
    public String getEncoderPort() {
        return this.encoderPort;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        return jsonWriter.writeEndObject();
    }

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

                if ("ingestUrl".equals(fieldName)) {
                    deserializedMediaLiveEventEncoderConnectedEventData.ingestUrl = reader.getString();
                } else if ("streamId".equals(fieldName)) {
                    deserializedMediaLiveEventEncoderConnectedEventData.streamId = reader.getString();
                } else if ("encoderIp".equals(fieldName)) {
                    deserializedMediaLiveEventEncoderConnectedEventData.encoderIp = reader.getString();
                } else if ("encoderPort".equals(fieldName)) {
                    deserializedMediaLiveEventEncoderConnectedEventData.encoderPort = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMediaLiveEventEncoderConnectedEventData;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy