From 870783a9406dd53b7b694dafd74e9c8fa082d3fa Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 1 May 2020 06:45:35 +0000 Subject: [PATCH] Update from master --- sdk/cosmos/mgmt-v2019_12_12/pom.xml | 2 +- .../v2019_12_12/NotebookWorkspace.java | 98 ++ ...NotebookWorkspaceConnectionInfoResult.java | 30 + ...tebookWorkspaceCreateUpdateParameters.java | 16 + .../v2019_12_12/NotebookWorkspaces.java | 81 ++ .../PrivateEndpointConnection.java | 62 +- .../v2019_12_12/PrivateLinkResource.java | 5 + .../v2019_12_12/PrivateLinkResources.java | 4 +- ...ProvisionedThroughputSettingsResource.java | 85 ++ ...roughputSettingsGetPropertiesResource.java | 31 +- .../ThroughputSettingsResource.java | 33 +- .../CosmosDBManagementClientImpl.java | 14 + .../implementation/CosmosDBManager.java | 12 + ...bookWorkspaceConnectionInfoResultImpl.java | 36 + ...ookWorkspaceConnectionInfoResultInner.java | 48 + .../implementation/NotebookWorkspaceImpl.java | 102 ++ .../NotebookWorkspaceInner.java | 51 + .../NotebookWorkspacesImpl.java | 110 ++ .../NotebookWorkspacesInner.java | 975 ++++++++++++++++++ .../PrivateEndpointConnectionImpl.java | 22 + .../PrivateEndpointConnectionInner.java | 52 + .../PrivateLinkResourceImpl.java | 5 + .../PrivateLinkResourceInner.java | 15 + .../PrivateLinkResourcesInner.java | 16 +- 24 files changed, 1861 insertions(+), 44 deletions(-) create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspace.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaceConnectionInfoResult.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaceCreateUpdateParameters.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaces.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ProvisionedThroughputSettingsResource.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceConnectionInfoResultImpl.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceConnectionInfoResultInner.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceImpl.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceInner.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspacesImpl.java create mode 100644 sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspacesInner.java diff --git a/sdk/cosmos/mgmt-v2019_12_12/pom.xml b/sdk/cosmos/mgmt-v2019_12_12/pom.xml index 0c9ad69a60448..c314cc1c0c305 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/pom.xml +++ b/sdk/cosmos/mgmt-v2019_12_12/pom.xml @@ -11,7 +11,7 @@ com.microsoft.azure azure-arm-parent - 1.3.0 + 1.1.0 ../../../pom.management.xml azure-mgmt-cosmosdb diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspace.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspace.java new file mode 100644 index 0000000000000..8e3400f4aa111 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspace.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation.NotebookWorkspaceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation.CosmosDBManager; + +/** + * Type representing NotebookWorkspace. + */ +public interface NotebookWorkspace extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the notebookServerEndpoint value. + */ + String notebookServerEndpoint(); + + /** + * @return the status value. + */ + String status(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the NotebookWorkspace definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithDatabaseAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of NotebookWorkspace definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a NotebookWorkspace definition. + */ + interface Blank extends WithDatabaseAccount { + } + + /** + * The stage of the notebookworkspace definition allowing to specify DatabaseAccount. + */ + interface WithDatabaseAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param accountName Cosmos DB database account name + * @return the next definition stage + */ + WithCreate withExistingDatabaseAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a NotebookWorkspace update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of NotebookWorkspace update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaceConnectionInfoResult.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaceConnectionInfoResult.java new file mode 100644 index 0000000000000..c75a43ae04a50 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaceConnectionInfoResult.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation.CosmosDBManager; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation.NotebookWorkspaceConnectionInfoResultInner; + +/** + * Type representing NotebookWorkspaceConnectionInfoResult. + */ +public interface NotebookWorkspaceConnectionInfoResult extends HasInner, HasManager { + /** + * @return the authToken value. + */ + String authToken(); + + /** + * @return the notebookServerEndpoint value. + */ + String notebookServerEndpoint(); + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaceCreateUpdateParameters.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaceCreateUpdateParameters.java new file mode 100644 index 0000000000000..50b7d8b090d02 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaceCreateUpdateParameters.java @@ -0,0 +1,16 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12; + + +/** + * Parameters to create a notebook workspace resource. + */ +public class NotebookWorkspaceCreateUpdateParameters extends ARMProxyResource { +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaces.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaces.java new file mode 100644 index 0000000000000..f1092f1e25bba --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/NotebookWorkspaces.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation.NotebookWorkspacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing NotebookWorkspaces. + */ +public interface NotebookWorkspaces extends SupportsCreating, HasInner { + /** + * Retrieves the connection info for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listConnectionInfoAsync(String resourceGroupName, String accountName); + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable regenerateAuthTokenAsync(String resourceGroupName, String accountName); + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String accountName); + + /** + * Gets the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName); + + /** + * Gets the notebook workspace resources of an existing Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByDatabaseAccountAsync(String resourceGroupName, String accountName); + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateEndpointConnection.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateEndpointConnection.java index 5171ac2376797..e93556baf66f1 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateEndpointConnection.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateEndpointConnection.java @@ -22,6 +22,11 @@ * Type representing PrivateEndpointConnection. */ public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the groupId value. + */ + String groupId(); + /** * @return the id value. */ @@ -42,6 +47,11 @@ public interface PrivateEndpointConnection extends HasInner, DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + interface WithCreate extends Creatable, DefinitionStages.WithGroupId, DefinitionStages.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState, DefinitionStages.WithProvisioningState { } } /** * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + interface Update extends Appliable, UpdateStages.WithGroupId, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState, UpdateStages.WithProvisioningState { } /** * Grouping of PrivateEndpointConnection update stages. */ interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify GroupId. + */ + interface WithGroupId { + /** + * Specifies groupId. + * @param groupId Group id of the private endpoint + * @return the next update stage + */ + Update withGroupId(String groupId); + } + /** * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. */ @@ -142,5 +188,17 @@ interface WithPrivateLinkServiceConnectionState { Update withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState); } + /** + * The stage of the privateendpointconnection update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState Provisioning state of the private endpoint + * @return the next update stage + */ + Update withProvisioningState(String provisioningState); + } + } } diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateLinkResource.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateLinkResource.java index 72f85698411e4..41c2890cba86f 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateLinkResource.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateLinkResource.java @@ -40,6 +40,11 @@ public interface PrivateLinkResource extends HasInner, */ List requiredMembers(); + /** + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + /** * @return the type value. */ diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateLinkResources.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateLinkResources.java index 4fc657af11f8f..f60b6047d7ff1 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateLinkResources.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/PrivateLinkResources.java @@ -19,7 +19,7 @@ public interface PrivateLinkResources extends HasInner implements NotebookWorkspaceConnectionInfoResult { + private final CosmosDBManager manager; + NotebookWorkspaceConnectionInfoResultImpl(NotebookWorkspaceConnectionInfoResultInner inner, CosmosDBManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public String authToken() { + return this.inner().authToken(); + } + + @Override + public String notebookServerEndpoint() { + return this.inner().notebookServerEndpoint(); + } + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceConnectionInfoResultInner.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceConnectionInfoResultInner.java new file mode 100644 index 0000000000000..8acaa75b11427 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceConnectionInfoResultInner.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The connection info for the given notebook workspace. + */ +public class NotebookWorkspaceConnectionInfoResultInner { + /** + * Specifies auth token used for connecting to Notebook server (uses + * token-based auth). + */ + @JsonProperty(value = "authToken", access = JsonProperty.Access.WRITE_ONLY) + private String authToken; + + /** + * Specifies the endpoint of Notebook server. + */ + @JsonProperty(value = "notebookServerEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String notebookServerEndpoint; + + /** + * Get specifies auth token used for connecting to Notebook server (uses token-based auth). + * + * @return the authToken value + */ + public String authToken() { + return this.authToken; + } + + /** + * Get specifies the endpoint of Notebook server. + * + * @return the notebookServerEndpoint value + */ + public String notebookServerEndpoint() { + return this.notebookServerEndpoint; + } + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceImpl.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceImpl.java new file mode 100644 index 0000000000000..e82fca9251cc1 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceImpl.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation; + +import com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspace; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class NotebookWorkspaceImpl extends CreatableUpdatableImpl implements NotebookWorkspace, NotebookWorkspace.Definition, NotebookWorkspace.Update { + private final CosmosDBManager manager; + private String resourceGroupName; + private String accountName; + + NotebookWorkspaceImpl(String name, CosmosDBManager manager) { + super(name, new NotebookWorkspaceInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + } + + NotebookWorkspaceImpl(NotebookWorkspaceInner inner, CosmosDBManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "databaseAccounts"); + // + } + + @Override + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + NotebookWorkspacesInner client = this.manager().inner().notebookWorkspaces(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + NotebookWorkspacesInner client = this.manager().inner().notebookWorkspaces(); + return client.createOrUpdateAsync(this.resourceGroupName, this.accountName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + NotebookWorkspacesInner client = this.manager().inner().notebookWorkspaces(); + return client.getAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String notebookServerEndpoint() { + return this.inner().notebookServerEndpoint(); + } + + @Override + public String status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public NotebookWorkspaceImpl withExistingDatabaseAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceInner.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceInner.java new file mode 100644 index 0000000000000..0f7eda92c6133 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspaceInner.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.ARMProxyResource; + +/** + * A notebook workspace resource. + */ +@JsonFlatten +public class NotebookWorkspaceInner extends ARMProxyResource { + /** + * Specifies the endpoint of Notebook server. + */ + @JsonProperty(value = "properties.notebookServerEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String notebookServerEndpoint; + + /** + * Status of the notebook workspace. Possible values are: Creating, Online, + * Deleting, Failed, Updating. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private String status; + + /** + * Get specifies the endpoint of Notebook server. + * + * @return the notebookServerEndpoint value + */ + public String notebookServerEndpoint() { + return this.notebookServerEndpoint; + } + + /** + * Get status of the notebook workspace. Possible values are: Creating, Online, Deleting, Failed, Updating. + * + * @return the status value + */ + public String status() { + return this.status; + } + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspacesImpl.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspacesImpl.java new file mode 100644 index 0000000000000..9e4d15880e590 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspacesImpl.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaceConnectionInfoResult; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspace; + +class NotebookWorkspacesImpl extends WrapperImpl implements NotebookWorkspaces { + private final CosmosDBManager manager; + + NotebookWorkspacesImpl(CosmosDBManager manager) { + super(manager.inner().notebookWorkspaces()); + this.manager = manager; + } + + public CosmosDBManager manager() { + return this.manager; + } + + @Override + public NotebookWorkspaceImpl define(String name) { + return wrapModel(name); + } + + private NotebookWorkspaceImpl wrapModel(NotebookWorkspaceInner inner) { + return new NotebookWorkspaceImpl(inner, manager()); + } + + private NotebookWorkspaceImpl wrapModel(String name) { + return new NotebookWorkspaceImpl(name, this.manager()); + } + + @Override + public Observable listConnectionInfoAsync(String resourceGroupName, String accountName) { + NotebookWorkspacesInner client = this.inner(); + return client.listConnectionInfoAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public NotebookWorkspaceConnectionInfoResult call(NotebookWorkspaceConnectionInfoResultInner inner) { + return new NotebookWorkspaceConnectionInfoResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable regenerateAuthTokenAsync(String resourceGroupName, String accountName) { + NotebookWorkspacesInner client = this.inner(); + return client.regenerateAuthTokenAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String accountName) { + NotebookWorkspacesInner client = this.inner(); + return client.startAsync(resourceGroupName, accountName).toCompletable(); + } + + @Override + public Observable listByDatabaseAccountAsync(String resourceGroupName, String accountName) { + NotebookWorkspacesInner client = this.inner(); + return client.listByDatabaseAccountAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public NotebookWorkspace call(NotebookWorkspaceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName) { + NotebookWorkspacesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(NotebookWorkspaceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((NotebookWorkspace)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName) { + NotebookWorkspacesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName).toCompletable(); + } + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspacesInner.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspacesInner.java new file mode 100644 index 0000000000000..7c943bcc0cc64 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/NotebookWorkspacesInner.java @@ -0,0 +1,975 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.cosmosdb.v2019_12_12.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.ErrorResponseException; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaceCreateUpdateParameters; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in NotebookWorkspaces. + */ +public class NotebookWorkspacesInner implements InnerSupportsDelete { + /** The Retrofit service to perform REST calls. */ + private NotebookWorkspacesService service; + /** The service client containing this operation class. */ + private CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of NotebookWorkspacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public NotebookWorkspacesInner(Retrofit retrofit, CosmosDBManagementClientImpl client) { + this.service = retrofit.create(NotebookWorkspacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for NotebookWorkspaces to be + * used by Retrofit to perform actually REST calls. + */ + interface NotebookWorkspacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces listByDatabaseAccount" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces") + Observable> listByDatabaseAccount(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces listConnectionInfo" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo") + Observable> listConnectionInfo(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces regenerateAuthToken" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken") + Observable> regenerateAuthToken(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces beginRegenerateAuthToken" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken") + Observable> beginRegenerateAuthToken(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("notebookWorkspaceName") String notebookWorkspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the List<NotebookWorkspaceInner> object if successful. + */ + public List listByDatabaseAccount(String resourceGroupName, String accountName) { + return listByDatabaseAccountWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByDatabaseAccountAsync(String resourceGroupName, String accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByDatabaseAccountWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NotebookWorkspaceInner> object + */ + public Observable> listByDatabaseAccountAsync(String resourceGroupName, String accountName) { + return listByDatabaseAccountWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<NotebookWorkspaceInner> object + */ + public Observable>> listByDatabaseAccountWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String apiVersion = "2019-08-01"; + return service.listByDatabaseAccount(this.client.subscriptionId(), resourceGroupName, accountName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByDatabaseAccountDelegate(response); + List items = null; + if (result.body() != null) { + items = result.body().items(); + } + ServiceResponse> clientResponse = new ServiceResponse>(items, result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByDatabaseAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotebookWorkspaceInner object if successful. + */ + public NotebookWorkspaceInner get(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotebookWorkspaceInner object + */ + public Observable getAsync(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, NotebookWorkspaceInner>() { + @Override + public NotebookWorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotebookWorkspaceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + return service.get(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Creates the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotebookWorkspaceInner object if successful. + */ + public NotebookWorkspaceInner createOrUpdate(String resourceGroupName, String accountName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Creates the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Creates the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String accountName) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, NotebookWorkspaceInner>() { + @Override + public NotebookWorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), notebookCreateUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotebookWorkspaceInner object if successful. + */ + public NotebookWorkspaceInner beginCreateOrUpdate(String resourceGroupName, String accountName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Creates the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Creates the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotebookWorkspaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String accountName) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, NotebookWorkspaceInner>() { + @Override + public NotebookWorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotebookWorkspaceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), notebookCreateUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String accountName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the notebook workspace for a Cosmos DB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieves the connection info for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the NotebookWorkspaceConnectionInfoResultInner object if successful. + */ + public NotebookWorkspaceConnectionInfoResultInner listConnectionInfo(String resourceGroupName, String accountName) { + return listConnectionInfoWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Retrieves the connection info for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listConnectionInfoAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listConnectionInfoWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Retrieves the connection info for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotebookWorkspaceConnectionInfoResultInner object + */ + public Observable listConnectionInfoAsync(String resourceGroupName, String accountName) { + return listConnectionInfoWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, NotebookWorkspaceConnectionInfoResultInner>() { + @Override + public NotebookWorkspaceConnectionInfoResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the connection info for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the NotebookWorkspaceConnectionInfoResultInner object + */ + public Observable> listConnectionInfoWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + return service.listConnectionInfo(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listConnectionInfoDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listConnectionInfoDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void regenerateAuthToken(String resourceGroupName, String accountName) { + regenerateAuthTokenWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateAuthTokenAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateAuthTokenWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable regenerateAuthTokenAsync(String resourceGroupName, String accountName) { + return regenerateAuthTokenWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> regenerateAuthTokenWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + Observable> observable = service.regenerateAuthToken(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRegenerateAuthToken(String resourceGroupName, String accountName) { + beginRegenerateAuthTokenWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginRegenerateAuthTokenAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRegenerateAuthTokenWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRegenerateAuthTokenAsync(String resourceGroupName, String accountName) { + return beginRegenerateAuthTokenWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the auth token for the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRegenerateAuthTokenWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + return service.beginRegenerateAuthToken(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRegenerateAuthTokenDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRegenerateAuthTokenDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String accountName) { + startWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().body(); + } + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String accountName) { + return startWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + Observable> observable = service.start(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String accountName) { + beginStartWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String accountName) { + return beginStartWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts the notebook workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + final String notebookWorkspaceName = "default"; + final String apiVersion = "2019-08-01"; + return service.beginStart(this.client.subscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateEndpointConnectionImpl.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateEndpointConnectionImpl.java index 6fa632dd785af..30effe59f9a05 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateEndpointConnectionImpl.java @@ -71,6 +71,11 @@ public boolean isInCreateMode() { } + @Override + public String groupId() { + return this.inner().groupId(); + } + @Override public String id() { return this.inner().id(); @@ -91,6 +96,11 @@ public PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionSta return this.inner().privateLinkServiceConnectionState(); } + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + @Override public String type() { return this.inner().type(); @@ -103,6 +113,12 @@ public PrivateEndpointConnectionImpl withExistingDatabaseAccount(String resource return this; } + @Override + public PrivateEndpointConnectionImpl withGroupId(String groupId) { + this.inner().withGroupId(groupId); + return this; + } + @Override public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpointProperty privateEndpoint) { this.inner().withPrivateEndpoint(privateEndpoint); @@ -115,4 +131,10 @@ public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(Priva return this; } + @Override + public PrivateEndpointConnectionImpl withProvisioningState(String provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateEndpointConnectionInner.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateEndpointConnectionInner.java index 45e04a7811ba7..f16ffa2802ebc 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateEndpointConnectionInner.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateEndpointConnectionInner.java @@ -31,6 +31,18 @@ public class PrivateEndpointConnectionInner extends ProxyResource { @JsonProperty(value = "properties.privateLinkServiceConnectionState") private PrivateLinkServiceConnectionStateProperty privateLinkServiceConnectionState; + /** + * Group id of the private endpoint. + */ + @JsonProperty(value = "properties.groupId") + private String groupId; + + /** + * Provisioning state of the private endpoint. + */ + @JsonProperty(value = "properties.provisioningState") + private String provisioningState; + /** * Get private endpoint which the connection belongs to. * @@ -71,4 +83,44 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(Priv return this; } + /** + * Get group id of the private endpoint. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Set group id of the private endpoint. + * + * @param groupId the groupId value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get provisioning state of the private endpoint. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Set provisioning state of the private endpoint. + * + * @param provisioningState the provisioningState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withProvisioningState(String provisioningState) { + this.provisioningState = provisioningState; + return this; + } + } diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourceImpl.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourceImpl.java index fd526da517102..45dcf6a23b011 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourceImpl.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourceImpl.java @@ -61,6 +61,11 @@ public List requiredMembers() { return this.inner().requiredMembers(); } + @Override + public List requiredZoneNames() { + return this.inner().requiredZoneNames(); + } + @Override public String type() { return this.inner().type(); diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourceInner.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourceInner.java index fabd8ebc3045e..c82a5ab343149 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourceInner.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourceInner.java @@ -30,6 +30,12 @@ public class PrivateLinkResourceInner extends ARMProxyResource { @JsonProperty(value = "properties.requiredMembers", access = JsonProperty.Access.WRITE_ONLY) private List requiredMembers; + /** + * The private link resource required zone names. + */ + @JsonProperty(value = "properties.requiredZoneNames", access = JsonProperty.Access.WRITE_ONLY) + private List requiredZoneNames; + /** * Get the private link resource group id. * @@ -48,4 +54,13 @@ public List requiredMembers() { return this.requiredMembers; } + /** + * Get the private link resource required zone names. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + } diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourcesInner.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourcesInner.java index 3173659890580..19da1d75ceb67 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourcesInner.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/PrivateLinkResourcesInner.java @@ -65,7 +65,7 @@ interface PrivateLinkResourcesService { /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server @@ -79,7 +79,7 @@ public List listByDatabaseAccount(String resourceGroup /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -92,7 +92,7 @@ public ServiceFuture> listByDatabaseAccountAsync( /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the List<PrivateLinkResourceInner> object @@ -109,7 +109,7 @@ public List call(ServiceResponse> listByDatabaseAccoun /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -169,7 +169,7 @@ public PrivateLinkResourceInner get(String resourceGroupName, String accountName /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. @@ -183,7 +183,7 @@ public ServiceFuture getAsync(String resourceGroupName /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation @@ -201,7 +201,7 @@ public PrivateLinkResourceInner call(ServiceResponse r /** * Gets the private link resources that need to be created for a Cosmos DB account. * - * @param resourceGroupName Name of an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation