Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
436 changes: 432 additions & 4 deletions sdk/botservice/azure-resourcemanager-botservice/CHANGELOG.md

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions sdk/botservice/azure-resourcemanager-botservice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager BotService client library for Java.

This package contains Microsoft Azure SDK for BotService Management SDK. Azure Bot Service is a platform for creating smart conversational agents. Package tag package-2021-03-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for BotService Management SDK. Azure Bot Service is a platform for creating smart conversational agents. Package api-version 2023-09-15-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -52,15 +52,15 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
BotServiceManager manager = BotServiceManager
.authenticate(credential, profile);
```

The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.

See [Authentication][authenticate] for more options.

Expand Down Expand Up @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/


489 changes: 377 additions & 112 deletions sdk/botservice/azure-resourcemanager-botservice/SAMPLE.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions sdk/botservice/azure-resourcemanager-botservice/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!--
~ Copyright (c) Microsoft Corporation. All rights reserved.
~ Licensed under the MIT License.
~ Code generated by Microsoft (R) AutoRest Code Generator.
~ Code generated by Microsoft (R) TypeSpec Code Generator.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.azure</groupId>
Expand All @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for BotService Management</name>
<description>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.</description>
<description>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 api-version 2023-09-15-preview.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand All @@ -45,7 +45,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<spotless.skip>false</spotless.skip>
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.azure.resourcemanager.botservice;

Expand All @@ -22,25 +22,39 @@
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.botservice.fluent.AzureBotService;
import com.azure.resourcemanager.botservice.implementation.AzureBotServiceBuilder;
import com.azure.resourcemanager.botservice.fluent.BotServiceManagementClient;
import com.azure.resourcemanager.botservice.implementation.BotConnectionsImpl;
import com.azure.resourcemanager.botservice.implementation.BotServiceManagementClientBuilder;
import com.azure.resourcemanager.botservice.implementation.BotsImpl;
import com.azure.resourcemanager.botservice.implementation.ChannelsImpl;
import com.azure.resourcemanager.botservice.implementation.DirectLinesImpl;
import com.azure.resourcemanager.botservice.implementation.EmailsImpl;
import com.azure.resourcemanager.botservice.implementation.HostSettingsImpl;
import com.azure.resourcemanager.botservice.implementation.NetworkSecurityPerimeterConfigurationsImpl;
import com.azure.resourcemanager.botservice.implementation.OperationResultsImpl;
import com.azure.resourcemanager.botservice.implementation.OperationsImpl;
import com.azure.resourcemanager.botservice.implementation.PrivateEndpointConnectionsImpl;
import com.azure.resourcemanager.botservice.implementation.PrivateLinkResourcesImpl;
import com.azure.resourcemanager.botservice.implementation.QnAMakerEndpointKeysImpl;
import com.azure.resourcemanager.botservice.models.BotConnections;
import com.azure.resourcemanager.botservice.models.Bots;
import com.azure.resourcemanager.botservice.models.Channels;
import com.azure.resourcemanager.botservice.models.DirectLines;
import com.azure.resourcemanager.botservice.models.Emails;
import com.azure.resourcemanager.botservice.models.HostSettings;
import com.azure.resourcemanager.botservice.models.NetworkSecurityPerimeterConfigurations;
import com.azure.resourcemanager.botservice.models.OperationResults;
import com.azure.resourcemanager.botservice.models.Operations;
import com.azure.resourcemanager.botservice.models.PrivateEndpointConnections;
import com.azure.resourcemanager.botservice.models.PrivateLinkResources;
import com.azure.resourcemanager.botservice.models.QnAMakerEndpointKeys;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

Expand All @@ -49,24 +63,36 @@
* Azure Bot Service is a platform for creating smart conversational agents.
*/
public final class BotServiceManager {
private Operations operations;

private Bots bots;

private PrivateEndpointConnections privateEndpointConnections;

private NetworkSecurityPerimeterConfigurations networkSecurityPerimeterConfigurations;

private Emails emails;

private PrivateLinkResources privateLinkResources;

private Channels channels;

private DirectLines directLines;

private Operations operations;

private BotConnections botConnections;

private QnAMakerEndpointKeys qnAMakerEndpointKeys;

private HostSettings hostSettings;

private final AzureBotService clientObject;
private OperationResults operationResults;

private final BotServiceManagementClient clientObject;

private BotServiceManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
this.clientObject = new AzureBotServiceBuilder().pipeline(httpPipeline)
this.clientObject = new BotServiceManagementClientBuilder().pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval)
Expand Down Expand Up @@ -113,6 +139,9 @@ public static Configurable configure() {
*/
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
private static final String SDK_VERSION = "version";
private static final Map<String, String> PROPERTIES
= CoreUtils.getProperties("azure-resourcemanager-botservice.properties");

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
Expand Down Expand Up @@ -220,12 +249,14 @@ public BotServiceManager authenticate(TokenCredential credential, AzureProfile p
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");

String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");

StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.botservice")
.append("/")
.append("1.0.0");
.append(clientVersion);
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
Expand Down Expand Up @@ -271,6 +302,18 @@ public BotServiceManager authenticate(TokenCredential credential, AzureProfile p
}
}

/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/**
* Gets the resource collection API of Bots. It manages Bot.
*
Expand All @@ -283,6 +326,56 @@ public Bots bots() {
return bots;
}

/**
* Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection.
*
* @return Resource collection API of PrivateEndpointConnections.
*/
public PrivateEndpointConnections privateEndpointConnections() {
if (this.privateEndpointConnections == null) {
this.privateEndpointConnections
= new PrivateEndpointConnectionsImpl(clientObject.getPrivateEndpointConnections(), this);
}
return privateEndpointConnections;
}

/**
* Gets the resource collection API of NetworkSecurityPerimeterConfigurations.
*
* @return Resource collection API of NetworkSecurityPerimeterConfigurations.
*/
public NetworkSecurityPerimeterConfigurations networkSecurityPerimeterConfigurations() {
if (this.networkSecurityPerimeterConfigurations == null) {
this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsImpl(
clientObject.getNetworkSecurityPerimeterConfigurations(), this);
}
return networkSecurityPerimeterConfigurations;
}

/**
* Gets the resource collection API of Emails.
*
* @return Resource collection API of Emails.
*/
public Emails emails() {
if (this.emails == null) {
this.emails = new EmailsImpl(clientObject.getEmails(), this);
}
return emails;
}

/**
* Gets the resource collection API of PrivateLinkResources.
*
* @return Resource collection API of PrivateLinkResources.
*/
public PrivateLinkResources privateLinkResources() {
if (this.privateLinkResources == null) {
this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this);
}
return privateLinkResources;
}

/**
* Gets the resource collection API of Channels.
*
Expand All @@ -307,18 +400,6 @@ public DirectLines directLines() {
return directLines;
}

/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/**
* Gets the resource collection API of BotConnections. It manages ConnectionSetting.
*
Expand All @@ -331,6 +412,18 @@ public BotConnections botConnections() {
return botConnections;
}

/**
* Gets the resource collection API of QnAMakerEndpointKeys.
*
* @return Resource collection API of QnAMakerEndpointKeys.
*/
public QnAMakerEndpointKeys qnAMakerEndpointKeys() {
if (this.qnAMakerEndpointKeys == null) {
this.qnAMakerEndpointKeys = new QnAMakerEndpointKeysImpl(clientObject.getQnAMakerEndpointKeys(), this);
}
return qnAMakerEndpointKeys;
}

/**
* Gets the resource collection API of HostSettings.
*
Expand All @@ -344,12 +437,24 @@ public HostSettings hostSettings() {
}

/**
* Gets wrapped service client AzureBotService providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
* Gets the resource collection API of OperationResults.
*
* @return Resource collection API of OperationResults.
*/
public OperationResults operationResults() {
if (this.operationResults == null) {
this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this);
}
return operationResults;
}

/**
* Gets wrapped service client BotServiceManagementClient providing direct access to the underlying auto-generated
* API implementation, based on Azure REST API.
*
* @return Wrapped service client AzureBotService.
* @return Wrapped service client BotServiceManagementClient.
*/
public AzureBotService serviceClient() {
public BotServiceManagementClient serviceClient() {
return this.clientObject;
}
}
Loading
Loading