diff --git a/sdk/cosmos/mgmt-v2019_12_12/pom.xml b/sdk/cosmos/mgmt-v2019_12_12/pom.xml index 0c9ad69a6044..c314cc1c0c30 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 000000000000..cb89d3676b8b --- /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 Name of an Azure resource group + * @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 000000000000..c75a43ae04a5 --- /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 000000000000..50b7d8b090d0 --- /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 000000000000..4815b5d9fc44 --- /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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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/ProvisionedThroughputSettingsResource.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ProvisionedThroughputSettingsResource.java new file mode 100644 index 000000000000..63a9f24afa00 --- /dev/null +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ProvisionedThroughputSettingsResource.java @@ -0,0 +1,85 @@ +/** + * 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * Cosmos DB provisioned throughput settings object. + */ +public class ProvisionedThroughputSettingsResource { + /** + * Represents maximum throughput container can scale up to. + */ + @JsonProperty(value = "maxThroughput", required = true) + private int maxThroughput; + + /** + * Cosmos DB resource auto-upgrade policy. + */ + @JsonProperty(value = "autoUpgradePolicy") + private AutoUpgradePolicyResource autoUpgradePolicy; + + /** + * Represents target maximum throughput container can scale up to once + * offer is no longer in pending state. + */ + @JsonProperty(value = "targetMaxThroughput", access = JsonProperty.Access.WRITE_ONLY) + private Integer targetMaxThroughput; + + /** + * Get represents maximum throughput container can scale up to. + * + * @return the maxThroughput value + */ + public int maxThroughput() { + return this.maxThroughput; + } + + /** + * Set represents maximum throughput container can scale up to. + * + * @param maxThroughput the maxThroughput value to set + * @return the ProvisionedThroughputSettingsResource object itself. + */ + public ProvisionedThroughputSettingsResource withMaxThroughput(int maxThroughput) { + this.maxThroughput = maxThroughput; + return this; + } + + /** + * Get cosmos DB resource auto-upgrade policy. + * + * @return the autoUpgradePolicy value + */ + public AutoUpgradePolicyResource autoUpgradePolicy() { + return this.autoUpgradePolicy; + } + + /** + * Set cosmos DB resource auto-upgrade policy. + * + * @param autoUpgradePolicy the autoUpgradePolicy value to set + * @return the ProvisionedThroughputSettingsResource object itself. + */ + public ProvisionedThroughputSettingsResource withAutoUpgradePolicy(AutoUpgradePolicyResource autoUpgradePolicy) { + this.autoUpgradePolicy = autoUpgradePolicy; + return this; + } + + /** + * Get represents target maximum throughput container can scale up to once offer is no longer in pending state. + * + * @return the targetMaxThroughput value + */ + public Integer targetMaxThroughput() { + return this.targetMaxThroughput; + } + +} diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ThroughputSettingsGetPropertiesResource.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ThroughputSettingsGetPropertiesResource.java index b2d19df2103a..ccf669913268 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ThroughputSettingsGetPropertiesResource.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ThroughputSettingsGetPropertiesResource.java @@ -16,17 +16,18 @@ public class ThroughputSettingsGetPropertiesResource { /** * Value of the Cosmos DB resource throughput. Either throughput is - * required or autopilotSettings is required, but not both. + * required or provisionedThroughputSettings is required, but not both. */ @JsonProperty(value = "throughput") private Integer throughput; /** - * Cosmos DB resource for Autopilot settings. Either throughput is required - * or autopilotSettings is required, but not both. + * Cosmos DB resource for provisioned throughput settings. Either + * throughput is required or provisionedThroughputSettings is required, but + * not both. */ - @JsonProperty(value = "autopilotSettings") - private AutopilotSettingsResource autopilotSettings; + @JsonProperty(value = "provisionedThroughputSettings") + private ProvisionedThroughputSettingsResource provisionedThroughputSettings; /** * The minimum throughput of the resource. @@ -61,7 +62,7 @@ public class ThroughputSettingsGetPropertiesResource { private String _etag; /** - * Get value of the Cosmos DB resource throughput. Either throughput is required or autopilotSettings is required, but not both. + * Get value of the Cosmos DB resource throughput. Either throughput is required or provisionedThroughputSettings is required, but not both. * * @return the throughput value */ @@ -70,7 +71,7 @@ public Integer throughput() { } /** - * Set value of the Cosmos DB resource throughput. Either throughput is required or autopilotSettings is required, but not both. + * Set value of the Cosmos DB resource throughput. Either throughput is required or provisionedThroughputSettings is required, but not both. * * @param throughput the throughput value to set * @return the ThroughputSettingsGetPropertiesResource object itself. @@ -81,22 +82,22 @@ public ThroughputSettingsGetPropertiesResource withThroughput(Integer throughput } /** - * Get cosmos DB resource for Autopilot settings. Either throughput is required or autopilotSettings is required, but not both. + * Get cosmos DB resource for provisioned throughput settings. Either throughput is required or provisionedThroughputSettings is required, but not both. * - * @return the autopilotSettings value + * @return the provisionedThroughputSettings value */ - public AutopilotSettingsResource autopilotSettings() { - return this.autopilotSettings; + public ProvisionedThroughputSettingsResource provisionedThroughputSettings() { + return this.provisionedThroughputSettings; } /** - * Set cosmos DB resource for Autopilot settings. Either throughput is required or autopilotSettings is required, but not both. + * Set cosmos DB resource for provisioned throughput settings. Either throughput is required or provisionedThroughputSettings is required, but not both. * - * @param autopilotSettings the autopilotSettings value to set + * @param provisionedThroughputSettings the provisionedThroughputSettings value to set * @return the ThroughputSettingsGetPropertiesResource object itself. */ - public ThroughputSettingsGetPropertiesResource withAutopilotSettings(AutopilotSettingsResource autopilotSettings) { - this.autopilotSettings = autopilotSettings; + public ThroughputSettingsGetPropertiesResource withProvisionedThroughputSettings(ProvisionedThroughputSettingsResource provisionedThroughputSettings) { + this.provisionedThroughputSettings = provisionedThroughputSettings; return this; } diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ThroughputSettingsResource.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ThroughputSettingsResource.java index 01320f65d00b..dee14539faa8 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ThroughputSettingsResource.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/ThroughputSettingsResource.java @@ -12,22 +12,23 @@ /** * Cosmos DB resource throughput object. Either throughput is required or - * autopilotSettings is required, but not both. + * provisionedThroughputSettings is required, but not both. */ public class ThroughputSettingsResource { /** * Value of the Cosmos DB resource throughput. Either throughput is - * required or autopilotSettings is required, but not both. + * required or provisionedThroughputSettings is required, but not both. */ @JsonProperty(value = "throughput") private Integer throughput; /** - * Cosmos DB resource for Autopilot settings. Either throughput is required - * or autopilotSettings is required, but not both. + * Cosmos DB resource for provisioned throughput settings. Either + * throughput is required or provisionedThroughputSettings is required, but + * not both. */ - @JsonProperty(value = "autopilotSettings") - private AutopilotSettingsResource autopilotSettings; + @JsonProperty(value = "provisionedThroughputSettings") + private ProvisionedThroughputSettingsResource provisionedThroughputSettings; /** * The minimum throughput of the resource. @@ -42,7 +43,7 @@ public class ThroughputSettingsResource { private String offerReplacePending; /** - * Get value of the Cosmos DB resource throughput. Either throughput is required or autopilotSettings is required, but not both. + * Get value of the Cosmos DB resource throughput. Either throughput is required or provisionedThroughputSettings is required, but not both. * * @return the throughput value */ @@ -51,7 +52,7 @@ public Integer throughput() { } /** - * Set value of the Cosmos DB resource throughput. Either throughput is required or autopilotSettings is required, but not both. + * Set value of the Cosmos DB resource throughput. Either throughput is required or provisionedThroughputSettings is required, but not both. * * @param throughput the throughput value to set * @return the ThroughputSettingsResource object itself. @@ -62,22 +63,22 @@ public ThroughputSettingsResource withThroughput(Integer throughput) { } /** - * Get cosmos DB resource for Autopilot settings. Either throughput is required or autopilotSettings is required, but not both. + * Get cosmos DB resource for provisioned throughput settings. Either throughput is required or provisionedThroughputSettings is required, but not both. * - * @return the autopilotSettings value + * @return the provisionedThroughputSettings value */ - public AutopilotSettingsResource autopilotSettings() { - return this.autopilotSettings; + public ProvisionedThroughputSettingsResource provisionedThroughputSettings() { + return this.provisionedThroughputSettings; } /** - * Set cosmos DB resource for Autopilot settings. Either throughput is required or autopilotSettings is required, but not both. + * Set cosmos DB resource for provisioned throughput settings. Either throughput is required or provisionedThroughputSettings is required, but not both. * - * @param autopilotSettings the autopilotSettings value to set + * @param provisionedThroughputSettings the provisionedThroughputSettings value to set * @return the ThroughputSettingsResource object itself. */ - public ThroughputSettingsResource withAutopilotSettings(AutopilotSettingsResource autopilotSettings) { - this.autopilotSettings = autopilotSettings; + public ThroughputSettingsResource withProvisionedThroughputSettings(ProvisionedThroughputSettingsResource provisionedThroughputSettings) { + this.provisionedThroughputSettings = provisionedThroughputSettings; return this; } diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/CosmosDBManagementClientImpl.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/CosmosDBManagementClientImpl.java index c1b4728b90be..8ff33e90c295 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/CosmosDBManagementClientImpl.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/CosmosDBManagementClientImpl.java @@ -377,6 +377,19 @@ public GremlinResourcesInner gremlinResources() { return this.gremlinResources; } + /** + * The NotebookWorkspacesInner object to access its operations. + */ + private NotebookWorkspacesInner notebookWorkspaces; + + /** + * Gets the NotebookWorkspacesInner object to access its operations. + * @return the NotebookWorkspacesInner object. + */ + public NotebookWorkspacesInner notebookWorkspaces() { + return this.notebookWorkspaces; + } + /** * The PrivateLinkResourcesInner object to access its operations. */ @@ -455,6 +468,7 @@ protected void initialize() { this.tableResources = new TableResourcesInner(restClient().retrofit(), this); this.cassandraResources = new CassandraResourcesInner(restClient().retrofit(), this); this.gremlinResources = new GremlinResourcesInner(restClient().retrofit(), this); + this.notebookWorkspaces = new NotebookWorkspacesInner(restClient().retrofit(), this); this.privateLinkResources = new PrivateLinkResourcesInner(restClient().retrofit(), this); this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); diff --git a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/CosmosDBManager.java b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/CosmosDBManager.java index 65ad284c9088..b126f8727b88 100644 --- a/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/CosmosDBManager.java +++ b/sdk/cosmos/mgmt-v2019_12_12/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_12_12/implementation/CosmosDBManager.java @@ -34,6 +34,7 @@ import com.microsoft.azure.management.cosmosdb.v2019_12_12.TableResources; import com.microsoft.azure.management.cosmosdb.v2019_12_12.CassandraResources; import com.microsoft.azure.management.cosmosdb.v2019_12_12.GremlinResources; +import com.microsoft.azure.management.cosmosdb.v2019_12_12.NotebookWorkspaces; import com.microsoft.azure.management.cosmosdb.v2019_12_12.PrivateLinkResources; import com.microsoft.azure.management.cosmosdb.v2019_12_12.PrivateEndpointConnections; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; @@ -61,6 +62,7 @@ public final class CosmosDBManager extends ManagerCore 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 000000000000..8acaa75b1142 --- /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 000000000000..e82fca9251cc --- /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 000000000000..0f7eda92c613 --- /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 000000000000..9e4d15880e59 --- /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 000000000000..1e744c0c4eeb --- /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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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 Name of an Azure resource group. + * @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); + } + +}