com.azure.resourcemanager.botservice.models.Site Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-botservice Show documentation
Show all versions of azure-resourcemanager-botservice Show documentation
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.core.util.logging.ClientLogger;
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;
/**
* A site for the channel.
*/
@Fluent
public class Site implements JsonSerializable {
/*
* Tenant Id
*/
private String tenantId;
/*
* Site Id
*/
private String siteId;
/*
* Site name
*/
private String siteName;
/*
* Primary key. Value only returned through POST to the action Channel List API, otherwise empty.
*/
private String key;
/*
* Secondary key. Value only returned through POST to the action Channel List API, otherwise empty.
*/
private String key2;
/*
* Whether this site is enabled for DirectLine channel
*/
private boolean isEnabled;
/*
* Whether this site is token enabled for channel
*/
private Boolean isTokenEnabled;
/*
* Whether this site is EndpointParameters enabled for channel
*/
private Boolean isEndpointParametersEnabled;
/*
* Whether this site is disabled detailed logging for
*/
private Boolean isDetailedLoggingEnabled;
/*
* Whether this site is enabled for block user upload.
*/
private Boolean isBlockUserUploadEnabled;
/*
* Whether this no-storage site is disabled detailed logging for
*/
private Boolean isNoStorageEnabled;
/*
* Entity Tag
*/
private String etag;
/*
* DirectLine application id
*/
private String appId;
/*
* Whether this site is enabled for Bot Framework V1 protocol.
*/
private Boolean isV1Enabled;
/*
* Whether this site is enabled for Bot Framework V3 protocol.
*/
private Boolean isV3Enabled;
/*
* Whether this site is enabled for authentication with Bot Framework.
*/
private Boolean isSecureSiteEnabled;
/*
* List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True.
*/
private List trustedOrigins;
/*
* Whether this site is enabled for Webchat Speech
*/
private Boolean isWebChatSpeechEnabled;
/*
* Whether this site is enabled for preview versions of Webchat
*/
private Boolean isWebchatPreviewEnabled;
/**
* Creates an instance of Site class.
*/
public Site() {
}
/**
* Get the tenantId property: Tenant Id.
*
* @return the tenantId value.
*/
public String tenantId() {
return this.tenantId;
}
/**
* Set the tenantId property: Tenant Id.
*
* @param tenantId the tenantId value to set.
* @return the Site object itself.
*/
public Site withTenantId(String tenantId) {
this.tenantId = tenantId;
return this;
}
/**
* Get the siteId property: Site Id.
*
* @return the siteId value.
*/
public String siteId() {
return this.siteId;
}
/**
* Set the siteId property: Site Id.
*
* @param siteId the siteId value to set.
* @return the Site object itself.
*/
Site withSiteId(String siteId) {
this.siteId = siteId;
return this;
}
/**
* Get the siteName property: Site name.
*
* @return the siteName value.
*/
public String siteName() {
return this.siteName;
}
/**
* Set the siteName property: Site name.
*
* @param siteName the siteName value to set.
* @return the Site object itself.
*/
public Site withSiteName(String siteName) {
this.siteName = siteName;
return this;
}
/**
* Get the key property: Primary key. Value only returned through POST to the action Channel List API, otherwise
* empty.
*
* @return the key value.
*/
public String key() {
return this.key;
}
/**
* Set the key property: Primary key. Value only returned through POST to the action Channel List API, otherwise
* empty.
*
* @param key the key value to set.
* @return the Site object itself.
*/
Site withKey(String key) {
this.key = key;
return this;
}
/**
* Get the key2 property: Secondary key. Value only returned through POST to the action Channel List API, otherwise
* empty.
*
* @return the key2 value.
*/
public String key2() {
return this.key2;
}
/**
* Set the key2 property: Secondary key. Value only returned through POST to the action Channel List API, otherwise
* empty.
*
* @param key2 the key2 value to set.
* @return the Site object itself.
*/
Site withKey2(String key2) {
this.key2 = key2;
return this;
}
/**
* Get the isEnabled property: Whether this site is enabled for DirectLine channel.
*
* @return the isEnabled value.
*/
public boolean isEnabled() {
return this.isEnabled;
}
/**
* Set the isEnabled property: Whether this site is enabled for DirectLine channel.
*
* @param isEnabled the isEnabled value to set.
* @return the Site object itself.
*/
public Site withIsEnabled(boolean isEnabled) {
this.isEnabled = isEnabled;
return this;
}
/**
* Get the isTokenEnabled property: Whether this site is token enabled for channel.
*
* @return the isTokenEnabled value.
*/
public Boolean isTokenEnabled() {
return this.isTokenEnabled;
}
/**
* Set the isTokenEnabled property: Whether this site is token enabled for channel.
*
* @param isTokenEnabled the isTokenEnabled value to set.
* @return the Site object itself.
*/
Site withIsTokenEnabled(Boolean isTokenEnabled) {
this.isTokenEnabled = isTokenEnabled;
return this;
}
/**
* Get the isEndpointParametersEnabled property: Whether this site is EndpointParameters enabled for channel.
*
* @return the isEndpointParametersEnabled value.
*/
public Boolean isEndpointParametersEnabled() {
return this.isEndpointParametersEnabled;
}
/**
* Set the isEndpointParametersEnabled property: Whether this site is EndpointParameters enabled for channel.
*
* @param isEndpointParametersEnabled the isEndpointParametersEnabled value to set.
* @return the Site object itself.
*/
public Site withIsEndpointParametersEnabled(Boolean isEndpointParametersEnabled) {
this.isEndpointParametersEnabled = isEndpointParametersEnabled;
return this;
}
/**
* Get the isDetailedLoggingEnabled property: Whether this site is disabled detailed logging for.
*
* @return the isDetailedLoggingEnabled value.
*/
public Boolean isDetailedLoggingEnabled() {
return this.isDetailedLoggingEnabled;
}
/**
* Set the isDetailedLoggingEnabled property: Whether this site is disabled detailed logging for.
*
* @param isDetailedLoggingEnabled the isDetailedLoggingEnabled value to set.
* @return the Site object itself.
*/
public Site withIsDetailedLoggingEnabled(Boolean isDetailedLoggingEnabled) {
this.isDetailedLoggingEnabled = isDetailedLoggingEnabled;
return this;
}
/**
* Get the isBlockUserUploadEnabled property: Whether this site is enabled for block user upload.
*
* @return the isBlockUserUploadEnabled value.
*/
public Boolean isBlockUserUploadEnabled() {
return this.isBlockUserUploadEnabled;
}
/**
* Set the isBlockUserUploadEnabled property: Whether this site is enabled for block user upload.
*
* @param isBlockUserUploadEnabled the isBlockUserUploadEnabled value to set.
* @return the Site object itself.
*/
public Site withIsBlockUserUploadEnabled(Boolean isBlockUserUploadEnabled) {
this.isBlockUserUploadEnabled = isBlockUserUploadEnabled;
return this;
}
/**
* Get the isNoStorageEnabled property: Whether this no-storage site is disabled detailed logging for.
*
* @return the isNoStorageEnabled value.
*/
public Boolean isNoStorageEnabled() {
return this.isNoStorageEnabled;
}
/**
* Set the isNoStorageEnabled property: Whether this no-storage site is disabled detailed logging for.
*
* @param isNoStorageEnabled the isNoStorageEnabled value to set.
* @return the Site object itself.
*/
public Site withIsNoStorageEnabled(Boolean isNoStorageEnabled) {
this.isNoStorageEnabled = isNoStorageEnabled;
return this;
}
/**
* Get the etag property: Entity Tag.
*
* @return the etag value.
*/
public String etag() {
return this.etag;
}
/**
* Set the etag property: Entity Tag.
*
* @param etag the etag value to set.
* @return the Site object itself.
*/
public Site withEtag(String etag) {
this.etag = etag;
return this;
}
/**
* Get the appId property: DirectLine application id.
*
* @return the appId value.
*/
public String appId() {
return this.appId;
}
/**
* Set the appId property: DirectLine application id.
*
* @param appId the appId value to set.
* @return the Site object itself.
*/
public Site withAppId(String appId) {
this.appId = appId;
return this;
}
/**
* Get the isV1Enabled property: Whether this site is enabled for Bot Framework V1 protocol.
*
* @return the isV1Enabled value.
*/
public Boolean isV1Enabled() {
return this.isV1Enabled;
}
/**
* Set the isV1Enabled property: Whether this site is enabled for Bot Framework V1 protocol.
*
* @param isV1Enabled the isV1Enabled value to set.
* @return the Site object itself.
*/
public Site withIsV1Enabled(Boolean isV1Enabled) {
this.isV1Enabled = isV1Enabled;
return this;
}
/**
* Get the isV3Enabled property: Whether this site is enabled for Bot Framework V3 protocol.
*
* @return the isV3Enabled value.
*/
public Boolean isV3Enabled() {
return this.isV3Enabled;
}
/**
* Set the isV3Enabled property: Whether this site is enabled for Bot Framework V3 protocol.
*
* @param isV3Enabled the isV3Enabled value to set.
* @return the Site object itself.
*/
public Site withIsV3Enabled(Boolean isV3Enabled) {
this.isV3Enabled = isV3Enabled;
return this;
}
/**
* Get the isSecureSiteEnabled property: Whether this site is enabled for authentication with Bot Framework.
*
* @return the isSecureSiteEnabled value.
*/
public Boolean isSecureSiteEnabled() {
return this.isSecureSiteEnabled;
}
/**
* Set the isSecureSiteEnabled property: Whether this site is enabled for authentication with Bot Framework.
*
* @param isSecureSiteEnabled the isSecureSiteEnabled value to set.
* @return the Site object itself.
*/
public Site withIsSecureSiteEnabled(Boolean isSecureSiteEnabled) {
this.isSecureSiteEnabled = isSecureSiteEnabled;
return this;
}
/**
* Get the trustedOrigins property: List of Trusted Origin URLs for this site. This field is applicable only if
* isSecureSiteEnabled is True.
*
* @return the trustedOrigins value.
*/
public List trustedOrigins() {
return this.trustedOrigins;
}
/**
* Set the trustedOrigins property: List of Trusted Origin URLs for this site. This field is applicable only if
* isSecureSiteEnabled is True.
*
* @param trustedOrigins the trustedOrigins value to set.
* @return the Site object itself.
*/
public Site withTrustedOrigins(List trustedOrigins) {
this.trustedOrigins = trustedOrigins;
return this;
}
/**
* Get the isWebChatSpeechEnabled property: Whether this site is enabled for Webchat Speech.
*
* @return the isWebChatSpeechEnabled value.
*/
public Boolean isWebChatSpeechEnabled() {
return this.isWebChatSpeechEnabled;
}
/**
* Set the isWebChatSpeechEnabled property: Whether this site is enabled for Webchat Speech.
*
* @param isWebChatSpeechEnabled the isWebChatSpeechEnabled value to set.
* @return the Site object itself.
*/
public Site withIsWebChatSpeechEnabled(Boolean isWebChatSpeechEnabled) {
this.isWebChatSpeechEnabled = isWebChatSpeechEnabled;
return this;
}
/**
* Get the isWebchatPreviewEnabled property: Whether this site is enabled for preview versions of Webchat.
*
* @return the isWebchatPreviewEnabled value.
*/
public Boolean isWebchatPreviewEnabled() {
return this.isWebchatPreviewEnabled;
}
/**
* Set the isWebchatPreviewEnabled property: Whether this site is enabled for preview versions of Webchat.
*
* @param isWebchatPreviewEnabled the isWebchatPreviewEnabled value to set.
* @return the Site object itself.
*/
public Site withIsWebchatPreviewEnabled(Boolean isWebchatPreviewEnabled) {
this.isWebchatPreviewEnabled = isWebchatPreviewEnabled;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (siteName() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException("Missing required property siteName in model Site"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(Site.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("siteName", this.siteName);
jsonWriter.writeBooleanField("isEnabled", this.isEnabled);
jsonWriter.writeStringField("tenantId", this.tenantId);
jsonWriter.writeBooleanField("isEndpointParametersEnabled", this.isEndpointParametersEnabled);
jsonWriter.writeBooleanField("isDetailedLoggingEnabled", this.isDetailedLoggingEnabled);
jsonWriter.writeBooleanField("isBlockUserUploadEnabled", this.isBlockUserUploadEnabled);
jsonWriter.writeBooleanField("isNoStorageEnabled", this.isNoStorageEnabled);
jsonWriter.writeStringField("eTag", this.etag);
jsonWriter.writeStringField("appId", this.appId);
jsonWriter.writeBooleanField("isV1Enabled", this.isV1Enabled);
jsonWriter.writeBooleanField("isV3Enabled", this.isV3Enabled);
jsonWriter.writeBooleanField("isSecureSiteEnabled", this.isSecureSiteEnabled);
jsonWriter.writeArrayField("trustedOrigins", this.trustedOrigins,
(writer, element) -> writer.writeString(element));
jsonWriter.writeBooleanField("isWebChatSpeechEnabled", this.isWebChatSpeechEnabled);
jsonWriter.writeBooleanField("isWebchatPreviewEnabled", this.isWebchatPreviewEnabled);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of Site from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of Site 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 Site.
*/
public static Site fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
Site deserializedSite = new Site();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("siteName".equals(fieldName)) {
deserializedSite.siteName = reader.getString();
} else if ("isEnabled".equals(fieldName)) {
deserializedSite.isEnabled = reader.getBoolean();
} else if ("tenantId".equals(fieldName)) {
deserializedSite.tenantId = reader.getString();
} else if ("siteId".equals(fieldName)) {
deserializedSite.siteId = reader.getString();
} else if ("key".equals(fieldName)) {
deserializedSite.key = reader.getString();
} else if ("key2".equals(fieldName)) {
deserializedSite.key2 = reader.getString();
} else if ("isTokenEnabled".equals(fieldName)) {
deserializedSite.isTokenEnabled = reader.getNullable(JsonReader::getBoolean);
} else if ("isEndpointParametersEnabled".equals(fieldName)) {
deserializedSite.isEndpointParametersEnabled = reader.getNullable(JsonReader::getBoolean);
} else if ("isDetailedLoggingEnabled".equals(fieldName)) {
deserializedSite.isDetailedLoggingEnabled = reader.getNullable(JsonReader::getBoolean);
} else if ("isBlockUserUploadEnabled".equals(fieldName)) {
deserializedSite.isBlockUserUploadEnabled = reader.getNullable(JsonReader::getBoolean);
} else if ("isNoStorageEnabled".equals(fieldName)) {
deserializedSite.isNoStorageEnabled = reader.getNullable(JsonReader::getBoolean);
} else if ("eTag".equals(fieldName)) {
deserializedSite.etag = reader.getString();
} else if ("appId".equals(fieldName)) {
deserializedSite.appId = reader.getString();
} else if ("isV1Enabled".equals(fieldName)) {
deserializedSite.isV1Enabled = reader.getNullable(JsonReader::getBoolean);
} else if ("isV3Enabled".equals(fieldName)) {
deserializedSite.isV3Enabled = reader.getNullable(JsonReader::getBoolean);
} else if ("isSecureSiteEnabled".equals(fieldName)) {
deserializedSite.isSecureSiteEnabled = reader.getNullable(JsonReader::getBoolean);
} else if ("trustedOrigins".equals(fieldName)) {
List trustedOrigins = reader.readArray(reader1 -> reader1.getString());
deserializedSite.trustedOrigins = trustedOrigins;
} else if ("isWebChatSpeechEnabled".equals(fieldName)) {
deserializedSite.isWebChatSpeechEnabled = reader.getNullable(JsonReader::getBoolean);
} else if ("isWebchatPreviewEnabled".equals(fieldName)) {
deserializedSite.isWebchatPreviewEnabled = reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedSite;
});
}
}