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

com.azure.resourcemanager.botservice.models.SlackChannelProperties 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 Slack channel.
 */
@Fluent
public final class SlackChannelProperties implements JsonSerializable {
    /*
     * The Slack client id
     */
    private String clientId;

    /*
     * The Slack client secret. Value only returned through POST to the action Channel List API, otherwise empty.
     */
    private String clientSecret;

    /*
     * The Slack verification token. Value only returned through POST to the action Channel List API, otherwise empty.
     */
    private String verificationToken;

    /*
     * The Slack permission scopes.
     */
    private String scopes;

    /*
     * The Slack landing page Url
     */
    private String landingPageUrl;

    /*
     * The Slack redirect action
     */
    private String redirectAction;

    /*
     * The Sms auth token
     */
    private String lastSubmissionId;

    /*
     * Whether to register the settings before OAuth validation is performed. Recommended to True.
     */
    private Boolean registerBeforeOAuthFlow;

    /*
     * Whether this channel is validated for the bot
     */
    private Boolean isValidated;

    /*
     * The Slack signing secret.
     */
    private String signingSecret;

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

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

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

    /**
     * Set the clientId property: The Slack client id.
     * 
     * @param clientId the clientId value to set.
     * @return the SlackChannelProperties object itself.
     */
    public SlackChannelProperties withClientId(String clientId) {
        this.clientId = clientId;
        return this;
    }

    /**
     * Get the clientSecret property: The Slack client secret. Value only returned through POST to the action Channel
     * List API, otherwise empty.
     * 
     * @return the clientSecret value.
     */
    public String clientSecret() {
        return this.clientSecret;
    }

    /**
     * Set the clientSecret property: The Slack client secret. Value only returned through POST to the action Channel
     * List API, otherwise empty.
     * 
     * @param clientSecret the clientSecret value to set.
     * @return the SlackChannelProperties object itself.
     */
    public SlackChannelProperties withClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
        return this;
    }

    /**
     * Get the verificationToken property: The Slack verification token. Value only returned through POST to the action
     * Channel List API, otherwise empty.
     * 
     * @return the verificationToken value.
     */
    public String verificationToken() {
        return this.verificationToken;
    }

    /**
     * Set the verificationToken property: The Slack verification token. Value only returned through POST to the action
     * Channel List API, otherwise empty.
     * 
     * @param verificationToken the verificationToken value to set.
     * @return the SlackChannelProperties object itself.
     */
    public SlackChannelProperties withVerificationToken(String verificationToken) {
        this.verificationToken = verificationToken;
        return this;
    }

    /**
     * Get the scopes property: The Slack permission scopes.
     * 
     * @return the scopes value.
     */
    public String scopes() {
        return this.scopes;
    }

    /**
     * Set the scopes property: The Slack permission scopes.
     * 
     * @param scopes the scopes value to set.
     * @return the SlackChannelProperties object itself.
     */
    public SlackChannelProperties withScopes(String scopes) {
        this.scopes = scopes;
        return this;
    }

    /**
     * Get the landingPageUrl property: The Slack landing page Url.
     * 
     * @return the landingPageUrl value.
     */
    public String landingPageUrl() {
        return this.landingPageUrl;
    }

    /**
     * Set the landingPageUrl property: The Slack landing page Url.
     * 
     * @param landingPageUrl the landingPageUrl value to set.
     * @return the SlackChannelProperties object itself.
     */
    public SlackChannelProperties withLandingPageUrl(String landingPageUrl) {
        this.landingPageUrl = landingPageUrl;
        return this;
    }

    /**
     * Get the redirectAction property: The Slack redirect action.
     * 
     * @return the redirectAction value.
     */
    public String redirectAction() {
        return this.redirectAction;
    }

    /**
     * Get the lastSubmissionId property: The Sms auth token.
     * 
     * @return the lastSubmissionId value.
     */
    public String lastSubmissionId() {
        return this.lastSubmissionId;
    }

    /**
     * Get the registerBeforeOAuthFlow property: Whether to register the settings before OAuth validation is performed.
     * Recommended to True.
     * 
     * @return the registerBeforeOAuthFlow value.
     */
    public Boolean registerBeforeOAuthFlow() {
        return this.registerBeforeOAuthFlow;
    }

    /**
     * Get the isValidated property: Whether this channel is validated for the bot.
     * 
     * @return the isValidated value.
     */
    public Boolean isValidated() {
        return this.isValidated;
    }

    /**
     * Get the signingSecret property: The Slack signing secret.
     * 
     * @return the signingSecret value.
     */
    public String signingSecret() {
        return this.signingSecret;
    }

    /**
     * Set the signingSecret property: The Slack signing secret.
     * 
     * @param signingSecret the signingSecret value to set.
     * @return the SlackChannelProperties object itself.
     */
    public SlackChannelProperties withSigningSecret(String signingSecret) {
        this.signingSecret = signingSecret;
        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 SlackChannelProperties object itself.
     */
    public SlackChannelProperties withIsEnabled(boolean isEnabled) {
        this.isEnabled = isEnabled;
        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.writeStringField("clientId", this.clientId);
        jsonWriter.writeStringField("clientSecret", this.clientSecret);
        jsonWriter.writeStringField("verificationToken", this.verificationToken);
        jsonWriter.writeStringField("scopes", this.scopes);
        jsonWriter.writeStringField("landingPageUrl", this.landingPageUrl);
        jsonWriter.writeStringField("signingSecret", this.signingSecret);
        return jsonWriter.writeEndObject();
    }

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

                if ("isEnabled".equals(fieldName)) {
                    deserializedSlackChannelProperties.isEnabled = reader.getBoolean();
                } else if ("clientId".equals(fieldName)) {
                    deserializedSlackChannelProperties.clientId = reader.getString();
                } else if ("clientSecret".equals(fieldName)) {
                    deserializedSlackChannelProperties.clientSecret = reader.getString();
                } else if ("verificationToken".equals(fieldName)) {
                    deserializedSlackChannelProperties.verificationToken = reader.getString();
                } else if ("scopes".equals(fieldName)) {
                    deserializedSlackChannelProperties.scopes = reader.getString();
                } else if ("landingPageUrl".equals(fieldName)) {
                    deserializedSlackChannelProperties.landingPageUrl = reader.getString();
                } else if ("redirectAction".equals(fieldName)) {
                    deserializedSlackChannelProperties.redirectAction = reader.getString();
                } else if ("lastSubmissionId".equals(fieldName)) {
                    deserializedSlackChannelProperties.lastSubmissionId = reader.getString();
                } else if ("registerBeforeOAuthFlow".equals(fieldName)) {
                    deserializedSlackChannelProperties.registerBeforeOAuthFlow
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("IsValidated".equals(fieldName)) {
                    deserializedSlackChannelProperties.isValidated = reader.getNullable(JsonReader::getBoolean);
                } else if ("signingSecret".equals(fieldName)) {
                    deserializedSlackChannelProperties.signingSecret = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSlackChannelProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy