diff --git a/sdk/cosmos/mgmt-v2019_08_01_preview/pom.xml b/sdk/cosmos/mgmt-v2019_08_01_preview/pom.xml
index 5d27a686283c..8afdecd853bd 100644
--- a/sdk/cosmos/mgmt-v2019_08_01_preview/pom.xml
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/pom.xml
@@ -11,11 +11,11 @@
com.microsoft.azure
azure-arm-parent
- 1.2.0
+ 1.1.0
../../../pom.management.xml
azure-mgmt-cosmosdb
- 1.0.0-beta-2
+ 1.0.0-beta
jar
Microsoft Azure SDK for CosmosDB Management
This package contains Microsoft CosmosDB Management SDK.
diff --git a/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/NotebookWorkspace.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/NotebookWorkspace.java
new file mode 100644
index 000000000000..19182e5f90ed
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.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_08_01_preview.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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/NotebookWorkspaceConnectionInfoResult.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/NotebookWorkspaceConnectionInfoResult.java
new file mode 100644
index 000000000000..a458907460f0
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.implementation.CosmosDBManager;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/NotebookWorkspaceCreateUpdateParameters.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/NotebookWorkspaceCreateUpdateParameters.java
new file mode 100644
index 000000000000..291043e3d808
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview;
+
+
+/**
+ * Parameters to create a notebook workspace resource.
+ */
+public class NotebookWorkspaceCreateUpdateParameters extends ARMProxyResource {
+}
diff --git a/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/NotebookWorkspaces.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/NotebookWorkspaces.java
new file mode 100644
index 000000000000..6549e8913085
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview;
+
+import com.microsoft.azure.arm.collection.SupportsCreating;
+import rx.Completable;
+import rx.Observable;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/CosmosDBManagementClientImpl.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/CosmosDBManagementClientImpl.java
index 78270e426c9e..474014d371ef 100644
--- a/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/CosmosDBManagementClientImpl.java
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/CosmosDBManager.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/CosmosDBManager.java
index 140c5c37cbec..e73156f3df42 100644
--- a/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/CosmosDBManager.java
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/CosmosDBManager.java
@@ -34,6 +34,7 @@
import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.TableResources;
import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.CassandraResources;
import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.GremlinResources;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.NotebookWorkspaces;
import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.PrivateLinkResources;
import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspaceConnectionInfoResultInner.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspaceConnectionInfoResultInner.java
new file mode 100644
index 000000000000..9fa2c3c369eb
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview.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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspaceImpl.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspaceImpl.java
new file mode 100644
index 000000000000..ce48bb54d1a9
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview.implementation;
+
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspaceInner.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspaceInner.java
new file mode 100644
index 000000000000..8835e2932e2b
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspacesImpl.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspacesImpl.java
new file mode 100644
index 000000000000..dbf542e00653
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.NotebookWorkspaces;
+import rx.Completable;
+import rx.Observable;
+import rx.functions.Func1;
+import java.util.List;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.NotebookWorkspaceConnectionInfoResult;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.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_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspacesInner.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/NotebookWorkspacesInner.java
new file mode 100644
index 000000000000..33c193148ef3
--- /dev/null
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/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_08_01_preview.implementation;
+
+import com.microsoft.azure.arm.collection.InnerSupportsDelete;
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.ErrorResponseException;
+import com.microsoft.azure.management.cosmosdb.v2019_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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_08_01_preview.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);
+ }
+
+}
diff --git a/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/SqlResourcesInner.java b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/SqlResourcesInner.java
index 7bb21c05af4f..9d5ac6ac9e06 100644
--- a/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/SqlResourcesInner.java
+++ b/sdk/cosmos/mgmt-v2019_08_01_preview/src/main/java/com/microsoft/azure/management/cosmosdb/v2019_08_01_preview/implementation/SqlResourcesInner.java
@@ -135,7 +135,7 @@ interface SqlResourcesService {
Observable> beginUpdateSqlContainerThroughput(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body ThroughputSettingsUpdateParameters updateThroughputParameters, @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_08_01_preview.SqlResources listSqlStoredProcedures" })
- @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/")
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures")
Observable> listSqlStoredProcedures(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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_08_01_preview.SqlResources getSqlStoredProcedure" })
@@ -159,7 +159,7 @@ interface SqlResourcesService {
Observable> beginDeleteSqlStoredProcedure(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Path("storedProcedureName") String storedProcedureName, @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_08_01_preview.SqlResources listSqlUserDefinedFunctions" })
- @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/")
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions")
Observable> listSqlUserDefinedFunctions(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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_08_01_preview.SqlResources getSqlUserDefinedFunction" })
@@ -183,7 +183,7 @@ interface SqlResourcesService {
Observable> beginDeleteSqlUserDefinedFunction(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @Path("userDefinedFunctionName") String userDefinedFunctionName, @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_08_01_preview.SqlResources listSqlTriggers" })
- @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/")
+ @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers")
Observable> listSqlTriggers(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("databaseName") String databaseName, @Path("containerName") String containerName, @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_08_01_preview.SqlResources getSqlTrigger" })