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

com.azure.messaging.eventgrid.systemevents.AcsMicrosoftTeamsAppIdentifier 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.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * A Microsoft Teams application.
 */
@Fluent
public final class AcsMicrosoftTeamsAppIdentifier implements JsonSerializable {
    /*
     * The Id of the Microsoft Teams application.
     */
    private String appId;

    /*
     * The cloud that the Microsoft Teams application belongs to. By default 'public' if missing.
     */
    private CommunicationCloudEnvironmentModel cloud;

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

    /**
     * Get the appId property: The Id of the Microsoft Teams application.
     * 
     * @return the appId value.
     */
    public String getAppId() {
        return this.appId;
    }

    /**
     * Set the appId property: The Id of the Microsoft Teams application.
     * 
     * @param appId the appId value to set.
     * @return the MicrosoftTeamsAppIdentifier object itself.
     */
    public AcsMicrosoftTeamsAppIdentifier setAppId(String appId) {
        this.appId = appId;
        return this;
    }

    /**
     * Get the cloud property: The cloud that the Microsoft Teams application belongs to. By default 'public' if
     * missing.
     * 
     * @return the cloud value.
     */
    public CommunicationCloudEnvironmentModel getCloud() {
        return this.cloud;
    }

    /**
     * Set the cloud property: The cloud that the Microsoft Teams application belongs to. By default 'public' if
     * missing.
     * 
     * @param cloud the cloud value to set.
     * @return the MicrosoftTeamsAppIdentifier object itself.
     */
    public AcsMicrosoftTeamsAppIdentifier setCloud(CommunicationCloudEnvironmentModel cloud) {
        this.cloud = cloud;
        return this;
    }

    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("appId", this.appId);
        jsonWriter.writeStringField("cloud", this.cloud == null ? null : this.cloud.toString());
        return jsonWriter.writeEndObject();
    }

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

                if ("appId".equals(fieldName)) {
                    deserializedMicrosoftTeamsAppIdentifier.appId = reader.getString();
                } else if ("cloud".equals(fieldName)) {
                    deserializedMicrosoftTeamsAppIdentifier.cloud
                        = CommunicationCloudEnvironmentModel.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMicrosoftTeamsAppIdentifier;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy