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

com.azure.resourcemanager.botservice.models.TelephonyPhoneNumbers 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;

/**
 * A telephone number for the Telephony channel.
 */
@Fluent
public final class TelephonyPhoneNumbers implements JsonSerializable {
    /*
     * The element id.
     */
    private String id;

    /*
     * The phone number.
     */
    private String phoneNumber;

    /*
     * The endpoint of ACS.
     */
    private String acsEndpoint;

    /*
     * The secret of ACS.
     */
    private String acsSecret;

    /*
     * The resource id of ACS.
     */
    private String acsResourceId;

    /*
     * The subscription key of cognitive service.
     */
    private String cognitiveServiceSubscriptionKey;

    /*
     * The service region of cognitive service.
     */
    private String cognitiveServiceRegion;

    /*
     * The resource id of cognitive service.
     */
    private String cognitiveServiceResourceId;

    /*
     * The default locale of the phone number.
     */
    private String defaultLocale;

    /*
     * Optional Property that will determine the offering type of the phone.
     */
    private String offerType;

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

    /**
     * Get the id property: The element id.
     * 
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: The element id.
     * 
     * @param id the id value to set.
     * @return the TelephonyPhoneNumbers object itself.
     */
    public TelephonyPhoneNumbers withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the phoneNumber property: The phone number.
     * 
     * @return the phoneNumber value.
     */
    public String phoneNumber() {
        return this.phoneNumber;
    }

    /**
     * Set the phoneNumber property: The phone number.
     * 
     * @param phoneNumber the phoneNumber value to set.
     * @return the TelephonyPhoneNumbers object itself.
     */
    public TelephonyPhoneNumbers withPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
        return this;
    }

    /**
     * Get the acsEndpoint property: The endpoint of ACS.
     * 
     * @return the acsEndpoint value.
     */
    public String acsEndpoint() {
        return this.acsEndpoint;
    }

    /**
     * Set the acsEndpoint property: The endpoint of ACS.
     * 
     * @param acsEndpoint the acsEndpoint value to set.
     * @return the TelephonyPhoneNumbers object itself.
     */
    public TelephonyPhoneNumbers withAcsEndpoint(String acsEndpoint) {
        this.acsEndpoint = acsEndpoint;
        return this;
    }

    /**
     * Get the acsSecret property: The secret of ACS.
     * 
     * @return the acsSecret value.
     */
    public String acsSecret() {
        return this.acsSecret;
    }

    /**
     * Set the acsSecret property: The secret of ACS.
     * 
     * @param acsSecret the acsSecret value to set.
     * @return the TelephonyPhoneNumbers object itself.
     */
    public TelephonyPhoneNumbers withAcsSecret(String acsSecret) {
        this.acsSecret = acsSecret;
        return this;
    }

    /**
     * Get the acsResourceId property: The resource id of ACS.
     * 
     * @return the acsResourceId value.
     */
    public String acsResourceId() {
        return this.acsResourceId;
    }

    /**
     * Set the acsResourceId property: The resource id of ACS.
     * 
     * @param acsResourceId the acsResourceId value to set.
     * @return the TelephonyPhoneNumbers object itself.
     */
    public TelephonyPhoneNumbers withAcsResourceId(String acsResourceId) {
        this.acsResourceId = acsResourceId;
        return this;
    }

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

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

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

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

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

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

    /**
     * Get the defaultLocale property: The default locale of the phone number.
     * 
     * @return the defaultLocale value.
     */
    public String defaultLocale() {
        return this.defaultLocale;
    }

    /**
     * Set the defaultLocale property: The default locale of the phone number.
     * 
     * @param defaultLocale the defaultLocale value to set.
     * @return the TelephonyPhoneNumbers object itself.
     */
    public TelephonyPhoneNumbers withDefaultLocale(String defaultLocale) {
        this.defaultLocale = defaultLocale;
        return this;
    }

    /**
     * Get the offerType property: Optional Property that will determine the offering type of the phone.
     * 
     * @return the offerType value.
     */
    public String offerType() {
        return this.offerType;
    }

    /**
     * Set the offerType property: Optional Property that will determine the offering type of the phone.
     * 
     * @param offerType the offerType value to set.
     * @return the TelephonyPhoneNumbers object itself.
     */
    public TelephonyPhoneNumbers withOfferType(String offerType) {
        this.offerType = offerType;
        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("id", this.id);
        jsonWriter.writeStringField("phoneNumber", this.phoneNumber);
        jsonWriter.writeStringField("acsEndpoint", this.acsEndpoint);
        jsonWriter.writeStringField("acsSecret", this.acsSecret);
        jsonWriter.writeStringField("acsResourceId", this.acsResourceId);
        jsonWriter.writeStringField("cognitiveServiceSubscriptionKey", this.cognitiveServiceSubscriptionKey);
        jsonWriter.writeStringField("cognitiveServiceRegion", this.cognitiveServiceRegion);
        jsonWriter.writeStringField("cognitiveServiceResourceId", this.cognitiveServiceResourceId);
        jsonWriter.writeStringField("defaultLocale", this.defaultLocale);
        jsonWriter.writeStringField("offerType", this.offerType);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.id = reader.getString();
                } else if ("phoneNumber".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.phoneNumber = reader.getString();
                } else if ("acsEndpoint".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.acsEndpoint = reader.getString();
                } else if ("acsSecret".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.acsSecret = reader.getString();
                } else if ("acsResourceId".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.acsResourceId = reader.getString();
                } else if ("cognitiveServiceSubscriptionKey".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.cognitiveServiceSubscriptionKey = reader.getString();
                } else if ("cognitiveServiceRegion".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.cognitiveServiceRegion = reader.getString();
                } else if ("cognitiveServiceResourceId".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.cognitiveServiceResourceId = reader.getString();
                } else if ("defaultLocale".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.defaultLocale = reader.getString();
                } else if ("offerType".equals(fieldName)) {
                    deserializedTelephonyPhoneNumbers.offerType = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedTelephonyPhoneNumbers;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy