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

com.azure.resourcemanager.botservice.models.DirectLineSpeechChannelProperties 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 DirectLine Speech channel.
 */
@Fluent
public final class DirectLineSpeechChannelProperties implements JsonSerializable {
    /*
     * The cognitive service id with this channel registration.
     */
    private String cognitiveServiceResourceId;

    /*
     * The cognitive service region with this channel registration.
     */
    private String cognitiveServiceRegion;

    /*
     * The cognitive service subscription key to use with this channel registration.
     */
    private String cognitiveServiceSubscriptionKey;

    /*
     * Whether this channel is enabled or not.
     */
    private Boolean isEnabled;

    /*
     * Custom speech model id (optional).
     */
    private String customVoiceDeploymentId;

    /*
     * Custom voice deployment id (optional).
     */
    private String customSpeechModelId;

    /*
     * Make this a default bot for chosen cognitive service account.
     */
    private Boolean isDefaultBotForCogSvcAccount;

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

    /**
     * Get the cognitiveServiceResourceId property: The cognitive service id with this channel registration.
     * 
     * @return the cognitiveServiceResourceId value.
     */
    public String cognitiveServiceResourceId() {
        return this.cognitiveServiceResourceId;
    }

    /**
     * Set the cognitiveServiceResourceId property: The cognitive service id with this channel registration.
     * 
     * @param cognitiveServiceResourceId the cognitiveServiceResourceId value to set.
     * @return the DirectLineSpeechChannelProperties object itself.
     */
    public DirectLineSpeechChannelProperties withCognitiveServiceResourceId(String cognitiveServiceResourceId) {
        this.cognitiveServiceResourceId = cognitiveServiceResourceId;
        return this;
    }

    /**
     * Get the cognitiveServiceRegion property: The cognitive service region with this channel registration.
     * 
     * @return the cognitiveServiceRegion value.
     */
    public String cognitiveServiceRegion() {
        return this.cognitiveServiceRegion;
    }

    /**
     * Set the cognitiveServiceRegion property: The cognitive service region with this channel registration.
     * 
     * @param cognitiveServiceRegion the cognitiveServiceRegion value to set.
     * @return the DirectLineSpeechChannelProperties object itself.
     */
    public DirectLineSpeechChannelProperties withCognitiveServiceRegion(String cognitiveServiceRegion) {
        this.cognitiveServiceRegion = cognitiveServiceRegion;
        return this;
    }

    /**
     * Get the cognitiveServiceSubscriptionKey property: The cognitive service subscription key to use with this channel
     * registration.
     * 
     * @return the cognitiveServiceSubscriptionKey value.
     */
    public String cognitiveServiceSubscriptionKey() {
        return this.cognitiveServiceSubscriptionKey;
    }

    /**
     * Set the cognitiveServiceSubscriptionKey property: The cognitive service subscription key to use with this channel
     * registration.
     * 
     * @param cognitiveServiceSubscriptionKey the cognitiveServiceSubscriptionKey value to set.
     * @return the DirectLineSpeechChannelProperties object itself.
     */
    public DirectLineSpeechChannelProperties
        withCognitiveServiceSubscriptionKey(String cognitiveServiceSubscriptionKey) {
        this.cognitiveServiceSubscriptionKey = cognitiveServiceSubscriptionKey;
        return this;
    }

    /**
     * Get the isEnabled property: Whether this channel is enabled or not.
     * 
     * @return the isEnabled value.
     */
    public Boolean isEnabled() {
        return this.isEnabled;
    }

    /**
     * Set the isEnabled property: Whether this channel is enabled or not.
     * 
     * @param isEnabled the isEnabled value to set.
     * @return the DirectLineSpeechChannelProperties object itself.
     */
    public DirectLineSpeechChannelProperties withIsEnabled(Boolean isEnabled) {
        this.isEnabled = isEnabled;
        return this;
    }

    /**
     * Get the customVoiceDeploymentId property: Custom speech model id (optional).
     * 
     * @return the customVoiceDeploymentId value.
     */
    public String customVoiceDeploymentId() {
        return this.customVoiceDeploymentId;
    }

    /**
     * Set the customVoiceDeploymentId property: Custom speech model id (optional).
     * 
     * @param customVoiceDeploymentId the customVoiceDeploymentId value to set.
     * @return the DirectLineSpeechChannelProperties object itself.
     */
    public DirectLineSpeechChannelProperties withCustomVoiceDeploymentId(String customVoiceDeploymentId) {
        this.customVoiceDeploymentId = customVoiceDeploymentId;
        return this;
    }

    /**
     * Get the customSpeechModelId property: Custom voice deployment id (optional).
     * 
     * @return the customSpeechModelId value.
     */
    public String customSpeechModelId() {
        return this.customSpeechModelId;
    }

    /**
     * Set the customSpeechModelId property: Custom voice deployment id (optional).
     * 
     * @param customSpeechModelId the customSpeechModelId value to set.
     * @return the DirectLineSpeechChannelProperties object itself.
     */
    public DirectLineSpeechChannelProperties withCustomSpeechModelId(String customSpeechModelId) {
        this.customSpeechModelId = customSpeechModelId;
        return this;
    }

    /**
     * Get the isDefaultBotForCogSvcAccount property: Make this a default bot for chosen cognitive service account.
     * 
     * @return the isDefaultBotForCogSvcAccount value.
     */
    public Boolean isDefaultBotForCogSvcAccount() {
        return this.isDefaultBotForCogSvcAccount;
    }

    /**
     * Set the isDefaultBotForCogSvcAccount property: Make this a default bot for chosen cognitive service account.
     * 
     * @param isDefaultBotForCogSvcAccount the isDefaultBotForCogSvcAccount value to set.
     * @return the DirectLineSpeechChannelProperties object itself.
     */
    public DirectLineSpeechChannelProperties withIsDefaultBotForCogSvcAccount(Boolean isDefaultBotForCogSvcAccount) {
        this.isDefaultBotForCogSvcAccount = isDefaultBotForCogSvcAccount;
        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("cognitiveServiceResourceId", this.cognitiveServiceResourceId);
        jsonWriter.writeStringField("cognitiveServiceRegion", this.cognitiveServiceRegion);
        jsonWriter.writeStringField("cognitiveServiceSubscriptionKey", this.cognitiveServiceSubscriptionKey);
        jsonWriter.writeBooleanField("isEnabled", this.isEnabled);
        jsonWriter.writeStringField("customVoiceDeploymentId", this.customVoiceDeploymentId);
        jsonWriter.writeStringField("customSpeechModelId", this.customSpeechModelId);
        jsonWriter.writeBooleanField("isDefaultBotForCogSvcAccount", this.isDefaultBotForCogSvcAccount);
        return jsonWriter.writeEndObject();
    }

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

                if ("cognitiveServiceResourceId".equals(fieldName)) {
                    deserializedDirectLineSpeechChannelProperties.cognitiveServiceResourceId = reader.getString();
                } else if ("cognitiveServiceRegion".equals(fieldName)) {
                    deserializedDirectLineSpeechChannelProperties.cognitiveServiceRegion = reader.getString();
                } else if ("cognitiveServiceSubscriptionKey".equals(fieldName)) {
                    deserializedDirectLineSpeechChannelProperties.cognitiveServiceSubscriptionKey = reader.getString();
                } else if ("isEnabled".equals(fieldName)) {
                    deserializedDirectLineSpeechChannelProperties.isEnabled
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("customVoiceDeploymentId".equals(fieldName)) {
                    deserializedDirectLineSpeechChannelProperties.customVoiceDeploymentId = reader.getString();
                } else if ("customSpeechModelId".equals(fieldName)) {
                    deserializedDirectLineSpeechChannelProperties.customSpeechModelId = reader.getString();
                } else if ("isDefaultBotForCogSvcAccount".equals(fieldName)) {
                    deserializedDirectLineSpeechChannelProperties.isDefaultBotForCogSvcAccount
                        = reader.getNullable(JsonReader::getBoolean);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDirectLineSpeechChannelProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy