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

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

There is a newer version: 4.27.0
Show 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.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.Map;

/**
 * Schema of common properties of all Router Job events.
 */
@Fluent
public class AcsRouterJobEventData extends AcsRouterEventData {
    /*
     * Router Job events Queue Id
     */
    private String queueId;

    /*
     * Router Job events Labels
     */
    private Map labels;

    /*
     * Router Jobs events Tags
     */
    private Map tags;

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

    /**
     * Get the queueId property: Router Job events Queue Id.
     * 
     * @return the queueId value.
     */
    public String getQueueId() {
        return this.queueId;
    }

    /**
     * Set the queueId property: Router Job events Queue Id.
     * 
     * @param queueId the queueId value to set.
     * @return the AcsRouterJobEventData object itself.
     */
    public AcsRouterJobEventData setQueueId(String queueId) {
        this.queueId = queueId;
        return this;
    }

    /**
     * Get the labels property: Router Job events Labels.
     * 
     * @return the labels value.
     */
    public Map getLabels() {
        return this.labels;
    }

    /**
     * Set the labels property: Router Job events Labels.
     * 
     * @param labels the labels value to set.
     * @return the AcsRouterJobEventData object itself.
     */
    public AcsRouterJobEventData setLabels(Map labels) {
        this.labels = labels;
        return this;
    }

    /**
     * Get the tags property: Router Jobs events Tags.
     * 
     * @return the tags value.
     */
    public Map getTags() {
        return this.tags;
    }

    /**
     * Set the tags property: Router Jobs events Tags.
     * 
     * @param tags the tags value to set.
     * @return the AcsRouterJobEventData object itself.
     */
    public AcsRouterJobEventData setTags(Map tags) {
        this.tags = tags;
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AcsRouterJobEventData setJobId(String jobId) {
        super.setJobId(jobId);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AcsRouterJobEventData setChannelReference(String channelReference) {
        super.setChannelReference(channelReference);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public AcsRouterJobEventData setChannelId(String channelId) {
        super.setChannelId(channelId);
        return this;
    }

    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("jobId", getJobId());
        jsonWriter.writeStringField("channelReference", getChannelReference());
        jsonWriter.writeStringField("channelId", getChannelId());
        jsonWriter.writeStringField("queueId", this.queueId);
        jsonWriter.writeMapField("labels", this.labels, (writer, element) -> writer.writeString(element));
        jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("jobId".equals(fieldName)) {
                    deserializedAcsRouterJobEventData.setJobId(reader.getString());
                } else if ("channelReference".equals(fieldName)) {
                    deserializedAcsRouterJobEventData.setChannelReference(reader.getString());
                } else if ("channelId".equals(fieldName)) {
                    deserializedAcsRouterJobEventData.setChannelId(reader.getString());
                } else if ("queueId".equals(fieldName)) {
                    deserializedAcsRouterJobEventData.queueId = reader.getString();
                } else if ("labels".equals(fieldName)) {
                    Map labels = reader.readMap(reader1 -> reader1.getString());
                    deserializedAcsRouterJobEventData.labels = labels;
                } else if ("tags".equals(fieldName)) {
                    Map tags = reader.readMap(reader1 -> reader1.getString());
                    deserializedAcsRouterJobEventData.tags = tags;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAcsRouterJobEventData;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy