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

com.azure.resourcemanager.botservice.models.MsTeamsChannelProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for BotService Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Bot Service is a platform for creating smart conversational agents. Package tag package-2021-03-01.

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.botservice.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;

/**
 * The parameters to provide for the Microsoft Teams channel.
 */
@Fluent
public final class MsTeamsChannelProperties implements JsonSerializable {
    /*
     * Enable calling for Microsoft Teams channel
     */
    private Boolean enableCalling;

    /*
     * Webhook for Microsoft Teams channel calls
     */
    private String callingWebhook;

    /*
     * Whether this channel is enabled for the bot
     */
    private boolean isEnabled;

    /*
     * Webhook for Microsoft Teams channel calls
     */
    private String incomingCallRoute;

    /*
     * Deployment environment for Microsoft Teams channel calls
     */
    private String deploymentEnvironment;

    /*
     * Whether this channel accepted terms
     */
    private Boolean acceptedTerms;

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

    /**
     * Get the enableCalling property: Enable calling for Microsoft Teams channel.
     * 
     * @return the enableCalling value.
     */
    public Boolean enableCalling() {
        return this.enableCalling;
    }

    /**
     * Set the enableCalling property: Enable calling for Microsoft Teams channel.
     * 
     * @param enableCalling the enableCalling value to set.
     * @return the MsTeamsChannelProperties object itself.
     */
    public MsTeamsChannelProperties withEnableCalling(Boolean enableCalling) {
        this.enableCalling = enableCalling;
        return this;
    }

    /**
     * Get the callingWebhook property: Webhook for Microsoft Teams channel calls.
     * 
     * @return the callingWebhook value.
     */
    public String callingWebhook() {
        return this.callingWebhook;
    }

    /**
     * Set the callingWebhook property: Webhook for Microsoft Teams channel calls.
     * 
     * @param callingWebhook the callingWebhook value to set.
     * @return the MsTeamsChannelProperties object itself.
     */
    public MsTeamsChannelProperties withCallingWebhook(String callingWebhook) {
        this.callingWebhook = callingWebhook;
        return this;
    }

    /**
     * Get the isEnabled property: Whether this channel is enabled for the bot.
     * 
     * @return the isEnabled value.
     */
    public boolean isEnabled() {
        return this.isEnabled;
    }

    /**
     * Set the isEnabled property: Whether this channel is enabled for the bot.
     * 
     * @param isEnabled the isEnabled value to set.
     * @return the MsTeamsChannelProperties object itself.
     */
    public MsTeamsChannelProperties withIsEnabled(boolean isEnabled) {
        this.isEnabled = isEnabled;
        return this;
    }

    /**
     * Get the incomingCallRoute property: Webhook for Microsoft Teams channel calls.
     * 
     * @return the incomingCallRoute value.
     */
    public String incomingCallRoute() {
        return this.incomingCallRoute;
    }

    /**
     * Set the incomingCallRoute property: Webhook for Microsoft Teams channel calls.
     * 
     * @param incomingCallRoute the incomingCallRoute value to set.
     * @return the MsTeamsChannelProperties object itself.
     */
    public MsTeamsChannelProperties withIncomingCallRoute(String incomingCallRoute) {
        this.incomingCallRoute = incomingCallRoute;
        return this;
    }

    /**
     * Get the deploymentEnvironment property: Deployment environment for Microsoft Teams channel calls.
     * 
     * @return the deploymentEnvironment value.
     */
    public String deploymentEnvironment() {
        return this.deploymentEnvironment;
    }

    /**
     * Set the deploymentEnvironment property: Deployment environment for Microsoft Teams channel calls.
     * 
     * @param deploymentEnvironment the deploymentEnvironment value to set.
     * @return the MsTeamsChannelProperties object itself.
     */
    public MsTeamsChannelProperties withDeploymentEnvironment(String deploymentEnvironment) {
        this.deploymentEnvironment = deploymentEnvironment;
        return this;
    }

    /**
     * Get the acceptedTerms property: Whether this channel accepted terms.
     * 
     * @return the acceptedTerms value.
     */
    public Boolean acceptedTerms() {
        return this.acceptedTerms;
    }

    /**
     * Set the acceptedTerms property: Whether this channel accepted terms.
     * 
     * @param acceptedTerms the acceptedTerms value to set.
     * @return the MsTeamsChannelProperties object itself.
     */
    public MsTeamsChannelProperties withAcceptedTerms(Boolean acceptedTerms) {
        this.acceptedTerms = acceptedTerms;
        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.writeBooleanField("isEnabled", this.isEnabled);
        jsonWriter.writeBooleanField("enableCalling", this.enableCalling);
        jsonWriter.writeStringField("callingWebhook", this.callingWebhook);
        jsonWriter.writeStringField("incomingCallRoute", this.incomingCallRoute);
        jsonWriter.writeStringField("deploymentEnvironment", this.deploymentEnvironment);
        jsonWriter.writeBooleanField("acceptedTerms", this.acceptedTerms);
        return jsonWriter.writeEndObject();
    }

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

                if ("isEnabled".equals(fieldName)) {
                    deserializedMsTeamsChannelProperties.isEnabled = reader.getBoolean();
                } else if ("enableCalling".equals(fieldName)) {
                    deserializedMsTeamsChannelProperties.enableCalling = reader.getNullable(JsonReader::getBoolean);
                } else if ("callingWebhook".equals(fieldName)) {
                    deserializedMsTeamsChannelProperties.callingWebhook = reader.getString();
                } else if ("incomingCallRoute".equals(fieldName)) {
                    deserializedMsTeamsChannelProperties.incomingCallRoute = reader.getString();
                } else if ("deploymentEnvironment".equals(fieldName)) {
                    deserializedMsTeamsChannelProperties.deploymentEnvironment = reader.getString();
                } else if ("acceptedTerms".equals(fieldName)) {
                    deserializedMsTeamsChannelProperties.acceptedTerms = reader.getNullable(JsonReader::getBoolean);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMsTeamsChannelProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy