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

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

/**
 * Properties for a Connection Setting Item.
 */
@Fluent
public final class ConnectionSettingProperties implements JsonSerializable {
    /*
     * Id of the Connection Setting.
     */
    private String id;

    /*
     * Name of the Connection Setting.
     */
    private String name;

    /*
     * Client Id associated with the Connection Setting.
     */
    private String clientId;

    /*
     * Setting Id set by the service for the Connection Setting.
     */
    private String settingId;

    /*
     * Client Secret associated with the Connection Setting
     */
    private String clientSecret;

    /*
     * Scopes associated with the Connection Setting
     */
    private String scopes;

    /*
     * Service Provider Id associated with the Connection Setting
     */
    private String serviceProviderId;

    /*
     * Service Provider Display Name associated with the Connection Setting
     */
    private String serviceProviderDisplayName;

    /*
     * Service Provider Parameters associated with the Connection Setting
     */
    private List parameters;

    /*
     * Provisioning state of the resource
     */
    private String provisioningState;

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

    /**
     * Get the id property: Id of the Connection Setting.
     * 
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Id of the Connection Setting.
     * 
     * @param id the id value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the name property: Name of the Connection Setting.
     * 
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Name of the Connection Setting.
     * 
     * @param name the name value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the clientId property: Client Id associated with the Connection Setting.
     * 
     * @return the clientId value.
     */
    public String clientId() {
        return this.clientId;
    }

    /**
     * Set the clientId property: Client Id associated with the Connection Setting.
     * 
     * @param clientId the clientId value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withClientId(String clientId) {
        this.clientId = clientId;
        return this;
    }

    /**
     * Get the settingId property: Setting Id set by the service for the Connection Setting.
     * 
     * @return the settingId value.
     */
    public String settingId() {
        return this.settingId;
    }

    /**
     * Get the clientSecret property: Client Secret associated with the Connection Setting.
     * 
     * @return the clientSecret value.
     */
    public String clientSecret() {
        return this.clientSecret;
    }

    /**
     * Set the clientSecret property: Client Secret associated with the Connection Setting.
     * 
     * @param clientSecret the clientSecret value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
        return this;
    }

    /**
     * Get the scopes property: Scopes associated with the Connection Setting.
     * 
     * @return the scopes value.
     */
    public String scopes() {
        return this.scopes;
    }

    /**
     * Set the scopes property: Scopes associated with the Connection Setting.
     * 
     * @param scopes the scopes value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withScopes(String scopes) {
        this.scopes = scopes;
        return this;
    }

    /**
     * Get the serviceProviderId property: Service Provider Id associated with the Connection Setting.
     * 
     * @return the serviceProviderId value.
     */
    public String serviceProviderId() {
        return this.serviceProviderId;
    }

    /**
     * Set the serviceProviderId property: Service Provider Id associated with the Connection Setting.
     * 
     * @param serviceProviderId the serviceProviderId value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withServiceProviderId(String serviceProviderId) {
        this.serviceProviderId = serviceProviderId;
        return this;
    }

    /**
     * Get the serviceProviderDisplayName property: Service Provider Display Name associated with the Connection
     * Setting.
     * 
     * @return the serviceProviderDisplayName value.
     */
    public String serviceProviderDisplayName() {
        return this.serviceProviderDisplayName;
    }

    /**
     * Set the serviceProviderDisplayName property: Service Provider Display Name associated with the Connection
     * Setting.
     * 
     * @param serviceProviderDisplayName the serviceProviderDisplayName value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withServiceProviderDisplayName(String serviceProviderDisplayName) {
        this.serviceProviderDisplayName = serviceProviderDisplayName;
        return this;
    }

    /**
     * Get the parameters property: Service Provider Parameters associated with the Connection Setting.
     * 
     * @return the parameters value.
     */
    public List parameters() {
        return this.parameters;
    }

    /**
     * Set the parameters property: Service Provider Parameters associated with the Connection Setting.
     * 
     * @param parameters the parameters value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withParameters(List parameters) {
        this.parameters = parameters;
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning state of the resource.
     * 
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Set the provisioningState property: Provisioning state of the resource.
     * 
     * @param provisioningState the provisioningState value to set.
     * @return the ConnectionSettingProperties object itself.
     */
    public ConnectionSettingProperties withProvisioningState(String provisioningState) {
        this.provisioningState = provisioningState;
        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("id", this.id);
        jsonWriter.writeStringField("name", this.name);
        jsonWriter.writeStringField("clientId", this.clientId);
        jsonWriter.writeStringField("clientSecret", this.clientSecret);
        jsonWriter.writeStringField("scopes", this.scopes);
        jsonWriter.writeStringField("serviceProviderId", this.serviceProviderId);
        jsonWriter.writeStringField("serviceProviderDisplayName", this.serviceProviderDisplayName);
        jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeStringField("provisioningState", this.provisioningState);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedConnectionSettingProperties.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedConnectionSettingProperties.name = reader.getString();
                } else if ("clientId".equals(fieldName)) {
                    deserializedConnectionSettingProperties.clientId = reader.getString();
                } else if ("settingId".equals(fieldName)) {
                    deserializedConnectionSettingProperties.settingId = reader.getString();
                } else if ("clientSecret".equals(fieldName)) {
                    deserializedConnectionSettingProperties.clientSecret = reader.getString();
                } else if ("scopes".equals(fieldName)) {
                    deserializedConnectionSettingProperties.scopes = reader.getString();
                } else if ("serviceProviderId".equals(fieldName)) {
                    deserializedConnectionSettingProperties.serviceProviderId = reader.getString();
                } else if ("serviceProviderDisplayName".equals(fieldName)) {
                    deserializedConnectionSettingProperties.serviceProviderDisplayName = reader.getString();
                } else if ("parameters".equals(fieldName)) {
                    List parameters
                        = reader.readArray(reader1 -> ConnectionSettingParameter.fromJson(reader1));
                    deserializedConnectionSettingProperties.parameters = parameters;
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedConnectionSettingProperties.provisioningState = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedConnectionSettingProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy