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

com.azure.messaging.eventgrid.systemevents.AcsEmailDeliveryReportStatusDetails 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.messaging.eventgrid.systemevents;

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

/**
 * Detailed information about the status if any.
 */
@Fluent
public final class AcsEmailDeliveryReportStatusDetails
    implements JsonSerializable {
    /*
     * Detailed status message
     */
    private String statusMessage;

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

    /**
     * Get the statusMessage property: Detailed status message.
     * 
     * @return the statusMessage value.
     */
    public String getStatusMessage() {
        return this.statusMessage;
    }

    /**
     * Set the statusMessage property: Detailed status message.
     * 
     * @param statusMessage the statusMessage value to set.
     * @return the AcsEmailDeliveryReportStatusDetails object itself.
     */
    public AcsEmailDeliveryReportStatusDetails setStatusMessage(String statusMessage) {
        this.statusMessage = statusMessage;
        return this;
    }

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

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

                if ("statusMessage".equals(fieldName)) {
                    deserializedAcsEmailDeliveryReportStatusDetails.statusMessage = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAcsEmailDeliveryReportStatusDetails;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy