![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.desktopvirtualization.models.SendMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-desktopvirtualization Show documentation
Show all versions of azure-resourcemanager-desktopvirtualization Show documentation
This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-04.
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.resourcemanager.desktopvirtualization.models;
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;
/**
* Represents message sent to a UserSession.
*/
@Fluent
public final class SendMessage implements JsonSerializable {
/*
* Title of message.
*/
private String messageTitle;
/*
* Body of message.
*/
private String messageBody;
/**
* Creates an instance of SendMessage class.
*/
public SendMessage() {
}
/**
* Get the messageTitle property: Title of message.
*
* @return the messageTitle value.
*/
public String messageTitle() {
return this.messageTitle;
}
/**
* Set the messageTitle property: Title of message.
*
* @param messageTitle the messageTitle value to set.
* @return the SendMessage object itself.
*/
public SendMessage withMessageTitle(String messageTitle) {
this.messageTitle = messageTitle;
return this;
}
/**
* Get the messageBody property: Body of message.
*
* @return the messageBody value.
*/
public String messageBody() {
return this.messageBody;
}
/**
* Set the messageBody property: Body of message.
*
* @param messageBody the messageBody value to set.
* @return the SendMessage object itself.
*/
public SendMessage withMessageBody(String messageBody) {
this.messageBody = messageBody;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("messageTitle", this.messageTitle);
jsonWriter.writeStringField("messageBody", this.messageBody);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of SendMessage from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SendMessage 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 SendMessage.
*/
public static SendMessage fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SendMessage deserializedSendMessage = new SendMessage();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("messageTitle".equals(fieldName)) {
deserializedSendMessage.messageTitle = reader.getString();
} else if ("messageBody".equals(fieldName)) {
deserializedSendMessage.messageBody = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedSendMessage;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy