diff --git a/powerbi/resource-manager/v2016_01_29/pom.xml b/powerbi/resource-manager/v2016_01_29/pom.xml new file mode 100644 index 000000000000..bc79cca0db4f --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.powerbi.v2016_01_29 + + com.microsoft.azure + azure-arm-parent + 0.0.3-beta + ../../../pom.xml + + azure-mgmt-powerbi + 1.0.0-beta + jar + Microsoft Azure SDK for PowerBI Management + This package contains Microsoft PowerBI Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/AccessKeyName.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/AccessKeyName.java new file mode 100644 index 000000000000..2add8a40f50f --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/AccessKeyName.java @@ -0,0 +1,53 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for AccessKeyName. + */ +public enum AccessKeyName { + /** Enum value key1. */ + KEY1("key1"), + + /** Enum value key2. */ + KEY2("key2"); + + /** The actual serialized value for a AccessKeyName instance. */ + private String value; + + AccessKeyName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AccessKeyName instance. + * + * @param value the serialized value to parse. + * @return the parsed AccessKeyName object, or null if unable to parse. + */ + @JsonCreator + public static AccessKeyName fromString(String value) { + AccessKeyName[] items = AccessKeyName.values(); + for (AccessKeyName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/AzureSku.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/AzureSku.java new file mode 100644 index 000000000000..e116e1f61385 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/AzureSku.java @@ -0,0 +1,77 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The AzureSku model. + */ +public class AzureSku { + /** + * SKU name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * SKU tier. + */ + @JsonProperty(value = "tier", required = true) + private String tier; + + /** + * Creates an instance of AzureSku class. + */ + public AzureSku() { + name = "S1"; + tier = "Standard"; + } + + /** + * Get sKU name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set sKU name. + * + * @param name the name value to set + * @return the AzureSku object itself. + */ + public AzureSku withName(String name) { + this.name = name; + return this; + } + + /** + * Get sKU tier. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set sKU tier. + * + * @param tier the tier value to set + * @return the AzureSku object itself. + */ + public AzureSku withTier(String tier) { + this.tier = tier; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameReason.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameReason.java new file mode 100644 index 000000000000..8c0c9f9e1fa1 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameReason.java @@ -0,0 +1,41 @@ +/** + * 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.powerbi.v2016_01_29; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for CheckNameReason. + */ +public final class CheckNameReason extends ExpandableStringEnum { + /** Static value Unavailable for CheckNameReason. */ + public static final CheckNameReason UNAVAILABLE = fromString("Unavailable"); + + /** Static value Invalid for CheckNameReason. */ + public static final CheckNameReason INVALID = fromString("Invalid"); + + /** + * Creates or finds a CheckNameReason from its string representation. + * @param name a name to look for + * @return the corresponding CheckNameReason + */ + @JsonCreator + public static CheckNameReason fromString(String name) { + return fromString(name, CheckNameReason.class); + } + + /** + * @return known CheckNameReason values + */ + public static Collection values() { + return values(CheckNameReason.class); + } +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameRequest.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameRequest.java new file mode 100644 index 000000000000..874577d24f51 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameRequest.java @@ -0,0 +1,69 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameRequest model. + */ +public class CheckNameRequest { + /** + * Workspace collection name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Get workspace collection name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set workspace collection name. + * + * @param name the name value to set + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type. + * + * @param type the type value to set + * @return the CheckNameRequest object itself. + */ + public CheckNameRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameResponse.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameResponse.java new file mode 100644 index 000000000000..7f84824fdaf5 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CheckNameResponse.java @@ -0,0 +1,35 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.PowerBIManager; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.CheckNameResponseInner; + +/** + * Type representing CheckNameResponse. + */ +public interface CheckNameResponse extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + CheckNameReason reason(); + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CreateWorkspaceCollectionRequest.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CreateWorkspaceCollectionRequest.java new file mode 100644 index 000000000000..f6ff0cc3cbab --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/CreateWorkspaceCollectionRequest.java @@ -0,0 +1,103 @@ +/** + * 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.powerbi.v2016_01_29; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CreateWorkspaceCollectionRequest model. + */ +public class CreateWorkspaceCollectionRequest { + /** + * Azure location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The tags property. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /** + * Creates an instance of CreateWorkspaceCollectionRequest class. + */ + public CreateWorkspaceCollectionRequest() { + sku = new AzureSku(); + } + + /** + * Get azure location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure location. + * + * @param location the location value to set + * @return the CreateWorkspaceCollectionRequest object itself. + */ + public CreateWorkspaceCollectionRequest withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the CreateWorkspaceCollectionRequest object itself. + */ + public CreateWorkspaceCollectionRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the CreateWorkspaceCollectionRequest object itself. + */ + public CreateWorkspaceCollectionRequest withSku(AzureSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Display.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Display.java new file mode 100644 index 000000000000..84b31b0e7c4f --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Display.java @@ -0,0 +1,159 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Display model. + */ +public class Display { + /** + * The localized friendly form of the resource provider name. This form is + * also expected to include the publisher/company responsible. Use Title + * Casing. Begin with "Microsoft" for 1st party services. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The localized friendly form of the resource type related to this + * action/operation. This form should match the public documentation for + * the resource provider. Use Title Casing. For examples, refer to the + * "name" section. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The localized friendly name for the operation as shown to the user. This + * name should be concise (to fit in drop downs), but clear + * (self-documenting). Use Title Casing and include the entity/resource to + * which it applies. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The localized friendly description for the operation as shown to the + * user. This description should be thorough, yet concise. It will be used + * in tool-tips and detailed views. + */ + @JsonProperty(value = "description") + private String description; + + /** + * The intended executor of the operation; governs the display of the + * operation in the RBAC UX and the audit logs UX. Default value is + * 'user,system'. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Get the localized friendly form of the resource provider name. This form is also expected to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st party services. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the localized friendly form of the resource provider name. This form is also expected to include the publisher/company responsible. Use Title Casing. Begin with "Microsoft" for 1st party services. + * + * @param provider the provider value to set + * @return the Display object itself. + */ + public Display withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the localized friendly form of the resource type related to this action/operation. This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer to the "name" section. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the localized friendly form of the resource type related to this action/operation. This form should match the public documentation for the resource provider. Use Title Casing. For examples, refer to the "name" section. + * + * @param resource the resource value to set + * @return the Display object itself. + */ + public Display withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the localized friendly name for the operation as shown to the user. This name should be concise (to fit in drop downs), but clear (self-documenting). Use Title Casing and include the entity/resource to which it applies. + * + * @param operation the operation value to set + * @return the Display object itself. + */ + public Display withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the localized friendly description for the operation as shown to the user. This description should be thorough, yet concise. It will be used in tool-tips and detailed views. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the localized friendly description for the operation as shown to the user. This description should be thorough, yet concise. It will be used in tool-tips and detailed views. + * + * @param description the description value to set + * @return the Display object itself. + */ + public Display withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is 'user,system'. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is 'user,system'. + * + * @param origin the origin value to set + * @return the Display object itself. + */ + public Display withOrigin(String origin) { + this.origin = origin; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Error.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Error.java new file mode 100644 index 000000000000..f2905393188e --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Error.java @@ -0,0 +1,122 @@ +/** + * 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.powerbi.v2016_01_29; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Error model. + */ +public class Error { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The details property. + */ + @JsonProperty(value = "details") + private List details; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the Error object itself. + */ + public Error withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the details value. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Set the details value. + * + * @param details the details value to set + * @return the Error object itself. + */ + public Error withDetails(List details) { + this.details = details; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/ErrorDetail.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/ErrorDetail.java new file mode 100644 index 000000000000..30c4607c4079 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/ErrorDetail.java @@ -0,0 +1,95 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ErrorDetail model. + */ +public class ErrorDetail { + /** + * The code property. + */ + @JsonProperty(value = "code") + private String code; + + /** + * The message property. + */ + @JsonProperty(value = "message") + private String message; + + /** + * The target property. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @param message the message value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get the target value. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the target value. + * + * @param target the target value to set + * @return the ErrorDetail object itself. + */ + public ErrorDetail withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/ErrorException.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/ErrorException.java new file mode 100644 index 000000000000..6deb74117b62 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/ErrorException.java @@ -0,0 +1,44 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with Error information. + */ +public class ErrorException extends RestException { + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorException(final String message, final Response response, final Error body) { + super(message, response, body); + } + + @Override + public Error body() { + return (Error) super.body(); + } +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/MigrateWorkspaceCollectionRequest.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/MigrateWorkspaceCollectionRequest.java new file mode 100644 index 000000000000..78eda8df5021 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/MigrateWorkspaceCollectionRequest.java @@ -0,0 +1,71 @@ +/** + * 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.powerbi.v2016_01_29; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The MigrateWorkspaceCollectionRequest model. + */ +public class MigrateWorkspaceCollectionRequest { + /** + * Name of the resource group the Power BI workspace collections will be + * migrated to. + */ + @JsonProperty(value = "targetResourceGroup") + private String targetResourceGroup; + + /** + * The resources property. + */ + @JsonProperty(value = "resources") + private List resources; + + /** + * Get name of the resource group the Power BI workspace collections will be migrated to. + * + * @return the targetResourceGroup value + */ + public String targetResourceGroup() { + return this.targetResourceGroup; + } + + /** + * Set name of the resource group the Power BI workspace collections will be migrated to. + * + * @param targetResourceGroup the targetResourceGroup value to set + * @return the MigrateWorkspaceCollectionRequest object itself. + */ + public MigrateWorkspaceCollectionRequest withTargetResourceGroup(String targetResourceGroup) { + this.targetResourceGroup = targetResourceGroup; + return this; + } + + /** + * Get the resources value. + * + * @return the resources value + */ + public List resources() { + return this.resources; + } + + /** + * Set the resources value. + * + * @param resources the resources value to set + * @return the MigrateWorkspaceCollectionRequest object itself. + */ + public MigrateWorkspaceCollectionRequest withResources(List resources) { + this.resources = resources; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Operation.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Operation.java new file mode 100644 index 000000000000..b44f1fd849c8 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Operation.java @@ -0,0 +1,71 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Operation model. + */ +public class Operation { + /** + * The name of the operation being performed on this particular object. + * This name should match the action name that appears in RBAC / the event + * service. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display property. + */ + @JsonProperty(value = "display") + private Display display; + + /** + * Get the name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation being performed on this particular object. This name should match the action name that appears in RBAC / the event service. + * + * @param name the name value to set + * @return the Operation object itself. + */ + public Operation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public Display display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the Operation object itself. + */ + public Operation withDisplay(Display display) { + this.display = display; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/UpdateWorkspaceCollectionRequest.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/UpdateWorkspaceCollectionRequest.java new file mode 100644 index 000000000000..f56b05129ab3 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/UpdateWorkspaceCollectionRequest.java @@ -0,0 +1,77 @@ +/** + * 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.powerbi.v2016_01_29; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UpdateWorkspaceCollectionRequest model. + */ +public class UpdateWorkspaceCollectionRequest { + /** + * The tags property. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /** + * Creates an instance of UpdateWorkspaceCollectionRequest class. + */ + public UpdateWorkspaceCollectionRequest() { + sku = new AzureSku(); + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the UpdateWorkspaceCollectionRequest object itself. + */ + public UpdateWorkspaceCollectionRequest withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the UpdateWorkspaceCollectionRequest object itself. + */ + public UpdateWorkspaceCollectionRequest withSku(AzureSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Workspace.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Workspace.java new file mode 100644 index 000000000000..91e3916f715e --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Workspace.java @@ -0,0 +1,40 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.WorkspaceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.PowerBIManager; + +/** + * Type representing Workspace. + */ +public interface Workspace extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + Object properties(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollection.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollection.java new file mode 100644 index 000000000000..81a129bfe37f --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollection.java @@ -0,0 +1,103 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +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.powerbi.v2016_01_29.implementation.PowerBIManager; +import java.util.Map; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.WorkspaceCollectionInner; + +/** + * Type representing WorkspaceCollection. + */ +public interface WorkspaceCollection extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the properties value. + */ + Object properties(); + + /** + * @return the sku value. + */ + AzureSku sku(); + + /** + * The entirety of the WorkspaceCollection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of WorkspaceCollection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a WorkspaceCollection definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the WorkspaceCollection definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the workspacecollection definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku the sku parameter value + * @return the next definition stage + */ + WithCreate withSku(AzureSku sku); + } + + /** + * 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, Resource.DefinitionWithTags, DefinitionStages.WithSku { + } + } + /** + * The template for a WorkspaceCollection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithTags { + } + + /** + * Grouping of WorkspaceCollection update stages. + */ + interface UpdateStages { + /** + * The stage of the workspacecollection update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags the tags parameter value + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollectionAccessKey.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollectionAccessKey.java new file mode 100644 index 000000000000..40d73c1dc93c --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollectionAccessKey.java @@ -0,0 +1,43 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The WorkspaceCollectionAccessKey model. + */ +public class WorkspaceCollectionAccessKey { + /** + * Key name. Possible values include: 'key1', 'key2'. + */ + @JsonProperty(value = "keyName") + private AccessKeyName keyName; + + /** + * Get key name. Possible values include: 'key1', 'key2'. + * + * @return the keyName value + */ + public AccessKeyName keyName() { + return this.keyName; + } + + /** + * Set key name. Possible values include: 'key1', 'key2'. + * + * @param keyName the keyName value to set + * @return the WorkspaceCollectionAccessKey object itself. + */ + public WorkspaceCollectionAccessKey withKeyName(AccessKeyName keyName) { + this.keyName = keyName; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollectionAccessKeys.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollectionAccessKeys.java new file mode 100644 index 000000000000..9ee8e9eded3a --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollectionAccessKeys.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.powerbi.v2016_01_29; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.PowerBIManager; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.WorkspaceCollectionAccessKeysInner; + +/** + * Type representing WorkspaceCollectionAccessKeys. + */ +public interface WorkspaceCollectionAccessKeys extends HasInner, HasManager { + /** + * @return the key1 value. + */ + String key1(); + + /** + * @return the key2 value. + */ + String key2(); + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollections.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollections.java new file mode 100644 index 000000000000..5406e8628d30 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/WorkspaceCollections.java @@ -0,0 +1,66 @@ +/** + * 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.powerbi.v2016_01_29; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.WorkspaceCollectionsInner; +import com.microsoft.azure.arm.model.HasInner; +import rx.Completable; + +/** + * Type representing WorkspaceCollections. + */ +public interface WorkspaceCollections extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Retrieves the primary and secondary access keys for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAccessKeysAsync(String resourceGroupName, String workspaceCollectionName); + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateKeyAsync(String resourceGroupName, String workspaceCollectionName); + + /** + * Verify the specified Power BI Workspace Collection name is valid and not already in use. + * + * @param location Azure location + * @param body Check name availability request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String location, CheckNameRequest body); + + /** + * Migrates an existing Power BI Workspace Collection to a different resource group and/or subscription. + * + * @param resourceGroupName Azure resource group + * @param body Workspace migration request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable migrateAsync(String resourceGroupName, MigrateWorkspaceCollectionRequest body); + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Workspaces.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Workspaces.java new file mode 100644 index 000000000000..bdf41f2b72f6 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/Workspaces.java @@ -0,0 +1,29 @@ +/** + * 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.powerbi.v2016_01_29; + +import rx.Observable; +import com.microsoft.azure.management.powerbi.v2016_01_29.implementation.WorkspacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Workspaces. + */ +public interface Workspaces extends HasInner { + /** + * Retrieves all existing Power BI workspaces in the specified workspace collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String workspaceCollectionName); + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/CheckNameResponseImpl.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/CheckNameResponseImpl.java new file mode 100644 index 000000000000..674771954aa8 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/CheckNameResponseImpl.java @@ -0,0 +1,42 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.management.powerbi.v2016_01_29.CheckNameResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.powerbi.v2016_01_29.CheckNameReason; + +class CheckNameResponseImpl extends WrapperImpl implements CheckNameResponse { + private final PowerBIManager manager; + CheckNameResponseImpl(CheckNameResponseInner inner, PowerBIManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public PowerBIManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public CheckNameReason reason() { + return this.inner().reason(); + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/CheckNameResponseInner.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/CheckNameResponseInner.java new file mode 100644 index 000000000000..f40f9ec81e0a --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/CheckNameResponseInner.java @@ -0,0 +1,99 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.management.powerbi.v2016_01_29.CheckNameReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The CheckNameResponseInner model. + */ +public class CheckNameResponseInner { + /** + * Specifies a Boolean value that indicates whether the specified Power BI + * Workspace Collection name is available to use. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * Reason why the workspace collection name cannot be used. Possible values + * include: 'Unavailable', 'Invalid'. + */ + @JsonProperty(value = "reason") + private CheckNameReason reason; + + /** + * Message indicating an unavailable name due to a conflict, or a + * description of the naming rules that are violated. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get specifies a Boolean value that indicates whether the specified Power BI Workspace Collection name is available to use. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set specifies a Boolean value that indicates whether the specified Power BI Workspace Collection name is available to use. + * + * @param nameAvailable the nameAvailable value to set + * @return the CheckNameResponseInner object itself. + */ + public CheckNameResponseInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get reason why the workspace collection name cannot be used. Possible values include: 'Unavailable', 'Invalid'. + * + * @return the reason value + */ + public CheckNameReason reason() { + return this.reason; + } + + /** + * Set reason why the workspace collection name cannot be used. Possible values include: 'Unavailable', 'Invalid'. + * + * @param reason the reason value to set + * @return the CheckNameResponseInner object itself. + */ + public CheckNameResponseInner withReason(CheckNameReason reason) { + this.reason = reason; + return this; + } + + /** + * Get message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. + * + * @param message the message value to set + * @return the CheckNameResponseInner object itself. + */ + public CheckNameResponseInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/IdParsingUtils.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..40bd0d722f06 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * 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.powerbi.v2016_01_29.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/OperationListInner.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/OperationListInner.java new file mode 100644 index 000000000000..adfa75315b0a --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/OperationListInner.java @@ -0,0 +1,45 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import java.util.List; +import com.microsoft.azure.management.powerbi.v2016_01_29.Operation; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationListInner model. + */ +public class OperationListInner { + /** + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the OperationListInner object itself. + */ + public OperationListInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PageImpl.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PageImpl.java new file mode 100644 index 000000000000..6410b221e890 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PowerBIEmbeddedManagementClientImpl.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PowerBIEmbeddedManagementClientImpl.java new file mode 100644 index 000000000000..4af43354f4da --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PowerBIEmbeddedManagementClientImpl.java @@ -0,0 +1,312 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.management.powerbi.v2016_01_29.ErrorException; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * Initializes a new instance of the PowerBIEmbeddedManagementClientImpl class. + */ +public class PowerBIEmbeddedManagementClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private PowerBIEmbeddedManagementClientService service; + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** Gets subscription credentials which uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Gets subscription credentials which uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets Gets subscription credentials which uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public PowerBIEmbeddedManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Client Api Version. */ + private String apiVersion; + + /** + * Gets Client Api Version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public PowerBIEmbeddedManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public PowerBIEmbeddedManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public PowerBIEmbeddedManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The WorkspaceCollectionsInner object to access its operations. + */ + private WorkspaceCollectionsInner workspaceCollections; + + /** + * Gets the WorkspaceCollectionsInner object to access its operations. + * @return the WorkspaceCollectionsInner object. + */ + public WorkspaceCollectionsInner workspaceCollections() { + return this.workspaceCollections; + } + + /** + * The WorkspacesInner object to access its operations. + */ + private WorkspacesInner workspaces; + + /** + * Gets the WorkspacesInner object to access its operations. + * @return the WorkspacesInner object. + */ + public WorkspacesInner workspaces() { + return this.workspaces; + } + + /** + * Initializes an instance of PowerBIEmbeddedManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public PowerBIEmbeddedManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of PowerBIEmbeddedManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public PowerBIEmbeddedManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of PowerBIEmbeddedManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public PowerBIEmbeddedManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-01-29"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.workspaceCollections = new WorkspaceCollectionsInner(restClient().retrofit(), this); + this.workspaces = new WorkspacesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + initializeService(); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "PowerBIEmbeddedManagementClient", "2016-01-29"); + } + + private void initializeService() { + service = restClient().retrofit().create(PowerBIEmbeddedManagementClientService.class); + } + + /** + * The interface defining all the services for PowerBIEmbeddedManagementClient to be + * used by Retrofit to perform actually REST calls. + */ + interface PowerBIEmbeddedManagementClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.powerbi.v2016_01_29.PowerBIEmbeddedManagementClient getAvailableOperations" }) + @GET("providers/Microsoft.PowerBI/operations") + Observable> getAvailableOperations(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Indicates which operations can be performed by the Power BI Resource Provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationListInner object if successful. + */ + public OperationListInner getAvailableOperations() { + return getAvailableOperationsWithServiceResponseAsync().toBlocking().single().body(); + } + + /** + * Indicates which operations can be performed by the Power BI Resource Provider. + * + * @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 getAvailableOperationsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAvailableOperationsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Indicates which operations can be performed by the Power BI Resource Provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListInner object + */ + public Observable getAvailableOperationsAsync() { + return getAvailableOperationsWithServiceResponseAsync().map(new Func1, OperationListInner>() { + @Override + public OperationListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Indicates which operations can be performed by the Power BI Resource Provider. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationListInner object + */ + public Observable> getAvailableOperationsWithServiceResponseAsync() { + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + return service.getAvailableOperations(this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAvailableOperationsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAvailableOperationsDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory().newInstance(this.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PowerBIManager.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PowerBIManager.java new file mode 100644 index 000000000000..fd745ce8ef03 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/PowerBIManager.java @@ -0,0 +1,111 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollections; +import com.microsoft.azure.management.powerbi.v2016_01_29.Workspaces; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure PowerBI resource management. + */ +public final class PowerBIManager extends ManagerCore { + private WorkspaceCollections workspaceCollections; + private Workspaces workspaces; + /** + * Get a Configurable instance that can be used to create PowerBIManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new PowerBIManager.ConfigurableImpl(); + } + /** + * Creates an instance of PowerBIManager that exposes PowerBI resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the PowerBIManager + */ + public static PowerBIManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new PowerBIManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of PowerBIManager that exposes PowerBI resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the PowerBIManager + */ + public static PowerBIManager authenticate(RestClient restClient, String subscriptionId) { + return new PowerBIManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of PowerBIManager that exposes PowerBI management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing PowerBI management API entry points that work across subscriptions + */ + PowerBIManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage WorkspaceCollections. + */ + public WorkspaceCollections workspaceCollections() { + if (this.workspaceCollections == null) { + this.workspaceCollections = new WorkspaceCollectionsImpl(this); + } + return this.workspaceCollections; + } + + /** + * @return Entry point to manage Workspaces. + */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(this); + } + return this.workspaces; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public PowerBIManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return PowerBIManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private PowerBIManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new PowerBIEmbeddedManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionAccessKeysImpl.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionAccessKeysImpl.java new file mode 100644 index 000000000000..1fe706d78385 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionAccessKeysImpl.java @@ -0,0 +1,36 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollectionAccessKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class WorkspaceCollectionAccessKeysImpl extends WrapperImpl implements WorkspaceCollectionAccessKeys { + private final PowerBIManager manager; + WorkspaceCollectionAccessKeysImpl(WorkspaceCollectionAccessKeysInner inner, PowerBIManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public PowerBIManager manager() { + return this.manager; + } + + @Override + public String key1() { + return this.inner().key1(); + } + + @Override + public String key2() { + return this.inner().key2(); + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionAccessKeysInner.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionAccessKeysInner.java new file mode 100644 index 000000000000..020c17d54eee --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionAccessKeysInner.java @@ -0,0 +1,69 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The WorkspaceCollectionAccessKeysInner model. + */ +public class WorkspaceCollectionAccessKeysInner { + /** + * Access key 1. + */ + @JsonProperty(value = "key1") + private String key1; + + /** + * Access key 2. + */ + @JsonProperty(value = "key2") + private String key2; + + /** + * Get access key 1. + * + * @return the key1 value + */ + public String key1() { + return this.key1; + } + + /** + * Set access key 1. + * + * @param key1 the key1 value to set + * @return the WorkspaceCollectionAccessKeysInner object itself. + */ + public WorkspaceCollectionAccessKeysInner withKey1(String key1) { + this.key1 = key1; + return this; + } + + /** + * Get access key 2. + * + * @return the key2 value + */ + public String key2() { + return this.key2; + } + + /** + * Set access key 2. + * + * @param key2 the key2 value to set + * @return the WorkspaceCollectionAccessKeysInner object itself. + */ + public WorkspaceCollectionAccessKeysInner withKey2(String key2) { + this.key2 = key2; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionImpl.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionImpl.java new file mode 100644 index 000000000000..6d0a370bb5b0 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionImpl.java @@ -0,0 +1,94 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollection; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.powerbi.v2016_01_29.CreateWorkspaceCollectionRequest; +import com.microsoft.azure.management.powerbi.v2016_01_29.AzureSku; +import rx.functions.Func1; + +class WorkspaceCollectionImpl extends GroupableResourceCoreImpl implements WorkspaceCollection, WorkspaceCollection.Definition, WorkspaceCollection.Update { + private Map utags; + private CreateWorkspaceCollectionRequest createParameter; + WorkspaceCollectionImpl(String name, WorkspaceCollectionInner inner, PowerBIManager manager) { + super(name, inner, manager); + this.createParameter = new CreateWorkspaceCollectionRequest(); + } + + @Override + public Observable createResourceAsync() { + WorkspaceCollectionsInner client = this.manager().inner().workspaceCollections(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public WorkspaceCollectionInner call(WorkspaceCollectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WorkspaceCollectionsInner client = this.manager().inner().workspaceCollections(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.utags) + .map(new Func1() { + @Override + public WorkspaceCollectionInner call(WorkspaceCollectionInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WorkspaceCollectionsInner client = this.manager().inner().workspaceCollections(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new CreateWorkspaceCollectionRequest(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + + @Override + public AzureSku sku() { + return this.inner().sku(); + } + + @Override + public WorkspaceCollectionImpl withSku(AzureSku sku) { + this.createParameter.withSku(sku); + return this; + } + + @Override + public WorkspaceCollectionImpl withTags(Map tags) { + this.utags = tags; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionInner.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionInner.java new file mode 100644 index 000000000000..de59e024b64a --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionInner.java @@ -0,0 +1,208 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import java.util.Map; +import com.microsoft.azure.management.powerbi.v2016_01_29.AzureSku; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The WorkspaceCollectionInner model. + */ +public class WorkspaceCollectionInner { + /** + * Resource id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Workspace collection name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Azure location. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The tags property. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The sku property. + */ + @JsonProperty(value = "sku") + private AzureSku sku; + + /** + * Properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Creates an instance of WorkspaceCollectionInner class. + */ + public WorkspaceCollectionInner() { + sku = new AzureSku(); + } + + /** + * Get resource id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set resource id. + * + * @param id the id value to set + * @return the WorkspaceCollectionInner object itself. + */ + public WorkspaceCollectionInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get workspace collection name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set workspace collection name. + * + * @param name the name value to set + * @return the WorkspaceCollectionInner object itself. + */ + public WorkspaceCollectionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type. + * + * @param type the type value to set + * @return the WorkspaceCollectionInner object itself. + */ + public WorkspaceCollectionInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get azure location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set azure location. + * + * @param location the location value to set + * @return the WorkspaceCollectionInner object itself. + */ + public WorkspaceCollectionInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the WorkspaceCollectionInner object itself. + */ + public WorkspaceCollectionInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the sku value. + * + * @return the sku value + */ + public AzureSku sku() { + return this.sku; + } + + /** + * Set the sku value. + * + * @param sku the sku value to set + * @return the WorkspaceCollectionInner object itself. + */ + public WorkspaceCollectionInner withSku(AzureSku sku) { + this.sku = sku; + return this; + } + + /** + * Get properties. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set properties. + * + * @param properties the properties value to set + * @return the WorkspaceCollectionInner object itself. + */ + public WorkspaceCollectionInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionsImpl.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionsImpl.java new file mode 100644 index 000000000000..bf4db900c855 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionsImpl.java @@ -0,0 +1,184 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollections; +import com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollection; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollectionAccessKeys; +import com.microsoft.azure.management.powerbi.v2016_01_29.CheckNameResponse; +import com.microsoft.azure.management.powerbi.v2016_01_29.CheckNameRequest; +import com.microsoft.azure.management.powerbi.v2016_01_29.MigrateWorkspaceCollectionRequest; + +class WorkspaceCollectionsImpl extends GroupableResourcesCoreImpl implements WorkspaceCollections { + protected WorkspaceCollectionsImpl(PowerBIManager manager) { + super(manager.inner().workspaceCollections(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + WorkspaceCollectionsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + WorkspaceCollectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + WorkspaceCollectionsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + WorkspaceCollectionsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public WorkspaceCollection call(WorkspaceCollectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + WorkspaceCollectionsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + WorkspaceCollectionsInner client = this.inner(); + return client.listAsync() + .flatMap(new Func1, Observable>() { + @Override + public Observable call(Page innerPage) { + return Observable.from(innerPage.items()); + } + }) + .map(new Func1() { + @Override + public WorkspaceCollection call(WorkspaceCollectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public WorkspaceCollectionImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable getAccessKeysAsync(String resourceGroupName, String workspaceCollectionName) { + WorkspaceCollectionsInner client = this.inner(); + return client.getAccessKeysAsync(resourceGroupName, workspaceCollectionName) + .map(new Func1() { + @Override + public WorkspaceCollectionAccessKeys call(WorkspaceCollectionAccessKeysInner inner) { + return new WorkspaceCollectionAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateKeyAsync(String resourceGroupName, String workspaceCollectionName) { + WorkspaceCollectionsInner client = this.inner(); + return client.regenerateKeyAsync(resourceGroupName, workspaceCollectionName) + .map(new Func1() { + @Override + public WorkspaceCollectionAccessKeys call(WorkspaceCollectionAccessKeysInner inner) { + return new WorkspaceCollectionAccessKeysImpl(inner, manager()); + } + }); + } + + @Override + protected WorkspaceCollectionImpl wrapModel(WorkspaceCollectionInner inner) { + return new WorkspaceCollectionImpl(inner.name(), inner, manager()); + } + + @Override + protected WorkspaceCollectionImpl wrapModel(String name) { + return new WorkspaceCollectionImpl(name, new WorkspaceCollectionInner(), this.manager()); + } + + @Override + public Observable checkNameAvailabilityAsync(String location, CheckNameRequest body) { + WorkspaceCollectionsInner client = this.inner(); + return client.checkNameAvailabilityAsync(location, body) + .map(new Func1() { + @Override + public CheckNameResponse call(CheckNameResponseInner inner) { + return new CheckNameResponseImpl(inner, manager()); + } + }); + } + + @Override + public Completable migrateAsync(String resourceGroupName, MigrateWorkspaceCollectionRequest body) { + WorkspaceCollectionsInner client = this.inner(); + return client.migrateAsync(resourceGroupName, body).toCompletable(); + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionsInner.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionsInner.java new file mode 100644 index 000000000000..8a5f0c1382d7 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceCollectionsInner.java @@ -0,0 +1,1229 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.powerbi.v2016_01_29.AccessKeyName; +import com.microsoft.azure.management.powerbi.v2016_01_29.CheckNameRequest; +import com.microsoft.azure.management.powerbi.v2016_01_29.CreateWorkspaceCollectionRequest; +import com.microsoft.azure.management.powerbi.v2016_01_29.ErrorException; +import com.microsoft.azure.management.powerbi.v2016_01_29.MigrateWorkspaceCollectionRequest; +import com.microsoft.azure.management.powerbi.v2016_01_29.UpdateWorkspaceCollectionRequest; +import com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollectionAccessKey; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +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.PATCH; +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 WorkspaceCollections. + */ +public class WorkspaceCollectionsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private WorkspaceCollectionsService service; + /** The service client containing this operation class. */ + private PowerBIEmbeddedManagementClientImpl client; + + /** + * Initializes an instance of WorkspaceCollectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkspaceCollectionsInner(Retrofit retrofit, PowerBIEmbeddedManagementClientImpl client) { + this.service = retrofit.create(WorkspaceCollectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for WorkspaceCollections to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkspaceCollectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollections getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceCollectionName") String workspaceCollectionName, @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.powerbi.v2016_01_29.WorkspaceCollections create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceCollectionName") String workspaceCollectionName, @Query("api-version") String apiVersion, @Body CreateWorkspaceCollectionRequest body, @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.powerbi.v2016_01_29.WorkspaceCollections update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceCollectionName") String workspaceCollectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body UpdateWorkspaceCollectionRequest body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceCollectionName") String workspaceCollectionName, @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.powerbi.v2016_01_29.WorkspaceCollections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceCollectionName") String workspaceCollectionName, @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.powerbi.v2016_01_29.WorkspaceCollections checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/locations/{location}/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @Query("api-version") String apiVersion, @Body CheckNameRequest body, @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.powerbi.v2016_01_29.WorkspaceCollections listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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.powerbi.v2016_01_29.WorkspaceCollections list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/workspaceCollections") + Observable> list(@Path("subscriptionId") String subscriptionId, @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.powerbi.v2016_01_29.WorkspaceCollections getAccessKeys" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/listKeys") + Observable> getAccessKeys(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceCollectionName") String workspaceCollectionName, @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.powerbi.v2016_01_29.WorkspaceCollections regenerateKey" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/regenerateKey") + Observable> regenerateKey(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceCollectionName") String workspaceCollectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body WorkspaceCollectionAccessKey body, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.powerbi.v2016_01_29.WorkspaceCollections migrate" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources") + Observable> migrate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Body MigrateWorkspaceCollectionRequest body, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves an existing Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceCollectionInner object if successful. + */ + public WorkspaceCollectionInner getByResourceGroup(String resourceGroupName, String workspaceCollectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).toBlocking().single().body(); + } + + /** + * Retrieves an existing Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection 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 getByResourceGroupAsync(String resourceGroupName, String workspaceCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceCollectionName), serviceCallback); + } + + /** + * Retrieves an existing Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String workspaceCollectionName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).map(new Func1, WorkspaceCollectionInner>() { + @Override + public WorkspaceCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves an existing Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Creates a new Power BI Workspace Collection with the specified properties. A Power BI Workspace Collection contains one or more workspaces, and can be used to provision keys that provide API access to those workspaces. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param body Create workspace collection request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceCollectionInner object if successful. + */ + public WorkspaceCollectionInner create(String resourceGroupName, String workspaceCollectionName, CreateWorkspaceCollectionRequest body) { + return createWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, body).toBlocking().single().body(); + } + + /** + * Creates a new Power BI Workspace Collection with the specified properties. A Power BI Workspace Collection contains one or more workspaces, and can be used to provision keys that provide API access to those workspaces. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param body Create workspace collection request + * @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 createAsync(String resourceGroupName, String workspaceCollectionName, CreateWorkspaceCollectionRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, body), serviceCallback); + } + + /** + * Creates a new Power BI Workspace Collection with the specified properties. A Power BI Workspace Collection contains one or more workspaces, and can be used to provision keys that provide API access to those workspaces. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param body Create workspace collection request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionInner object + */ + public Observable createAsync(String resourceGroupName, String workspaceCollectionName, CreateWorkspaceCollectionRequest body) { + return createWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, body).map(new Func1, WorkspaceCollectionInner>() { + @Override + public WorkspaceCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new Power BI Workspace Collection with the specified properties. A Power BI Workspace Collection contains one or more workspaces, and can be used to provision keys that provide API access to those workspaces. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param body Create workspace collection request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName, CreateWorkspaceCollectionRequest body) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.create(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Update an existing Power BI Workspace Collection with the specified properties. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceCollectionInner object if successful. + */ + public WorkspaceCollectionInner update(String resourceGroupName, String workspaceCollectionName) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).toBlocking().single().body(); + } + + /** + * Update an existing Power BI Workspace Collection with the specified properties. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection 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 updateAsync(String resourceGroupName, String workspaceCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, workspaceCollectionName), serviceCallback); + } + + /** + * Update an existing Power BI Workspace Collection with the specified properties. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionInner object + */ + public Observable updateAsync(String resourceGroupName, String workspaceCollectionName) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).map(new Func1, WorkspaceCollectionInner>() { + @Override + public WorkspaceCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an existing Power BI Workspace Collection with the specified properties. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final Map tags = null; + UpdateWorkspaceCollectionRequest body = new UpdateWorkspaceCollectionRequest(); + body.withTags(null); + return service.update(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Update an existing Power BI Workspace Collection with the specified properties. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param tags the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceCollectionInner object if successful. + */ + public WorkspaceCollectionInner update(String resourceGroupName, String workspaceCollectionName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, tags).toBlocking().single().body(); + } + + /** + * Update an existing Power BI Workspace Collection with the specified properties. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param tags the Map<String, String> value + * @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 updateAsync(String resourceGroupName, String workspaceCollectionName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, tags), serviceCallback); + } + + /** + * Update an existing Power BI Workspace Collection with the specified properties. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param tags the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionInner object + */ + public Observable updateAsync(String resourceGroupName, String workspaceCollectionName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, tags).map(new Func1, WorkspaceCollectionInner>() { + @Override + public WorkspaceCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an existing Power BI Workspace Collection with the specified properties. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param tags the Map<String, String> value + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName, Map tags) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + UpdateWorkspaceCollectionRequest body = new UpdateWorkspaceCollectionRequest(); + body.withTags(tags); + return service.update(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Delete a Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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 workspaceCollectionName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).toBlocking().last().body(); + } + + /** + * Delete a Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection 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 workspaceCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceCollectionName), serviceCallback); + } + + /** + * Delete a Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String workspaceCollectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete a Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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 workspaceCollectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).toBlocking().single().body(); + } + + /** + * Delete a Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection 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 workspaceCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceCollectionName), serviceCallback); + } + + /** + * Delete a Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String workspaceCollectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.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 ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Verify the specified Power BI Workspace Collection name is valid and not already in use. + * + * @param location Azure location + * @param body Check name availability request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CheckNameResponseInner object if successful. + */ + public CheckNameResponseInner checkNameAvailability(String location, CheckNameRequest body) { + return checkNameAvailabilityWithServiceResponseAsync(location, body).toBlocking().single().body(); + } + + /** + * Verify the specified Power BI Workspace Collection name is valid and not already in use. + * + * @param location Azure location + * @param body Check name availability request + * @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 checkNameAvailabilityAsync(String location, CheckNameRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(location, body), serviceCallback); + } + + /** + * Verify the specified Power BI Workspace Collection name is valid and not already in use. + * + * @param location Azure location + * @param body Check name availability request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResponseInner object + */ + public Observable checkNameAvailabilityAsync(String location, CheckNameRequest body) { + return checkNameAvailabilityWithServiceResponseAsync(location, body).map(new Func1, CheckNameResponseInner>() { + @Override + public CheckNameResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Verify the specified Power BI Workspace Collection name is valid and not already in use. + * + * @param location Azure location + * @param body Check name availability request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CheckNameResponseInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String location, CheckNameRequest body) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.checkNameAvailability(this.client.subscriptionId(), location, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all existing Power BI workspace collections in the specified resource group. + * + * @param resourceGroupName Azure resource group + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl page = new PageImpl<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Retrieves all existing Power BI workspace collections in the specified resource group. + * + * @param resourceGroupName Azure resource group + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Retrieves all existing Power BI workspace collections in the specified resource group. + * + * @param resourceGroupName Azure resource group + * @return the observable to the List<WorkspaceCollectionInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Retrieves all existing Power BI workspace collections in the specified resource group. + * + * @param resourceGroupName Azure resource group + * @return the observable to the List<WorkspaceCollectionInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(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> listByResourceGroupDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves all existing Power BI workspace collections in the specified subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl page = new PageImpl<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Retrieves all existing Power BI workspace collections in the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Retrieves all existing Power BI workspace collections in the specified subscription. + * + * @return the observable to the List<WorkspaceCollectionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl page = new PageImpl<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Retrieves all existing Power BI workspace collections in the specified subscription. + * + * @return the observable to the List<WorkspaceCollectionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(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> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Retrieves the primary and secondary access keys for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceCollectionAccessKeysInner object if successful. + */ + public WorkspaceCollectionAccessKeysInner getAccessKeys(String resourceGroupName, String workspaceCollectionName) { + return getAccessKeysWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).toBlocking().single().body(); + } + + /** + * Retrieves the primary and secondary access keys for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection 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 getAccessKeysAsync(String resourceGroupName, String workspaceCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getAccessKeysWithServiceResponseAsync(resourceGroupName, workspaceCollectionName), serviceCallback); + } + + /** + * Retrieves the primary and secondary access keys for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionAccessKeysInner object + */ + public Observable getAccessKeysAsync(String resourceGroupName, String workspaceCollectionName) { + return getAccessKeysWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).map(new Func1, WorkspaceCollectionAccessKeysInner>() { + @Override + public WorkspaceCollectionAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieves the primary and secondary access keys for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionAccessKeysInner object + */ + public Observable> getAccessKeysWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getAccessKeys(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getAccessKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getAccessKeysDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceCollectionAccessKeysInner object if successful. + */ + public WorkspaceCollectionAccessKeysInner regenerateKey(String resourceGroupName, String workspaceCollectionName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).toBlocking().single().body(); + } + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection 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 regenerateKeyAsync(String resourceGroupName, String workspaceCollectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, workspaceCollectionName), serviceCallback); + } + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionAccessKeysInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String workspaceCollectionName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).map(new Func1, WorkspaceCollectionAccessKeysInner>() { + @Override + public WorkspaceCollectionAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionAccessKeysInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + final AccessKeyName keyName = null; + WorkspaceCollectionAccessKey body = new WorkspaceCollectionAccessKey(); + body.withKeyName(null); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param keyName Key name. Possible values include: 'key1', 'key2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceCollectionAccessKeysInner object if successful. + */ + public WorkspaceCollectionAccessKeysInner regenerateKey(String resourceGroupName, String workspaceCollectionName, AccessKeyName keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, keyName).toBlocking().single().body(); + } + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param keyName Key name. Possible values include: 'key1', 'key2' + * @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 regenerateKeyAsync(String resourceGroupName, String workspaceCollectionName, AccessKeyName keyName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateKeyWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, keyName), serviceCallback); + } + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param keyName Key name. Possible values include: 'key1', 'key2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionAccessKeysInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String workspaceCollectionName, AccessKeyName keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, workspaceCollectionName, keyName).map(new Func1, WorkspaceCollectionAccessKeysInner>() { + @Override + public WorkspaceCollectionAccessKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the primary or secondary access key for the specified Power BI Workspace Collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @param keyName Key name. Possible values include: 'key1', 'key2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceCollectionAccessKeysInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName, AccessKeyName keyName) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + WorkspaceCollectionAccessKey body = new WorkspaceCollectionAccessKey(); + body.withKeyName(keyName); + return service.regenerateKey(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), body, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateKeyDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateKeyDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + + /** + * Migrates an existing Power BI Workspace Collection to a different resource group and/or subscription. + * + * @param resourceGroupName Azure resource group + * @param body Workspace migration request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void migrate(String resourceGroupName, MigrateWorkspaceCollectionRequest body) { + migrateWithServiceResponseAsync(resourceGroupName, body).toBlocking().single().body(); + } + + /** + * Migrates an existing Power BI Workspace Collection to a different resource group and/or subscription. + * + * @param resourceGroupName Azure resource group + * @param body Workspace migration request + * @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 migrateAsync(String resourceGroupName, MigrateWorkspaceCollectionRequest body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(migrateWithServiceResponseAsync(resourceGroupName, body), serviceCallback); + } + + /** + * Migrates an existing Power BI Workspace Collection to a different resource group and/or subscription. + * + * @param resourceGroupName Azure resource group + * @param body Workspace migration request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable migrateAsync(String resourceGroupName, MigrateWorkspaceCollectionRequest body) { + return migrateWithServiceResponseAsync(resourceGroupName, body).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Migrates an existing Power BI Workspace Collection to a different resource group and/or subscription. + * + * @param resourceGroupName Azure resource group + * @param body Workspace migration request + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> migrateWithServiceResponseAsync(String resourceGroupName, MigrateWorkspaceCollectionRequest body) { + 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (body == null) { + throw new IllegalArgumentException("Parameter body is required and cannot be null."); + } + Validator.validate(body); + return service.migrate(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = migrateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse migrateDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceImpl.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceImpl.java new file mode 100644 index 000000000000..696556a06c6e --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceImpl.java @@ -0,0 +1,50 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.management.powerbi.v2016_01_29.Workspace; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class WorkspaceImpl extends WrapperImpl implements Workspace { + private final PowerBIManager manager; + + WorkspaceImpl(WorkspaceInner inner, PowerBIManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public PowerBIManager manager() { + return this.manager; + } + + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceInner.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceInner.java new file mode 100644 index 000000000000..2ae2f7b452cb --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspaceInner.java @@ -0,0 +1,121 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The WorkspaceInner model. + */ +public class WorkspaceInner { + /** + * Workspace id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Workspace name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Resource type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * Property bag. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * Get workspace id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set workspace id. + * + * @param id the id value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get workspace name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set workspace name. + * + * @param name the name value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get resource type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set resource type. + * + * @param type the type value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get property bag. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set property bag. + * + * @param properties the properties value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withProperties(Object properties) { + this.properties = properties; + return this; + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspacesImpl.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspacesImpl.java new file mode 100644 index 000000000000..e796731c6b2f --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspacesImpl.java @@ -0,0 +1,53 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.powerbi.v2016_01_29.Workspaces; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.powerbi.v2016_01_29.Workspace; + +class WorkspacesImpl extends WrapperImpl implements Workspaces { + private final PowerBIManager manager; + + WorkspacesImpl(PowerBIManager manager) { + super(manager.inner().workspaces()); + this.manager = manager; + } + + public PowerBIManager manager() { + return this.manager; + } + + private WorkspaceImpl wrapModel(WorkspaceInner inner) { + return new WorkspaceImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String workspaceCollectionName) { + WorkspacesInner client = this.inner(); + return client.listAsync(resourceGroupName, workspaceCollectionName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Workspace call(WorkspaceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspacesInner.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspacesInner.java new file mode 100644 index 000000000000..435d8b3fe078 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/WorkspacesInner.java @@ -0,0 +1,152 @@ +/** + * 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.powerbi.v2016_01_29.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.powerbi.v2016_01_29.ErrorException; +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.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 Workspaces. + */ +public class WorkspacesInner { + /** The Retrofit service to perform REST calls. */ + private WorkspacesService service; + /** The service client containing this operation class. */ + private PowerBIEmbeddedManagementClientImpl client; + + /** + * Initializes an instance of WorkspacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkspacesInner(Retrofit retrofit, PowerBIEmbeddedManagementClientImpl client) { + this.service = retrofit.create(WorkspacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Workspaces to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkspacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.powerbi.v2016_01_29.Workspaces list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/workspaces") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceCollectionName") String workspaceCollectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieves all existing Power BI workspaces in the specified workspace collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorException 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<WorkspaceInner> object if successful. + */ + public List list(String resourceGroupName, String workspaceCollectionName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).toBlocking().single().body(); + } + + /** + * Retrieves all existing Power BI workspaces in the specified workspace collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection 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> listAsync(String resourceGroupName, String workspaceCollectionName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, workspaceCollectionName), serviceCallback); + } + + /** + * Retrieves all existing Power BI workspaces in the specified workspace collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<WorkspaceInner> object + */ + public Observable> listAsync(String resourceGroupName, String workspaceCollectionName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceCollectionName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Retrieves all existing Power BI workspaces in the specified workspace collection. + * + * @param resourceGroupName Azure resource group + * @param workspaceCollectionName Power BI Embedded Workspace Collection name + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<WorkspaceInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String workspaceCollectionName) { + 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 (workspaceCollectionName == null) { + throw new IllegalArgumentException("Parameter workspaceCollectionName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, workspaceCollectionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(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> listDelegate(Response response) throws ErrorException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorException.class) + .build(response); + } + +} diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/package-info.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/package-info.java new file mode 100644 index 000000000000..1a79f4afe2fa --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/implementation/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the implementation classes for PowerBIEmbeddedManagementClient. + * Client to manage your Power BI Embedded workspace collections and retrieve workspaces. + */ +package com.microsoft.azure.management.powerbi.v2016_01_29.implementation; diff --git a/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/package-info.java b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/package-info.java new file mode 100644 index 000000000000..413a19a72496 --- /dev/null +++ b/powerbi/resource-manager/v2016_01_29/src/main/java/com/microsoft/azure/management/powerbi/v2016_01_29/package-info.java @@ -0,0 +1,11 @@ +// 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. + +/** + * This package contains the classes for PowerBIEmbeddedManagementClient. + * Client to manage your Power BI Embedded workspace collections and retrieve workspaces. + */ +package com.microsoft.azure.management.powerbi.v2016_01_29;