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

com.azure.resourcemanager.botservice.models.ServiceProviderProperties 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;
import java.util.List;

/**
 * The Object used to describe a Service Provider supported by Bot Service.
 */
@Fluent
public final class ServiceProviderProperties implements JsonSerializable {
    /*
     * Id for Service Provider
     */
    private String id;

    /*
     * Display Name of the Service Provider
     */
    private String displayName;

    /*
     * Name of the Service Provider
     */
    private String serviceProviderName;

    /*
     * URL of Dev Portal
     */
    private String devPortalUrl;

    /*
     * The URL of icon
     */
    private String iconUrl;

    /*
     * The list of parameters for the Service Provider
     */
    private List parameters;

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

    /**
     * Get the id property: Id for Service Provider.
     * 
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Get the displayName property: Display Name of the Service Provider.
     * 
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Get the serviceProviderName property: Name of the Service Provider.
     * 
     * @return the serviceProviderName value.
     */
    public String serviceProviderName() {
        return this.serviceProviderName;
    }

    /**
     * Get the devPortalUrl property: URL of Dev Portal.
     * 
     * @return the devPortalUrl value.
     */
    public String devPortalUrl() {
        return this.devPortalUrl;
    }

    /**
     * Get the iconUrl property: The URL of icon.
     * 
     * @return the iconUrl value.
     */
    public String iconUrl() {
        return this.iconUrl;
    }

    /**
     * Set the iconUrl property: The URL of icon.
     * 
     * @param iconUrl the iconUrl value to set.
     * @return the ServiceProviderProperties object itself.
     */
    public ServiceProviderProperties withIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
        return this;
    }

    /**
     * Get the parameters property: The list of parameters for the Service Provider.
     * 
     * @return the parameters value.
     */
    public List parameters() {
        return this.parameters;
    }

    /**
     * Set the parameters property: The list of parameters for the Service Provider.
     * 
     * @param parameters the parameters value to set.
     * @return the ServiceProviderProperties object itself.
     */
    public ServiceProviderProperties withParameters(List parameters) {
        this.parameters = parameters;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (parameters() != null) {
            parameters().forEach(e -> e.validate());
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("iconUrl", this.iconUrl);
        jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedServiceProviderProperties.id = reader.getString();
                } else if ("displayName".equals(fieldName)) {
                    deserializedServiceProviderProperties.displayName = reader.getString();
                } else if ("serviceProviderName".equals(fieldName)) {
                    deserializedServiceProviderProperties.serviceProviderName = reader.getString();
                } else if ("devPortalUrl".equals(fieldName)) {
                    deserializedServiceProviderProperties.devPortalUrl = reader.getString();
                } else if ("iconUrl".equals(fieldName)) {
                    deserializedServiceProviderProperties.iconUrl = reader.getString();
                } else if ("parameters".equals(fieldName)) {
                    List parameters
                        = reader.readArray(reader1 -> ServiceProviderParameter.fromJson(reader1));
                    deserializedServiceProviderProperties.parameters = parameters;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedServiceProviderProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy