diff --git a/eng/mgmt/api-specs.json b/eng/mgmt/api-specs.json index 097bd1fe3c46..4337ef6beeee 100644 --- a/eng/mgmt/api-specs.json +++ b/eng/mgmt/api-specs.json @@ -66,6 +66,10 @@ "source": "specification/consumption/resource-manager/readme.md", "args": "--multiapi --fluent" }, + "containerinstance/resource-manager": { + "source": "specification/containerinstance/resource-manager/readme.md", + "args": "--multiapi --fluent" + }, "containerservice/resource-manager": { "source": "specification/containerservice/resource-manager/readme.md", "args": "--multiapi --fluent" diff --git a/sdk/containerinstance/mgmt-v2019_12_01/pom.xml b/sdk/containerinstance/mgmt-v2019_12_01/pom.xml new file mode 100644 index 000000000000..779e9983a356 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.containerinstance.v2019_12_01 + + com.microsoft.azure + azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-containerinstance + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerInstance Management + This package contains Microsoft ContainerInstance 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 + + 1.6.5 + + + + + + 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/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/AzureFileVolume.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/AzureFileVolume.java new file mode 100644 index 000000000000..e13e7cc8e270 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/AzureFileVolume.java @@ -0,0 +1,123 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the Azure File volume. Azure File shares are mounted as + * volumes. + */ +public class AzureFileVolume { + /** + * The name of the Azure File share to be mounted as a volume. + */ + @JsonProperty(value = "shareName", required = true) + private String shareName; + + /** + * The flag indicating whether the Azure File shared mounted as a volume is + * read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * The name of the storage account that contains the Azure File share. + */ + @JsonProperty(value = "storageAccountName", required = true) + private String storageAccountName; + + /** + * The storage account access key used to access the Azure File share. + */ + @JsonProperty(value = "storageAccountKey") + private String storageAccountKey; + + /** + * Get the name of the Azure File share to be mounted as a volume. + * + * @return the shareName value + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the name of the Azure File share to be mounted as a volume. + * + * @param shareName the shareName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Get the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the Azure File shared mounted as a volume is read-only. + * + * @param readOnly the readOnly value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * Get the name of the storage account that contains the Azure File share. + * + * @return the storageAccountName value + */ + public String storageAccountName() { + return this.storageAccountName; + } + + /** + * Set the name of the storage account that contains the Azure File share. + * + * @param storageAccountName the storageAccountName value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountName(String storageAccountName) { + this.storageAccountName = storageAccountName; + return this; + } + + /** + * Get the storage account access key used to access the Azure File share. + * + * @return the storageAccountKey value + */ + public String storageAccountKey() { + return this.storageAccountKey; + } + + /** + * Set the storage account access key used to access the Azure File share. + * + * @param storageAccountKey the storageAccountKey value to set + * @return the AzureFileVolume object itself. + */ + public AzureFileVolume withStorageAccountKey(String storageAccountKey) { + this.storageAccountKey = storageAccountKey; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/CachedImages.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/CachedImages.java new file mode 100644 index 000000000000..5f9e30b4f84f --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/CachedImages.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.containerinstance.v2019_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.CachedImagesInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerInstanceManager; + +/** + * Type representing CachedImages. + */ +public interface CachedImages extends HasInner, HasManager { + /** + * @return the image value. + */ + String image(); + + /** + * @return the osType value. + */ + String osType(); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Capabilities.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Capabilities.java new file mode 100644 index 000000000000..8cef34cd034d --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Capabilities.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.containerinstance.v2019_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.CapabilitiesInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerInstanceManager; + +/** + * Type representing Capabilities. + */ +public interface Capabilities extends HasInner, HasManager { + /** + * @return the capabilities value. + */ + CapabilitiesCapabilities capabilities(); + + /** + * @return the gpu value. + */ + String gpu(); + + /** + * @return the ipAddressType value. + */ + String ipAddressType(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the osType value. + */ + String osType(); + + /** + * @return the resourceType value. + */ + String resourceType(); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/CapabilitiesCapabilities.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/CapabilitiesCapabilities.java new file mode 100644 index 000000000000..911db8ba54b2 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/CapabilitiesCapabilities.java @@ -0,0 +1,62 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The supported capabilities. + */ +public class CapabilitiesCapabilities { + /** + * The maximum allowed memory request in GB. + */ + @JsonProperty(value = "maxMemoryInGB", access = JsonProperty.Access.WRITE_ONLY) + private Double maxMemoryInGB; + + /** + * The maximum allowed CPU request in cores. + */ + @JsonProperty(value = "maxCpu", access = JsonProperty.Access.WRITE_ONLY) + private Double maxCpu; + + /** + * The maximum allowed GPU count. + */ + @JsonProperty(value = "maxGpuCount", access = JsonProperty.Access.WRITE_ONLY) + private Double maxGpuCount; + + /** + * Get the maximum allowed memory request in GB. + * + * @return the maxMemoryInGB value + */ + public Double maxMemoryInGB() { + return this.maxMemoryInGB; + } + + /** + * Get the maximum allowed CPU request in cores. + * + * @return the maxCpu value + */ + public Double maxCpu() { + return this.maxCpu; + } + + /** + * Get the maximum allowed GPU count. + * + * @return the maxGpuCount value + */ + public Double maxGpuCount() { + return this.maxGpuCount; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExec.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExec.java new file mode 100644 index 000000000000..ab771554071f --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExec.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.containerinstance.v2019_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container execution command, for liveness or readiness probe. + */ +public class ContainerExec { + /** + * The commands to execute within the container. + */ + @JsonProperty(value = "command") + private List command; + + /** + * Get the commands to execute within the container. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container. + * + * @param command the command value to set + * @return the ContainerExec object itself. + */ + public ContainerExec withCommand(List command) { + this.command = command; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecRequest.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecRequest.java new file mode 100644 index 000000000000..477a591da178 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecRequest.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container exec request. + */ +public class ContainerExecRequest { + /** + * The command to be executed. + */ + @JsonProperty(value = "command") + private String command; + + /** + * The size of the terminal. + */ + @JsonProperty(value = "terminalSize") + private ContainerExecRequestTerminalSize terminalSize; + + /** + * Get the command to be executed. + * + * @return the command value + */ + public String command() { + return this.command; + } + + /** + * Set the command to be executed. + * + * @param command the command value to set + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the size of the terminal. + * + * @return the terminalSize value + */ + public ContainerExecRequestTerminalSize terminalSize() { + return this.terminalSize; + } + + /** + * Set the size of the terminal. + * + * @param terminalSize the terminalSize value to set + * @return the ContainerExecRequest object itself. + */ + public ContainerExecRequest withTerminalSize(ContainerExecRequestTerminalSize terminalSize) { + this.terminalSize = terminalSize; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecRequestTerminalSize.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecRequestTerminalSize.java new file mode 100644 index 000000000000..a4cd6587bbf6 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecRequestTerminalSize.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The size of the terminal. + */ +public class ContainerExecRequestTerminalSize { + /** + * The row size of the terminal. + */ + @JsonProperty(value = "rows") + private Integer rows; + + /** + * The column size of the terminal. + */ + @JsonProperty(value = "cols") + private Integer cols; + + /** + * Get the row size of the terminal. + * + * @return the rows value + */ + public Integer rows() { + return this.rows; + } + + /** + * Set the row size of the terminal. + * + * @param rows the rows value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withRows(Integer rows) { + this.rows = rows; + return this; + } + + /** + * Get the column size of the terminal. + * + * @return the cols value + */ + public Integer cols() { + return this.cols; + } + + /** + * Set the column size of the terminal. + * + * @param cols the cols value to set + * @return the ContainerExecRequestTerminalSize object itself. + */ + public ContainerExecRequestTerminalSize withCols(Integer cols) { + this.cols = cols; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecResponse.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecResponse.java new file mode 100644 index 000000000000..9f93486977c0 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerExecResponse.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.containerinstance.v2019_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerExecResponseInner; + +/** + * Type representing ContainerExecResponse. + */ +public interface ContainerExecResponse extends HasInner, HasManager { + /** + * @return the password value. + */ + String password(); + + /** + * @return the webSocketUri value. + */ + String webSocketUri(); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroup.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroup.java new file mode 100644 index 000000000000..25c48b3ec562 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroup.java @@ -0,0 +1,305 @@ +/** + * 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.containerinstance.v2019_12_01; + +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.containerinstance.v2019_12_01.implementation.ContainerInstanceManager; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerInner; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerGroupInner; + +/** + * Type representing ContainerGroup. + */ +public interface ContainerGroup extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the diagnostics value. + */ + ContainerGroupDiagnostics diagnostics(); + + /** + * @return the dnsConfig value. + */ + DnsConfiguration dnsConfig(); + + /** + * @return the encryptionProperties value. + */ + EncryptionProperties encryptionProperties(); + + /** + * @return the identity value. + */ + ContainerGroupIdentity identity(); + + /** + * @return the imageRegistryCredentials value. + */ + List imageRegistryCredentials(); + + /** + * @return the initContainers value. + */ + List initContainers(); + + /** + * @return the instanceView value. + */ + ContainerGroupPropertiesInstanceView instanceView(); + + /** + * @return the ipAddress value. + */ + IpAddress ipAddress(); + + /** + * @return the networkProfile value. + */ + ContainerGroupNetworkProfile networkProfile(); + + /** + * @return the osType value. + */ + OperatingSystemTypes osType(); + + /** + * @return the provisioningState value. + */ + String provisioningState(); + + /** + * @return the restartPolicy value. + */ + ContainerGroupRestartPolicy restartPolicy(); + + /** + * @return the sku value. + */ + ContainerGroupSku sku(); + + /** + * @return the volumes value. + */ + List volumes(); + + /** + * The entirety of the ContainerGroup definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithContainers, DefinitionStages.WithOsType, DefinitionStages.WithCreate { + } + + /** + * Grouping of ContainerGroup definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ContainerGroup definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the ContainerGroup definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the containergroup definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + * @param containers The containers within the container group + * @return the next definition stage +*/ + WithOsType withContainers(List containers); + } + + /** + * The stage of the containergroup definition allowing to specify OsType. + */ + interface WithOsType { + /** + * Specifies osType. + * @param osType The operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux' + * @return the next definition stage +*/ + WithCreate withOsType(OperatingSystemTypes osType); + } + + /** + * The stage of the containergroup definition allowing to specify Diagnostics. + */ + interface WithDiagnostics { + /** + * Specifies diagnostics. + * @param diagnostics The diagnostic information for a container group + * @return the next definition stage + */ + WithCreate withDiagnostics(ContainerGroupDiagnostics diagnostics); + } + + /** + * The stage of the containergroup definition allowing to specify DnsConfig. + */ + interface WithDnsConfig { + /** + * Specifies dnsConfig. + * @param dnsConfig The DNS config information for a container group + * @return the next definition stage + */ + WithCreate withDnsConfig(DnsConfiguration dnsConfig); + } + + /** + * The stage of the containergroup definition allowing to specify EncryptionProperties. + */ + interface WithEncryptionProperties { + /** + * Specifies encryptionProperties. + * @param encryptionProperties The encryption properties for a container group + * @return the next definition stage + */ + WithCreate withEncryptionProperties(EncryptionProperties encryptionProperties); + } + + /** + * The stage of the containergroup definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the container group, if configured + * @return the next definition stage + */ + WithCreate withIdentity(ContainerGroupIdentity identity); + } + + /** + * The stage of the containergroup definition allowing to specify ImageRegistryCredentials. + */ + interface WithImageRegistryCredentials { + /** + * Specifies imageRegistryCredentials. + * @param imageRegistryCredentials The image registry credentials by which the container group is created from + * @return the next definition stage + */ + WithCreate withImageRegistryCredentials(List imageRegistryCredentials); + } + + /** + * The stage of the containergroup definition allowing to specify InitContainers. + */ + interface WithInitContainers { + /** + * Specifies initContainers. + * @param initContainers The init containers for a container group + * @return the next definition stage + */ + WithCreate withInitContainers(List initContainers); + } + + /** + * The stage of the containergroup definition allowing to specify IpAddress. + */ + interface WithIpAddress { + /** + * Specifies ipAddress. + * @param ipAddress The IP address type of the container group + * @return the next definition stage + */ + WithCreate withIpAddress(IpAddress ipAddress); + } + + /** + * The stage of the containergroup definition allowing to specify NetworkProfile. + */ + interface WithNetworkProfile { + /** + * Specifies networkProfile. + * @param networkProfile The network profile information for a container group + * @return the next definition stage + */ + WithCreate withNetworkProfile(ContainerGroupNetworkProfile networkProfile); + } + + /** + * The stage of the containergroup definition allowing to specify RestartPolicy. + */ + interface WithRestartPolicy { + /** + * Specifies restartPolicy. + * @param restartPolicy Restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never' + * @return the next definition stage + */ + WithCreate withRestartPolicy(ContainerGroupRestartPolicy restartPolicy); + } + + /** + * The stage of the containergroup definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU for a container group. Possible values include: 'Standard', 'Dedicated' + * @return the next definition stage + */ + WithCreate withSku(ContainerGroupSku sku); + } + + /** + * The stage of the containergroup definition allowing to specify Volumes. + */ + interface WithVolumes { + /** + * Specifies volumes. + * @param volumes The list of volumes that can be mounted by containers in this container group + * @return the next definition stage + */ + WithCreate withVolumes(List volumes); + } + + /** + * 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.WithDiagnostics, DefinitionStages.WithDnsConfig, DefinitionStages.WithEncryptionProperties, DefinitionStages.WithIdentity, DefinitionStages.WithImageRegistryCredentials, DefinitionStages.WithInitContainers, DefinitionStages.WithIpAddress, DefinitionStages.WithNetworkProfile, DefinitionStages.WithRestartPolicy, DefinitionStages.WithSku, DefinitionStages.WithVolumes { + } + } + /** + * The template for a ContainerGroup update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags { + } + + /** + * Grouping of ContainerGroup update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupDiagnostics.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupDiagnostics.java new file mode 100644 index 000000000000..571468253b94 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupDiagnostics.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container group diagnostic information. + */ +public class ContainerGroupDiagnostics { + /** + * Container group log analytics information. + */ + @JsonProperty(value = "logAnalytics") + private LogAnalytics logAnalytics; + + /** + * Get container group log analytics information. + * + * @return the logAnalytics value + */ + public LogAnalytics logAnalytics() { + return this.logAnalytics; + } + + /** + * Set container group log analytics information. + * + * @param logAnalytics the logAnalytics value to set + * @return the ContainerGroupDiagnostics object itself. + */ + public ContainerGroupDiagnostics withLogAnalytics(LogAnalytics logAnalytics) { + this.logAnalytics = logAnalytics; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIdentity.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIdentity.java new file mode 100644 index 000000000000..e418cd9f37ff --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIdentity.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the container group. + */ +public class ContainerGroupIdentity { + /** + * The principal id of the container group identity. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant id associated with the container group. This property will + * only be provided for a system assigned identity. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The type of identity used for the container group. The type + * 'SystemAssigned, UserAssigned' includes both an implicitly created + * identity and a set of user assigned identities. The type 'None' will + * remove any identities from the container group. Possible values include: + * 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', + * 'None'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * The list of user identities associated with the container group. The + * user identity dictionary key references will be ARM resource ids in the + * form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principal id of the container group identity. This property will only be provided for a system assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant id associated with the container group. This property will only be provided for a system assigned identity. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the container group. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the type of identity used for the container group. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the container group. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @param type the type value to set + * @return the ContainerGroupIdentity object itself. + */ + public ContainerGroupIdentity withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the list of user identities associated with the container group. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the list of user identities associated with the container group. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set + * @return the ContainerGroupIdentity object itself. + */ + public ContainerGroupIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIdentityUserAssignedIdentitiesValue.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIdentityUserAssignedIdentitiesValue.java new file mode 100644 index 000000000000..a5823a08169f --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIdentityUserAssignedIdentitiesValue.java @@ -0,0 +1,47 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ContainerGroupIdentityUserAssignedIdentitiesValue model. + */ +public class ContainerGroupIdentityUserAssignedIdentitiesValue { + /** + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) + private String clientId; + + /** + * Get the principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIpAddressType.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIpAddressType.java new file mode 100644 index 000000000000..52895db4ee8d --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupIpAddressType.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupIpAddressType. + */ +public final class ContainerGroupIpAddressType extends ExpandableStringEnum { + /** Static value Public for ContainerGroupIpAddressType. */ + public static final ContainerGroupIpAddressType PUBLIC = fromString("Public"); + + /** Static value Private for ContainerGroupIpAddressType. */ + public static final ContainerGroupIpAddressType PRIVATE = fromString("Private"); + + /** + * Creates or finds a ContainerGroupIpAddressType from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupIpAddressType + */ + @JsonCreator + public static ContainerGroupIpAddressType fromString(String name) { + return fromString(name, ContainerGroupIpAddressType.class); + } + + /** + * @return known ContainerGroupIpAddressType values + */ + public static Collection values() { + return values(ContainerGroupIpAddressType.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupNetworkProfile.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupNetworkProfile.java new file mode 100644 index 000000000000..41ecc15ab570 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupNetworkProfile.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container group network profile information. + */ +public class ContainerGroupNetworkProfile { + /** + * The identifier for a network profile. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the identifier for a network profile. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the identifier for a network profile. + * + * @param id the id value to set + * @return the ContainerGroupNetworkProfile object itself. + */ + public ContainerGroupNetworkProfile withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupNetworkProtocol.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupNetworkProtocol.java new file mode 100644 index 000000000000..b5de9f4cab21 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupNetworkProtocol.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupNetworkProtocol. + */ +public final class ContainerGroupNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerGroupNetworkProtocol. */ + public static final ContainerGroupNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerGroupNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupNetworkProtocol + */ + @JsonCreator + public static ContainerGroupNetworkProtocol fromString(String name) { + return fromString(name, ContainerGroupNetworkProtocol.class); + } + + /** + * @return known ContainerGroupNetworkProtocol values + */ + public static Collection values() { + return values(ContainerGroupNetworkProtocol.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupPropertiesInstanceView.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupPropertiesInstanceView.java new file mode 100644 index 000000000000..374f24d74b1f --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupPropertiesInstanceView.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container group. Only valid in response. + */ +public class ContainerGroupPropertiesInstanceView { + /** + * The events of this container group. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * The state of the container group. Only valid in response. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * Get the events of this container group. + * + * @return the events value + */ + public List events() { + return this.events; + } + + /** + * Get the state of the container group. Only valid in response. + * + * @return the state value + */ + public String state() { + return this.state; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupRestartPolicy.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupRestartPolicy.java new file mode 100644 index 000000000000..f831beb5fdf9 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupRestartPolicy.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupRestartPolicy. + */ +public final class ContainerGroupRestartPolicy extends ExpandableStringEnum { + /** Static value Always for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ALWAYS = fromString("Always"); + + /** Static value OnFailure for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy ON_FAILURE = fromString("OnFailure"); + + /** Static value Never for ContainerGroupRestartPolicy. */ + public static final ContainerGroupRestartPolicy NEVER = fromString("Never"); + + /** + * Creates or finds a ContainerGroupRestartPolicy from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupRestartPolicy + */ + @JsonCreator + public static ContainerGroupRestartPolicy fromString(String name) { + return fromString(name, ContainerGroupRestartPolicy.class); + } + + /** + * @return known ContainerGroupRestartPolicy values + */ + public static Collection values() { + return values(ContainerGroupRestartPolicy.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupSku.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupSku.java new file mode 100644 index 000000000000..58a59d524d92 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroupSku.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerGroupSku. + */ +public final class ContainerGroupSku extends ExpandableStringEnum { + /** Static value Standard for ContainerGroupSku. */ + public static final ContainerGroupSku STANDARD = fromString("Standard"); + + /** Static value Dedicated for ContainerGroupSku. */ + public static final ContainerGroupSku DEDICATED = fromString("Dedicated"); + + /** + * Creates or finds a ContainerGroupSku from its string representation. + * @param name a name to look for + * @return the corresponding ContainerGroupSku + */ + @JsonCreator + public static ContainerGroupSku fromString(String name) { + return fromString(name, ContainerGroupSku.class); + } + + /** + * @return known ContainerGroupSku values + */ + public static Collection values() { + return values(ContainerGroupSku.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroups.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroups.java new file mode 100644 index 000000000000..f43856570bdb --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerGroups.java @@ -0,0 +1,59 @@ +/** + * 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.containerinstance.v2019_12_01; + +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 rx.Completable; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ContainerGroups. + */ +public interface ContainerGroups extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable restartAsync(String resourceGroupName, String containerGroupName); + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable stopAsync(String resourceGroupName, String containerGroupName); + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable startAsync(String resourceGroupName, String containerGroupName); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerHttpGet.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerHttpGet.java new file mode 100644 index 000000000000..f64a1e84b35b --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerHttpGet.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container Http Get settings, for liveness or readiness probe. + */ +public class ContainerHttpGet { + /** + * The path to probe. + */ + @JsonProperty(value = "path") + private String path; + + /** + * The port number to probe. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * The scheme. Possible values include: 'http', 'https'. + */ + @JsonProperty(value = "scheme") + private Scheme scheme; + + /** + * Get the path to probe. + * + * @return the path value + */ + public String path() { + return this.path; + } + + /** + * Set the path to probe. + * + * @param path the path value to set + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the port number to probe. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number to probe. + * + * @param port the port value to set + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withPort(int port) { + this.port = port; + return this; + } + + /** + * Get the scheme. Possible values include: 'http', 'https'. + * + * @return the scheme value + */ + public Scheme scheme() { + return this.scheme; + } + + /** + * Set the scheme. Possible values include: 'http', 'https'. + * + * @param scheme the scheme value to set + * @return the ContainerHttpGet object itself. + */ + public ContainerHttpGet withScheme(Scheme scheme) { + this.scheme = scheme; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerInstanceOperationsOrigin.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerInstanceOperationsOrigin.java new file mode 100644 index 000000000000..27fb372b5200 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerInstanceOperationsOrigin.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerInstanceOperationsOrigin. + */ +public final class ContainerInstanceOperationsOrigin extends ExpandableStringEnum { + /** Static value User for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin USER = fromString("User"); + + /** Static value System for ContainerInstanceOperationsOrigin. */ + public static final ContainerInstanceOperationsOrigin SYSTEM = fromString("System"); + + /** + * Creates or finds a ContainerInstanceOperationsOrigin from its string representation. + * @param name a name to look for + * @return the corresponding ContainerInstanceOperationsOrigin + */ + @JsonCreator + public static ContainerInstanceOperationsOrigin fromString(String name) { + return fromString(name, ContainerInstanceOperationsOrigin.class); + } + + /** + * @return known ContainerInstanceOperationsOrigin values + */ + public static Collection values() { + return values(ContainerInstanceOperationsOrigin.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerNetworkProtocol.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerNetworkProtocol.java new file mode 100644 index 000000000000..5811d27dd0e4 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerNetworkProtocol.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ContainerNetworkProtocol. + */ +public final class ContainerNetworkProtocol extends ExpandableStringEnum { + /** Static value TCP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol TCP = fromString("TCP"); + + /** Static value UDP for ContainerNetworkProtocol. */ + public static final ContainerNetworkProtocol UDP = fromString("UDP"); + + /** + * Creates or finds a ContainerNetworkProtocol from its string representation. + * @param name a name to look for + * @return the corresponding ContainerNetworkProtocol + */ + @JsonCreator + public static ContainerNetworkProtocol fromString(String name) { + return fromString(name, ContainerNetworkProtocol.class); + } + + /** + * @return known ContainerNetworkProtocol values + */ + public static Collection values() { + return values(ContainerNetworkProtocol.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerPort.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerPort.java new file mode 100644 index 000000000000..2c055f125f0b --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerPort.java @@ -0,0 +1,70 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container instance. + */ +public class ContainerPort { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerNetworkProtocol protocol; + + /** + * The port number exposed within the container group. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withProtocol(ContainerNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number exposed within the container group. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number exposed within the container group. + * + * @param port the port value to set + * @return the ContainerPort object itself. + */ + public ContainerPort withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerProbe.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerProbe.java new file mode 100644 index 000000000000..3324147b2e77 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerProbe.java @@ -0,0 +1,199 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container probe, for liveness or readiness. + */ +public class ContainerProbe { + /** + * The execution command to probe. + */ + @JsonProperty(value = "exec") + private ContainerExec exec; + + /** + * The Http Get settings to probe. + */ + @JsonProperty(value = "httpGet") + private ContainerHttpGet httpGet; + + /** + * The initial delay seconds. + */ + @JsonProperty(value = "initialDelaySeconds") + private Integer initialDelaySeconds; + + /** + * The period seconds. + */ + @JsonProperty(value = "periodSeconds") + private Integer periodSeconds; + + /** + * The failure threshold. + */ + @JsonProperty(value = "failureThreshold") + private Integer failureThreshold; + + /** + * The success threshold. + */ + @JsonProperty(value = "successThreshold") + private Integer successThreshold; + + /** + * The timeout seconds. + */ + @JsonProperty(value = "timeoutSeconds") + private Integer timeoutSeconds; + + /** + * Get the execution command to probe. + * + * @return the exec value + */ + public ContainerExec exec() { + return this.exec; + } + + /** + * Set the execution command to probe. + * + * @param exec the exec value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withExec(ContainerExec exec) { + this.exec = exec; + return this; + } + + /** + * Get the Http Get settings to probe. + * + * @return the httpGet value + */ + public ContainerHttpGet httpGet() { + return this.httpGet; + } + + /** + * Set the Http Get settings to probe. + * + * @param httpGet the httpGet value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withHttpGet(ContainerHttpGet httpGet) { + this.httpGet = httpGet; + return this; + } + + /** + * Get the initial delay seconds. + * + * @return the initialDelaySeconds value + */ + public Integer initialDelaySeconds() { + return this.initialDelaySeconds; + } + + /** + * Set the initial delay seconds. + * + * @param initialDelaySeconds the initialDelaySeconds value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withInitialDelaySeconds(Integer initialDelaySeconds) { + this.initialDelaySeconds = initialDelaySeconds; + return this; + } + + /** + * Get the period seconds. + * + * @return the periodSeconds value + */ + public Integer periodSeconds() { + return this.periodSeconds; + } + + /** + * Set the period seconds. + * + * @param periodSeconds the periodSeconds value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withPeriodSeconds(Integer periodSeconds) { + this.periodSeconds = periodSeconds; + return this; + } + + /** + * Get the failure threshold. + * + * @return the failureThreshold value + */ + public Integer failureThreshold() { + return this.failureThreshold; + } + + /** + * Set the failure threshold. + * + * @param failureThreshold the failureThreshold value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withFailureThreshold(Integer failureThreshold) { + this.failureThreshold = failureThreshold; + return this; + } + + /** + * Get the success threshold. + * + * @return the successThreshold value + */ + public Integer successThreshold() { + return this.successThreshold; + } + + /** + * Set the success threshold. + * + * @param successThreshold the successThreshold value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withSuccessThreshold(Integer successThreshold) { + this.successThreshold = successThreshold; + return this; + } + + /** + * Get the timeout seconds. + * + * @return the timeoutSeconds value + */ + public Integer timeoutSeconds() { + return this.timeoutSeconds; + } + + /** + * Set the timeout seconds. + * + * @param timeoutSeconds the timeoutSeconds value to set + * @return the ContainerProbe object itself. + */ + public ContainerProbe withTimeoutSeconds(Integer timeoutSeconds) { + this.timeoutSeconds = timeoutSeconds; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerPropertiesInstanceView.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerPropertiesInstanceView.java new file mode 100644 index 000000000000..eabf84f9bf16 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerPropertiesInstanceView.java @@ -0,0 +1,78 @@ +/** + * 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.containerinstance.v2019_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the container instance. Only valid in response. + */ +public class ContainerPropertiesInstanceView { + /** + * The number of times that the container instance has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /** + * Current container instance state. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /** + * Previous container instance state. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /** + * The events of the container instance. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * Get the number of times that the container instance has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get current container instance state. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get previous container instance state. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the container instance. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerState.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerState.java new file mode 100644 index 000000000000..f11c5fa0107e --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ContainerState.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.containerinstance.v2019_12_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container instance state. + */ +public class ContainerState { + /** + * The state of the container instance. + */ + @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * The date-time when the container instance state started. + */ + @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime startTime; + + /** + * The container instance exit codes correspond to those from the `docker + * run` command. + */ + @JsonProperty(value = "exitCode", access = JsonProperty.Access.WRITE_ONLY) + private Integer exitCode; + + /** + * The date-time when the container instance state finished. + */ + @JsonProperty(value = "finishTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime finishTime; + + /** + * The human-readable status of the container instance state. + */ + @JsonProperty(value = "detailStatus", access = JsonProperty.Access.WRITE_ONLY) + private String detailStatus; + + /** + * Get the state of the container instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get the date-time when the container instance state started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Get the container instance exit codes correspond to those from the `docker run` command. + * + * @return the exitCode value + */ + public Integer exitCode() { + return this.exitCode; + } + + /** + * Get the date-time when the container instance state finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Get the human-readable status of the container instance state. + * + * @return the detailStatus value + */ + public String detailStatus() { + return this.detailStatus; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Containers.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Containers.java new file mode 100644 index 000000000000..08ec5a90b740 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Containers.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.containerinstance.v2019_12_01; + +import rx.Observable; + +/** + * Type representing Containers. + */ +public interface Containers { + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listLogsAsync(String resourceGroupName, String containerGroupName, String containerName); + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable executeCommandAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/DnsConfiguration.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/DnsConfiguration.java new file mode 100644 index 000000000000..66619a4ba2ee --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/DnsConfiguration.java @@ -0,0 +1,96 @@ +/** + * 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.containerinstance.v2019_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DNS configuration for the container group. + */ +public class DnsConfiguration { + /** + * The DNS servers for the container group. + */ + @JsonProperty(value = "nameServers", required = true) + private List nameServers; + + /** + * The DNS search domains for hostname lookup in the container group. + */ + @JsonProperty(value = "searchDomains") + private String searchDomains; + + /** + * The DNS options for the container group. + */ + @JsonProperty(value = "options") + private String options; + + /** + * Get the DNS servers for the container group. + * + * @return the nameServers value + */ + public List nameServers() { + return this.nameServers; + } + + /** + * Set the DNS servers for the container group. + * + * @param nameServers the nameServers value to set + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withNameServers(List nameServers) { + this.nameServers = nameServers; + return this; + } + + /** + * Get the DNS search domains for hostname lookup in the container group. + * + * @return the searchDomains value + */ + public String searchDomains() { + return this.searchDomains; + } + + /** + * Set the DNS search domains for hostname lookup in the container group. + * + * @param searchDomains the searchDomains value to set + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withSearchDomains(String searchDomains) { + this.searchDomains = searchDomains; + return this; + } + + /** + * Get the DNS options for the container group. + * + * @return the options value + */ + public String options() { + return this.options; + } + + /** + * Set the DNS options for the container group. + * + * @param options the options value to set + * @return the DnsConfiguration object itself. + */ + public DnsConfiguration withOptions(String options) { + this.options = options; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/EncryptionProperties.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/EncryptionProperties.java new file mode 100644 index 000000000000..34c9e2927636 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/EncryptionProperties.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The container group encryption properties. + */ +public class EncryptionProperties { + /** + * The keyvault base url. + */ + @JsonProperty(value = "vaultBaseUrl", required = true) + private String vaultBaseUrl; + + /** + * The encryption key name. + */ + @JsonProperty(value = "keyName", required = true) + private String keyName; + + /** + * The encryption key version. + */ + @JsonProperty(value = "keyVersion", required = true) + private String keyVersion; + + /** + * Get the keyvault base url. + * + * @return the vaultBaseUrl value + */ + public String vaultBaseUrl() { + return this.vaultBaseUrl; + } + + /** + * Set the keyvault base url. + * + * @param vaultBaseUrl the vaultBaseUrl value to set + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withVaultBaseUrl(String vaultBaseUrl) { + this.vaultBaseUrl = vaultBaseUrl; + return this; + } + + /** + * Get the encryption key name. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the encryption key name. + * + * @param keyName the keyName value to set + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the encryption key version. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the encryption key version. + * + * @param keyVersion the keyVersion value to set + * @return the EncryptionProperties object itself. + */ + public EncryptionProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/EnvironmentVariable.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/EnvironmentVariable.java new file mode 100644 index 000000000000..9cab382238a2 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/EnvironmentVariable.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The environment variable to set within the container instance. + */ +public class EnvironmentVariable { + /** + * The name of the environment variable. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the environment variable. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The value of the secure environment variable. + */ + @JsonProperty(value = "secureValue") + private String secureValue; + + /** + * Get the name of the environment variable. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the environment variable. + * + * @param name the name value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the environment variable. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the environment variable. + * + * @param value the value value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the value of the secure environment variable. + * + * @return the secureValue value + */ + public String secureValue() { + return this.secureValue; + } + + /** + * Set the value of the secure environment variable. + * + * @param secureValue the secureValue value to set + * @return the EnvironmentVariable object itself. + */ + public EnvironmentVariable withSecureValue(String secureValue) { + this.secureValue = secureValue; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Event.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Event.java new file mode 100644 index 000000000000..c5df20e8893d --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Event.java @@ -0,0 +1,108 @@ +/** + * 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.containerinstance.v2019_12_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A container group or container instance event. + */ +public class Event { + /** + * The count of the event. + */ + @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) + private Integer count; + + /** + * The date-time of the earliest logged event. + */ + @JsonProperty(value = "firstTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime firstTimestamp; + + /** + * The date-time of the latest logged event. + */ + @JsonProperty(value = "lastTimestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastTimestamp; + + /** + * The event name. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The event message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The event type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the count of the event. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Get the date-time of the earliest logged event. + * + * @return the firstTimestamp value + */ + public DateTime firstTimestamp() { + return this.firstTimestamp; + } + + /** + * Get the date-time of the latest logged event. + * + * @return the lastTimestamp value + */ + public DateTime lastTimestamp() { + return this.lastTimestamp; + } + + /** + * Get the event name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the event message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the event type. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GitRepoVolume.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GitRepoVolume.java new file mode 100644 index 000000000000..93daf7bb8b47 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GitRepoVolume.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a volume that is populated with the contents of a git repository. + */ +public class GitRepoVolume { + /** + * Target directory name. Must not contain or start with '..'. If '.' is + * supplied, the volume directory will be the git repository. Otherwise, + * if specified, the volume will contain the git repository in the + * subdirectory with the given name. + */ + @JsonProperty(value = "directory") + private String directory; + + /** + * Repository URL. + */ + @JsonProperty(value = "repository", required = true) + private String repository; + + /** + * Commit hash for the specified revision. + */ + @JsonProperty(value = "revision") + private String revision; + + /** + * Get target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @return the directory value + */ + public String directory() { + return this.directory; + } + + /** + * Set target directory name. Must not contain or start with '..'. If '.' is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name. + * + * @param directory the directory value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withDirectory(String directory) { + this.directory = directory; + return this; + } + + /** + * Get repository URL. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set repository URL. + * + * @param repository the repository value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get commit hash for the specified revision. + * + * @return the revision value + */ + public String revision() { + return this.revision; + } + + /** + * Set commit hash for the specified revision. + * + * @param revision the revision value to set + * @return the GitRepoVolume object itself. + */ + public GitRepoVolume withRevision(String revision) { + this.revision = revision; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GpuResource.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GpuResource.java new file mode 100644 index 000000000000..10c267612acd --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GpuResource.java @@ -0,0 +1,70 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The GPU resource. + */ +public class GpuResource { + /** + * The count of the GPU resource. + */ + @JsonProperty(value = "count", required = true) + private int count; + + /** + * The SKU of the GPU resource. Possible values include: 'K80', 'P100', + * 'V100'. + */ + @JsonProperty(value = "sku", required = true) + private GpuSku sku; + + /** + * Get the count of the GPU resource. + * + * @return the count value + */ + public int count() { + return this.count; + } + + /** + * Set the count of the GPU resource. + * + * @param count the count value to set + * @return the GpuResource object itself. + */ + public GpuResource withCount(int count) { + this.count = count; + return this; + } + + /** + * Get the SKU of the GPU resource. Possible values include: 'K80', 'P100', 'V100'. + * + * @return the sku value + */ + public GpuSku sku() { + return this.sku; + } + + /** + * Set the SKU of the GPU resource. Possible values include: 'K80', 'P100', 'V100'. + * + * @param sku the sku value to set + * @return the GpuResource object itself. + */ + public GpuResource withSku(GpuSku sku) { + this.sku = sku; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GpuSku.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GpuSku.java new file mode 100644 index 000000000000..42dcbc8fef5c --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/GpuSku.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for GpuSku. + */ +public final class GpuSku extends ExpandableStringEnum { + /** Static value K80 for GpuSku. */ + public static final GpuSku K80 = fromString("K80"); + + /** Static value P100 for GpuSku. */ + public static final GpuSku P100 = fromString("P100"); + + /** Static value V100 for GpuSku. */ + public static final GpuSku V100 = fromString("V100"); + + /** + * Creates or finds a GpuSku from its string representation. + * @param name a name to look for + * @return the corresponding GpuSku + */ + @JsonCreator + public static GpuSku fromString(String name) { + return fromString(name, GpuSku.class); + } + + /** + * @return known GpuSku values + */ + public static Collection values() { + return values(GpuSku.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ImageRegistryCredential.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ImageRegistryCredential.java new file mode 100644 index 000000000000..5aebb6992368 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ImageRegistryCredential.java @@ -0,0 +1,96 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Image registry credential. + */ +public class ImageRegistryCredential { + /** + * The Docker image registry server without a protocol such as "http" and + * "https". + */ + @JsonProperty(value = "server", required = true) + private String server; + + /** + * The username for the private registry. + */ + @JsonProperty(value = "username", required = true) + private String username; + + /** + * The password for the private registry. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the Docker image registry server without a protocol such as "http" and "https". + * + * @return the server value + */ + public String server() { + return this.server; + } + + /** + * Set the Docker image registry server without a protocol such as "http" and "https". + * + * @param server the server value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username for the private registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for the private registry. + * + * @param username the username value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password for the private registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password for the private registry. + * + * @param password the password value to set + * @return the ImageRegistryCredential object itself. + */ + public ImageRegistryCredential withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/InitContainerDefinition.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/InitContainerDefinition.java new file mode 100644 index 000000000000..0069e7072cf2 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/InitContainerDefinition.java @@ -0,0 +1,165 @@ +/** + * 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.containerinstance.v2019_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The init container definition. + */ +@JsonFlatten +public class InitContainerDefinition { + /** + * The name for the init container. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The image of the init container. + */ + @JsonProperty(value = "properties.image") + private String image; + + /** + * The command to execute within the init container in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The environment variables to set in the init container. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the init container. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private InitContainerPropertiesDefinitionInstanceView instanceView; + + /** + * The volume mounts available to the init container. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * Get the name for the init container. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name for the init container. + * + * @param name the name value to set + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the image of the init container. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the image of the init container. + * + * @param image the image value to set + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the command to execute within the init container in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the command to execute within the init container in exec form. + * + * @param command the command value to set + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the environment variables to set in the init container. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in the init container. + * + * @param environmentVariables the environmentVariables value to set + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the init container. Only valid in response. + * + * @return the instanceView value + */ + public InitContainerPropertiesDefinitionInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the volume mounts available to the init container. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volume mounts available to the init container. + * + * @param volumeMounts the volumeMounts value to set + * @return the InitContainerDefinition object itself. + */ + public InitContainerDefinition withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/InitContainerPropertiesDefinitionInstanceView.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/InitContainerPropertiesDefinitionInstanceView.java new file mode 100644 index 000000000000..8818bdd86506 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/InitContainerPropertiesDefinitionInstanceView.java @@ -0,0 +1,78 @@ +/** + * 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.containerinstance.v2019_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The instance view of the init container. Only valid in response. + */ +public class InitContainerPropertiesDefinitionInstanceView { + /** + * The number of times that the init container has been restarted. + */ + @JsonProperty(value = "restartCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer restartCount; + + /** + * The current state of the init container. + */ + @JsonProperty(value = "currentState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState currentState; + + /** + * The previous state of the init container. + */ + @JsonProperty(value = "previousState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerState previousState; + + /** + * The events of the init container. + */ + @JsonProperty(value = "events", access = JsonProperty.Access.WRITE_ONLY) + private List events; + + /** + * Get the number of times that the init container has been restarted. + * + * @return the restartCount value + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Get the current state of the init container. + * + * @return the currentState value + */ + public ContainerState currentState() { + return this.currentState; + } + + /** + * Get the previous state of the init container. + * + * @return the previousState value + */ + public ContainerState previousState() { + return this.previousState; + } + + /** + * Get the events of the init container. + * + * @return the events value + */ + public List events() { + return this.events; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/IpAddress.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/IpAddress.java new file mode 100644 index 000000000000..4d4ca9f920d2 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/IpAddress.java @@ -0,0 +1,138 @@ +/** + * 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.containerinstance.v2019_12_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP address for the container group. + */ +public class IpAddress { + /** + * The list of ports exposed on the container group. + */ + @JsonProperty(value = "ports", required = true) + private List ports; + + /** + * Specifies if the IP is exposed to the public internet or private VNET. + * Possible values include: 'Public', 'Private'. + */ + @JsonProperty(value = "type", required = true) + private ContainerGroupIpAddressType type; + + /** + * The IP exposed to the public internet. + */ + @JsonProperty(value = "ip") + private String ip; + + /** + * The Dns name label for the IP. + */ + @JsonProperty(value = "dnsNameLabel") + private String dnsNameLabel; + + /** + * The FQDN for the IP. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /** + * Get the list of ports exposed on the container group. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the list of ports exposed on the container group. + * + * @param ports the ports value to set + * @return the IpAddress object itself. + */ + public IpAddress withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get specifies if the IP is exposed to the public internet or private VNET. Possible values include: 'Public', 'Private'. + * + * @return the type value + */ + public ContainerGroupIpAddressType type() { + return this.type; + } + + /** + * Set specifies if the IP is exposed to the public internet or private VNET. Possible values include: 'Public', 'Private'. + * + * @param type the type value to set + * @return the IpAddress object itself. + */ + public IpAddress withType(ContainerGroupIpAddressType type) { + this.type = type; + return this; + } + + /** + * Get the IP exposed to the public internet. + * + * @return the ip value + */ + public String ip() { + return this.ip; + } + + /** + * Set the IP exposed to the public internet. + * + * @param ip the ip value to set + * @return the IpAddress object itself. + */ + public IpAddress withIp(String ip) { + this.ip = ip; + return this; + } + + /** + * Get the Dns name label for the IP. + * + * @return the dnsNameLabel value + */ + public String dnsNameLabel() { + return this.dnsNameLabel; + } + + /** + * Set the Dns name label for the IP. + * + * @param dnsNameLabel the dnsNameLabel value to set + * @return the IpAddress object itself. + */ + public IpAddress withDnsNameLabel(String dnsNameLabel) { + this.dnsNameLabel = dnsNameLabel; + return this; + } + + /** + * Get the FQDN for the IP. + * + * @return the fqdn value + */ + public String fqdn() { + return this.fqdn; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Locations.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Locations.java new file mode 100644 index 000000000000..90cd4086b979 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Locations.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.LocationsInner; +import com.microsoft.azure.arm.model.HasInner; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Capabilities; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Usage; +import com.microsoft.azure.management.containerinstance.v2019_12_01.CachedImages; + +/** + * Type representing Locations. + */ +public interface Locations extends HasInner { + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCapabilitiesAsync(final String location); + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsageAsync(String location); + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCachedImagesAsync(final String location); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/LogAnalytics.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/LogAnalytics.java new file mode 100644 index 000000000000..c204a52c1efc --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/LogAnalytics.java @@ -0,0 +1,123 @@ +/** + * 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.containerinstance.v2019_12_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Container group log analytics information. + */ +public class LogAnalytics { + /** + * The workspace id for log analytics. + */ + @JsonProperty(value = "workspaceId", required = true) + private String workspaceId; + + /** + * The workspace key for log analytics. + */ + @JsonProperty(value = "workspaceKey", required = true) + private String workspaceKey; + + /** + * The log type to be used. Possible values include: 'ContainerInsights', + * 'ContainerInstanceLogs'. + */ + @JsonProperty(value = "logType") + private LogAnalyticsLogType logType; + + /** + * Metadata for log analytics. + */ + @JsonProperty(value = "metadata") + private Map metadata; + + /** + * Get the workspace id for log analytics. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Set the workspace id for log analytics. + * + * @param workspaceId the workspaceId value to set + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceId(String workspaceId) { + this.workspaceId = workspaceId; + return this; + } + + /** + * Get the workspace key for log analytics. + * + * @return the workspaceKey value + */ + public String workspaceKey() { + return this.workspaceKey; + } + + /** + * Set the workspace key for log analytics. + * + * @param workspaceKey the workspaceKey value to set + * @return the LogAnalytics object itself. + */ + public LogAnalytics withWorkspaceKey(String workspaceKey) { + this.workspaceKey = workspaceKey; + return this; + } + + /** + * Get the log type to be used. Possible values include: 'ContainerInsights', 'ContainerInstanceLogs'. + * + * @return the logType value + */ + public LogAnalyticsLogType logType() { + return this.logType; + } + + /** + * Set the log type to be used. Possible values include: 'ContainerInsights', 'ContainerInstanceLogs'. + * + * @param logType the logType value to set + * @return the LogAnalytics object itself. + */ + public LogAnalytics withLogType(LogAnalyticsLogType logType) { + this.logType = logType; + return this; + } + + /** + * Get metadata for log analytics. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set metadata for log analytics. + * + * @param metadata the metadata value to set + * @return the LogAnalytics object itself. + */ + public LogAnalytics withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/LogAnalyticsLogType.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/LogAnalyticsLogType.java new file mode 100644 index 000000000000..61b1c5968e75 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/LogAnalyticsLogType.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LogAnalyticsLogType. + */ +public final class LogAnalyticsLogType extends ExpandableStringEnum { + /** Static value ContainerInsights for LogAnalyticsLogType. */ + public static final LogAnalyticsLogType CONTAINER_INSIGHTS = fromString("ContainerInsights"); + + /** Static value ContainerInstanceLogs for LogAnalyticsLogType. */ + public static final LogAnalyticsLogType CONTAINER_INSTANCE_LOGS = fromString("ContainerInstanceLogs"); + + /** + * Creates or finds a LogAnalyticsLogType from its string representation. + * @param name a name to look for + * @return the corresponding LogAnalyticsLogType + */ + @JsonCreator + public static LogAnalyticsLogType fromString(String name) { + return fromString(name, LogAnalyticsLogType.class); + } + + /** + * @return known LogAnalyticsLogType values + */ + public static Collection values() { + return values(LogAnalyticsLogType.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Logs.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Logs.java new file mode 100644 index 000000000000..82c5a33f17d8 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Logs.java @@ -0,0 +1,25 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.LogsInner; + +/** + * Type representing Logs. + */ +public interface Logs extends HasInner, HasManager { + /** + * @return the content value. + */ + String content(); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/OperatingSystemTypes.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/OperatingSystemTypes.java new file mode 100644 index 000000000000..ac3790724410 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/OperatingSystemTypes.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OperatingSystemTypes. + */ +public final class OperatingSystemTypes extends ExpandableStringEnum { + /** Static value Windows for OperatingSystemTypes. */ + public static final OperatingSystemTypes WINDOWS = fromString("Windows"); + + /** Static value Linux for OperatingSystemTypes. */ + public static final OperatingSystemTypes LINUX = fromString("Linux"); + + /** + * Creates or finds a OperatingSystemTypes from its string representation. + * @param name a name to look for + * @return the corresponding OperatingSystemTypes + */ + @JsonCreator + public static OperatingSystemTypes fromString(String name) { + return fromString(name, OperatingSystemTypes.class); + } + + /** + * @return known OperatingSystemTypes values + */ + public static Collection values() { + return values(OperatingSystemTypes.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Operation.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Operation.java new file mode 100644 index 000000000000..7a94c4f0c69a --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Operation.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.containerinstance.v2019_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerInstanceManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + ContainerInstanceOperationsOrigin origin(); + + /** + * @return the properties value. + */ + Object properties(); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/OperationDisplay.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/OperationDisplay.java new file mode 100644 index 000000000000..adcc3a721286 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/OperationDisplay.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information of the operation. + */ +public class OperationDisplay { + /** + * The name of the provider of the operation. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The name of the resource type of the operation. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The friendly name of the operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the name of the provider of the operation. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the name of the provider of the operation. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the name of the resource type of the operation. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the name of the resource type of the operation. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the friendly name of the operation. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the friendly name of the operation. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description of the operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Operations.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Operations.java new file mode 100644 index 000000000000..1dd40068daeb --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Operations.java @@ -0,0 +1,27 @@ +/** + * 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.containerinstance.v2019_12_01; + +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Port.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Port.java new file mode 100644 index 000000000000..83ab65e2b1b8 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Port.java @@ -0,0 +1,70 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The port exposed on the container group. + */ +public class Port { + /** + * The protocol associated with the port. Possible values include: 'TCP', + * 'UDP'. + */ + @JsonProperty(value = "protocol") + private ContainerGroupNetworkProtocol protocol; + + /** + * The port number. + */ + @JsonProperty(value = "port", required = true) + private int port; + + /** + * Get the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @return the protocol value + */ + public ContainerGroupNetworkProtocol protocol() { + return this.protocol; + } + + /** + * Set the protocol associated with the port. Possible values include: 'TCP', 'UDP'. + * + * @param protocol the protocol value to set + * @return the Port object itself. + */ + public Port withProtocol(ContainerGroupNetworkProtocol protocol) { + this.protocol = protocol; + return this; + } + + /** + * Get the port number. + * + * @return the port value + */ + public int port() { + return this.port; + } + + /** + * Set the port number. + * + * @param port the port value to set + * @return the Port object itself. + */ + public Port withPort(int port) { + this.port = port; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceIdentityType.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceIdentityType.java new file mode 100644 index 000000000000..c50c4c633145 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceIdentityType.java @@ -0,0 +1,59 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceLimits.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceLimits.java new file mode 100644 index 000000000000..857c7098c3a9 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceLimits.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource limits. + */ +public class ResourceLimits { + /** + * The memory limit in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB") + private Double memoryInGB; + + /** + * The CPU limit of this container instance. + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /** + * The GPU limit of this container instance. + */ + @JsonProperty(value = "gpu") + private GpuResource gpu; + + /** + * Get the memory limit in GB of this container instance. + * + * @return the memoryInGB value + */ + public Double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory limit in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withMemoryInGB(Double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU limit of this container instance. + * + * @return the cpu value + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the CPU limit of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the GPU limit of this container instance. + * + * @return the gpu value + */ + public GpuResource gpu() { + return this.gpu; + } + + /** + * Set the GPU limit of this container instance. + * + * @param gpu the gpu value to set + * @return the ResourceLimits object itself. + */ + public ResourceLimits withGpu(GpuResource gpu) { + this.gpu = gpu; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceRequests.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceRequests.java new file mode 100644 index 000000000000..6d60f2bf039a --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceRequests.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requests. + */ +public class ResourceRequests { + /** + * The memory request in GB of this container instance. + */ + @JsonProperty(value = "memoryInGB", required = true) + private double memoryInGB; + + /** + * The CPU request of this container instance. + */ + @JsonProperty(value = "cpu", required = true) + private double cpu; + + /** + * The GPU request of this container instance. + */ + @JsonProperty(value = "gpu") + private GpuResource gpu; + + /** + * Get the memory request in GB of this container instance. + * + * @return the memoryInGB value + */ + public double memoryInGB() { + return this.memoryInGB; + } + + /** + * Set the memory request in GB of this container instance. + * + * @param memoryInGB the memoryInGB value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withMemoryInGB(double memoryInGB) { + this.memoryInGB = memoryInGB; + return this; + } + + /** + * Get the CPU request of this container instance. + * + * @return the cpu value + */ + public double cpu() { + return this.cpu; + } + + /** + * Set the CPU request of this container instance. + * + * @param cpu the cpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withCpu(double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the GPU request of this container instance. + * + * @return the gpu value + */ + public GpuResource gpu() { + return this.gpu; + } + + /** + * Set the GPU request of this container instance. + * + * @param gpu the gpu value to set + * @return the ResourceRequests object itself. + */ + public ResourceRequests withGpu(GpuResource gpu) { + this.gpu = gpu; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceRequirements.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceRequirements.java new file mode 100644 index 000000000000..07c7df6ac0b0 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/ResourceRequirements.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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource requirements. + */ +public class ResourceRequirements { + /** + * The resource requests of this container instance. + */ + @JsonProperty(value = "requests", required = true) + private ResourceRequests requests; + + /** + * The resource limits of this container instance. + */ + @JsonProperty(value = "limits") + private ResourceLimits limits; + + /** + * Get the resource requests of this container instance. + * + * @return the requests value + */ + public ResourceRequests requests() { + return this.requests; + } + + /** + * Set the resource requests of this container instance. + * + * @param requests the requests value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withRequests(ResourceRequests requests) { + this.requests = requests; + return this; + } + + /** + * Get the resource limits of this container instance. + * + * @return the limits value + */ + public ResourceLimits limits() { + return this.limits; + } + + /** + * Set the resource limits of this container instance. + * + * @param limits the limits value to set + * @return the ResourceRequirements object itself. + */ + public ResourceRequirements withLimits(ResourceLimits limits) { + this.limits = limits; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Scheme.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Scheme.java new file mode 100644 index 000000000000..2ac0096917ee --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Scheme.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.containerinstance.v2019_12_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Scheme. + */ +public final class Scheme extends ExpandableStringEnum { + /** Static value http for Scheme. */ + public static final Scheme HTTP = fromString("http"); + + /** Static value https for Scheme. */ + public static final Scheme HTTPS = fromString("https"); + + /** + * Creates or finds a Scheme from its string representation. + * @param name a name to look for + * @return the corresponding Scheme + */ + @JsonCreator + public static Scheme fromString(String name) { + return fromString(name, Scheme.class); + } + + /** + * @return known Scheme values + */ + public static Collection values() { + return values(Scheme.class); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Usage.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Usage.java new file mode 100644 index 000000000000..d7a375d5f9c7 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Usage.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.containerinstance.v2019_12_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.UsageInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerinstance.v2019_12_01.implementation.ContainerInstanceManager; + +/** + * Type representing Usage. + */ +public interface Usage extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Integer currentValue(); + + /** + * @return the limit value. + */ + Integer limit(); + + /** + * @return the name value. + */ + UsageName name(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/UsageName.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/UsageName.java new file mode 100644 index 000000000000..dbb71214e8c9 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/UsageName.java @@ -0,0 +1,47 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name object of the resource. + */ +public class UsageName { + /** + * The name of the resource. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * The localized name of the resource. + */ + @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) + private String localizedValue; + + /** + * Get the name of the resource. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Get the localized name of the resource. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Volume.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Volume.java new file mode 100644 index 000000000000..df7858da7292 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/Volume.java @@ -0,0 +1,148 @@ +/** + * 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.containerinstance.v2019_12_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume. + */ +public class Volume { + /** + * The name of the volume. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The Azure File volume. + */ + @JsonProperty(value = "azureFile") + private AzureFileVolume azureFile; + + /** + * The empty directory volume. + */ + @JsonProperty(value = "emptyDir") + private Object emptyDir; + + /** + * The secret volume. + */ + @JsonProperty(value = "secret") + private Map secret; + + /** + * The git repo volume. + */ + @JsonProperty(value = "gitRepo") + private GitRepoVolume gitRepo; + + /** + * Get the name of the volume. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume. + * + * @param name the name value to set + * @return the Volume object itself. + */ + public Volume withName(String name) { + this.name = name; + return this; + } + + /** + * Get the Azure File volume. + * + * @return the azureFile value + */ + public AzureFileVolume azureFile() { + return this.azureFile; + } + + /** + * Set the Azure File volume. + * + * @param azureFile the azureFile value to set + * @return the Volume object itself. + */ + public Volume withAzureFile(AzureFileVolume azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Get the empty directory volume. + * + * @return the emptyDir value + */ + public Object emptyDir() { + return this.emptyDir; + } + + /** + * Set the empty directory volume. + * + * @param emptyDir the emptyDir value to set + * @return the Volume object itself. + */ + public Volume withEmptyDir(Object emptyDir) { + this.emptyDir = emptyDir; + return this; + } + + /** + * Get the secret volume. + * + * @return the secret value + */ + public Map secret() { + return this.secret; + } + + /** + * Set the secret volume. + * + * @param secret the secret value to set + * @return the Volume object itself. + */ + public Volume withSecret(Map secret) { + this.secret = secret; + return this; + } + + /** + * Get the git repo volume. + * + * @return the gitRepo value + */ + public GitRepoVolume gitRepo() { + return this.gitRepo; + } + + /** + * Set the git repo volume. + * + * @param gitRepo the gitRepo value to set + * @return the Volume object itself. + */ + public Volume withGitRepo(GitRepoVolume gitRepo) { + this.gitRepo = gitRepo; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/VolumeMount.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/VolumeMount.java new file mode 100644 index 000000000000..f604f5918afc --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/VolumeMount.java @@ -0,0 +1,96 @@ +/** + * 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.containerinstance.v2019_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the volume mount. + */ +public class VolumeMount { + /** + * The name of the volume mount. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The path within the container where the volume should be mounted. Must + * not contain colon (:). + */ + @JsonProperty(value = "mountPath", required = true) + private String mountPath; + + /** + * The flag indicating whether the volume mount is read-only. + */ + @JsonProperty(value = "readOnly") + private Boolean readOnly; + + /** + * Get the name of the volume mount. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the volume mount. + * + * @param name the name value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withName(String name) { + this.name = name; + return this; + } + + /** + * Get the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @return the mountPath value + */ + public String mountPath() { + return this.mountPath; + } + + /** + * Set the path within the container where the volume should be mounted. Must not contain colon (:). + * + * @param mountPath the mountPath value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withMountPath(String mountPath) { + this.mountPath = mountPath; + return this; + } + + /** + * Get the flag indicating whether the volume mount is read-only. + * + * @return the readOnly value + */ + public Boolean readOnly() { + return this.readOnly; + } + + /** + * Set the flag indicating whether the volume mount is read-only. + * + * @param readOnly the readOnly value to set + * @return the VolumeMount object itself. + */ + public VolumeMount withReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CachedImagesImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CachedImagesImpl.java new file mode 100644 index 000000000000..c911d10450f2 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CachedImagesImpl.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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.CachedImages; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class CachedImagesImpl extends WrapperImpl implements CachedImages { + private final ContainerInstanceManager manager; + + CachedImagesImpl(CachedImagesInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + + + @Override + public String image() { + return this.inner().image(); + } + + @Override + public String osType() { + return this.inner().osType(); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CachedImagesInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CachedImagesInner.java new file mode 100644 index 000000000000..8e0f6b0324b3 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CachedImagesInner.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.containerinstance.v2019_12_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cached image and OS type. + */ +public class CachedImagesInner { + /** + * The OS type of the cached image. + */ + @JsonProperty(value = "osType", required = true) + private String osType; + + /** + * The cached image name. + */ + @JsonProperty(value = "image", required = true) + private String image; + + /** + * Get the OS type of the cached image. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Set the OS type of the cached image. + * + * @param osType the osType value to set + * @return the CachedImagesInner object itself. + */ + public CachedImagesInner withOsType(String osType) { + this.osType = osType; + return this; + } + + /** + * Get the cached image name. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the cached image name. + * + * @param image the image value to set + * @return the CachedImagesInner object itself. + */ + public CachedImagesInner withImage(String image) { + this.image = image; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CapabilitiesImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CapabilitiesImpl.java new file mode 100644 index 000000000000..c2d064a074d5 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CapabilitiesImpl.java @@ -0,0 +1,61 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.Capabilities; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2019_12_01.CapabilitiesCapabilities; + +class CapabilitiesImpl extends WrapperImpl implements Capabilities { + private final ContainerInstanceManager manager; + + CapabilitiesImpl(CapabilitiesInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + + + @Override + public CapabilitiesCapabilities capabilities() { + return this.inner().capabilities(); + } + + @Override + public String gpu() { + return this.inner().gpu(); + } + + @Override + public String ipAddressType() { + return this.inner().ipAddressType(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String osType() { + return this.inner().osType(); + } + + @Override + public String resourceType() { + return this.inner().resourceType(); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CapabilitiesInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CapabilitiesInner.java new file mode 100644 index 000000000000..8e85fe88b11b --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/CapabilitiesInner.java @@ -0,0 +1,108 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.CapabilitiesCapabilities; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The regional capabilities. + */ +public class CapabilitiesInner { + /** + * The resource type that this capability describes. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /** + * The OS type that this capability describes. + */ + @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY) + private String osType; + + /** + * The resource location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /** + * The ip address type that this capability describes. + */ + @JsonProperty(value = "ipAddressType", access = JsonProperty.Access.WRITE_ONLY) + private String ipAddressType; + + /** + * The GPU sku that this capability describes. + */ + @JsonProperty(value = "gpu", access = JsonProperty.Access.WRITE_ONLY) + private String gpu; + + /** + * The supported capabilities. + */ + @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY) + private CapabilitiesCapabilities capabilities; + + /** + * Get the resource type that this capability describes. + * + * @return the resourceType value + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the OS type that this capability describes. + * + * @return the osType value + */ + public String osType() { + return this.osType; + } + + /** + * Get the resource location. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Get the ip address type that this capability describes. + * + * @return the ipAddressType value + */ + public String ipAddressType() { + return this.ipAddressType; + } + + /** + * Get the GPU sku that this capability describes. + * + * @return the gpu value + */ + public String gpu() { + return this.gpu; + } + + /** + * Get the supported capabilities. + * + * @return the capabilities value + */ + public CapabilitiesCapabilities capabilities() { + return this.capabilities; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerExecResponseImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerExecResponseImpl.java new file mode 100644 index 000000000000..b303a37475c2 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerExecResponseImpl.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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerExecResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class ContainerExecResponseImpl extends WrapperImpl implements ContainerExecResponse { + private final ContainerInstanceManager manager; + ContainerExecResponseImpl(ContainerExecResponseInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String webSocketUri() { + return this.inner().webSocketUri(); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerExecResponseInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerExecResponseInner.java new file mode 100644 index 000000000000..dd686503acbc --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerExecResponseInner.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.containerinstance.v2019_12_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The information for the container exec command. + */ +public class ContainerExecResponseInner { + /** + * The uri for the exec websocket. + */ + @JsonProperty(value = "webSocketUri") + private String webSocketUri; + + /** + * The password to start the exec command. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the uri for the exec websocket. + * + * @return the webSocketUri value + */ + public String webSocketUri() { + return this.webSocketUri; + } + + /** + * Set the uri for the exec websocket. + * + * @param webSocketUri the webSocketUri value to set + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withWebSocketUri(String webSocketUri) { + this.webSocketUri = webSocketUri; + return this; + } + + /** + * Get the password to start the exec command. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password to start the exec command. + * + * @param password the password value to set + * @return the ContainerExecResponseInner object itself. + */ + public ContainerExecResponseInner withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupImpl.java new file mode 100644 index 000000000000..e2bbcc2975c2 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupImpl.java @@ -0,0 +1,235 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroup; +import rx.Observable; +import com.microsoft.azure.Resource; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupIdentity; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2019_12_01.IpAddress; +import com.microsoft.azure.management.containerinstance.v2019_12_01.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Volume; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupPropertiesInstanceView; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupDiagnostics; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupNetworkProfile; +import com.microsoft.azure.management.containerinstance.v2019_12_01.DnsConfiguration; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupSku; +import com.microsoft.azure.management.containerinstance.v2019_12_01.EncryptionProperties; +import com.microsoft.azure.management.containerinstance.v2019_12_01.InitContainerDefinition; +import java.util.ArrayList; +import rx.functions.Func1; + +class ContainerGroupImpl extends GroupableResourceCoreImpl implements ContainerGroup, ContainerGroup.Definition, ContainerGroup.Update { + private Resource updateParameter; + ContainerGroupImpl(String name, ContainerGroupInner inner, ContainerInstanceManager manager) { + super(name, inner, manager); + this.updateParameter = new Resource(); + } + + @Override + public Observable createResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ContainerGroupInner call(ContainerGroupInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ContainerGroupsInner client = this.manager().inner().containerGroups(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new Resource(); + } + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public ContainerGroupDiagnostics diagnostics() { + return this.inner().diagnostics(); + } + + @Override + public DnsConfiguration dnsConfig() { + return this.inner().dnsConfig(); + } + + @Override + public EncryptionProperties encryptionProperties() { + return this.inner().encryptionProperties(); + } + + @Override + public ContainerGroupIdentity identity() { + return this.inner().identity(); + } + + @Override + public List imageRegistryCredentials() { + return this.inner().imageRegistryCredentials(); + } + + @Override + public List initContainers() { + return this.inner().initContainers(); + } + + @Override + public ContainerGroupPropertiesInstanceView instanceView() { + return this.inner().instanceView(); + } + + @Override + public IpAddress ipAddress() { + return this.inner().ipAddress(); + } + + @Override + public ContainerGroupNetworkProfile networkProfile() { + return this.inner().networkProfile(); + } + + @Override + public OperatingSystemTypes osType() { + return this.inner().osType(); + } + + @Override + public String provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ContainerGroupRestartPolicy restartPolicy() { + return this.inner().restartPolicy(); + } + + @Override + public ContainerGroupSku sku() { + return this.inner().sku(); + } + + @Override + public List volumes() { + return this.inner().volumes(); + } + + @Override + public ContainerGroupImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public ContainerGroupImpl withOsType(OperatingSystemTypes osType) { + this.inner().withOsType(osType); + return this; + } + + @Override + public ContainerGroupImpl withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.inner().withDiagnostics(diagnostics); + return this; + } + + @Override + public ContainerGroupImpl withDnsConfig(DnsConfiguration dnsConfig) { + this.inner().withDnsConfig(dnsConfig); + return this; + } + + @Override + public ContainerGroupImpl withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.inner().withEncryptionProperties(encryptionProperties); + return this; + } + + @Override + public ContainerGroupImpl withIdentity(ContainerGroupIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) { + this.inner().withImageRegistryCredentials(imageRegistryCredentials); + return this; + } + + @Override + public ContainerGroupImpl withInitContainers(List initContainers) { + this.inner().withInitContainers(initContainers); + return this; + } + + @Override + public ContainerGroupImpl withIpAddress(IpAddress ipAddress) { + this.inner().withIpAddress(ipAddress); + return this; + } + + @Override + public ContainerGroupImpl withNetworkProfile(ContainerGroupNetworkProfile networkProfile) { + this.inner().withNetworkProfile(networkProfile); + return this; + } + + @Override + public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.inner().withRestartPolicy(restartPolicy); + return this; + } + + @Override + public ContainerGroupImpl withSku(ContainerGroupSku sku) { + this.inner().withSku(sku); + return this; + } + + @Override + public ContainerGroupImpl withVolumes(List volumes) { + this.inner().withVolumes(volumes); + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupInner.java new file mode 100644 index 000000000000..5f980d4a1f3b --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupInner.java @@ -0,0 +1,421 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupIdentity; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ImageRegistryCredential; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupRestartPolicy; +import com.microsoft.azure.management.containerinstance.v2019_12_01.IpAddress; +import com.microsoft.azure.management.containerinstance.v2019_12_01.OperatingSystemTypes; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Volume; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupPropertiesInstanceView; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupDiagnostics; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupNetworkProfile; +import com.microsoft.azure.management.containerinstance.v2019_12_01.DnsConfiguration; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroupSku; +import com.microsoft.azure.management.containerinstance.v2019_12_01.EncryptionProperties; +import com.microsoft.azure.management.containerinstance.v2019_12_01.InitContainerDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.rest.SkipParentValidation; +import com.microsoft.azure.Resource; + +/** + * A container group. + */ +@JsonFlatten +@SkipParentValidation +public class ContainerGroupInner extends Resource { + /** + * The identity of the container group, if configured. + */ + @JsonProperty(value = "identity") + private ContainerGroupIdentity identity; + + /** + * The provisioning state of the container group. This only appears in the + * response. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningState; + + /** + * The containers within the container group. + */ + @JsonProperty(value = "properties.containers", required = true) + private List containers; + + /** + * The image registry credentials by which the container group is created + * from. + */ + @JsonProperty(value = "properties.imageRegistryCredentials") + private List imageRegistryCredentials; + + /** + * Restart policy for all containers within the container group. + * - `Always` Always restart + * - `OnFailure` Restart on failure + * - `Never` Never restart + * . Possible values include: 'Always', 'OnFailure', 'Never'. + */ + @JsonProperty(value = "properties.restartPolicy") + private ContainerGroupRestartPolicy restartPolicy; + + /** + * The IP address type of the container group. + */ + @JsonProperty(value = "properties.ipAddress") + private IpAddress ipAddress; + + /** + * The operating system type required by the containers in the container + * group. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.osType", required = true) + private OperatingSystemTypes osType; + + /** + * The list of volumes that can be mounted by containers in this container + * group. + */ + @JsonProperty(value = "properties.volumes") + private List volumes; + + /** + * The instance view of the container group. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerGroupPropertiesInstanceView instanceView; + + /** + * The diagnostic information for a container group. + */ + @JsonProperty(value = "properties.diagnostics") + private ContainerGroupDiagnostics diagnostics; + + /** + * The network profile information for a container group. + */ + @JsonProperty(value = "properties.networkProfile") + private ContainerGroupNetworkProfile networkProfile; + + /** + * The DNS config information for a container group. + */ + @JsonProperty(value = "properties.dnsConfig") + private DnsConfiguration dnsConfig; + + /** + * The SKU for a container group. Possible values include: 'Standard', + * 'Dedicated'. + */ + @JsonProperty(value = "properties.sku") + private ContainerGroupSku sku; + + /** + * The encryption properties for a container group. + */ + @JsonProperty(value = "properties.encryptionProperties") + private EncryptionProperties encryptionProperties; + + /** + * The init containers for a container group. + */ + @JsonProperty(value = "properties.initContainers") + private List initContainers; + + /** + * Get the identity of the container group, if configured. + * + * @return the identity value + */ + public ContainerGroupIdentity identity() { + return this.identity; + } + + /** + * Set the identity of the container group, if configured. + * + * @param identity the identity value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIdentity(ContainerGroupIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioning state of the container group. This only appears in the response. + * + * @return the provisioningState value + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Get the containers within the container group. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers within the container group. + * + * @param containers the containers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the image registry credentials by which the container group is created from. + * + * @return the imageRegistryCredentials value + */ + public List imageRegistryCredentials() { + return this.imageRegistryCredentials; + } + + /** + * Set the image registry credentials by which the container group is created from. + * + * @param imageRegistryCredentials the imageRegistryCredentials value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) { + this.imageRegistryCredentials = imageRegistryCredentials; + return this; + } + + /** + * Get restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @return the restartPolicy value + */ + public ContainerGroupRestartPolicy restartPolicy() { + return this.restartPolicy; + } + + /** + * Set restart policy for all containers within the container group. + - `Always` Always restart + - `OnFailure` Restart on failure + - `Never` Never restart + . Possible values include: 'Always', 'OnFailure', 'Never'. + * + * @param restartPolicy the restartPolicy value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) { + this.restartPolicy = restartPolicy; + return this; + } + + /** + * Get the IP address type of the container group. + * + * @return the ipAddress value + */ + public IpAddress ipAddress() { + return this.ipAddress; + } + + /** + * Set the IP address type of the container group. + * + * @param ipAddress the ipAddress value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withIpAddress(IpAddress ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * Get the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OperatingSystemTypes osType() { + return this.osType; + } + + /** + * Set the operating system type required by the containers in the container group. Possible values include: 'Windows', 'Linux'. + * + * @param osType the osType value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withOsType(OperatingSystemTypes osType) { + this.osType = osType; + return this; + } + + /** + * Get the list of volumes that can be mounted by containers in this container group. + * + * @return the volumes value + */ + public List volumes() { + return this.volumes; + } + + /** + * Set the list of volumes that can be mounted by containers in this container group. + * + * @param volumes the volumes value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withVolumes(List volumes) { + this.volumes = volumes; + return this; + } + + /** + * Get the instance view of the container group. Only valid in response. + * + * @return the instanceView value + */ + public ContainerGroupPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the diagnostic information for a container group. + * + * @return the diagnostics value + */ + public ContainerGroupDiagnostics diagnostics() { + return this.diagnostics; + } + + /** + * Set the diagnostic information for a container group. + * + * @param diagnostics the diagnostics value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withDiagnostics(ContainerGroupDiagnostics diagnostics) { + this.diagnostics = diagnostics; + return this; + } + + /** + * Get the network profile information for a container group. + * + * @return the networkProfile value + */ + public ContainerGroupNetworkProfile networkProfile() { + return this.networkProfile; + } + + /** + * Set the network profile information for a container group. + * + * @param networkProfile the networkProfile value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withNetworkProfile(ContainerGroupNetworkProfile networkProfile) { + this.networkProfile = networkProfile; + return this; + } + + /** + * Get the DNS config information for a container group. + * + * @return the dnsConfig value + */ + public DnsConfiguration dnsConfig() { + return this.dnsConfig; + } + + /** + * Set the DNS config information for a container group. + * + * @param dnsConfig the dnsConfig value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withDnsConfig(DnsConfiguration dnsConfig) { + this.dnsConfig = dnsConfig; + return this; + } + + /** + * Get the SKU for a container group. Possible values include: 'Standard', 'Dedicated'. + * + * @return the sku value + */ + public ContainerGroupSku sku() { + return this.sku; + } + + /** + * Set the SKU for a container group. Possible values include: 'Standard', 'Dedicated'. + * + * @param sku the sku value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withSku(ContainerGroupSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the encryption properties for a container group. + * + * @return the encryptionProperties value + */ + public EncryptionProperties encryptionProperties() { + return this.encryptionProperties; + } + + /** + * Set the encryption properties for a container group. + * + * @param encryptionProperties the encryptionProperties value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withEncryptionProperties(EncryptionProperties encryptionProperties) { + this.encryptionProperties = encryptionProperties; + return this; + } + + /** + * Get the init containers for a container group. + * + * @return the initContainers value + */ + public List initContainers() { + return this.initContainers; + } + + /** + * Set the init containers for a container group. + * + * @param initContainers the initContainers value to set + * @return the ContainerGroupInner object itself. + */ + public ContainerGroupInner withInitContainers(List initContainers) { + this.initContainers = initContainers; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupsImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupsImpl.java new file mode 100644 index 000000000000..0a6b74714f19 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupsImpl.java @@ -0,0 +1,156 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroup; +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; + +class ContainerGroupsImpl extends GroupableResourcesCoreImpl implements ContainerGroups { + protected ContainerGroupsImpl(ContainerInstanceManager manager) { + super(manager.inner().containerGroups(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ContainerGroupsInner 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) { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ContainerGroupsInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ContainerGroupsInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ContainerGroupsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ContainerGroup call(ContainerGroupInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ContainerGroupImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable restartAsync(String resourceGroupName, String containerGroupName) { + ContainerGroupsInner client = this.inner(); + return client.restartAsync(resourceGroupName, containerGroupName).toCompletable(); + } + + @Override + public Completable stopAsync(String resourceGroupName, String containerGroupName) { + ContainerGroupsInner client = this.inner(); + return client.stopAsync(resourceGroupName, containerGroupName).toCompletable(); + } + + @Override + public Completable startAsync(String resourceGroupName, String containerGroupName) { + ContainerGroupsInner client = this.inner(); + return client.startAsync(resourceGroupName, containerGroupName).toCompletable(); + } + + @Override + protected ContainerGroupImpl wrapModel(ContainerGroupInner inner) { + return new ContainerGroupImpl(inner.name(), inner, manager()); + } + + @Override + protected ContainerGroupImpl wrapModel(String name) { + return new ContainerGroupImpl(name, new ContainerGroupInner(), this.manager()); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupsInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupsInner.java new file mode 100644 index 000000000000..4916c1eddb0a --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerGroupsInner.java @@ -0,0 +1,1540 @@ +/** + * 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.containerinstance.v2019_12_01.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.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Resource; +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 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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ContainerGroups. + */ +public class ContainerGroupsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ContainerGroupsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainerGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainerGroupsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainerGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ContainerGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainerGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerGroups list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups") + 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.containerinstance.v2019_12_01.ContainerGroups listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups") + 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.containerinstance.v2019_12_01.ContainerGroups getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @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.containerinstance.v2019_12_01.ContainerGroups createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @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.containerinstance.v2019_12_01.ContainerGroups beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body ContainerGroupInner containerGroup, @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.containerinstance.v2019_12_01.ContainerGroups update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Query("api-version") String apiVersion, @Body Resource resource, @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.containerinstance.v2019_12_01.ContainerGroups delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @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.containerinstance.v2019_12_01.ContainerGroups beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @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.containerinstance.v2019_12_01.ContainerGroups restart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart") + Observable> restart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @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.containerinstance.v2019_12_01.ContainerGroups beginRestart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/restart") + Observable> beginRestart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @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.containerinstance.v2019_12_01.ContainerGroups stop" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/stop") + Observable> stop(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @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.containerinstance.v2019_12_01.ContainerGroups start" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start") + Observable> start(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @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.containerinstance.v2019_12_01.ContainerGroups beginStart" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/start") + Observable> beginStart(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @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.containerinstance.v2019_12_01.ContainerGroups listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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.containerinstance.v2019_12_01.ContainerGroups listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @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(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @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 containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String containerGroupName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of the specified container group. + * Gets the properties of the specified container group in the specified subscription and resource group. The operation returns the properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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, containerGroupName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner createOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().last().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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 (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner beginCreateOrUpdate(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).toBlocking().single().body(); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup), serviceCallback); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, containerGroupName, containerGroup).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update container groups. + * Create or update container groups with specified configurations. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerGroup The properties of the container group to be created or updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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 (containerGroup == null) { + throw new IllegalArgumentException("Parameter containerGroup is required and cannot be null."); + } + Validator.validate(containerGroup); + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), containerGroup, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).toBlocking().single().body(); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @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 containerGroupName, Resource resource, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource), serviceCallback); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable updateAsync(String resourceGroupName, String containerGroupName, Resource resource) { + return updateWithServiceResponseAsync(resourceGroupName, containerGroupName, resource).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update container groups. + * Updates container group tags with specified values. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param resource The container group resource with just the tags to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String containerGroupName, Resource resource) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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 (resource == null) { + throw new IllegalArgumentException("Parameter resource is required and cannot be null."); + } + Validator.validate(resource); + return service.update(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), resource, this.client.acceptLanguage(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().last().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @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 containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String containerGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerGroupInner object if successful. + */ + public ContainerGroupInner beginDelete(String resourceGroupName, String containerGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @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 containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable beginDeleteAsync(String resourceGroupName, String containerGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, ContainerGroupInner>() { + @Override + public ContainerGroupInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete the specified container group. + * Delete the specified container group in the specified subscription and resource group. The operation does not delete other resources provided by the user, such as volumes. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerGroupInner object + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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, containerGroupName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void restart(String resourceGroupName, String containerGroupName) { + restartWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().last().body(); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @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 restartAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(restartWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable restartAsync(String resourceGroupName, String containerGroupName) { + return restartWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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.restart(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginRestart(String resourceGroupName, String containerGroupName) { + beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @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 beginRestartAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRestartAsync(String resourceGroupName, String containerGroupName) { + return beginRestartWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Restarts all containers in a container group. + * Restarts all containers in a container group in place. If container image has updates, new image will be downloaded. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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.beginRestart(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginRestartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginRestartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void stop(String resourceGroupName, String containerGroupName) { + stopWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @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 stopAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(stopWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable stopAsync(String resourceGroupName, String containerGroupName) { + return stopWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Stops all containers in a container group. + * Stops all containers in a container group. Compute resources will be deallocated and billing will stop. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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.stop(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = stopDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse stopDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void start(String resourceGroupName, String containerGroupName) { + startWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().last().body(); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture startAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(startWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable startAsync(String resourceGroupName, String containerGroupName) { + return startWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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.start(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginStart(String resourceGroupName, String containerGroupName) { + beginStartWithServiceResponseAsync(resourceGroupName, containerGroupName).toBlocking().single().body(); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginStartAsync(String resourceGroupName, String containerGroupName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginStartWithServiceResponseAsync(resourceGroupName, containerGroupName), serviceCallback); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String containerGroupName) { + return beginStartWithServiceResponseAsync(resourceGroupName, containerGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Starts all containers in a container group. + * Starts all containers in a container group. Compute resources will be allocated and billing will start. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String containerGroupName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName 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.beginStart(this.client.subscriptionId(), resourceGroupName, containerGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginStartDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginStartDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription. + * Get a list of container groups in the specified subscription. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ContainerGroupInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ContainerGroupInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get a list of container groups in the specified subscription and resource group. + * Get a list of container groups in a specified subscription and resource group. This operation returns properties of each container group including containers, image registry credentials, restart policy, IP address type, OS type, state, and volumes. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ContainerGroupInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInner.java new file mode 100644 index 000000000000..aa6a887db948 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInner.java @@ -0,0 +1,275 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerPort; +import com.microsoft.azure.management.containerinstance.v2019_12_01.EnvironmentVariable; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerPropertiesInstanceView; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ResourceRequirements; +import com.microsoft.azure.management.containerinstance.v2019_12_01.VolumeMount; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerProbe; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A container instance. + */ +@JsonFlatten +public class ContainerInner { + /** + * The user-provided name of the container instance. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The name of the image used to create the container instance. + */ + @JsonProperty(value = "properties.image", required = true) + private String image; + + /** + * The commands to execute within the container instance in exec form. + */ + @JsonProperty(value = "properties.command") + private List command; + + /** + * The exposed ports on the container instance. + */ + @JsonProperty(value = "properties.ports") + private List ports; + + /** + * The environment variables to set in the container instance. + */ + @JsonProperty(value = "properties.environmentVariables") + private List environmentVariables; + + /** + * The instance view of the container instance. Only valid in response. + */ + @JsonProperty(value = "properties.instanceView", access = JsonProperty.Access.WRITE_ONLY) + private ContainerPropertiesInstanceView instanceView; + + /** + * The resource requirements of the container instance. + */ + @JsonProperty(value = "properties.resources", required = true) + private ResourceRequirements resources; + + /** + * The volume mounts available to the container instance. + */ + @JsonProperty(value = "properties.volumeMounts") + private List volumeMounts; + + /** + * The liveness probe. + */ + @JsonProperty(value = "properties.livenessProbe") + private ContainerProbe livenessProbe; + + /** + * The readiness probe. + */ + @JsonProperty(value = "properties.readinessProbe") + private ContainerProbe readinessProbe; + + /** + * Get the user-provided name of the container instance. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the user-provided name of the container instance. + * + * @param name the name value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the name of the image used to create the container instance. + * + * @return the image value + */ + public String image() { + return this.image; + } + + /** + * Set the name of the image used to create the container instance. + * + * @param image the image value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withImage(String image) { + this.image = image; + return this; + } + + /** + * Get the commands to execute within the container instance in exec form. + * + * @return the command value + */ + public List command() { + return this.command; + } + + /** + * Set the commands to execute within the container instance in exec form. + * + * @param command the command value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withCommand(List command) { + this.command = command; + return this; + } + + /** + * Get the exposed ports on the container instance. + * + * @return the ports value + */ + public List ports() { + return this.ports; + } + + /** + * Set the exposed ports on the container instance. + * + * @param ports the ports value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withPorts(List ports) { + this.ports = ports; + return this; + } + + /** + * Get the environment variables to set in the container instance. + * + * @return the environmentVariables value + */ + public List environmentVariables() { + return this.environmentVariables; + } + + /** + * Set the environment variables to set in the container instance. + * + * @param environmentVariables the environmentVariables value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withEnvironmentVariables(List environmentVariables) { + this.environmentVariables = environmentVariables; + return this; + } + + /** + * Get the instance view of the container instance. Only valid in response. + * + * @return the instanceView value + */ + public ContainerPropertiesInstanceView instanceView() { + return this.instanceView; + } + + /** + * Get the resource requirements of the container instance. + * + * @return the resources value + */ + public ResourceRequirements resources() { + return this.resources; + } + + /** + * Set the resource requirements of the container instance. + * + * @param resources the resources value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withResources(ResourceRequirements resources) { + this.resources = resources; + return this; + } + + /** + * Get the volume mounts available to the container instance. + * + * @return the volumeMounts value + */ + public List volumeMounts() { + return this.volumeMounts; + } + + /** + * Set the volume mounts available to the container instance. + * + * @param volumeMounts the volumeMounts value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withVolumeMounts(List volumeMounts) { + this.volumeMounts = volumeMounts; + return this; + } + + /** + * Get the liveness probe. + * + * @return the livenessProbe value + */ + public ContainerProbe livenessProbe() { + return this.livenessProbe; + } + + /** + * Set the liveness probe. + * + * @param livenessProbe the livenessProbe value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withLivenessProbe(ContainerProbe livenessProbe) { + this.livenessProbe = livenessProbe; + return this; + } + + /** + * Get the readiness probe. + * + * @return the readinessProbe value + */ + public ContainerProbe readinessProbe() { + return this.readinessProbe; + } + + /** + * Set the readiness probe. + * + * @param readinessProbe the readinessProbe value to set + * @return the ContainerInner object itself. + */ + public ContainerInner withReadinessProbe(ContainerProbe readinessProbe) { + this.readinessProbe = readinessProbe; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInstanceManagementClientImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInstanceManagementClientImpl.java new file mode 100644 index 000000000000..45fc46df5e4f --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInstanceManagementClientImpl.java @@ -0,0 +1,238 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerInstanceManagementClientImpl class. + */ +public class ContainerInstanceManagementClientImpl extends AzureServiceClient { + /** 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; + } + + /** Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. */ + private String subscriptionId; + + /** + * Gets Subscription credentials which uniquely identify 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 Subscription credentials which uniquely identify 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 ContainerInstanceManagementClientImpl 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 ContainerInstanceManagementClientImpl 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 ContainerInstanceManagementClientImpl 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 ContainerInstanceManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The ContainerGroupsInner object to access its operations. + */ + private ContainerGroupsInner containerGroups; + + /** + * Gets the ContainerGroupsInner object to access its operations. + * @return the ContainerGroupsInner object. + */ + public ContainerGroupsInner containerGroups() { + return this.containerGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The LocationsInner object to access its operations. + */ + private LocationsInner locations; + + /** + * Gets the LocationsInner object to access its operations. + * @return the LocationsInner object. + */ + public LocationsInner locations() { + return this.locations; + } + + /** + * The ContainersInner object to access its operations. + */ + private ContainersInner containers; + + /** + * Gets the ContainersInner object to access its operations. + * @return the ContainersInner object. + */ + public ContainersInner containers() { + return this.containers; + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerInstanceManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerInstanceManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerInstanceManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2019-12-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.containerGroups = new ContainerGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.locations = new LocationsInner(restClient().retrofit(), this); + this.containers = new ContainersInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * 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(), "ContainerInstanceManagementClient", "2019-12-01"); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInstanceManager.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInstanceManager.java new file mode 100644 index 000000000000..2674a06f548c --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainerInstanceManager.java @@ -0,0 +1,135 @@ +/** + * 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.containerinstance.v2019_12_01.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.containerinstance.v2019_12_01.ContainerGroups; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Operations; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Locations; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Containers; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerInstance resource management. + */ +public final class ContainerInstanceManager extends ManagerCore { + private ContainerGroups containerGroups; + private Operations operations; + private Locations locations; + private Containers containers; + /** + * Get a Configurable instance that can be used to create ContainerInstanceManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerInstanceManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerInstanceManager(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 ContainerInstanceManager that exposes ContainerInstance resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerInstanceManager + */ + public static ContainerInstanceManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerInstanceManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerInstanceManager that exposes ContainerInstance management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerInstance management API entry points that work across subscriptions + */ + ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage ContainerGroups. + */ + public ContainerGroups containerGroups() { + if (this.containerGroups == null) { + this.containerGroups = new ContainerGroupsImpl(this); + } + return this.containerGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Locations. + */ + public Locations locations() { + if (this.locations == null) { + this.locations = new LocationsImpl(this); + } + return this.locations; + } + + /** + * @return Entry point to manage Containers. + */ + public Containers containers() { + if (this.containers == null) { + this.containers = new ContainersImpl(this); + } + return this.containers; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerInstanceManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerInstanceManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerInstanceManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerInstanceManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainersImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainersImpl.java new file mode 100644 index 000000000000..69319242cc8f --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainersImpl.java @@ -0,0 +1,56 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Containers; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Logs; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerExecResponse; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerExecRequest; + +class ContainersImpl extends WrapperImpl implements Containers { + private final ContainerInstanceManager manager; + + ContainersImpl(ContainerInstanceManager manager) { + super(manager.inner().containers()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) { + ContainersInner client = this.inner(); + return client.listLogsAsync(resourceGroupName, containerGroupName, containerName) + .map(new Func1() { + @Override + public Logs call(LogsInner inner) { + return new LogsImpl(inner, manager()); + } + }); + } + + @Override + public Observable executeCommandAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + ContainersInner client = this.inner(); + return client.executeCommandAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest) + .map(new Func1() { + @Override + public ContainerExecResponse call(ContainerExecResponseInner inner) { + return new ContainerExecResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainersInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainersInner.java new file mode 100644 index 000000000000..31f432478752 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/ContainersInner.java @@ -0,0 +1,365 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerExecRequest; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 Containers. + */ +public class ContainersInner { + /** The Retrofit service to perform REST calls. */ + private ContainersService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of ContainersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ContainersInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(ContainersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Containers to be + * used by Retrofit to perform actually REST calls. + */ + interface ContainersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2019_12_01.Containers listLogs" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/logs") + Observable> listLogs(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Query("tail") Integer tail, @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.containerinstance.v2019_12_01.Containers executeCommand" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance/containerGroups/{containerGroupName}/containers/{containerName}/exec") + Observable> executeCommand(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("containerGroupName") String containerGroupName, @Path("containerName") String containerName, @Query("api-version") String apiVersion, @Body ContainerExecRequest containerExecRequest, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName) { + return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @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 listLogsAsync(String resourceGroupName, String containerGroupName, String containerName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) { + return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listLogsWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 Integer tail = null; + return service.listLogs(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listLogsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LogsInner object if successful. + */ + public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body(); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @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 listLogsAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail), serviceCallback); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable listLogsAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).map(new Func1, LogsInner>() { + @Override + public LogsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the logs for a specified container instance. + * Get the logs for a specified container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param tail The number of lines to show from the tail of the container instance log. If not provided, all available logs are shown up to 4mb. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LogsInner object + */ + public Observable> listLogsWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, Integer tail) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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.listLogs(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), tail, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listLogsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listLogsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ContainerExecResponseInner object if successful. + */ + public ContainerExecResponseInner executeCommand(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return executeCommandWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).toBlocking().single().body(); + } + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @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 executeCommandAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(executeCommandWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest), serviceCallback); + } + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable executeCommandAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + return executeCommandWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).map(new Func1, ContainerExecResponseInner>() { + @Override + public ContainerExecResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Executes a command in a specific container instance. + * Executes a command for a specific container instance in a specified resource group and container group. + * + * @param resourceGroupName The name of the resource group. + * @param containerGroupName The name of the container group. + * @param containerName The name of the container instance. + * @param containerExecRequest The request for the exec command. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ContainerExecResponseInner object + */ + public Observable> executeCommandWithServiceResponseAsync(String resourceGroupName, String containerGroupName, String containerName, ContainerExecRequest containerExecRequest) { + 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 (containerGroupName == null) { + throw new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."); + } + if (containerName == null) { + throw new IllegalArgumentException("Parameter containerName 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 (containerExecRequest == null) { + throw new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null."); + } + Validator.validate(containerExecRequest); + return service.executeCommand(this.client.subscriptionId(), resourceGroupName, containerGroupName, containerName, this.client.apiVersion(), containerExecRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = executeCommandDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse executeCommandDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/IdParsingUtils.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..535f824669b8 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/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.containerinstance.v2019_12_01.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/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LocationsImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LocationsImpl.java new file mode 100644 index 000000000000..69a7025043d5 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LocationsImpl.java @@ -0,0 +1,100 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Locations; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Capabilities; +import java.util.List; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Usage; +import com.microsoft.azure.management.containerinstance.v2019_12_01.CachedImages; + +class LocationsImpl extends WrapperImpl implements Locations { + private final ContainerInstanceManager manager; + + LocationsImpl(ContainerInstanceManager manager) { + super(manager.inner().locations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + private CapabilitiesImpl wrapCapabilitiesModel(CapabilitiesInner inner) { + return new CapabilitiesImpl(inner, manager()); + } + + private UsageImpl wrapUsageModel(UsageInner inner) { + return new UsageImpl(inner, manager()); + } + + private CachedImagesImpl wrapCachedImagesModel(CachedImagesInner inner) { + return new CachedImagesImpl(inner, manager()); + } + + @Override + public Observable listCapabilitiesAsync(final String location) { + LocationsInner client = this.inner(); + return client.listCapabilitiesAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Capabilities call(CapabilitiesInner inner) { + return wrapCapabilitiesModel(inner); + } + }); + } + + @Override + public Observable listUsageAsync(String location) { + LocationsInner client = this.inner(); + return client.listUsageAsync(location) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Usage call(UsageInner inner) { + return wrapUsageModel(inner); + } + }); + } + + @Override + public Observable listCachedImagesAsync(final String location) { + LocationsInner client = this.inner(); + return client.listCachedImagesAsync(location) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public CachedImages call(CachedImagesInner inner) { + return wrapCachedImagesModel(inner); + } + }); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LocationsInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LocationsInner.java new file mode 100644 index 000000000000..7e976c7f507a --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LocationsInner.java @@ -0,0 +1,638 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +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 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.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Locations. + */ +public class LocationsInner { + /** The Retrofit service to perform REST calls. */ + private LocationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of LocationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LocationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(LocationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Locations to be + * used by Retrofit to perform actually REST calls. + */ + interface LocationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2019_12_01.Locations listUsage" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/usages") + Observable> listUsage(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @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.containerinstance.v2019_12_01.Locations listCachedImages" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/cachedImages") + Observable> listCachedImages(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @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.containerinstance.v2019_12_01.Locations listCapabilities" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/locations/{location}/capabilities") + Observable> listCapabilities(@Path("subscriptionId") String subscriptionId, @Path("location") String location, @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.containerinstance.v2019_12_01.Locations listCachedImagesNext" }) + @GET + Observable> listCachedImagesNext(@Url String nextUrl, @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.containerinstance.v2019_12_01.Locations listCapabilitiesNext" }) + @GET + Observable> listCapabilitiesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<UsageInner> object if successful. + */ + public List listUsage(String location) { + return listUsageWithServiceResponseAsync(location).toBlocking().single().body(); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @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> listUsageAsync(String location, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listUsageWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable> listUsageAsync(String location) { + return listUsageWithServiceResponseAsync(location).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the usage for a subscription. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageInner> object + */ + public Observable>> listUsageWithServiceResponseAsync(String location) { + 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."); + } + return service.listUsage(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listUsageDelegate(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> listUsageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CachedImagesInner> object if successful. + */ + public PagedList listCachedImages(final String location) { + ServiceResponse> response = listCachedImagesSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listCachedImagesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @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> listCachedImagesAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listCachedImagesSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listCachedImagesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CachedImagesInner> object + */ + public Observable> listCachedImagesAsync(final String location) { + return listCachedImagesWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CachedImagesInner> object + */ + public Observable>> listCachedImagesWithServiceResponseAsync(final String location) { + return listCachedImagesSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listCachedImagesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + ServiceResponse> * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CachedImagesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listCachedImagesSinglePageAsync(final String location) { + 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."); + } + return service.listCachedImages(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCachedImagesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listCachedImagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CapabilitiesInner> object if successful. + */ + public PagedList listCapabilities(final String location) { + ServiceResponse> response = listCapabilitiesSinglePageAsync(location).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listCapabilitiesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @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> listCapabilitiesAsync(final String location, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listCapabilitiesSinglePageAsync(location), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listCapabilitiesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CapabilitiesInner> object + */ + public Observable> listCapabilitiesAsync(final String location) { + return listCapabilitiesWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CapabilitiesInner> object + */ + public Observable>> listCapabilitiesWithServiceResponseAsync(final String location) { + return listCapabilitiesSinglePageAsync(location) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listCapabilitiesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + ServiceResponse> * @param location The identifier for the physical azure location. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CapabilitiesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listCapabilitiesSinglePageAsync(final String location) { + 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."); + } + return service.listCapabilities(this.client.subscriptionId(), location, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCapabilitiesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listCapabilitiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CachedImagesInner> object if successful. + */ + public PagedList listCachedImagesNext(final String nextPageLink) { + ServiceResponse> response = listCachedImagesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listCachedImagesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listCachedImagesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listCachedImagesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listCachedImagesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CachedImagesInner> object + */ + public Observable> listCachedImagesNextAsync(final String nextPageLink) { + return listCachedImagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CachedImagesInner> object + */ + public Observable>> listCachedImagesNextWithServiceResponseAsync(final String nextPageLink) { + return listCachedImagesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listCachedImagesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of cached images. + * Get the list of cached images on specific OS type for a subscription in a region. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CachedImagesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listCachedImagesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listCachedImagesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCachedImagesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listCachedImagesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<CapabilitiesInner> object if successful. + */ + public PagedList listCapabilitiesNext(final String nextPageLink) { + ServiceResponse> response = listCapabilitiesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listCapabilitiesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listCapabilitiesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listCapabilitiesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listCapabilitiesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CapabilitiesInner> object + */ + public Observable> listCapabilitiesNextAsync(final String nextPageLink) { + return listCapabilitiesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<CapabilitiesInner> object + */ + public Observable>> listCapabilitiesNextWithServiceResponseAsync(final String nextPageLink) { + return listCapabilitiesNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listCapabilitiesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Get the list of capabilities of the location. + * Get the list of CPU/memory/GPU capabilities of a region. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<CapabilitiesInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listCapabilitiesNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listCapabilitiesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listCapabilitiesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listCapabilitiesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LogsImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LogsImpl.java new file mode 100644 index 000000000000..3f140ef60ed7 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LogsImpl.java @@ -0,0 +1,31 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.Logs; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class LogsImpl extends WrapperImpl implements Logs { + private final ContainerInstanceManager manager; + LogsImpl(LogsInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public String content() { + return this.inner().content(); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LogsInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LogsInner.java new file mode 100644 index 000000000000..2fb4bccfb939 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/LogsInner.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.containerinstance.v2019_12_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The logs. + */ +public class LogsInner { + /** + * The content of the log. + */ + @JsonProperty(value = "content") + private String content; + + /** + * Get the content of the log. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the log. + * + * @param content the content value to set + * @return the LogsInner object itself. + */ + public LogsInner withContent(String content) { + this.content = content; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..64cf3c98485d --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationImpl.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2019_12_01.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerInstanceOperationsOrigin; + +class OperationImpl extends WrapperImpl implements Operation { + private final ContainerInstanceManager manager; + OperationImpl(OperationInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ContainerInstanceOperationsOrigin origin() { + return this.inner().origin(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationInner.java new file mode 100644 index 000000000000..8b08c67de4f7 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationInner.java @@ -0,0 +1,124 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.OperationDisplay; +import com.microsoft.azure.management.containerinstance.v2019_12_01.ContainerInstanceOperationsOrigin; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An operation for Azure Container Instance service. + */ +public class OperationInner { + /** + * The name of the operation. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The display information of the operation. + */ + @JsonProperty(value = "display", required = true) + private OperationDisplay display; + + /** + * The additional properties. + */ + @JsonProperty(value = "properties") + private Object properties; + + /** + * The intended executor of the operation. Possible values include: 'User', + * 'System'. + */ + @JsonProperty(value = "origin") + private ContainerInstanceOperationsOrigin origin; + + /** + * Get the name of the operation. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the operation. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information of the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display information of the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the additional properties. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the additional properties. + * + * @param properties the properties value to set + * @return the OperationInner object itself. + */ + public OperationInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @return the origin value + */ + public ContainerInstanceOperationsOrigin origin() { + return this.origin; + } + + /** + * Set the intended executor of the operation. Possible values include: 'User', 'System'. + * + * @param origin the origin value to set + * @return the OperationInner object itself. + */ + public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) { + this.origin = origin; + return this; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationsImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..244681c992bc --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerinstance.v2019_12_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerInstanceManager manager; + + OperationsImpl(ContainerInstanceManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerInstanceManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationsInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..9c20764f068f --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +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.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerInstanceManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerInstanceManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerinstance.v2019_12_01.Operations list" }) + @GET("providers/Microsoft.ContainerInstance/operations") + Observable> list(@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.containerinstance.v2019_12_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the operations for Azure Container Instance service. + * + * @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(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the operations for Azure Container Instance service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the operations for Azure Container Instance service. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/PageImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/PageImpl.java new file mode 100644 index 000000000000..96a44bef50f4 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/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.containerinstance.v2019_12_01.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("nextLink") + 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/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/PageImpl1.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..9e935a7982f8 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/PageImpl1.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.containerinstance.v2019_12_01.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 PageImpl1 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 PageImpl1 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 PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/UsageImpl.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/UsageImpl.java new file mode 100644 index 000000000000..d0258df257c8 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/UsageImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.Usage; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.containerinstance.v2019_12_01.UsageName; + +class UsageImpl extends WrapperImpl implements Usage { + private final ContainerInstanceManager manager; + + UsageImpl(UsageInner inner, ContainerInstanceManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerInstanceManager manager() { + return this.manager; + } + + + + @Override + public Integer currentValue() { + return this.inner().currentValue(); + } + + @Override + public Integer limit() { + return this.inner().limit(); + } + + @Override + public UsageName name() { + return this.inner().name(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/UsageInner.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/UsageInner.java new file mode 100644 index 000000000000..5dac96ded940 --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/UsageInner.java @@ -0,0 +1,78 @@ +/** + * 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.containerinstance.v2019_12_01.implementation; + +import com.microsoft.azure.management.containerinstance.v2019_12_01.UsageName; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A single usage result. + */ +public class UsageInner { + /** + * Unit of the usage result. + */ + @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) + private String unit; + + /** + * The current usage of the resource. + */ + @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY) + private Integer currentValue; + + /** + * The maximum permitted usage of the resource. + */ + @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY) + private Integer limit; + + /** + * The name object of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private UsageName name; + + /** + * Get unit of the usage result. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Get the current usage of the resource. + * + * @return the currentValue value + */ + public Integer currentValue() { + return this.currentValue; + } + + /** + * Get the maximum permitted usage of the resource. + * + * @return the limit value + */ + public Integer limit() { + return this.limit; + } + + /** + * Get the name object of the resource. + * + * @return the name value + */ + public UsageName name() { + return this.name; + } + +} diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/package-info.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/package-info.java new file mode 100644 index 000000000000..01d1d271734d --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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 ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2019_12_01.implementation; diff --git a/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/package-info.java b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/package-info.java new file mode 100644 index 000000000000..38b8fa3a90fa --- /dev/null +++ b/sdk/containerinstance/mgmt-v2019_12_01/src/main/java/com/microsoft/azure/management/containerinstance/v2019_12_01/package-info.java @@ -0,0 +1,10 @@ +// 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 ContainerInstanceManagementClient. + */ +package com.microsoft.azure.management.containerinstance.v2019_12_01; diff --git a/sdk/containerinstance/pom.mgmt.xml b/sdk/containerinstance/pom.mgmt.xml index a0c8f6da2d4f..9ff76a756e3f 100644 --- a/sdk/containerinstance/pom.mgmt.xml +++ b/sdk/containerinstance/pom.mgmt.xml @@ -15,5 +15,6 @@ mgmt-v2018_02_01_preview mgmt-v2018_04_01 mgmt-v2018_10_01 + mgmt-v2019_12_01 diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/pom.xml b/sdk/loganalytics/mgmt-v2020_03_01_preview/pom.xml new file mode 100644 index 000000000000..c8cd69aea31f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.loganalytics.v2020_03_01_preview + + com.microsoft.azure + azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml + + azure-mgmt-loganalytics + 1.0.0-beta + jar + Microsoft Azure SDK for LogAnalytics Management + This package contains Microsoft LogAnalytics 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 + + 1.6.5 + + + + + + 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/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AvailableServiceTier.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AvailableServiceTier.java new file mode 100644 index 000000000000..41fade0d68a3 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AvailableServiceTier.java @@ -0,0 +1,55 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.AvailableServiceTierInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; + +/** + * Type representing AvailableServiceTier. + */ +public interface AvailableServiceTier extends HasInner, HasManager { + /** + * @return the capacityReservationLevel value. + */ + Long capacityReservationLevel(); + + /** + * @return the defaultRetention value. + */ + Long defaultRetention(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the lastSkuUpdate value. + */ + String lastSkuUpdate(); + + /** + * @return the maximumRetention value. + */ + Long maximumRetention(); + + /** + * @return the minimumRetention value. + */ + Long minimumRetention(); + + /** + * @return the serviceTier value. + */ + SkuNameEnum serviceTier(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AvailableServiceTiers.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AvailableServiceTiers.java new file mode 100644 index 000000000000..1604da8435c9 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AvailableServiceTiers.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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.AvailableServiceTiersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AvailableServiceTiers. + */ +public interface AvailableServiceTiers extends HasInner { + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AzureEntityResource.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AzureEntityResource.java new file mode 100644 index 000000000000..ccc374d93c9a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/AzureEntityResource.java @@ -0,0 +1,34 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for a Azure Resource Manager resource with an + * etag. + */ +public class AzureEntityResource extends ProxyResource { + /** + * Resource Etag. + */ + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get resource Etag. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Cluster.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Cluster.java new file mode 100644 index 000000000000..e947bde229f1 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Cluster.java @@ -0,0 +1,170 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +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.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the clusterId value. + */ + String clusterId(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the keyVaultProperties value. + */ + KeyVaultProperties keyVaultProperties(); + + /** + * @return the nextLink value. + */ + String nextLink(); + + /** + * @return the provisioningState value. + */ + ClusterEntityStatus provisioningState(); + + /** + * @return the sku value. + */ + ClusterSku sku(); + + /** + * The entirety of the Cluster definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Cluster definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Cluster definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Cluster definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the cluster definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the resource + * @return the next definition stage + */ + WithCreate withIdentity(Identity identity); + } + + /** + * The stage of the cluster definition allowing to specify KeyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies keyVaultProperties. + * @param keyVaultProperties The associated key properties + * @return the next definition stage + */ + WithCreate withKeyVaultProperties(KeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the cluster definition allowing to specify NextLink. + */ + interface WithNextLink { + /** + * Specifies nextLink. + * @param nextLink The link used to get the next page of recommendations + * @return the next definition stage + */ + WithCreate withNextLink(String nextLink); + } + + /** + * The stage of the cluster definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku properties + * @return the next definition stage + */ + WithCreate withSku(ClusterSku 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.WithIdentity, DefinitionStages.WithKeyVaultProperties, DefinitionStages.WithNextLink, DefinitionStages.WithSku { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithKeyVaultProperties, UpdateStages.WithSku { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify KeyVaultProperties. + */ + interface WithKeyVaultProperties { + /** + * Specifies keyVaultProperties. + * @param keyVaultProperties The associated key properties + * @return the next update stage + */ + Update withKeyVaultProperties(KeyVaultProperties keyVaultProperties); + } + + /** + * The stage of the cluster update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The sku properties + * @return the next update stage + */ + Update withSku(ClusterSku sku); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterEntityStatus.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterEntityStatus.java new file mode 100644 index 000000000000..cb3008ec6259 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterEntityStatus.java @@ -0,0 +1,56 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ClusterEntityStatus. + */ +public final class ClusterEntityStatus extends ExpandableStringEnum { + /** Static value Creating for ClusterEntityStatus. */ + public static final ClusterEntityStatus CREATING = fromString("Creating"); + + /** Static value Succeeded for ClusterEntityStatus. */ + public static final ClusterEntityStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ClusterEntityStatus. */ + public static final ClusterEntityStatus FAILED = fromString("Failed"); + + /** Static value Canceled for ClusterEntityStatus. */ + public static final ClusterEntityStatus CANCELED = fromString("Canceled"); + + /** Static value Deleting for ClusterEntityStatus. */ + public static final ClusterEntityStatus DELETING = fromString("Deleting"); + + /** Static value ProvisioningAccount for ClusterEntityStatus. */ + public static final ClusterEntityStatus PROVISIONING_ACCOUNT = fromString("ProvisioningAccount"); + + /** Static value Updating for ClusterEntityStatus. */ + public static final ClusterEntityStatus UPDATING = fromString("Updating"); + + /** + * Creates or finds a ClusterEntityStatus from its string representation. + * @param name a name to look for + * @return the corresponding ClusterEntityStatus + */ + @JsonCreator + public static ClusterEntityStatus fromString(String name) { + return fromString(name, ClusterEntityStatus.class); + } + + /** + * @return known ClusterEntityStatus values + */ + public static Collection values() { + return values(ClusterEntityStatus.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterErrorResponse.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterErrorResponse.java new file mode 100644 index 000000000000..7acd30073fdc --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterErrorResponse.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response indicates that the service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class ClusterErrorResponse { + /** + * The details of the error. + */ + @JsonProperty(value = "error") + private ErrorResponse error; + + /** + * Get the details of the error. + * + * @return the error value + */ + public ErrorResponse error() { + return this.error; + } + + /** + * Set the details of the error. + * + * @param error the error value to set + * @return the ClusterErrorResponse object itself. + */ + public ClusterErrorResponse withError(ErrorResponse error) { + this.error = error; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterErrorResponseException.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterErrorResponseException.java new file mode 100644 index 000000000000..cb0fbb95f290 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterErrorResponseException.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ClusterErrorResponse + * information. + */ +public class ClusterErrorResponseException extends RestException { + /** + * Initializes a new instance of the ClusterErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ClusterErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ClusterErrorResponseException 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 ClusterErrorResponseException(final String message, final Response response, final ClusterErrorResponse body) { + super(message, response, body); + } + + @Override + public ClusterErrorResponse body() { + return (ClusterErrorResponse) super.body(); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterPatch.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterPatch.java new file mode 100644 index 000000000000..9bd565c09d28 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterPatch.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The top level Log Analytics cluster resource container. + */ +@JsonFlatten +public class ClusterPatch { + /** + * The associated key properties. + */ + @JsonProperty(value = "properties.keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * The sku properties. + */ + @JsonProperty(value = "sku") + private ClusterSku sku; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the associated key properties. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the associated key properties. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the ClusterPatch object itself. + */ + public ClusterPatch withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + + /** + * Get the sku properties. + * + * @return the sku value + */ + public ClusterSku sku() { + return this.sku; + } + + /** + * Set the sku properties. + * + * @param sku the sku value to set + * @return the ClusterPatch object itself. + */ + public ClusterPatch withSku(ClusterSku sku) { + this.sku = sku; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the ClusterPatch object itself. + */ + public ClusterPatch withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterSku.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterSku.java new file mode 100644 index 000000000000..0617bcbe7d58 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterSku.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The cluster sku definition. + */ +public class ClusterSku { + /** + * The capacity value. + */ + @JsonProperty(value = "capacity") + private Long capacity; + + /** + * The name of the SKU. Possible values include: 'CapacityReservation'. + */ + @JsonProperty(value = "name") + private ClusterSkuNameEnum name; + + /** + * Get the capacity value. + * + * @return the capacity value + */ + public Long capacity() { + return this.capacity; + } + + /** + * Set the capacity value. + * + * @param capacity the capacity value to set + * @return the ClusterSku object itself. + */ + public ClusterSku withCapacity(Long capacity) { + this.capacity = capacity; + return this; + } + + /** + * Get the name of the SKU. Possible values include: 'CapacityReservation'. + * + * @return the name value + */ + public ClusterSkuNameEnum name() { + return this.name; + } + + /** + * Set the name of the SKU. Possible values include: 'CapacityReservation'. + * + * @param name the name value to set + * @return the ClusterSku object itself. + */ + public ClusterSku withName(ClusterSkuNameEnum name) { + this.name = name; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterSkuNameEnum.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterSkuNameEnum.java new file mode 100644 index 000000000000..f6e0557e15bc --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ClusterSkuNameEnum.java @@ -0,0 +1,38 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ClusterSkuNameEnum. + */ +public final class ClusterSkuNameEnum extends ExpandableStringEnum { + /** Static value CapacityReservation for ClusterSkuNameEnum. */ + public static final ClusterSkuNameEnum CAPACITY_RESERVATION = fromString("CapacityReservation"); + + /** + * Creates or finds a ClusterSkuNameEnum from its string representation. + * @param name a name to look for + * @return the corresponding ClusterSkuNameEnum + */ + @JsonCreator + public static ClusterSkuNameEnum fromString(String name) { + return fromString(name, ClusterSkuNameEnum.class); + } + + /** + * @return known ClusterSkuNameEnum values + */ + public static Collection values() { + return values(ClusterSkuNameEnum.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Clusters.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Clusters.java new file mode 100644 index 000000000000..65501e9f779f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Clusters.java @@ -0,0 +1,25 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +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.loganalytics.v2020_03_01_preview.implementation.ClustersInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Clusters. + */ +public interface Clusters extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/CoreSummary.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/CoreSummary.java new file mode 100644 index 000000000000..624567579c3e --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/CoreSummary.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The core summary of a search. + */ +public class CoreSummary { + /** + * The status of a core summary. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The number of documents of a core summary. + */ + @JsonProperty(value = "numberOfDocuments", required = true) + private long numberOfDocuments; + + /** + * Get the status of a core summary. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of a core summary. + * + * @param status the status value to set + * @return the CoreSummary object itself. + */ + public CoreSummary withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the number of documents of a core summary. + * + * @return the numberOfDocuments value + */ + public long numberOfDocuments() { + return this.numberOfDocuments; + } + + /** + * Set the number of documents of a core summary. + * + * @param numberOfDocuments the numberOfDocuments value to set + * @return the CoreSummary object itself. + */ + public CoreSummary withNumberOfDocuments(long numberOfDocuments) { + this.numberOfDocuments = numberOfDocuments; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExport.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExport.java new file mode 100644 index 000000000000..10db33da1626 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExport.java @@ -0,0 +1,314 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.DataExportInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import java.util.List; + +/** + * Type representing DataExport. + */ +public interface DataExport extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the allTables value. + */ + Boolean allTables(); + + /** + * @return the createdDate value. + */ + String createdDate(); + + /** + * @return the dataExportId value. + */ + String dataExportId(); + + /** + * @return the dataExportType value. + */ + Type dataExportType(); + + /** + * @return the enable value. + */ + Boolean enable(); + + /** + * @return the eventHubName value. + */ + String eventHubName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the lastModifiedDate value. + */ + String lastModifiedDate(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the resourceId value. + */ + String resourceId(); + + /** + * @return the tableNames value. + */ + List tableNames(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DataExport definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithResourceId, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataExport definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataExport definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the dataexport definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @return the next definition stage + */ + WithResourceId withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the dataexport definition allowing to specify ResourceId. + */ + interface WithResourceId { + /** + * Specifies resourceId. + * @param resourceId The destination resource ID. This can be copied from the Properties entry of the destination resource in Azure + * @return the next definition stage + */ + WithCreate withResourceId(String resourceId); + } + + /** + * The stage of the dataexport definition allowing to specify AllTables. + */ + interface WithAllTables { + /** + * Specifies allTables. + * @param allTables When ‘true’, all workspace's tables are exported + * @return the next definition stage + */ + WithCreate withAllTables(Boolean allTables); + } + + /** + * The stage of the dataexport definition allowing to specify CreatedDate. + */ + interface WithCreatedDate { + /** + * Specifies createdDate. + * @param createdDate The latest data export rule modification time + * @return the next definition stage + */ + WithCreate withCreatedDate(String createdDate); + } + + /** + * The stage of the dataexport definition allowing to specify DataExportId. + */ + interface WithDataExportId { + /** + * Specifies dataExportId. + * @param dataExportId The data export rule ID + * @return the next definition stage + */ + WithCreate withDataExportId(String dataExportId); + } + + /** + * The stage of the dataexport definition allowing to specify Enable. + */ + interface WithEnable { + /** + * Specifies enable. + * @param enable Active when enabled + * @return the next definition stage + */ + WithCreate withEnable(Boolean enable); + } + + /** + * The stage of the dataexport definition allowing to specify EventHubName. + */ + interface WithEventHubName { + /** + * Specifies eventHubName. + * @param eventHubName Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account + * @return the next definition stage + */ + WithCreate withEventHubName(String eventHubName); + } + + /** + * The stage of the dataexport definition allowing to specify LastModifiedDate. + */ + interface WithLastModifiedDate { + /** + * Specifies lastModifiedDate. + * @param lastModifiedDate Date and time when the export was last modified + * @return the next definition stage + */ + WithCreate withLastModifiedDate(String lastModifiedDate); + } + + /** + * The stage of the dataexport definition allowing to specify TableNames. + */ + interface WithTableNames { + /** + * Specifies tableNames. + * @param tableNames An array of tables to export, for example: [“Heartbeat, SecurityEvent”] + * @return the next definition stage + */ + WithCreate withTableNames(List tableNames); + } + + /** + * 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, DefinitionStages.WithAllTables, DefinitionStages.WithCreatedDate, DefinitionStages.WithDataExportId, DefinitionStages.WithEnable, DefinitionStages.WithEventHubName, DefinitionStages.WithLastModifiedDate, DefinitionStages.WithTableNames { + } + } + /** + * The template for a DataExport update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAllTables, UpdateStages.WithCreatedDate, UpdateStages.WithDataExportId, UpdateStages.WithEnable, UpdateStages.WithEventHubName, UpdateStages.WithLastModifiedDate, UpdateStages.WithTableNames { + } + + /** + * Grouping of DataExport update stages. + */ + interface UpdateStages { + /** + * The stage of the dataexport update allowing to specify AllTables. + */ + interface WithAllTables { + /** + * Specifies allTables. + * @param allTables When ‘true’, all workspace's tables are exported + * @return the next update stage + */ + Update withAllTables(Boolean allTables); + } + + /** + * The stage of the dataexport update allowing to specify CreatedDate. + */ + interface WithCreatedDate { + /** + * Specifies createdDate. + * @param createdDate The latest data export rule modification time + * @return the next update stage + */ + Update withCreatedDate(String createdDate); + } + + /** + * The stage of the dataexport update allowing to specify DataExportId. + */ + interface WithDataExportId { + /** + * Specifies dataExportId. + * @param dataExportId The data export rule ID + * @return the next update stage + */ + Update withDataExportId(String dataExportId); + } + + /** + * The stage of the dataexport update allowing to specify Enable. + */ + interface WithEnable { + /** + * Specifies enable. + * @param enable Active when enabled + * @return the next update stage + */ + Update withEnable(Boolean enable); + } + + /** + * The stage of the dataexport update allowing to specify EventHubName. + */ + interface WithEventHubName { + /** + * Specifies eventHubName. + * @param eventHubName Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account + * @return the next update stage + */ + Update withEventHubName(String eventHubName); + } + + /** + * The stage of the dataexport update allowing to specify LastModifiedDate. + */ + interface WithLastModifiedDate { + /** + * Specifies lastModifiedDate. + * @param lastModifiedDate Date and time when the export was last modified + * @return the next update stage + */ + Update withLastModifiedDate(String lastModifiedDate); + } + + /** + * The stage of the dataexport update allowing to specify TableNames. + */ + interface WithTableNames { + /** + * Specifies tableNames. + * @param tableNames An array of tables to export, for example: [“Heartbeat, SecurityEvent”] + * @return the next update stage + */ + Update withTableNames(List tableNames); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExportErrorResponse.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExportErrorResponse.java new file mode 100644 index 000000000000..bfbcf121ec6d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExportErrorResponse.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response indicates that the service is not able to process the + * incoming request. The reason is provided in the error message. + */ +public class DataExportErrorResponse { + /** + * The details of the error. + */ + @JsonProperty(value = "error") + private ErrorResponse error; + + /** + * Get the details of the error. + * + * @return the error value + */ + public ErrorResponse error() { + return this.error; + } + + /** + * Set the details of the error. + * + * @param error the error value to set + * @return the DataExportErrorResponse object itself. + */ + public DataExportErrorResponse withError(ErrorResponse error) { + this.error = error; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExportErrorResponseException.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExportErrorResponseException.java new file mode 100644 index 000000000000..6cb68bda596e --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExportErrorResponseException.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with DataExportErrorResponse + * information. + */ +public class DataExportErrorResponseException extends RestException { + /** + * Initializes a new instance of the DataExportErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public DataExportErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the DataExportErrorResponseException 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 DataExportErrorResponseException(final String message, final Response response, final DataExportErrorResponse body) { + super(message, response, body); + } + + @Override + public DataExportErrorResponse body() { + return (DataExportErrorResponse) super.body(); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExports.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExports.java new file mode 100644 index 000000000000..45ec4b26a52e --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataExports.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.DataExportsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DataExports. + */ +public interface DataExports extends SupportsCreating, HasInner { + /** + * Gets a data export instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String dataExportName); + + /** + * Lists the data export instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName); + + /** + * Deletes the specified data export in a given workspace.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String dataExportName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataIngestionStatus.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataIngestionStatus.java new file mode 100644 index 000000000000..45c7f347b450 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataIngestionStatus.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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataIngestionStatus. + */ +public final class DataIngestionStatus extends ExpandableStringEnum { + /** Static value RespectQuota for DataIngestionStatus. */ + public static final DataIngestionStatus RESPECT_QUOTA = fromString("RespectQuota"); + + /** Static value ForceOn for DataIngestionStatus. */ + public static final DataIngestionStatus FORCE_ON = fromString("ForceOn"); + + /** Static value ForceOff for DataIngestionStatus. */ + public static final DataIngestionStatus FORCE_OFF = fromString("ForceOff"); + + /** Static value OverQuota for DataIngestionStatus. */ + public static final DataIngestionStatus OVER_QUOTA = fromString("OverQuota"); + + /** Static value SubscriptionSuspended for DataIngestionStatus. */ + public static final DataIngestionStatus SUBSCRIPTION_SUSPENDED = fromString("SubscriptionSuspended"); + + /** Static value ApproachingQuota for DataIngestionStatus. */ + public static final DataIngestionStatus APPROACHING_QUOTA = fromString("ApproachingQuota"); + + /** + * Creates or finds a DataIngestionStatus from its string representation. + * @param name a name to look for + * @return the corresponding DataIngestionStatus + */ + @JsonCreator + public static DataIngestionStatus fromString(String name) { + return fromString(name, DataIngestionStatus.class); + } + + /** + * @return known DataIngestionStatus values + */ + public static Collection values() { + return values(DataIngestionStatus.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSource.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSource.java new file mode 100644 index 000000000000..a938301e9d3a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSource.java @@ -0,0 +1,181 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.DataSourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import java.util.Map; + +/** + * Type representing DataSource. + */ +public interface DataSource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the kind value. + */ + DataSourceKind kind(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + Object properties(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the DataSource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithKind, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + } + + /** + * Grouping of DataSource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a DataSource definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the datasource definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @return the next definition stage + */ + WithKind withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the datasource definition allowing to specify Kind. + */ + interface WithKind { + /** + * Specifies kind. + * @param kind Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification' + * @return the next definition stage + */ + WithProperties withKind(DataSourceKind kind); + } + + /** + * The stage of the datasource definition allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + * @param properties The data source properties in raw json format, each kind of data source have it's own schema + * @return the next definition stage + */ + WithCreate withProperties(Object properties); + } + + /** + * The stage of the datasource definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag of the data source + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the datasource definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * 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, DefinitionStages.WithEtag, DefinitionStages.WithTags { + } + } + /** + * The template for a DataSource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithTags { + } + + /** + * Grouping of DataSource update stages. + */ + interface UpdateStages { + /** + * The stage of the datasource update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag of the data source + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the datasource update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceFilter.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceFilter.java new file mode 100644 index 000000000000..0e60ff4ba0c9 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceFilter.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * DataSource filter. Right now, only filter by kind is supported. + */ +public class DataSourceFilter { + /** + * Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', + * 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', + * 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', + * 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', + * 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + * 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + * 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + * 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + * 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + * 'SecurityWindowsBaselineConfiguration', + * 'SecurityCenterSecurityWindowsBaselineConfiguration', + * 'SecurityEventCollectionConfiguration', + * 'SecurityInsightsSecurityEventCollectionConfiguration', + * 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + * 'ApplicationInsights', 'SqlDataClassification'. + */ + @JsonProperty(value = "kind") + private DataSourceKind kind; + + /** + * Get possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification'. + * + * @return the kind value + */ + public DataSourceKind kind() { + return this.kind; + } + + /** + * Set possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification'. + * + * @param kind the kind value to set + * @return the DataSourceFilter object itself. + */ + public DataSourceFilter withKind(DataSourceKind kind) { + this.kind = kind; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceKind.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceKind.java new file mode 100644 index 000000000000..4e5dd3e96127 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceKind.java @@ -0,0 +1,134 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DataSourceKind. + */ +public final class DataSourceKind extends ExpandableStringEnum { + /** Static value WindowsEvent for DataSourceKind. */ + public static final DataSourceKind WINDOWS_EVENT = fromString("WindowsEvent"); + + /** Static value WindowsPerformanceCounter for DataSourceKind. */ + public static final DataSourceKind WINDOWS_PERFORMANCE_COUNTER = fromString("WindowsPerformanceCounter"); + + /** Static value IISLogs for DataSourceKind. */ + public static final DataSourceKind IISLOGS = fromString("IISLogs"); + + /** Static value LinuxSyslog for DataSourceKind. */ + public static final DataSourceKind LINUX_SYSLOG = fromString("LinuxSyslog"); + + /** Static value LinuxSyslogCollection for DataSourceKind. */ + public static final DataSourceKind LINUX_SYSLOG_COLLECTION = fromString("LinuxSyslogCollection"); + + /** Static value LinuxPerformanceObject for DataSourceKind. */ + public static final DataSourceKind LINUX_PERFORMANCE_OBJECT = fromString("LinuxPerformanceObject"); + + /** Static value LinuxPerformanceCollection for DataSourceKind. */ + public static final DataSourceKind LINUX_PERFORMANCE_COLLECTION = fromString("LinuxPerformanceCollection"); + + /** Static value CustomLog for DataSourceKind. */ + public static final DataSourceKind CUSTOM_LOG = fromString("CustomLog"); + + /** Static value CustomLogCollection for DataSourceKind. */ + public static final DataSourceKind CUSTOM_LOG_COLLECTION = fromString("CustomLogCollection"); + + /** Static value AzureAuditLog for DataSourceKind. */ + public static final DataSourceKind AZURE_AUDIT_LOG = fromString("AzureAuditLog"); + + /** Static value AzureActivityLog for DataSourceKind. */ + public static final DataSourceKind AZURE_ACTIVITY_LOG = fromString("AzureActivityLog"); + + /** Static value GenericDataSource for DataSourceKind. */ + public static final DataSourceKind GENERIC_DATA_SOURCE = fromString("GenericDataSource"); + + /** Static value ChangeTrackingCustomPath for DataSourceKind. */ + public static final DataSourceKind CHANGE_TRACKING_CUSTOM_PATH = fromString("ChangeTrackingCustomPath"); + + /** Static value ChangeTrackingPath for DataSourceKind. */ + public static final DataSourceKind CHANGE_TRACKING_PATH = fromString("ChangeTrackingPath"); + + /** Static value ChangeTrackingServices for DataSourceKind. */ + public static final DataSourceKind CHANGE_TRACKING_SERVICES = fromString("ChangeTrackingServices"); + + /** Static value ChangeTrackingDataTypeConfiguration for DataSourceKind. */ + public static final DataSourceKind CHANGE_TRACKING_DATA_TYPE_CONFIGURATION = fromString("ChangeTrackingDataTypeConfiguration"); + + /** Static value ChangeTrackingDefaultRegistry for DataSourceKind. */ + public static final DataSourceKind CHANGE_TRACKING_DEFAULT_REGISTRY = fromString("ChangeTrackingDefaultRegistry"); + + /** Static value ChangeTrackingRegistry for DataSourceKind. */ + public static final DataSourceKind CHANGE_TRACKING_REGISTRY = fromString("ChangeTrackingRegistry"); + + /** Static value ChangeTrackingLinuxPath for DataSourceKind. */ + public static final DataSourceKind CHANGE_TRACKING_LINUX_PATH = fromString("ChangeTrackingLinuxPath"); + + /** Static value LinuxChangeTrackingPath for DataSourceKind. */ + public static final DataSourceKind LINUX_CHANGE_TRACKING_PATH = fromString("LinuxChangeTrackingPath"); + + /** Static value ChangeTrackingContentLocation for DataSourceKind. */ + public static final DataSourceKind CHANGE_TRACKING_CONTENT_LOCATION = fromString("ChangeTrackingContentLocation"); + + /** Static value WindowsTelemetry for DataSourceKind. */ + public static final DataSourceKind WINDOWS_TELEMETRY = fromString("WindowsTelemetry"); + + /** Static value Office365 for DataSourceKind. */ + public static final DataSourceKind OFFICE365 = fromString("Office365"); + + /** Static value SecurityWindowsBaselineConfiguration for DataSourceKind. */ + public static final DataSourceKind SECURITY_WINDOWS_BASELINE_CONFIGURATION = fromString("SecurityWindowsBaselineConfiguration"); + + /** Static value SecurityCenterSecurityWindowsBaselineConfiguration for DataSourceKind. */ + public static final DataSourceKind SECURITY_CENTER_SECURITY_WINDOWS_BASELINE_CONFIGURATION = fromString("SecurityCenterSecurityWindowsBaselineConfiguration"); + + /** Static value SecurityEventCollectionConfiguration for DataSourceKind. */ + public static final DataSourceKind SECURITY_EVENT_COLLECTION_CONFIGURATION = fromString("SecurityEventCollectionConfiguration"); + + /** Static value SecurityInsightsSecurityEventCollectionConfiguration for DataSourceKind. */ + public static final DataSourceKind SECURITY_INSIGHTS_SECURITY_EVENT_COLLECTION_CONFIGURATION = fromString("SecurityInsightsSecurityEventCollectionConfiguration"); + + /** Static value ImportComputerGroup for DataSourceKind. */ + public static final DataSourceKind IMPORT_COMPUTER_GROUP = fromString("ImportComputerGroup"); + + /** Static value NetworkMonitoring for DataSourceKind. */ + public static final DataSourceKind NETWORK_MONITORING = fromString("NetworkMonitoring"); + + /** Static value Itsm for DataSourceKind. */ + public static final DataSourceKind ITSM = fromString("Itsm"); + + /** Static value DnsAnalytics for DataSourceKind. */ + public static final DataSourceKind DNS_ANALYTICS = fromString("DnsAnalytics"); + + /** Static value ApplicationInsights for DataSourceKind. */ + public static final DataSourceKind APPLICATION_INSIGHTS = fromString("ApplicationInsights"); + + /** Static value SqlDataClassification for DataSourceKind. */ + public static final DataSourceKind SQL_DATA_CLASSIFICATION = fromString("SqlDataClassification"); + + /** + * Creates or finds a DataSourceKind from its string representation. + * @param name a name to look for + * @return the corresponding DataSourceKind + */ + @JsonCreator + public static DataSourceKind fromString(String name) { + return fromString(name, DataSourceKind.class); + } + + /** + * @return known DataSourceKind values + */ + public static Collection values() { + return values(DataSourceKind.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceType.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceType.java new file mode 100644 index 000000000000..23e1a47696ef --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSourceType.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for DataSourceType. + */ +public enum DataSourceType { + /** Enum value CustomLogs. */ + CUSTOM_LOGS("CustomLogs"), + + /** Enum value AzureWatson. */ + AZURE_WATSON("AzureWatson"); + + /** The actual serialized value for a DataSourceType instance. */ + private String value; + + DataSourceType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a DataSourceType instance. + * + * @param value the serialized value to parse. + * @return the parsed DataSourceType object, or null if unable to parse. + */ + @JsonCreator + public static DataSourceType fromString(String value) { + DataSourceType[] items = DataSourceType.values(); + for (DataSourceType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSources.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSources.java new file mode 100644 index 000000000000..0f46829b3597 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DataSources.java @@ -0,0 +1,54 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.DataSourcesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DataSources. + */ +public interface DataSources extends SupportsCreating, HasInner { + /** + * Gets a datasource instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String dataSourceName); + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final String filter); + + /** + * Deletes a data source instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String dataSourceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DeletedWorkspaces.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DeletedWorkspaces.java new file mode 100644 index 000000000000..33d41db9a273 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/DeletedWorkspaces.java @@ -0,0 +1,20 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.DeletedWorkspacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing DeletedWorkspaces. + */ +public interface DeletedWorkspaces extends SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorAdditionalInfo.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..1022178bd576 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorAdditionalInfo.java @@ -0,0 +1,47 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error additional info. + */ +public class ErrorAdditionalInfo { + /** + * The additional info type. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The additional info. + */ + @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) + private Object info; + + /** + * Get the additional info type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the additional info. + * + * @return the info value + */ + public Object info() { + return this.info; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorContract.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorContract.java new file mode 100644 index 000000000000..bb697f8ee64f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorContract.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error details. + * Contains details when the response code indicates an error. + */ +public class ErrorContract { + /** + * The details of the error. + */ + @JsonProperty(value = "error") + private ErrorResponse error; + + /** + * Get the details of the error. + * + * @return the error value + */ + public ErrorResponse error() { + return this.error; + } + + /** + * Set the details of the error. + * + * @param error the error value to set + * @return the ErrorContract object itself. + */ + public ErrorContract withError(ErrorResponse error) { + this.error = error; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorContractException.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorContractException.java new file mode 100644 index 000000000000..778235298660 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorContractException.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorContract information. + */ +public class ErrorContractException extends RestException { + /** + * Initializes a new instance of the ErrorContractException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorContractException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorContractException 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 ErrorContractException(final String message, final Response response, final ErrorContract body) { + super(message, response, body); + } + + @Override + public ErrorContract body() { + return (ErrorContract) super.body(); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorResponse.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorResponse.java new file mode 100644 index 000000000000..20996e06d101 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ErrorResponse.java @@ -0,0 +1,93 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource management error response. + */ +public class ErrorResponse { + /** + * The error code. + */ + @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) + private String code; + + /** + * The error message. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The error target. + */ + @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) + private String target; + + /** + * The error details. + */ + @JsonProperty(value = "details", access = JsonProperty.Access.WRITE_ONLY) + private List details; + + /** + * The error additional info. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private List additionalInfo; + + /** + * Get the error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Get the error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the error target. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Get the error details. + * + * @return the details value + */ + public List details() { + return this.details; + } + + /** + * Get the error additional info. + * + * @return the additionalInfo value + */ + public List additionalInfo() { + return this.additionalInfo; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Gateways.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Gateways.java new file mode 100644 index 000000000000..b33e98896052 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Gateways.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.loganalytics.v2020_03_01_preview; + +import rx.Completable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.GatewaysInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Gateways. + */ +public interface Gateways extends HasInner { + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param gatewayId The Log Analytics gateway Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String gatewayId); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Identity.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Identity.java new file mode 100644 index 000000000000..409186736736 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Identity.java @@ -0,0 +1,73 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Identity for the resource. + */ +public class Identity { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private String tenantId; + + /** + * The identity type. Possible values include: 'SystemAssigned', 'None'. + */ + @JsonProperty(value = "type", required = true) + private IdentityType type; + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Get the identity type. Possible values include: 'SystemAssigned', 'None'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'SystemAssigned', 'None'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IdentityType.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IdentityType.java new file mode 100644 index 000000000000..ba7550063bee --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IdentityType.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for IdentityType. + */ +public enum IdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a IdentityType instance. */ + private String value; + + IdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a IdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + @JsonCreator + public static IdentityType fromString(String value) { + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IntelligencePack.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IntelligencePack.java new file mode 100644 index 000000000000..8093ae06911b --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IntelligencePack.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.IntelligencePackInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; + +/** + * Type representing IntelligencePack. + */ +public interface IntelligencePack extends HasInner, HasManager { + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the enabled value. + */ + Boolean enabled(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IntelligencePacks.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IntelligencePacks.java new file mode 100644 index 000000000000..8c27789df606 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/IntelligencePacks.java @@ -0,0 +1,52 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.IntelligencePacksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing IntelligencePacks. + */ +public interface IntelligencePacks extends HasInner { + /** + * Disables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be disabled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable disableAsync(String resourceGroupName, String workspaceName, String intelligencePackName); + + /** + * Enables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be enabled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable enableAsync(String resourceGroupName, String workspaceName, String intelligencePackName); + + /** + * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/KeyVaultProperties.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/KeyVaultProperties.java new file mode 100644 index 000000000000..774e1cf05aa0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/KeyVaultProperties.java @@ -0,0 +1,96 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The key vault properties. + */ +public class KeyVaultProperties { + /** + * The Key Vault uri which holds they key associated with the Log Analytics + * cluster. + */ + @JsonProperty(value = "keyVaultUri") + private String keyVaultUri; + + /** + * The name of the key associated with the Log Analytics cluster. + */ + @JsonProperty(value = "keyName") + private String keyName; + + /** + * The version of the key associated with the Log Analytics cluster. + */ + @JsonProperty(value = "keyVersion") + private String keyVersion; + + /** + * Get the Key Vault uri which holds they key associated with the Log Analytics cluster. + * + * @return the keyVaultUri value + */ + public String keyVaultUri() { + return this.keyVaultUri; + } + + /** + * Set the Key Vault uri which holds they key associated with the Log Analytics cluster. + * + * @param keyVaultUri the keyVaultUri value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVaultUri(String keyVaultUri) { + this.keyVaultUri = keyVaultUri; + return this; + } + + /** + * Get the name of the key associated with the Log Analytics cluster. + * + * @return the keyName value + */ + public String keyName() { + return this.keyName; + } + + /** + * Set the name of the key associated with the Log Analytics cluster. + * + * @param keyName the keyName value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyName(String keyName) { + this.keyName = keyName; + return this; + } + + /** + * Get the version of the key associated with the Log Analytics cluster. + * + * @return the keyVersion value + */ + public String keyVersion() { + return this.keyVersion; + } + + /** + * Set the version of the key associated with the Log Analytics cluster. + * + * @param keyVersion the keyVersion value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyVersion(String keyVersion) { + this.keyVersion = keyVersion; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedService.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedService.java new file mode 100644 index 000000000000..3ef5ca2055d6 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedService.java @@ -0,0 +1,205 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LinkedServiceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import java.util.Map; + +/** + * Type representing LinkedService. + */ +public interface LinkedService extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + LinkedServiceEntityStatus provisioningState(); + + /** + * @return the resourceId value. + */ + String resourceId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the writeAccessResourceId value. + */ + String writeAccessResourceId(); + + /** + * The entirety of the LinkedService definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithCreate { + } + + /** + * Grouping of LinkedService definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LinkedService definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the linkedservice definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @return the next definition stage + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the linkedservice definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the linked service. Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating' + * @return the next definition stage + */ + WithCreate withProvisioningState(LinkedServiceEntityStatus provisioningState); + } + + /** + * The stage of the linkedservice definition allowing to specify ResourceId. + */ + interface WithResourceId { + /** + * Specifies resourceId. + * @param resourceId The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access + * @return the next definition stage + */ + WithCreate withResourceId(String resourceId); + } + + /** + * The stage of the linkedservice definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the linkedservice definition allowing to specify WriteAccessResourceId. + */ + interface WithWriteAccessResourceId { + /** + * Specifies writeAccessResourceId. + * @param writeAccessResourceId The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access + * @return the next definition stage + */ + WithCreate withWriteAccessResourceId(String writeAccessResourceId); + } + + /** + * 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, DefinitionStages.WithProvisioningState, DefinitionStages.WithResourceId, DefinitionStages.WithTags, DefinitionStages.WithWriteAccessResourceId { + } + } + /** + * The template for a LinkedService update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProvisioningState, UpdateStages.WithResourceId, UpdateStages.WithTags, UpdateStages.WithWriteAccessResourceId { + } + + /** + * Grouping of LinkedService update stages. + */ + interface UpdateStages { + /** + * The stage of the linkedservice update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the linked service. Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating' + * @return the next update stage + */ + Update withProvisioningState(LinkedServiceEntityStatus provisioningState); + } + + /** + * The stage of the linkedservice update allowing to specify ResourceId. + */ + interface WithResourceId { + /** + * Specifies resourceId. + * @param resourceId The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access + * @return the next update stage + */ + Update withResourceId(String resourceId); + } + + /** + * The stage of the linkedservice update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the linkedservice update allowing to specify WriteAccessResourceId. + */ + interface WithWriteAccessResourceId { + /** + * Specifies writeAccessResourceId. + * @param writeAccessResourceId The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access + * @return the next update stage + */ + Update withWriteAccessResourceId(String writeAccessResourceId); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedServiceEntityStatus.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedServiceEntityStatus.java new file mode 100644 index 000000000000..c9c094921f4a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedServiceEntityStatus.java @@ -0,0 +1,47 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for LinkedServiceEntityStatus. + */ +public final class LinkedServiceEntityStatus extends ExpandableStringEnum { + /** Static value Succeeded for LinkedServiceEntityStatus. */ + public static final LinkedServiceEntityStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Deleting for LinkedServiceEntityStatus. */ + public static final LinkedServiceEntityStatus DELETING = fromString("Deleting"); + + /** Static value ProvisioningAccount for LinkedServiceEntityStatus. */ + public static final LinkedServiceEntityStatus PROVISIONING_ACCOUNT = fromString("ProvisioningAccount"); + + /** Static value Updating for LinkedServiceEntityStatus. */ + public static final LinkedServiceEntityStatus UPDATING = fromString("Updating"); + + /** + * Creates or finds a LinkedServiceEntityStatus from its string representation. + * @param name a name to look for + * @return the corresponding LinkedServiceEntityStatus + */ + @JsonCreator + public static LinkedServiceEntityStatus fromString(String name) { + return fromString(name, LinkedServiceEntityStatus.class); + } + + /** + * @return known LinkedServiceEntityStatus values + */ + public static Collection values() { + return values(LinkedServiceEntityStatus.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedServices.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedServices.java new file mode 100644 index 000000000000..1e7899ed1d8a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedServices.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LinkedServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LinkedServices. + */ +public interface LinkedServices extends SupportsCreating, HasInner { + /** + * Gets a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String linkedServiceName); + + /** + * Gets the linked services instances in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName); + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String linkedServiceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedStorageAccounts.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedStorageAccounts.java new file mode 100644 index 000000000000..06d2dba268af --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedStorageAccounts.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LinkedStorageAccountsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing LinkedStorageAccounts. + */ +public interface LinkedStorageAccounts extends SupportsCreating, HasInner { + /** + * Gets all linked storage account of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType); + + /** + * Gets all linked storage accounts associated with the specified workspace, storage accounts will be sorted by their data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName); + + /** + * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedStorageAccountsResource.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedStorageAccountsResource.java new file mode 100644 index 000000000000..ed811adaff5e --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/LinkedStorageAccountsResource.java @@ -0,0 +1,123 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LinkedStorageAccountsResourceInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import java.util.List; + +/** + * Type representing LinkedStorageAccountsResource. + */ +public interface LinkedStorageAccountsResource extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the dataSourceType value. + */ + DataSourceType dataSourceType(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the storageAccountIds value. + */ + List storageAccountIds(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the LinkedStorageAccountsResource definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithStorageAccountIds, DefinitionStages.WithCreate { + } + + /** + * Grouping of LinkedStorageAccountsResource definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a LinkedStorageAccountsResource definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the linkedstorageaccountsresource definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @return the next definition stage + */ + WithStorageAccountIds withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the linkedstorageaccountsresource definition allowing to specify StorageAccountIds. + */ + interface WithStorageAccountIds { + /** + * Specifies storageAccountIds. + * @param storageAccountIds Linked storage accounts resources ids + * @return the next definition stage + */ + WithCreate withStorageAccountIds(List storageAccountIds); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a LinkedStorageAccountsResource update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithStorageAccountIds { + } + + /** + * Grouping of LinkedStorageAccountsResource update stages. + */ + interface UpdateStages { + /** + * The stage of the linkedstorageaccountsresource update allowing to specify StorageAccountIds. + */ + interface WithStorageAccountIds { + /** + * Specifies storageAccountIds. + * @param storageAccountIds Linked storage accounts resources ids + * @return the next update stage + */ + Update withStorageAccountIds(List storageAccountIds); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ManagementGroup.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ManagementGroup.java new file mode 100644 index 000000000000..fe5116b08719 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ManagementGroup.java @@ -0,0 +1,61 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.ManagementGroupInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import org.joda.time.DateTime; + +/** + * Type representing ManagementGroup. + */ +public interface ManagementGroup extends HasInner, HasManager { + /** + * @return the created value. + */ + DateTime created(); + + /** + * @return the dataReceived value. + */ + DateTime dataReceived(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the isGateway value. + */ + Boolean isGateway(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the serverCount value. + */ + Integer serverCount(); + + /** + * @return the sku value. + */ + String sku(); + + /** + * @return the version value. + */ + String version(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ManagementGroups.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ManagementGroups.java new file mode 100644 index 000000000000..e2511eeadf2c --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/ManagementGroups.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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.ManagementGroupsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ManagementGroups. + */ +public interface ManagementGroups extends HasInner { + /** + * Gets a list of management groups connected to a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/MetricName.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/MetricName.java new file mode 100644 index 000000000000..229041e87ddc --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/MetricName.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The name of a metric. + */ +public class MetricName { + /** + * The system name of the metric. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The localized name of the metric. + */ + @JsonProperty(value = "localizedValue") + private String localizedValue; + + /** + * Get the system name of the metric. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the system name of the metric. + * + * @param value the value value to set + * @return the MetricName object itself. + */ + public MetricName withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the localized name of the metric. + * + * @return the localizedValue value + */ + public String localizedValue() { + return this.localizedValue; + } + + /** + * Set the localized name of the metric. + * + * @param localizedValue the localizedValue value to set + * @return the MetricName object itself. + */ + public MetricName withLocalizedValue(String localizedValue) { + this.localizedValue = localizedValue; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Operation.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Operation.java new file mode 100644 index 000000000000..45c5a6433a0e --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Operation.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationDisplay.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationDisplay.java new file mode 100644 index 000000000000..8b3a77957b0f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationDisplay.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Display metadata associated with the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft OperationsManagement. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Type of operation: get, read, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft OperationsManagement. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft OperationsManagement. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get type of operation: get, read, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set type of operation: get, read, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of operation. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationStatus.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationStatus.java new file mode 100644 index 000000000000..70671acac36d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationStatus.java @@ -0,0 +1,52 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.OperationStatusInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; + +/** + * Type representing OperationStatus. + */ +public interface OperationStatus extends HasInner, Indexable, Refreshable, HasManager { + /** + * @return the endTime value. + */ + String endTime(); + + /** + * @return the error value. + */ + ErrorResponse error(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the startTime value. + */ + String startTime(); + + /** + * @return the status value. + */ + String status(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationStatuses.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationStatuses.java new file mode 100644 index 000000000000..7a926319cae6 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/OperationStatuses.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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.OperationStatusesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing OperationStatuses. + */ +public interface OperationStatuses extends HasInner { + /** + * Get the status of a long running azure asynchronous operation. + * + * @param location The region name of operation. + * @param asyncOperationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String location, String asyncOperationId); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Operations.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Operations.java new file mode 100644 index 000000000000..630aee5cba8d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PrivateLinkScopedResource.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PrivateLinkScopedResource.java new file mode 100644 index 000000000000..88cd7fa10690 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PrivateLinkScopedResource.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The private link scope resource reference. + */ +public class PrivateLinkScopedResource { + /** + * The full resource Id of the private link scope resource. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The private link scope unique Identifier. + */ + @JsonProperty(value = "scopeId") + private String scopeId; + + /** + * Get the full resource Id of the private link scope resource. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the full resource Id of the private link scope resource. + * + * @param resourceId the resourceId value to set + * @return the PrivateLinkScopedResource object itself. + */ + public PrivateLinkScopedResource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the private link scope unique Identifier. + * + * @return the scopeId value + */ + public String scopeId() { + return this.scopeId; + } + + /** + * Set the private link scope unique Identifier. + * + * @param scopeId the scopeId value to set + * @return the PrivateLinkScopedResource object itself. + */ + public PrivateLinkScopedResource withScopeId(String scopeId) { + this.scopeId = scopeId; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PublicNetworkAccessType.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PublicNetworkAccessType.java new file mode 100644 index 000000000000..bb6819566573 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PublicNetworkAccessType.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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PublicNetworkAccessType. + */ +public final class PublicNetworkAccessType extends ExpandableStringEnum { + /** Static value Enabled for PublicNetworkAccessType. */ + public static final PublicNetworkAccessType ENABLED = fromString("Enabled"); + + /** Static value Disabled for PublicNetworkAccessType. */ + public static final PublicNetworkAccessType DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PublicNetworkAccessType from its string representation. + * @param name a name to look for + * @return the corresponding PublicNetworkAccessType + */ + @JsonCreator + public static PublicNetworkAccessType fromString(String name) { + return fromString(name, PublicNetworkAccessType.class); + } + + /** + * @return known PublicNetworkAccessType values + */ + public static Collection values() { + return values(PublicNetworkAccessType.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PurgeState.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PurgeState.java new file mode 100644 index 000000000000..dd891719cfc5 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/PurgeState.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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PurgeState. + */ +public final class PurgeState extends ExpandableStringEnum { + /** Static value pending for PurgeState. */ + public static final PurgeState PENDING = fromString("pending"); + + /** Static value completed for PurgeState. */ + public static final PurgeState COMPLETED = fromString("completed"); + + /** + * Creates or finds a PurgeState from its string representation. + * @param name a name to look for + * @return the corresponding PurgeState + */ + @JsonCreator + public static PurgeState fromString(String name) { + return fromString(name, PurgeState.class); + } + + /** + * @return known PurgeState values + */ + public static Collection values() { + return values(PurgeState.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearch.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearch.java new file mode 100644 index 000000000000..96c464ea83d4 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearch.java @@ -0,0 +1,285 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.SavedSearchInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import java.util.List; + +/** + * Type representing SavedSearch. + */ +public interface SavedSearch extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the category value. + */ + String category(); + + /** + * @return the displayName value. + */ + String displayName(); + + /** + * @return the etag value. + */ + String etag(); + + /** + * @return the functionAlias value. + */ + String functionAlias(); + + /** + * @return the functionParameters value. + */ + String functionParameters(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the query value. + */ + String query(); + + /** + * @return the tags value. + */ + List tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the version value. + */ + Long version(); + + /** + * The entirety of the SavedSearch definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithCategory, DefinitionStages.WithDisplayName, DefinitionStages.WithQuery, DefinitionStages.WithCreate { + } + + /** + * Grouping of SavedSearch definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a SavedSearch definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the savedsearch definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @return the next definition stage + */ + WithCategory withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the savedsearch definition allowing to specify Category. + */ + interface WithCategory { + /** + * Specifies category. + * @param category The category of the saved search. This helps the user to find a saved search faster + * @return the next definition stage + */ + WithDisplayName withCategory(String category); + } + + /** + * The stage of the savedsearch definition allowing to specify DisplayName. + */ + interface WithDisplayName { + /** + * Specifies displayName. + * @param displayName Saved search display name + * @return the next definition stage + */ + WithQuery withDisplayName(String displayName); + } + + /** + * The stage of the savedsearch definition allowing to specify Query. + */ + interface WithQuery { + /** + * Specifies query. + * @param query The query expression for the saved search + * @return the next definition stage + */ + WithCreate withQuery(String query); + } + + /** + * The stage of the savedsearch definition allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag of the saved search + * @return the next definition stage + */ + WithCreate withEtag(String etag); + } + + /** + * The stage of the savedsearch definition allowing to specify FunctionAlias. + */ + interface WithFunctionAlias { + /** + * Specifies functionAlias. + * @param functionAlias The function alias if query serves as a function + * @return the next definition stage + */ + WithCreate withFunctionAlias(String functionAlias); + } + + /** + * The stage of the savedsearch definition allowing to specify FunctionParameters. + */ + interface WithFunctionParameters { + /** + * Specifies functionParameters. + * @param functionParameters The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions + * @return the next definition stage + */ + WithCreate withFunctionParameters(String functionParameters); + } + + /** + * The stage of the savedsearch definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags attached to the saved search + * @return the next definition stage + */ + WithCreate withTags(List tags); + } + + /** + * The stage of the savedsearch definition allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + * @param version The version number of the query language. The current version is 2 and is the default + * @return the next definition stage + */ + WithCreate withVersion(Long version); + } + + /** + * 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, DefinitionStages.WithEtag, DefinitionStages.WithFunctionAlias, DefinitionStages.WithFunctionParameters, DefinitionStages.WithTags, DefinitionStages.WithVersion { + } + } + /** + * The template for a SavedSearch update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithEtag, UpdateStages.WithFunctionAlias, UpdateStages.WithFunctionParameters, UpdateStages.WithTags, UpdateStages.WithVersion { + } + + /** + * Grouping of SavedSearch update stages. + */ + interface UpdateStages { + /** + * The stage of the savedsearch update allowing to specify Etag. + */ + interface WithEtag { + /** + * Specifies etag. + * @param etag The ETag of the saved search + * @return the next update stage + */ + Update withEtag(String etag); + } + + /** + * The stage of the savedsearch update allowing to specify FunctionAlias. + */ + interface WithFunctionAlias { + /** + * Specifies functionAlias. + * @param functionAlias The function alias if query serves as a function + * @return the next update stage + */ + Update withFunctionAlias(String functionAlias); + } + + /** + * The stage of the savedsearch update allowing to specify FunctionParameters. + */ + interface WithFunctionParameters { + /** + * Specifies functionParameters. + * @param functionParameters The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions + * @return the next update stage + */ + Update withFunctionParameters(String functionParameters); + } + + /** + * The stage of the savedsearch update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags attached to the saved search + * @return the next update stage + */ + Update withTags(List tags); + } + + /** + * The stage of the savedsearch update allowing to specify Version. + */ + interface WithVersion { + /** + * Specifies version. + * @param version The version number of the query language. The current version is 2 and is the default + * @return the next update stage + */ + Update withVersion(Long version); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearches.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearches.java new file mode 100644 index 000000000000..446a19f6abe2 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearches.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.SavedSearchesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SavedSearches. + */ +public interface SavedSearches extends SupportsCreating, HasInner { + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName); + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String savedSearchId); + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String savedSearchId); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearchesListResult.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearchesListResult.java new file mode 100644 index 000000000000..34dcc5e31132 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SavedSearchesListResult.java @@ -0,0 +1,27 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.SavedSearchesListResultInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.SavedSearchInner; +import java.util.List; + +/** + * Type representing SavedSearchesListResult. + */ +public interface SavedSearchesListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Schemas.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Schemas.java new file mode 100644 index 000000000000..dc4484865f6f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Schemas.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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.SchemasInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Schemas. + */ +public interface Schemas extends HasInner { + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchGetSchemaResponse.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchGetSchemaResponse.java new file mode 100644 index 000000000000..5f301679a749 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchGetSchemaResponse.java @@ -0,0 +1,31 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.SearchGetSchemaResponseInner; +import java.util.List; + +/** + * Type representing SearchGetSchemaResponse. + */ +public interface SearchGetSchemaResponse extends HasInner, HasManager { + /** + * @return the metadata value. + */ + SearchMetadata metadata(); + + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchMetadata.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchMetadata.java new file mode 100644 index 000000000000..9faf4b6a9e85 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchMetadata.java @@ -0,0 +1,461 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Metadata for search results. + */ +public class SearchMetadata { + /** + * The request id of the search. + */ + @JsonProperty(value = "requestId") + private String searchId; + + /** + * The search result type. + */ + @JsonProperty(value = "resultType") + private String resultType; + + /** + * The total number of search results. + */ + @JsonProperty(value = "total") + private Long total; + + /** + * The number of top search results. + */ + @JsonProperty(value = "top") + private Long top; + + /** + * The id of the search results request. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The core summaries. + */ + @JsonProperty(value = "coreSummaries") + private List coreSummaries; + + /** + * The status of the search results. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The start time for the search. + */ + @JsonProperty(value = "startTime") + private DateTime startTime; + + /** + * The time of last update. + */ + @JsonProperty(value = "lastUpdated") + private DateTime lastUpdated; + + /** + * The ETag of the search results. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * How the results are sorted. + */ + @JsonProperty(value = "sort") + private List sort; + + /** + * The request time. + */ + @JsonProperty(value = "requestTime") + private Long requestTime; + + /** + * The aggregated value field. + */ + @JsonProperty(value = "aggregatedValueField") + private String aggregatedValueField; + + /** + * The aggregated grouping fields. + */ + @JsonProperty(value = "aggregatedGroupingFields") + private String aggregatedGroupingFields; + + /** + * The sum of all aggregates returned in the result set. + */ + @JsonProperty(value = "sum") + private Long sum; + + /** + * The max of all aggregates returned in the result set. + */ + @JsonProperty(value = "max") + private Long max; + + /** + * The schema. + */ + @JsonProperty(value = "schema") + private SearchMetadataSchema schema; + + /** + * Get the request id of the search. + * + * @return the searchId value + */ + public String searchId() { + return this.searchId; + } + + /** + * Set the request id of the search. + * + * @param searchId the searchId value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withSearchId(String searchId) { + this.searchId = searchId; + return this; + } + + /** + * Get the search result type. + * + * @return the resultType value + */ + public String resultType() { + return this.resultType; + } + + /** + * Set the search result type. + * + * @param resultType the resultType value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withResultType(String resultType) { + this.resultType = resultType; + return this; + } + + /** + * Get the total number of search results. + * + * @return the total value + */ + public Long total() { + return this.total; + } + + /** + * Set the total number of search results. + * + * @param total the total value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withTotal(Long total) { + this.total = total; + return this; + } + + /** + * Get the number of top search results. + * + * @return the top value + */ + public Long top() { + return this.top; + } + + /** + * Set the number of top search results. + * + * @param top the top value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withTop(Long top) { + this.top = top; + return this; + } + + /** + * Get the id of the search results request. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id of the search results request. + * + * @param id the id value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withId(String id) { + this.id = id; + return this; + } + + /** + * Get the core summaries. + * + * @return the coreSummaries value + */ + public List coreSummaries() { + return this.coreSummaries; + } + + /** + * Set the core summaries. + * + * @param coreSummaries the coreSummaries value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withCoreSummaries(List coreSummaries) { + this.coreSummaries = coreSummaries; + return this; + } + + /** + * Get the status of the search results. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of the search results. + * + * @param status the status value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the start time for the search. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the start time for the search. + * + * @param startTime the startTime value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the time of last update. + * + * @return the lastUpdated value + */ + public DateTime lastUpdated() { + return this.lastUpdated; + } + + /** + * Set the time of last update. + * + * @param lastUpdated the lastUpdated value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withLastUpdated(DateTime lastUpdated) { + this.lastUpdated = lastUpdated; + return this; + } + + /** + * Get the ETag of the search results. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag of the search results. + * + * @param eTag the eTag value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get how the results are sorted. + * + * @return the sort value + */ + public List sort() { + return this.sort; + } + + /** + * Set how the results are sorted. + * + * @param sort the sort value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withSort(List sort) { + this.sort = sort; + return this; + } + + /** + * Get the request time. + * + * @return the requestTime value + */ + public Long requestTime() { + return this.requestTime; + } + + /** + * Set the request time. + * + * @param requestTime the requestTime value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withRequestTime(Long requestTime) { + this.requestTime = requestTime; + return this; + } + + /** + * Get the aggregated value field. + * + * @return the aggregatedValueField value + */ + public String aggregatedValueField() { + return this.aggregatedValueField; + } + + /** + * Set the aggregated value field. + * + * @param aggregatedValueField the aggregatedValueField value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withAggregatedValueField(String aggregatedValueField) { + this.aggregatedValueField = aggregatedValueField; + return this; + } + + /** + * Get the aggregated grouping fields. + * + * @return the aggregatedGroupingFields value + */ + public String aggregatedGroupingFields() { + return this.aggregatedGroupingFields; + } + + /** + * Set the aggregated grouping fields. + * + * @param aggregatedGroupingFields the aggregatedGroupingFields value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withAggregatedGroupingFields(String aggregatedGroupingFields) { + this.aggregatedGroupingFields = aggregatedGroupingFields; + return this; + } + + /** + * Get the sum of all aggregates returned in the result set. + * + * @return the sum value + */ + public Long sum() { + return this.sum; + } + + /** + * Set the sum of all aggregates returned in the result set. + * + * @param sum the sum value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withSum(Long sum) { + this.sum = sum; + return this; + } + + /** + * Get the max of all aggregates returned in the result set. + * + * @return the max value + */ + public Long max() { + return this.max; + } + + /** + * Set the max of all aggregates returned in the result set. + * + * @param max the max value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withMax(Long max) { + this.max = max; + return this; + } + + /** + * Get the schema. + * + * @return the schema value + */ + public SearchMetadataSchema schema() { + return this.schema; + } + + /** + * Set the schema. + * + * @param schema the schema value to set + * @return the SearchMetadata object itself. + */ + public SearchMetadata withSchema(SearchMetadataSchema schema) { + this.schema = schema; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchMetadataSchema.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchMetadataSchema.java new file mode 100644 index 000000000000..b22bbabd5d9e --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchMetadataSchema.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Schema metadata for search. + */ +public class SearchMetadataSchema { + /** + * The name of the metadata schema. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The version of the metadata schema. + */ + @JsonProperty(value = "version") + private Integer version; + + /** + * Get the name of the metadata schema. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the metadata schema. + * + * @param name the name value to set + * @return the SearchMetadataSchema object itself. + */ + public SearchMetadataSchema withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version of the metadata schema. + * + * @return the version value + */ + public Integer version() { + return this.version; + } + + /** + * Set the version of the metadata schema. + * + * @param version the version value to set + * @return the SearchMetadataSchema object itself. + */ + public SearchMetadataSchema withVersion(Integer version) { + this.version = version; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSchemaValue.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSchemaValue.java new file mode 100644 index 000000000000..64e9d13b1019 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSchemaValue.java @@ -0,0 +1,200 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Value object for schema results. + */ +public class SearchSchemaValue { + /** + * The name of the schema. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display name of the schema. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * The type. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The boolean that indicates the field is searchable as free text. + */ + @JsonProperty(value = "indexed", required = true) + private boolean indexed; + + /** + * The boolean that indicates whether or not the field is stored. + */ + @JsonProperty(value = "stored", required = true) + private boolean stored; + + /** + * The boolean that indicates whether or not the field is a facet. + */ + @JsonProperty(value = "facet", required = true) + private boolean facet; + + /** + * The array of workflows containing the field. + */ + @JsonProperty(value = "ownerType") + private List ownerType; + + /** + * Get the name of the schema. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the schema. + * + * @param name the name value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display name of the schema. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the schema. + * + * @param displayName the displayName value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the type. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type. + * + * @param type the type value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withType(String type) { + this.type = type; + return this; + } + + /** + * Get the boolean that indicates the field is searchable as free text. + * + * @return the indexed value + */ + public boolean indexed() { + return this.indexed; + } + + /** + * Set the boolean that indicates the field is searchable as free text. + * + * @param indexed the indexed value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withIndexed(boolean indexed) { + this.indexed = indexed; + return this; + } + + /** + * Get the boolean that indicates whether or not the field is stored. + * + * @return the stored value + */ + public boolean stored() { + return this.stored; + } + + /** + * Set the boolean that indicates whether or not the field is stored. + * + * @param stored the stored value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withStored(boolean stored) { + this.stored = stored; + return this; + } + + /** + * Get the boolean that indicates whether or not the field is a facet. + * + * @return the facet value + */ + public boolean facet() { + return this.facet; + } + + /** + * Set the boolean that indicates whether or not the field is a facet. + * + * @param facet the facet value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withFacet(boolean facet) { + this.facet = facet; + return this; + } + + /** + * Get the array of workflows containing the field. + * + * @return the ownerType value + */ + public List ownerType() { + return this.ownerType; + } + + /** + * Set the array of workflows containing the field. + * + * @param ownerType the ownerType value to set + * @return the SearchSchemaValue object itself. + */ + public SearchSchemaValue withOwnerType(List ownerType) { + this.ownerType = ownerType; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSort.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSort.java new file mode 100644 index 000000000000..8f396fa25564 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSort.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The sort parameters for search. + */ +public class SearchSort { + /** + * The name of the field the search query is sorted on. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The sort order of the search. Possible values include: 'asc', 'desc'. + */ + @JsonProperty(value = "order") + private SearchSortEnum order; + + /** + * Get the name of the field the search query is sorted on. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the field the search query is sorted on. + * + * @param name the name value to set + * @return the SearchSort object itself. + */ + public SearchSort withName(String name) { + this.name = name; + return this; + } + + /** + * Get the sort order of the search. Possible values include: 'asc', 'desc'. + * + * @return the order value + */ + public SearchSortEnum order() { + return this.order; + } + + /** + * Set the sort order of the search. Possible values include: 'asc', 'desc'. + * + * @param order the order value to set + * @return the SearchSort object itself. + */ + public SearchSort withOrder(SearchSortEnum order) { + this.order = order; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSortEnum.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSortEnum.java new file mode 100644 index 000000000000..b0c3ee1238fd --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SearchSortEnum.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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SearchSortEnum. + */ +public final class SearchSortEnum extends ExpandableStringEnum { + /** Static value asc for SearchSortEnum. */ + public static final SearchSortEnum ASC = fromString("asc"); + + /** Static value desc for SearchSortEnum. */ + public static final SearchSortEnum DESC = fromString("desc"); + + /** + * Creates or finds a SearchSortEnum from its string representation. + * @param name a name to look for + * @return the corresponding SearchSortEnum + */ + @JsonCreator + public static SearchSortEnum fromString(String name) { + return fromString(name, SearchSortEnum.class); + } + + /** + * @return known SearchSortEnum values + */ + public static Collection values() { + return values(SearchSortEnum.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SharedKeys.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SharedKeys.java new file mode 100644 index 000000000000..74a1040dafc1 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SharedKeys.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.SharedKeysInner; + +/** + * Type representing SharedKeys. + */ +public interface SharedKeys extends HasInner, HasManager { + /** + * @return the primarySharedKey value. + */ + String primarySharedKey(); + + /** + * @return the secondarySharedKey value. + */ + String secondarySharedKey(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SharedKeysOperations.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SharedKeysOperations.java new file mode 100644 index 000000000000..10d34d83dc4d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SharedKeysOperations.java @@ -0,0 +1,39 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.SharedKeysOperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing SharedKeysOperations. + */ +public interface SharedKeysOperations extends HasInner { + /** + * Gets the shared keys for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getSharedKeysAsync(String resourceGroupName, String workspaceName); + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SkuNameEnum.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SkuNameEnum.java new file mode 100644 index 000000000000..1d51d6574332 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/SkuNameEnum.java @@ -0,0 +1,56 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuNameEnum. + */ +public final class SkuNameEnum extends ExpandableStringEnum { + /** Static value Free for SkuNameEnum. */ + public static final SkuNameEnum FREE = fromString("Free"); + + /** Static value Standard for SkuNameEnum. */ + public static final SkuNameEnum STANDARD = fromString("Standard"); + + /** Static value Premium for SkuNameEnum. */ + public static final SkuNameEnum PREMIUM = fromString("Premium"); + + /** Static value PerNode for SkuNameEnum. */ + public static final SkuNameEnum PER_NODE = fromString("PerNode"); + + /** Static value PerGB2018 for SkuNameEnum. */ + public static final SkuNameEnum PER_GB2018 = fromString("PerGB2018"); + + /** Static value Standalone for SkuNameEnum. */ + public static final SkuNameEnum STANDALONE = fromString("Standalone"); + + /** Static value CapacityReservation for SkuNameEnum. */ + public static final SkuNameEnum CAPACITY_RESERVATION = fromString("CapacityReservation"); + + /** + * Creates or finds a SkuNameEnum from its string representation. + * @param name a name to look for + * @return the corresponding SkuNameEnum + */ + @JsonCreator + public static SkuNameEnum fromString(String name) { + return fromString(name, SkuNameEnum.class); + } + + /** + * @return known SkuNameEnum values + */ + public static Collection values() { + return values(SkuNameEnum.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageAccount.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageAccount.java new file mode 100644 index 000000000000..e66a56cefbf0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageAccount.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes a storage account connection. + */ +public class StorageAccount { + /** + * The Azure Resource Manager ID of the storage account resource. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * The storage account key. + */ + @JsonProperty(value = "key", required = true) + private String key; + + /** + * Get the Azure Resource Manager ID of the storage account resource. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the Azure Resource Manager ID of the storage account resource. + * + * @param id the id value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withId(String id) { + this.id = id; + return this; + } + + /** + * Get the storage account key. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set the storage account key. + * + * @param key the key value to set + * @return the StorageAccount object itself. + */ + public StorageAccount withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsight.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsight.java new file mode 100644 index 000000000000..ffa15d98368d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsight.java @@ -0,0 +1,228 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.StorageInsightInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import java.util.List; +import java.util.Map; + +/** + * Type representing StorageInsight. + */ +public interface StorageInsight extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the containers value. + */ + List containers(); + + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the status value. + */ + StorageInsightStatus status(); + + /** + * @return the storageAccount value. + */ + StorageAccount storageAccount(); + + /** + * @return the tables value. + */ + List tables(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StorageInsight definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithWorkspace, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageInsight definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageInsight definition. + */ + interface Blank extends WithWorkspace { + } + + /** + * The stage of the storageinsight definition allowing to specify Workspace. + */ + interface WithWorkspace { + /** + * Specifies resourceGroupName, workspaceName. + * @param resourceGroupName The name of the resource group. The name is case insensitive + * @param workspaceName The name of the workspace + * @return the next definition stage + */ + WithStorageAccount withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the storageinsight definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + * @param storageAccount The storage account connection details + * @return the next definition stage + */ + WithCreate withStorageAccount(StorageAccount storageAccount); + } + + /** + * The stage of the storageinsight definition allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + * @param containers The names of the blob containers that the workspace should read + * @return the next definition stage + */ + WithCreate withContainers(List containers); + } + + /** + * The stage of the storageinsight definition allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag The ETag of the storage insight + * @return the next definition stage + */ + WithCreate withETag(String eTag); + } + + /** + * The stage of the storageinsight definition allowing to specify Tables. + */ + interface WithTables { + /** + * Specifies tables. + * @param tables The names of the Azure tables that the workspace should read + * @return the next definition stage + */ + WithCreate withTables(List tables); + } + + /** + * The stage of the storageinsight definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * 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, DefinitionStages.WithContainers, DefinitionStages.WithETag, DefinitionStages.WithTables, DefinitionStages.WithTags { + } + } + /** + * The template for a StorageInsight update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithContainers, UpdateStages.WithETag, UpdateStages.WithTables, UpdateStages.WithTags { + } + + /** + * Grouping of StorageInsight update stages. + */ + interface UpdateStages { + /** + * The stage of the storageinsight update allowing to specify Containers. + */ + interface WithContainers { + /** + * Specifies containers. + * @param containers The names of the blob containers that the workspace should read + * @return the next update stage + */ + Update withContainers(List containers); + } + + /** + * The stage of the storageinsight update allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag The ETag of the storage insight + * @return the next update stage + */ + Update withETag(String eTag); + } + + /** + * The stage of the storageinsight update allowing to specify Tables. + */ + interface WithTables { + /** + * Specifies tables. + * @param tables The names of the Azure tables that the workspace should read + * @return the next update stage + */ + Update withTables(List tables); + } + + /** + * The stage of the storageinsight update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags Resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightConfigs.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightConfigs.java new file mode 100644 index 000000000000..91bf2afbc8b8 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightConfigs.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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.StorageInsightConfigsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing StorageInsightConfigs. + */ +public interface StorageInsightConfigs extends SupportsCreating, HasInner { + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String workspaceName, String storageInsightName); + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName); + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String workspaceName, String storageInsightName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightState.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightState.java new file mode 100644 index 000000000000..6d9c00789165 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightState.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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for StorageInsightState. + */ +public final class StorageInsightState extends ExpandableStringEnum { + /** Static value OK for StorageInsightState. */ + public static final StorageInsightState OK = fromString("OK"); + + /** Static value ERROR for StorageInsightState. */ + public static final StorageInsightState ERROR = fromString("ERROR"); + + /** + * Creates or finds a StorageInsightState from its string representation. + * @param name a name to look for + * @return the corresponding StorageInsightState + */ + @JsonCreator + public static StorageInsightState fromString(String name) { + return fromString(name, StorageInsightState.class); + } + + /** + * @return known StorageInsightState values + */ + public static Collection values() { + return values(StorageInsightState.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightStatus.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightStatus.java new file mode 100644 index 000000000000..041b5bb9cdd2 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/StorageInsightStatus.java @@ -0,0 +1,70 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The status of the storage insight. + */ +public class StorageInsightStatus { + /** + * The state of the storage insight connection to the workspace. Possible + * values include: 'OK', 'ERROR'. + */ + @JsonProperty(value = "state", required = true) + private StorageInsightState state; + + /** + * Description of the state of the storage insight. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the state of the storage insight connection to the workspace. Possible values include: 'OK', 'ERROR'. + * + * @return the state value + */ + public StorageInsightState state() { + return this.state; + } + + /** + * Set the state of the storage insight connection to the workspace. Possible values include: 'OK', 'ERROR'. + * + * @param state the state value to set + * @return the StorageInsightStatus object itself. + */ + public StorageInsightStatus withState(StorageInsightState state) { + this.state = state; + return this; + } + + /** + * Get description of the state of the storage insight. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the state of the storage insight. + * + * @param description the description value to set + * @return the StorageInsightStatus object itself. + */ + public StorageInsightStatus withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Table.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Table.java new file mode 100644 index 000000000000..b12869d76566 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Table.java @@ -0,0 +1,67 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.TableInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; + +/** + * Type representing Table. + */ +public interface Table extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the retentionInDays value. + */ + Integer retentionInDays(); + + /** + * @return the type value. + */ + String type(); + + /** + * The template for a Table update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable
, UpdateStages.WithRetentionInDays { + } + + /** + * Grouping of Table update stages. + */ + interface UpdateStages { + /** + * The stage of the table update allowing to specify RetentionInDays. + */ + interface WithRetentionInDays { + /** + * Specifies retentionInDays. + * @param retentionInDays The data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention + * @return the next update stage + */ + Update withRetentionInDays(Integer retentionInDays); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Tables.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Tables.java new file mode 100644 index 000000000000..5ff1cd051b6d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Tables.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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.TablesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tables. + */ +public interface Tables extends HasInner { + /** + * Gets a Log Analytics workspace table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable
getAsync(String resourceGroupName, String workspaceName, String tableName); + + /** + * Gets all the tables for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable
listByWorkspaceAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Tag.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Tag.java new file mode 100644 index 000000000000..73f5d1e34921 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Tag.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A tag of a saved search. + */ +public class Tag { + /** + * The tag name. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The tag value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Get the tag name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the tag name. + * + * @param name the name value to set + * @return the Tag object itself. + */ + public Tag withName(String name) { + this.name = name; + return this; + } + + /** + * Get the tag value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the tag value. + * + * @param value the value value to set + * @return the Tag object itself. + */ + public Tag withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Type.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Type.java new file mode 100644 index 000000000000..5def6af3c038 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Type.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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Type. + */ +public final class Type extends ExpandableStringEnum { + /** Static value StorageAccount for Type. */ + public static final Type STORAGE_ACCOUNT = fromString("StorageAccount"); + + /** Static value EventHub for Type. */ + public static final Type EVENT_HUB = fromString("EventHub"); + + /** + * Creates or finds a Type from its string representation. + * @param name a name to look for + * @return the corresponding Type + */ + @JsonCreator + public static Type fromString(String name) { + return fromString(name, Type.class); + } + + /** + * @return known Type values + */ + public static Collection values() { + return values(Type.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/UsageMetric.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/UsageMetric.java new file mode 100644 index 000000000000..379852b65e17 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/UsageMetric.java @@ -0,0 +1,51 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.UsageMetricInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import org.joda.time.DateTime; + +/** + * Type representing UsageMetric. + */ +public interface UsageMetric extends HasInner, HasManager { + /** + * @return the currentValue value. + */ + Double currentValue(); + + /** + * @return the limit value. + */ + Double limit(); + + /** + * @return the name value. + */ + MetricName name(); + + /** + * @return the nextResetTime value. + */ + DateTime nextResetTime(); + + /** + * @return the quotaPeriod value. + */ + String quotaPeriod(); + + /** + * @return the unit value. + */ + String unit(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Usages.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Usages.java new file mode 100644 index 000000000000..e07f9b67c073 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Usages.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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.UsagesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Usages. + */ +public interface Usages extends HasInner { + /** + * Gets a list of usage metrics for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String workspaceName); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Workspace.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Workspace.java new file mode 100644 index 000000000000..0fe08f78a790 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Workspace.java @@ -0,0 +1,270 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +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.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.WorkspaceInner; + +/** + * Type representing Workspace. + */ +public interface Workspace extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the customerId value. + */ + String customerId(); + + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the privateLinkScopedResources value. + */ + List privateLinkScopedResources(); + + /** + * @return the provisioningState value. + */ + WorkspaceEntityStatus provisioningState(); + + /** + * @return the publicNetworkAccessForIngestion value. + */ + PublicNetworkAccessType publicNetworkAccessForIngestion(); + + /** + * @return the publicNetworkAccessForQuery value. + */ + PublicNetworkAccessType publicNetworkAccessForQuery(); + + /** + * @return the retentionInDays value. + */ + Integer retentionInDays(); + + /** + * @return the sku value. + */ + WorkspaceSku sku(); + + /** + * @return the workspaceCapping value. + */ + WorkspaceCapping workspaceCapping(); + + /** + * The entirety of the Workspace definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate { + } + + /** + * Grouping of Workspace definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Workspace definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Workspace definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the workspace definition allowing to specify ETag. + */ + interface WithETag { + /** + * Specifies eTag. + * @param eTag The ETag of the workspace + * @return the next definition stage + */ + WithCreate withETag(String eTag); + } + + /** + * The stage of the workspace definition allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + * @return the next definition stage + */ + WithCreate withProvisioningState(WorkspaceEntityStatus provisioningState); + } + + /** + * The stage of the workspace definition allowing to specify PublicNetworkAccessForIngestion. + */ + interface WithPublicNetworkAccessForIngestion { + /** + * Specifies publicNetworkAccessForIngestion. + * @param publicNetworkAccessForIngestion The network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withPublicNetworkAccessForIngestion(PublicNetworkAccessType publicNetworkAccessForIngestion); + } + + /** + * The stage of the workspace definition allowing to specify PublicNetworkAccessForQuery. + */ + interface WithPublicNetworkAccessForQuery { + /** + * Specifies publicNetworkAccessForQuery. + * @param publicNetworkAccessForQuery The network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' + * @return the next definition stage + */ + WithCreate withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery); + } + + /** + * The stage of the workspace definition allowing to specify RetentionInDays. + */ + interface WithRetentionInDays { + /** + * Specifies retentionInDays. + * @param retentionInDays The workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus + * @return the next definition stage + */ + WithCreate withRetentionInDays(Integer retentionInDays); + } + + /** + * The stage of the workspace definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the workspace + * @return the next definition stage + */ + WithCreate withSku(WorkspaceSku sku); + } + + /** + * The stage of the workspace definition allowing to specify WorkspaceCapping. + */ + interface WithWorkspaceCapping { + /** + * Specifies workspaceCapping. + * @param workspaceCapping The daily volume cap for ingestion + * @return the next definition stage + */ + WithCreate withWorkspaceCapping(WorkspaceCapping workspaceCapping); + } + + /** + * 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.WithETag, DefinitionStages.WithProvisioningState, DefinitionStages.WithPublicNetworkAccessForIngestion, DefinitionStages.WithPublicNetworkAccessForQuery, DefinitionStages.WithRetentionInDays, DefinitionStages.WithSku, DefinitionStages.WithWorkspaceCapping { + } + } + /** + * The template for a Workspace update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithProvisioningState, UpdateStages.WithPublicNetworkAccessForIngestion, UpdateStages.WithPublicNetworkAccessForQuery, UpdateStages.WithRetentionInDays, UpdateStages.WithSku, UpdateStages.WithWorkspaceCapping { + } + + /** + * Grouping of Workspace update stages. + */ + interface UpdateStages { + /** + * The stage of the workspace update allowing to specify ProvisioningState. + */ + interface WithProvisioningState { + /** + * Specifies provisioningState. + * @param provisioningState The provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + * @return the next update stage + */ + Update withProvisioningState(WorkspaceEntityStatus provisioningState); + } + + /** + * The stage of the workspace update allowing to specify PublicNetworkAccessForIngestion. + */ + interface WithPublicNetworkAccessForIngestion { + /** + * Specifies publicNetworkAccessForIngestion. + * @param publicNetworkAccessForIngestion The network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withPublicNetworkAccessForIngestion(PublicNetworkAccessType publicNetworkAccessForIngestion); + } + + /** + * The stage of the workspace update allowing to specify PublicNetworkAccessForQuery. + */ + interface WithPublicNetworkAccessForQuery { + /** + * Specifies publicNetworkAccessForQuery. + * @param publicNetworkAccessForQuery The network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' + * @return the next update stage + */ + Update withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery); + } + + /** + * The stage of the workspace update allowing to specify RetentionInDays. + */ + interface WithRetentionInDays { + /** + * Specifies retentionInDays. + * @param retentionInDays The workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus + * @return the next update stage + */ + Update withRetentionInDays(Integer retentionInDays); + } + + /** + * The stage of the workspace update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the workspace + * @return the next update stage + */ + Update withSku(WorkspaceSku sku); + } + + /** + * The stage of the workspace update allowing to specify WorkspaceCapping. + */ + interface WithWorkspaceCapping { + /** + * Specifies workspaceCapping. + * @param workspaceCapping The daily volume cap for ingestion + * @return the next update stage + */ + Update withWorkspaceCapping(WorkspaceCapping workspaceCapping); + } + + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceCapping.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceCapping.java new file mode 100644 index 000000000000..23d0e6dc3efc --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceCapping.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The daily volume cap for ingestion. + */ +public class WorkspaceCapping { + /** + * The workspace daily quota for ingestion. -1 means unlimited. + */ + @JsonProperty(value = "dailyQuotaGb") + private Double dailyQuotaGb; + + /** + * The time when the quota will be rest. + */ + @JsonProperty(value = "quotaNextResetTime", access = JsonProperty.Access.WRITE_ONLY) + private String quotaNextResetTime; + + /** + * The status of data ingestion for this workspace. Possible values + * include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', + * 'SubscriptionSuspended', 'ApproachingQuota'. + */ + @JsonProperty(value = "dataIngestionStatus", access = JsonProperty.Access.WRITE_ONLY) + private DataIngestionStatus dataIngestionStatus; + + /** + * Get the workspace daily quota for ingestion. -1 means unlimited. + * + * @return the dailyQuotaGb value + */ + public Double dailyQuotaGb() { + return this.dailyQuotaGb; + } + + /** + * Set the workspace daily quota for ingestion. -1 means unlimited. + * + * @param dailyQuotaGb the dailyQuotaGb value to set + * @return the WorkspaceCapping object itself. + */ + public WorkspaceCapping withDailyQuotaGb(Double dailyQuotaGb) { + this.dailyQuotaGb = dailyQuotaGb; + return this; + } + + /** + * Get the time when the quota will be rest. + * + * @return the quotaNextResetTime value + */ + public String quotaNextResetTime() { + return this.quotaNextResetTime; + } + + /** + * Get the status of data ingestion for this workspace. Possible values include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', 'SubscriptionSuspended', 'ApproachingQuota'. + * + * @return the dataIngestionStatus value + */ + public DataIngestionStatus dataIngestionStatus() { + return this.dataIngestionStatus; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceEntityStatus.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceEntityStatus.java new file mode 100644 index 000000000000..41251ba2756f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceEntityStatus.java @@ -0,0 +1,56 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WorkspaceEntityStatus. + */ +public final class WorkspaceEntityStatus extends ExpandableStringEnum { + /** Static value Creating for WorkspaceEntityStatus. */ + public static final WorkspaceEntityStatus CREATING = fromString("Creating"); + + /** Static value Succeeded for WorkspaceEntityStatus. */ + public static final WorkspaceEntityStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for WorkspaceEntityStatus. */ + public static final WorkspaceEntityStatus FAILED = fromString("Failed"); + + /** Static value Canceled for WorkspaceEntityStatus. */ + public static final WorkspaceEntityStatus CANCELED = fromString("Canceled"); + + /** Static value Deleting for WorkspaceEntityStatus. */ + public static final WorkspaceEntityStatus DELETING = fromString("Deleting"); + + /** Static value ProvisioningAccount for WorkspaceEntityStatus. */ + public static final WorkspaceEntityStatus PROVISIONING_ACCOUNT = fromString("ProvisioningAccount"); + + /** Static value Updating for WorkspaceEntityStatus. */ + public static final WorkspaceEntityStatus UPDATING = fromString("Updating"); + + /** + * Creates or finds a WorkspaceEntityStatus from its string representation. + * @param name a name to look for + * @return the corresponding WorkspaceEntityStatus + */ + @JsonCreator + public static WorkspaceEntityStatus fromString(String name) { + return fromString(name, WorkspaceEntityStatus.class); + } + + /** + * @return known WorkspaceEntityStatus values + */ + public static Collection values() { + return values(WorkspaceEntityStatus.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceModel.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceModel.java new file mode 100644 index 000000000000..54e6dfb3fffb --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceModel.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.loganalytics.v2020_03_01_preview; + +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.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.WorkspaceInner; + +/** + * Type representing WorkspaceModel. + */ +public interface WorkspaceModel extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, HasManager { + /** + * @return the customerId value. + */ + String customerId(); + + /** + * @return the eTag value. + */ + String eTag(); + + /** + * @return the privateLinkScopedResources value. + */ + List privateLinkScopedResources(); + + /** + * @return the provisioningState value. + */ + WorkspaceEntityStatus provisioningState(); + + /** + * @return the publicNetworkAccessForIngestion value. + */ + PublicNetworkAccessType publicNetworkAccessForIngestion(); + + /** + * @return the publicNetworkAccessForQuery value. + */ + PublicNetworkAccessType publicNetworkAccessForQuery(); + + /** + * @return the retentionInDays value. + */ + Integer retentionInDays(); + + /** + * @return the sku value. + */ + WorkspaceSku sku(); + + /** + * @return the workspaceCapping value. + */ + WorkspaceCapping workspaceCapping(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePatch.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePatch.java new file mode 100644 index 000000000000..70d562d5f8f8 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePatch.java @@ -0,0 +1,239 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The top level Workspace resource container. + */ +@JsonFlatten +public class WorkspacePatch extends AzureEntityResource { + /** + * The provisioning state of the workspace. Possible values include: + * 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + * 'ProvisioningAccount', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState") + private WorkspaceEntityStatus provisioningState; + + /** + * This is a read-only property. Represents the ID associated with the + * workspace. + */ + @JsonProperty(value = "properties.customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; + + /** + * The SKU of the workspace. + */ + @JsonProperty(value = "properties.sku") + private WorkspaceSku sku; + + /** + * The workspace data retention in days. -1 means Unlimited retention for + * the Unlimited Sku. 730 days is the maximum allowed for all other Skus. + */ + @JsonProperty(value = "properties.retentionInDays") + private Integer retentionInDays; + + /** + * The daily volume cap for ingestion. + */ + @JsonProperty(value = "properties.workspaceCapping") + private WorkspaceCapping workspaceCapping; + + /** + * The network access type for accessing Log Analytics ingestion. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccessForIngestion") + private PublicNetworkAccessType publicNetworkAccessForIngestion; + + /** + * The network access type for accessing Log Analytics query. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccessForQuery") + private PublicNetworkAccessType publicNetworkAccessForQuery; + + /** + * List of linked private link scope resources. + */ + @JsonProperty(value = "properties.privateLinkScopedResources", access = JsonProperty.Access.WRITE_ONLY) + private List privateLinkScopedResources; + + /** + * Resource tags. Optional. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating'. + * + * @return the provisioningState value + */ + public WorkspaceEntityStatus provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating'. + * + * @param provisioningState the provisioningState value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withProvisioningState(WorkspaceEntityStatus provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get this is a read-only property. Represents the ID associated with the workspace. + * + * @return the customerId value + */ + public String customerId() { + return this.customerId; + } + + /** + * Get the SKU of the workspace. + * + * @return the sku value + */ + public WorkspaceSku sku() { + return this.sku; + } + + /** + * Set the SKU of the workspace. + * + * @param sku the sku value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withSku(WorkspaceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus. + * + * @return the retentionInDays value + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus. + * + * @param retentionInDays the retentionInDays value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + return this; + } + + /** + * Get the daily volume cap for ingestion. + * + * @return the workspaceCapping value + */ + public WorkspaceCapping workspaceCapping() { + return this.workspaceCapping; + } + + /** + * Set the daily volume cap for ingestion. + * + * @param workspaceCapping the workspaceCapping value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withWorkspaceCapping(WorkspaceCapping workspaceCapping) { + this.workspaceCapping = workspaceCapping; + return this; + } + + /** + * Get the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccessForIngestion value + */ + public PublicNetworkAccessType publicNetworkAccessForIngestion() { + return this.publicNetworkAccessForIngestion; + } + + /** + * Set the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccessForIngestion the publicNetworkAccessForIngestion value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withPublicNetworkAccessForIngestion(PublicNetworkAccessType publicNetworkAccessForIngestion) { + this.publicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + return this; + } + + /** + * Get the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccessForQuery value + */ + public PublicNetworkAccessType publicNetworkAccessForQuery() { + return this.publicNetworkAccessForQuery; + } + + /** + * Set the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccessForQuery the publicNetworkAccessForQuery value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery) { + this.publicNetworkAccessForQuery = publicNetworkAccessForQuery; + return this; + } + + /** + * Get list of linked private link scope resources. + * + * @return the privateLinkScopedResources value + */ + public List privateLinkScopedResources() { + return this.privateLinkScopedResources; + } + + /** + * Get resource tags. Optional. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. Optional. + * + * @param tags the tags value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeBody.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeBody.java new file mode 100644 index 000000000000..66baab9ec88a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeBody.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.loganalytics.v2020_03_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the body of a purge request for an App Insights Workspace. + */ +public class WorkspacePurgeBody { + /** + * Table from which to purge data. + */ + @JsonProperty(value = "table", required = true) + private String table; + + /** + * The set of columns and filters (queries) to run over them to purge the + * resulting data. + */ + @JsonProperty(value = "filters", required = true) + private List filters; + + /** + * Get table from which to purge data. + * + * @return the table value + */ + public String table() { + return this.table; + } + + /** + * Set table from which to purge data. + * + * @param table the table value to set + * @return the WorkspacePurgeBody object itself. + */ + public WorkspacePurgeBody withTable(String table) { + this.table = table; + return this; + } + + /** + * Get the set of columns and filters (queries) to run over them to purge the resulting data. + * + * @return the filters value + */ + public List filters() { + return this.filters; + } + + /** + * Set the set of columns and filters (queries) to run over them to purge the resulting data. + * + * @param filters the filters value to set + * @return the WorkspacePurgeBody object itself. + */ + public WorkspacePurgeBody withFilters(List filters) { + this.filters = filters; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeBodyFilters.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeBodyFilters.java new file mode 100644 index 000000000000..d6c086f296ab --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeBodyFilters.java @@ -0,0 +1,125 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * User-defined filters to return data which will be purged from the table. + */ +public class WorkspacePurgeBodyFilters { + /** + * The column of the table over which the given query should run. + */ + @JsonProperty(value = "column") + private String column; + + /** + * A query operator to evaluate over the provided column and value(s). + * Supported operators are ==, =~, in, in~, >, >=, <, <=, + * between, and have the same behavior as they would in a KQL query. + */ + @JsonProperty(value = "operator") + private String operator; + + /** + * the value for the operator to function over. This can be a number (e.g., + * > 100), a string (timestamp >= '2017-09-01') or array of values. + */ + @JsonProperty(value = "value") + private Object value; + + /** + * When filtering over custom dimensions, this key will be used as the name + * of the custom dimension. + */ + @JsonProperty(value = "key") + private String key; + + /** + * Get the column of the table over which the given query should run. + * + * @return the column value + */ + public String column() { + return this.column; + } + + /** + * Set the column of the table over which the given query should run. + * + * @param column the column value to set + * @return the WorkspacePurgeBodyFilters object itself. + */ + public WorkspacePurgeBodyFilters withColumn(String column) { + this.column = column; + return this; + } + + /** + * Get a query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + * + * @return the operator value + */ + public String operator() { + return this.operator; + } + + /** + * Set a query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + * + * @param operator the operator value to set + * @return the WorkspacePurgeBodyFilters object itself. + */ + public WorkspacePurgeBodyFilters withOperator(String operator) { + this.operator = operator; + return this; + } + + /** + * Get the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + * + * @return the value value + */ + public Object value() { + return this.value; + } + + /** + * Set the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + * + * @param value the value value to set + * @return the WorkspacePurgeBodyFilters object itself. + */ + public WorkspacePurgeBodyFilters withValue(Object value) { + this.value = value; + return this; + } + + /** + * Get when filtering over custom dimensions, this key will be used as the name of the custom dimension. + * + * @return the key value + */ + public String key() { + return this.key; + } + + /** + * Set when filtering over custom dimensions, this key will be used as the name of the custom dimension. + * + * @param key the key value to set + * @return the WorkspacePurgeBodyFilters object itself. + */ + public WorkspacePurgeBodyFilters withKey(String key) { + this.key = key; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgePurgeHeaders.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgePurgeHeaders.java new file mode 100644 index 000000000000..b403ed5e13f2 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgePurgeHeaders.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.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Defines headers for Purge operation. + */ +public class WorkspacePurgePurgeHeaders { + /** + * The location from which to request the operation status. + */ + @JsonProperty(value = "x-ms-status-location") + private String xMsStatusLocation; + + /** + * Get the location from which to request the operation status. + * + * @return the xMsStatusLocation value + */ + public String xMsStatusLocation() { + return this.xMsStatusLocation; + } + + /** + * Set the location from which to request the operation status. + * + * @param xMsStatusLocation the xMsStatusLocation value to set + * @return the WorkspacePurgePurgeHeaders object itself. + */ + public WorkspacePurgePurgeHeaders withXMsStatusLocation(String xMsStatusLocation) { + this.xMsStatusLocation = xMsStatusLocation; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeResponse.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeResponse.java new file mode 100644 index 000000000000..8b4106444ec8 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeResponse.java @@ -0,0 +1,25 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.WorkspacePurgeResponseInner; + +/** + * Type representing WorkspacePurgeResponse. + */ +public interface WorkspacePurgeResponse extends HasInner, HasManager { + /** + * @return the operationId value. + */ + String operationId(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeStatusResponse.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeStatusResponse.java new file mode 100644 index 000000000000..3bba6fd728c6 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurgeStatusResponse.java @@ -0,0 +1,25 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.WorkspacePurgeStatusResponseInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.LogAnalyticsManager; + +/** + * Type representing WorkspacePurgeStatusResponse. + */ +public interface WorkspacePurgeStatusResponse extends HasInner, HasManager { + /** + * @return the status value. + */ + PurgeState status(); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurges.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurges.java new file mode 100644 index 000000000000..a5907effcc93 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspacePurges.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.loganalytics.v2020_03_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation.WorkspacePurgesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing WorkspacePurges. + */ +public interface WorkspacePurges extends HasInner { + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName, String purgeId); + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body); + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceSku.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceSku.java new file mode 100644 index 000000000000..c50390203a08 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceSku.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU (tier) of a workspace. + */ +public class WorkspaceSku { + /** + * The name of the SKU. Possible values include: 'Free', 'Standard', + * 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation'. + */ + @JsonProperty(value = "name", required = true) + private WorkspaceSkuNameEnum name; + + /** + * The capacity reservation level for this workspace, when + * CapacityReservation sku is selected. + */ + @JsonProperty(value = "capacityReservationLevel") + private Integer capacityReservationLevel; + + /** + * The maximum capacity reservation level available for this workspace, + * when CapacityReservation sku is selected. + */ + @JsonProperty(value = "maxCapacityReservationLevel", access = JsonProperty.Access.WRITE_ONLY) + private Integer maxCapacityReservationLevel; + + /** + * The last time when the sku was updated. + */ + @JsonProperty(value = "lastSkuUpdate", access = JsonProperty.Access.WRITE_ONLY) + private String lastSkuUpdate; + + /** + * Get the name of the SKU. Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation'. + * + * @return the name value + */ + public WorkspaceSkuNameEnum name() { + return this.name; + } + + /** + * Set the name of the SKU. Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation'. + * + * @param name the name value to set + * @return the WorkspaceSku object itself. + */ + public WorkspaceSku withName(WorkspaceSkuNameEnum name) { + this.name = name; + return this; + } + + /** + * Get the capacity reservation level for this workspace, when CapacityReservation sku is selected. + * + * @return the capacityReservationLevel value + */ + public Integer capacityReservationLevel() { + return this.capacityReservationLevel; + } + + /** + * Set the capacity reservation level for this workspace, when CapacityReservation sku is selected. + * + * @param capacityReservationLevel the capacityReservationLevel value to set + * @return the WorkspaceSku object itself. + */ + public WorkspaceSku withCapacityReservationLevel(Integer capacityReservationLevel) { + this.capacityReservationLevel = capacityReservationLevel; + return this; + } + + /** + * Get the maximum capacity reservation level available for this workspace, when CapacityReservation sku is selected. + * + * @return the maxCapacityReservationLevel value + */ + public Integer maxCapacityReservationLevel() { + return this.maxCapacityReservationLevel; + } + + /** + * Get the last time when the sku was updated. + * + * @return the lastSkuUpdate value + */ + public String lastSkuUpdate() { + return this.lastSkuUpdate; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceSkuNameEnum.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceSkuNameEnum.java new file mode 100644 index 000000000000..a65a47df5549 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/WorkspaceSkuNameEnum.java @@ -0,0 +1,56 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WorkspaceSkuNameEnum. + */ +public final class WorkspaceSkuNameEnum extends ExpandableStringEnum { + /** Static value Free for WorkspaceSkuNameEnum. */ + public static final WorkspaceSkuNameEnum FREE = fromString("Free"); + + /** Static value Standard for WorkspaceSkuNameEnum. */ + public static final WorkspaceSkuNameEnum STANDARD = fromString("Standard"); + + /** Static value Premium for WorkspaceSkuNameEnum. */ + public static final WorkspaceSkuNameEnum PREMIUM = fromString("Premium"); + + /** Static value PerNode for WorkspaceSkuNameEnum. */ + public static final WorkspaceSkuNameEnum PER_NODE = fromString("PerNode"); + + /** Static value PerGB2018 for WorkspaceSkuNameEnum. */ + public static final WorkspaceSkuNameEnum PER_GB2018 = fromString("PerGB2018"); + + /** Static value Standalone for WorkspaceSkuNameEnum. */ + public static final WorkspaceSkuNameEnum STANDALONE = fromString("Standalone"); + + /** Static value CapacityReservation for WorkspaceSkuNameEnum. */ + public static final WorkspaceSkuNameEnum CAPACITY_RESERVATION = fromString("CapacityReservation"); + + /** + * Creates or finds a WorkspaceSkuNameEnum from its string representation. + * @param name a name to look for + * @return the corresponding WorkspaceSkuNameEnum + */ + @JsonCreator + public static WorkspaceSkuNameEnum fromString(String name) { + return fromString(name, WorkspaceSkuNameEnum.class); + } + + /** + * @return known WorkspaceSkuNameEnum values + */ + public static Collection values() { + return values(WorkspaceSkuNameEnum.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Workspaces.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Workspaces.java new file mode 100644 index 000000000000..b47d875f9937 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/Workspaces.java @@ -0,0 +1,25 @@ +/** + * 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.loganalytics.v2020_03_01_preview; + +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.loganalytics.v2020_03_01_preview.implementation.WorkspacesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Workspaces. + */ +public interface Workspaces extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTierImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTierImpl.java new file mode 100644 index 000000000000..a13e0e07b318 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTierImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.AvailableServiceTier; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SkuNameEnum; + +class AvailableServiceTierImpl extends WrapperImpl implements AvailableServiceTier { + private final LogAnalyticsManager manager; + + AvailableServiceTierImpl(AvailableServiceTierInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public Long capacityReservationLevel() { + return this.inner().capacityReservationLevel(); + } + + @Override + public Long defaultRetention() { + return this.inner().defaultRetention(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String lastSkuUpdate() { + return this.inner().lastSkuUpdate(); + } + + @Override + public Long maximumRetention() { + return this.inner().maximumRetention(); + } + + @Override + public Long minimumRetention() { + return this.inner().minimumRetention(); + } + + @Override + public SkuNameEnum serviceTier() { + return this.inner().serviceTier(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTierInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTierInner.java new file mode 100644 index 000000000000..3f87b43fd8e0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTierInner.java @@ -0,0 +1,127 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SkuNameEnum; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Service Tier details. + */ +public class AvailableServiceTierInner { + /** + * The name of the Service Tier. Possible values include: 'Free', + * 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', + * 'CapacityReservation'. + */ + @JsonProperty(value = "serviceTier", access = JsonProperty.Access.WRITE_ONLY) + private SkuNameEnum serviceTier; + + /** + * True if the Service Tier is enabled for the workspace. + */ + @JsonProperty(value = "enabled", access = JsonProperty.Access.WRITE_ONLY) + private Boolean enabled; + + /** + * The minimum retention for the Service Tier, in days. + */ + @JsonProperty(value = "minimumRetention", access = JsonProperty.Access.WRITE_ONLY) + private Long minimumRetention; + + /** + * The maximum retention for the Service Tier, in days. + */ + @JsonProperty(value = "maximumRetention", access = JsonProperty.Access.WRITE_ONLY) + private Long maximumRetention; + + /** + * The default retention for the Service Tier, in days. + */ + @JsonProperty(value = "defaultRetention", access = JsonProperty.Access.WRITE_ONLY) + private Long defaultRetention; + + /** + * The capacity reservation level in GB per day. Returned for the Capacity + * Reservation Service Tier. + */ + @JsonProperty(value = "capacityReservationLevel", access = JsonProperty.Access.WRITE_ONLY) + private Long capacityReservationLevel; + + /** + * Time when the sku was last updated for the workspace. Returned for the + * Capacity Reservation Service Tier. + */ + @JsonProperty(value = "lastSkuUpdate", access = JsonProperty.Access.WRITE_ONLY) + private String lastSkuUpdate; + + /** + * Get the name of the Service Tier. Possible values include: 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', 'CapacityReservation'. + * + * @return the serviceTier value + */ + public SkuNameEnum serviceTier() { + return this.serviceTier; + } + + /** + * Get true if the Service Tier is enabled for the workspace. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Get the minimum retention for the Service Tier, in days. + * + * @return the minimumRetention value + */ + public Long minimumRetention() { + return this.minimumRetention; + } + + /** + * Get the maximum retention for the Service Tier, in days. + * + * @return the maximumRetention value + */ + public Long maximumRetention() { + return this.maximumRetention; + } + + /** + * Get the default retention for the Service Tier, in days. + * + * @return the defaultRetention value + */ + public Long defaultRetention() { + return this.defaultRetention; + } + + /** + * Get the capacity reservation level in GB per day. Returned for the Capacity Reservation Service Tier. + * + * @return the capacityReservationLevel value + */ + public Long capacityReservationLevel() { + return this.capacityReservationLevel; + } + + /** + * Get time when the sku was last updated for the workspace. Returned for the Capacity Reservation Service Tier. + * + * @return the lastSkuUpdate value + */ + public String lastSkuUpdate() { + return this.lastSkuUpdate; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTiersImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTiersImpl.java new file mode 100644 index 000000000000..096d3457a9e3 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTiersImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.AvailableServiceTiers; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.AvailableServiceTier; + +class AvailableServiceTiersImpl extends WrapperImpl implements AvailableServiceTiers { + private final LogAnalyticsManager manager; + + AvailableServiceTiersImpl(LogAnalyticsManager manager) { + super(manager.inner().availableServiceTiers()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + private AvailableServiceTierImpl wrapModel(AvailableServiceTierInner inner) { + return new AvailableServiceTierImpl(inner, manager()); + } + + @Override + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + AvailableServiceTiersInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public AvailableServiceTier call(AvailableServiceTierInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTiersInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTiersInner.java new file mode 100644 index 000000000000..8e0980502d88 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/AvailableServiceTiersInner.java @@ -0,0 +1,147 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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 AvailableServiceTiers. + */ +public class AvailableServiceTiersInner { + /** The Retrofit service to perform REST calls. */ + private AvailableServiceTiersService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of AvailableServiceTiersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AvailableServiceTiersInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(AvailableServiceTiersService.class); + this.client = client; + } + + /** + * The interface defining all the services for AvailableServiceTiers to be + * used by Retrofit to perform actually REST calls. + */ + interface AvailableServiceTiersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.AvailableServiceTiers listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers") + Observable> listByWorkspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<AvailableServiceTierInner> object if successful. + */ + public List listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> listByWorkspaceAsync(String resourceGroupName, String workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AvailableServiceTierInner> object + */ + public Observable> listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the available service tiers for the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<AvailableServiceTierInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.listByWorkspace(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = listByWorkspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClusterImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClusterImpl.java new file mode 100644 index 000000000000..b17bdf930ca4 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClusterImpl.java @@ -0,0 +1,133 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Cluster; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ClusterPatch; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Identity; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ClusterSku; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ClusterEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.KeyVaultProperties; +import rx.functions.Func1; + +class ClusterImpl extends GroupableResourceCoreImpl implements Cluster, Cluster.Definition, Cluster.Update { + private ClusterPatch updateParameter; + ClusterImpl(String name, ClusterInner inner, LogAnalyticsManager manager) { + super(name, inner, manager); + this.updateParameter = new ClusterPatch(); + } + + @Override + public Observable createResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public ClusterInner call(ClusterInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ClustersInner client = this.manager().inner().clusters(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ClusterPatch(); + } + + @Override + public String clusterId() { + return this.inner().clusterId(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public KeyVaultProperties keyVaultProperties() { + return this.inner().keyVaultProperties(); + } + + @Override + public String nextLink() { + return this.inner().nextLink(); + } + + @Override + public ClusterEntityStatus provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ClusterSku sku() { + return this.inner().sku(); + } + + @Override + public ClusterImpl withIdentity(Identity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public ClusterImpl withNextLink(String nextLink) { + this.inner().withNextLink(nextLink); + return this; + } + + @Override + public ClusterImpl withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + if (isInCreateMode()) { + this.inner().withKeyVaultProperties(keyVaultProperties); + } else { + this.updateParameter.withKeyVaultProperties(keyVaultProperties); + } + return this; + } + + @Override + public ClusterImpl withSku(ClusterSku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClusterInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClusterInner.java new file mode 100644 index 000000000000..5cd3fd1ad884 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClusterInner.java @@ -0,0 +1,160 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Identity; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ClusterSku; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ClusterEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.KeyVaultProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The top level Log Analytics cluster resource container. + */ +@JsonFlatten +public class ClusterInner extends Resource { + /** + * The identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * The sku properties. + */ + @JsonProperty(value = "sku") + private ClusterSku sku; + + /** + * The link used to get the next page of recommendations. + */ + @JsonProperty(value = "properties.nextLink") + private String nextLink; + + /** + * The ID associated with the cluster. + */ + @JsonProperty(value = "properties.clusterId", access = JsonProperty.Access.WRITE_ONLY) + private String clusterId; + + /** + * The provisioning state of the cluster. Possible values include: + * 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + * 'ProvisioningAccount', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ClusterEntityStatus provisioningState; + + /** + * The associated key properties. + */ + @JsonProperty(value = "properties.keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get the identity of the resource. + * + * @return the identity value + */ + public Identity identity() { + return this.identity; + } + + /** + * Set the identity of the resource. + * + * @param identity the identity value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withIdentity(Identity identity) { + this.identity = identity; + return this; + } + + /** + * Get the sku properties. + * + * @return the sku value + */ + public ClusterSku sku() { + return this.sku; + } + + /** + * Set the sku properties. + * + * @param sku the sku value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withSku(ClusterSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the link used to get the next page of recommendations. + * + * @return the nextLink value + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the link used to get the next page of recommendations. + * + * @param nextLink the nextLink value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Get the ID associated with the cluster. + * + * @return the clusterId value + */ + public String clusterId() { + return this.clusterId; + } + + /** + * Get the provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating'. + * + * @return the provisioningState value + */ + public ClusterEntityStatus provisioningState() { + return this.provisioningState; + } + + /** + * Get the associated key properties. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set the associated key properties. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClustersImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClustersImpl.java new file mode 100644 index 000000000000..2638fb6969e3 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClustersImpl.java @@ -0,0 +1,138 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Clusters; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Cluster; +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; + +class ClustersImpl extends GroupableResourcesCoreImpl implements Clusters { + protected ClustersImpl(LogAnalyticsManager manager) { + super(manager.inner().clusters(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + ClustersInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + ClustersInner 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) { + ClustersInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + ClustersInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + ClustersInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + ClustersInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Cluster call(ClusterInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public ClusterImpl define(String name) { + return wrapModel(name); + } + + @Override + protected ClusterImpl wrapModel(ClusterInner inner) { + return new ClusterImpl(inner.name(), inner, manager()); + } + + @Override + protected ClusterImpl wrapModel(String name) { + return new ClusterImpl(name, new ClusterInner(), this.manager()); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClustersInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClustersInner.java new file mode 100644 index 000000000000..c1922190e136 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ClustersInner.java @@ -0,0 +1,1062 @@ +/** + * 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.loganalytics.v2020_03_01_preview.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.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ClusterErrorResponseException; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ClusterPatch; +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 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.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Clusters. + */ +public class ClustersInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ClustersService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of ClustersInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ClustersInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(ClustersService.class); + this.client = client; + } + + /** + * The interface defining all the services for Clusters to be + * used by Retrofit to perform actually REST calls. + */ + interface ClustersService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Clusters listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.loganalytics.v2020_03_01_preview.Clusters list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters") + 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.loganalytics.v2020_03_01_preview.Clusters createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterInner parameters, @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.loganalytics.v2020_03_01_preview.Clusters beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("clusterName") String clusterName, @Query("api-version") String apiVersion, @Body ClusterInner parameters, @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.loganalytics.v2020_03_01_preview.Clusters delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.loganalytics.v2020_03_01_preview.Clusters beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.loganalytics.v2020_03_01_preview.Clusters getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @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.loganalytics.v2020_03_01_preview.Clusters update" }) + @PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("clusterName") String clusterName, @Path("subscriptionId") String subscriptionId, @Body ClusterPatch parameters, @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.loganalytics.v2020_03_01_preview.Clusters listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @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.loganalytics.v2020_03_01_preview.Clusters listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets Log Analytics clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets Log Analytics clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets Log Analytics clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets Log Analytics clusters in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets Log Analytics clusters in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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.listByResourceGroup(resourceGroupName, 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 = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ClusterErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ClusterErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ClusterErrorResponseException.class) + .build(response); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @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(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ClusterErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ClusterErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ClusterErrorResponseException.class) + .build(response); + } + + /** + * Create or update a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Log Analytics cluster. + * @param parameters The parameters required to create or update a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().last().body(); + } + + /** + * Create or update a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Log Analytics cluster. + * @param parameters The parameters required to create or update a Log Analytics cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Create or update a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Log Analytics cluster. + * @param parameters The parameters required to create or update a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Log Analytics cluster. + * @param parameters The parameters required to create or update a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, this.client.subscriptionId(), clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Log Analytics cluster. + * @param parameters The parameters required to create or update a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Log Analytics cluster. + * @param parameters The parameters required to create or update a Log Analytics cluster. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Create or update a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Log Analytics cluster. + * @param parameters The parameters required to create or update a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Log Analytics cluster. + * @param parameters The parameters required to create or update a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, this.client.subscriptionId(), clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws ClusterErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ClusterErrorResponseException.class) + .build(response); + } + + /** + * Deletes a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException 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 clusterName) { + deleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().last().body(); + } + + /** + * Deletes a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String clusterName) { + return deleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, clusterName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException 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 clusterName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Deletes a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Deletes a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String clusterName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, clusterName, this.client.subscriptionId(), 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 ClusterErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ClusterErrorResponseException.class) + .build(response); + } + + /** + * Gets a Log Analytics cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body(); + } + + /** + * Gets a Log Analytics cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @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 clusterName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName), serviceCallback); + } + + /** + * Gets a Log Analytics cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, clusterName).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Log Analytics cluster instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName 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, clusterName, 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 ClusterErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ClusterErrorResponseException.class) + .build(response); + } + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ClusterInner object if successful. + */ + public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).toBlocking().single().body(); + } + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 clusterName, ClusterPatch parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters), serviceCallback); + } + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable updateAsync(String resourceGroupName, String clusterName, ClusterPatch parameters) { + return updateWithServiceResponseAsync(resourceGroupName, clusterName, parameters).map(new Func1, ClusterInner>() { + @Override + public ClusterInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Log Analytics cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Name of the Log Analytics Cluster. + * @param parameters The parameters required to patch a Log Analytics cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ClusterInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterPatch parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (clusterName == null) { + throw new IllegalArgumentException("Parameter clusterName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.update(resourceGroupName, clusterName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), 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 ClusterErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ClusterErrorResponseException.class) + .build(response); + } + + /** + * Gets Log Analytics clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets Log Analytics clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets Log Analytics clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets Log Analytics clusters in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets Log Analytics clusters in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws ClusterErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ClusterErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ClusterErrorResponseException.class) + .build(response); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ClusterErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ClusterInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ClusterInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ClusterInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ClusterErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ClusterErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ClusterErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportImpl.java new file mode 100644 index 000000000000..3e1ff39a1f76 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportImpl.java @@ -0,0 +1,189 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataExport; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Type; + +class DataExportImpl extends CreatableUpdatableImpl implements DataExport, DataExport.Definition, DataExport.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String dataExportName; + + DataExportImpl(String name, LogAnalyticsManager manager) { + super(name, new DataExportInner()); + this.manager = manager; + // Set resource name + this.dataExportName = name; + // + } + + DataExportImpl(DataExportInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.dataExportName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.dataExportName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataExports"); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DataExportsInner client = this.manager().inner().dataExports(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.dataExportName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DataExportsInner client = this.manager().inner().dataExports(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.dataExportName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DataExportsInner client = this.manager().inner().dataExports(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.dataExportName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Boolean allTables() { + return this.inner().allTables(); + } + + @Override + public String createdDate() { + return this.inner().createdDate(); + } + + @Override + public String dataExportId() { + return this.inner().dataExportId(); + } + + @Override + public Type dataExportType() { + return this.inner().dataExportType(); + } + + @Override + public Boolean enable() { + return this.inner().enable(); + } + + @Override + public String eventHubName() { + return this.inner().eventHubName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String lastModifiedDate() { + return this.inner().lastModifiedDate(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String resourceId() { + return this.inner().resourceId(); + } + + @Override + public List tableNames() { + return this.inner().tableNames(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DataExportImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public DataExportImpl withResourceId(String resourceId) { + this.inner().withResourceId(resourceId); + return this; + } + + @Override + public DataExportImpl withAllTables(Boolean allTables) { + this.inner().withAllTables(allTables); + return this; + } + + @Override + public DataExportImpl withCreatedDate(String createdDate) { + this.inner().withCreatedDate(createdDate); + return this; + } + + @Override + public DataExportImpl withDataExportId(String dataExportId) { + this.inner().withDataExportId(dataExportId); + return this; + } + + @Override + public DataExportImpl withEnable(Boolean enable) { + this.inner().withEnable(enable); + return this; + } + + @Override + public DataExportImpl withEventHubName(String eventHubName) { + this.inner().withEventHubName(eventHubName); + return this; + } + + @Override + public DataExportImpl withLastModifiedDate(String lastModifiedDate) { + this.inner().withLastModifiedDate(lastModifiedDate); + return this; + } + + @Override + public DataExportImpl withTableNames(List tableNames) { + this.inner().withTableNames(tableNames); + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportInner.java new file mode 100644 index 000000000000..c927ba6efaca --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportInner.java @@ -0,0 +1,248 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Type; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The top level data export resource container. + */ +@JsonFlatten +public class DataExportInner extends ProxyResource { + /** + * The data export rule ID. + */ + @JsonProperty(value = "properties.dataExportId") + private String dataExportId; + + /** + * When ‘true’, all workspace's tables are exported. + */ + @JsonProperty(value = "properties.allTables") + private Boolean allTables; + + /** + * An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + */ + @JsonProperty(value = "properties.tableNames") + private List tableNames; + + /** + * The destination resource ID. This can be copied from the Properties + * entry of the destination resource in Azure. + */ + @JsonProperty(value = "properties.destination.resourceId", required = true) + private String resourceId; + + /** + * The type of the destination resource. Possible values include: + * 'StorageAccount', 'EventHub'. + */ + @JsonProperty(value = "properties.destination.type", access = JsonProperty.Access.WRITE_ONLY) + private Type dataExportType; + + /** + * Optional. Allows to define an Event Hub name. Not applicable when + * destination is Storage Account. + */ + @JsonProperty(value = "properties.destination.metaData.eventHubName") + private String eventHubName; + + /** + * Active when enabled. + */ + @JsonProperty(value = "properties.enable") + private Boolean enable; + + /** + * The latest data export rule modification time. + */ + @JsonProperty(value = "properties.createdDate") + private String createdDate; + + /** + * Date and time when the export was last modified. + */ + @JsonProperty(value = "properties.lastModifiedDate") + private String lastModifiedDate; + + /** + * Get the data export rule ID. + * + * @return the dataExportId value + */ + public String dataExportId() { + return this.dataExportId; + } + + /** + * Set the data export rule ID. + * + * @param dataExportId the dataExportId value to set + * @return the DataExportInner object itself. + */ + public DataExportInner withDataExportId(String dataExportId) { + this.dataExportId = dataExportId; + return this; + } + + /** + * Get when ‘true’, all workspace's tables are exported. + * + * @return the allTables value + */ + public Boolean allTables() { + return this.allTables; + } + + /** + * Set when ‘true’, all workspace's tables are exported. + * + * @param allTables the allTables value to set + * @return the DataExportInner object itself. + */ + public DataExportInner withAllTables(Boolean allTables) { + this.allTables = allTables; + return this; + } + + /** + * Get an array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + * + * @return the tableNames value + */ + public List tableNames() { + return this.tableNames; + } + + /** + * Set an array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + * + * @param tableNames the tableNames value to set + * @return the DataExportInner object itself. + */ + public DataExportInner withTableNames(List tableNames) { + this.tableNames = tableNames; + return this; + } + + /** + * Get the destination resource ID. This can be copied from the Properties entry of the destination resource in Azure. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the destination resource ID. This can be copied from the Properties entry of the destination resource in Azure. + * + * @param resourceId the resourceId value to set + * @return the DataExportInner object itself. + */ + public DataExportInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the type of the destination resource. Possible values include: 'StorageAccount', 'EventHub'. + * + * @return the dataExportType value + */ + public Type dataExportType() { + return this.dataExportType; + } + + /** + * Get optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account. + * + * @return the eventHubName value + */ + public String eventHubName() { + return this.eventHubName; + } + + /** + * Set optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account. + * + * @param eventHubName the eventHubName value to set + * @return the DataExportInner object itself. + */ + public DataExportInner withEventHubName(String eventHubName) { + this.eventHubName = eventHubName; + return this; + } + + /** + * Get active when enabled. + * + * @return the enable value + */ + public Boolean enable() { + return this.enable; + } + + /** + * Set active when enabled. + * + * @param enable the enable value to set + * @return the DataExportInner object itself. + */ + public DataExportInner withEnable(Boolean enable) { + this.enable = enable; + return this; + } + + /** + * Get the latest data export rule modification time. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Set the latest data export rule modification time. + * + * @param createdDate the createdDate value to set + * @return the DataExportInner object itself. + */ + public DataExportInner withCreatedDate(String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get date and time when the export was last modified. + * + * @return the lastModifiedDate value + */ + public String lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Set date and time when the export was last modified. + * + * @param lastModifiedDate the lastModifiedDate value to set + * @return the DataExportInner object itself. + */ + public DataExportInner withLastModifiedDate(String lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportsImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportsImpl.java new file mode 100644 index 000000000000..cd55f6480c65 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataExports; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataExport; + +class DataExportsImpl extends WrapperImpl implements DataExports { + private final LogAnalyticsManager manager; + + DataExportsImpl(LogAnalyticsManager manager) { + super(manager.inner().dataExports()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public DataExportImpl define(String name) { + return wrapModel(name); + } + + private DataExportImpl wrapModel(DataExportInner inner) { + return new DataExportImpl(inner, manager()); + } + + private DataExportImpl wrapModel(String name) { + return new DataExportImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + DataExportsInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public DataExport call(DataExportInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String dataExportName) { + DataExportsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, dataExportName) + .flatMap(new Func1>() { + @Override + public Observable call(DataExportInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DataExport)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String dataExportName) { + DataExportsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, dataExportName).toCompletable(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportsInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportsInner.java new file mode 100644 index 000000000000..b4aff8bcd3be --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataExportsInner.java @@ -0,0 +1,456 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataExportErrorResponseException; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 DataExports. + */ +public class DataExportsInner { + /** The Retrofit service to perform REST calls. */ + private DataExportsService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of DataExportsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataExportsInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(DataExportsService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataExports to be + * used by Retrofit to perform actually REST calls. + */ + interface DataExportsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataExports listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports") + Observable> listByWorkspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2020_03_01_preview.DataExports createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataExportName") String dataExportName, @Query("api-version") String apiVersion, @Body DataExportInner parameters, @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.loganalytics.v2020_03_01_preview.DataExports get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataExportName") String dataExportName, @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.loganalytics.v2020_03_01_preview.DataExports delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataExportName") String dataExportName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists the data export instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DataExportErrorResponseException 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<DataExportInner> object if successful. + */ + public List listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Lists the data export instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> listByWorkspaceAsync(String resourceGroupName, String workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Lists the data export instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DataExportInner> object + */ + public Observable> listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the data export instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<DataExportInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.listByWorkspace(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceDelegate(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> listByWorkspaceDelegate(Response response) throws DataExportErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., DataExportErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(DataExportErrorResponseException.class) + .build(response); + } + + /** + * Create or update a data export. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @param parameters The parameters required to create or update a data export. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DataExportErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataExportInner object if successful. + */ + public DataExportInner createOrUpdate(String resourceGroupName, String workspaceName, String dataExportName, DataExportInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a data export. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @param parameters The parameters required to create or update a data export. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String dataExportName, DataExportInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName, parameters), serviceCallback); + } + + /** + * Create or update a data export. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @param parameters The parameters required to create or update a data export. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataExportInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String dataExportName, DataExportInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName, parameters).map(new Func1, DataExportInner>() { + @Override + public DataExportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a data export. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @param parameters The parameters required to create or update a data export. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataExportInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String dataExportName, DataExportInner parameters) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataExportName == null) { + throw new IllegalArgumentException("Parameter dataExportName 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, dataExportName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws DataExportErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(DataExportErrorResponseException.class) + .build(response); + } + + /** + * Gets a data export instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DataExportErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataExportInner object if successful. + */ + public DataExportInner get(String resourceGroupName, String workspaceName, String dataExportName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName).toBlocking().single().body(); + } + + /** + * Gets a data export instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String dataExportName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName), serviceCallback); + } + + /** + * Gets a data export instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataExportInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String dataExportName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName).map(new Func1, DataExportInner>() { + @Override + public DataExportInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a data export instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataExportInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String dataExportName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataExportName == null) { + throw new IllegalArgumentException("Parameter dataExportName 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.get(this.client.subscriptionId(), resourceGroupName, workspaceName, dataExportName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws DataExportErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(DataExportErrorResponseException.class) + .build(response); + } + + /** + * Deletes the specified data export in a given workspace.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws DataExportErrorResponseException 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 workspaceName, String dataExportName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName).toBlocking().single().body(); + } + + /** + * Deletes the specified data export in a given workspace.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule 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 workspaceName, String dataExportName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName), serviceCallback); + } + + /** + * Deletes the specified data export in a given workspace.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String dataExportName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataExportName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified data export in a given workspace.. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataExportName The data export rule name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String dataExportName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataExportName == null) { + throw new IllegalArgumentException("Parameter dataExportName 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.delete(this.client.subscriptionId(), resourceGroupName, workspaceName, dataExportName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws DataExportErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(404, new TypeToken() { }.getType()) + .registerError(DataExportErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourceImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourceImpl.java new file mode 100644 index 000000000000..0ff8899ca4f2 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourceImpl.java @@ -0,0 +1,140 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSourceKind; +import java.util.Map; + +class DataSourceImpl extends CreatableUpdatableImpl implements DataSource, DataSource.Definition, DataSource.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String dataSourceName; + + DataSourceImpl(String name, LogAnalyticsManager manager) { + super(name, new DataSourceInner()); + this.manager = manager; + // Set resource name + this.dataSourceName = name; + // + } + + DataSourceImpl(DataSourceInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.dataSourceName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.dataSourceName = IdParsingUtils.getValueFromIdByName(inner.id(), "dataSources"); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + DataSourcesInner client = this.manager().inner().dataSources(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.dataSourceName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + DataSourcesInner client = this.manager().inner().dataSources(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.dataSourceName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + DataSourcesInner client = this.manager().inner().dataSources(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.dataSourceName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public DataSourceKind kind() { + return this.inner().kind(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Object properties() { + return this.inner().properties(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public DataSourceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public DataSourceImpl withKind(DataSourceKind kind) { + this.inner().withKind(kind); + return this; + } + + @Override + public DataSourceImpl withProperties(Object properties) { + this.inner().withProperties(properties); + return this; + } + + @Override + public DataSourceImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public DataSourceImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourceInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourceInner.java new file mode 100644 index 000000000000..c826a431a0ba --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourceInner.java @@ -0,0 +1,139 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSourceKind; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Datasources under OMS Workspace. + */ +public class DataSourceInner extends ProxyResource { + /** + * The data source properties in raw json format, each kind of data source + * have it's own schema. + */ + @JsonProperty(value = "properties", required = true) + private Object properties; + + /** + * The ETag of the data source. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', + * 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', + * 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', + * 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', + * 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', + * 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', + * 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', + * 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', + * 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', + * 'SecurityWindowsBaselineConfiguration', + * 'SecurityCenterSecurityWindowsBaselineConfiguration', + * 'SecurityEventCollectionConfiguration', + * 'SecurityInsightsSecurityEventCollectionConfiguration', + * 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', + * 'ApplicationInsights', 'SqlDataClassification'. + */ + @JsonProperty(value = "kind", required = true) + private DataSourceKind kind; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the data source properties in raw json format, each kind of data source have it's own schema. + * + * @return the properties value + */ + public Object properties() { + return this.properties; + } + + /** + * Set the data source properties in raw json format, each kind of data source have it's own schema. + * + * @param properties the properties value to set + * @return the DataSourceInner object itself. + */ + public DataSourceInner withProperties(Object properties) { + this.properties = properties; + return this; + } + + /** + * Get the ETag of the data source. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag of the data source. + * + * @param etag the etag value to set + * @return the DataSourceInner object itself. + */ + public DataSourceInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification'. + * + * @return the kind value + */ + public DataSourceKind kind() { + return this.kind; + } + + /** + * Set possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', 'ApplicationInsights', 'SqlDataClassification'. + * + * @param kind the kind value to set + * @return the DataSourceInner object itself. + */ + public DataSourceInner withKind(DataSourceKind kind) { + this.kind = kind; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the DataSourceInner object itself. + */ + public DataSourceInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourcesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourcesImpl.java new file mode 100644 index 000000000000..545e6d449818 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourcesImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSources; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSource; + +class DataSourcesImpl extends WrapperImpl implements DataSources { + private final LogAnalyticsManager manager; + + DataSourcesImpl(LogAnalyticsManager manager) { + super(manager.inner().dataSources()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public DataSourceImpl define(String name) { + return wrapModel(name); + } + + private DataSourceImpl wrapModel(DataSourceInner inner) { + return new DataSourceImpl(inner, manager()); + } + + private DataSourceImpl wrapModel(String name) { + return new DataSourceImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final String filter) { + DataSourcesInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName, filter) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public DataSource call(DataSourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String dataSourceName) { + DataSourcesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, dataSourceName) + .flatMap(new Func1>() { + @Override + public Observable call(DataSourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((DataSource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String dataSourceName) { + DataSourcesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, dataSourceName).toCompletable(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourcesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourcesInner.java new file mode 100644 index 000000000000..8703a5d3e027 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DataSourcesInner.java @@ -0,0 +1,746 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in DataSources. + */ +public class DataSourcesInner { + /** The Retrofit service to perform REST calls. */ + private DataSourcesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of DataSourcesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DataSourcesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(DataSourcesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DataSources to be + * used by Retrofit to perform actually REST calls. + */ + interface DataSourcesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSources createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataSourceName") String dataSourceName, @Path("subscriptionId") String subscriptionId, @Body DataSourceInner parameters, @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.loganalytics.v2020_03_01_preview.DataSources delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataSourceName") String dataSourceName, @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.loganalytics.v2020_03_01_preview.DataSources get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataSourceName") String dataSourceName, @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.loganalytics.v2020_03_01_preview.DataSources listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources") + Observable> listByWorkspace(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("$filter") String filter, @Query("$skiptoken") String skiptoken, @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.loganalytics.v2020_03_01_preview.DataSources listByWorkspaceNext" }) + @GET + Observable> listByWorkspaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a data source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName The name of the datasource resource. + * @param parameters The parameters required to create or update a datasource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataSourceInner object if successful. + */ + public DataSourceInner createOrUpdate(String resourceGroupName, String workspaceName, String dataSourceName, DataSourceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a data source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName The name of the datasource resource. + * @param parameters The parameters required to create or update a datasource. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String dataSourceName, DataSourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName, parameters), serviceCallback); + } + + /** + * Create or update a data source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName The name of the datasource resource. + * @param parameters The parameters required to create or update a datasource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataSourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String dataSourceName, DataSourceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName, parameters).map(new Func1, DataSourceInner>() { + @Override + public DataSourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a data source. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName The name of the datasource resource. + * @param parameters The parameters required to create or update a datasource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataSourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String dataSourceName, DataSourceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataSourceName == null) { + throw new IllegalArgumentException("Parameter dataSourceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdate(resourceGroupName, workspaceName, dataSourceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a data source instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName, String dataSourceName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName).toBlocking().single().body(); + } + + /** + * Deletes a data source instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource. + * @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 workspaceName, String dataSourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName), serviceCallback); + } + + /** + * Deletes a data source instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String dataSourceName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a data source instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String dataSourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataSourceName == null) { + throw new IllegalArgumentException("Parameter dataSourceName is required and cannot be null."); + } + 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.delete(resourceGroupName, workspaceName, dataSourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a datasource instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the DataSourceInner object if successful. + */ + public DataSourceInner get(String resourceGroupName, String workspaceName, String dataSourceName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName).toBlocking().single().body(); + } + + /** + * Gets a datasource instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String dataSourceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName), serviceCallback); + } + + /** + * Gets a datasource instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataSourceInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String dataSourceName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceName).map(new Func1, DataSourceInner>() { + @Override + public DataSourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a datasource instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceName Name of the datasource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the DataSourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String dataSourceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataSourceName == null) { + throw new IllegalArgumentException("Parameter dataSourceName is required and cannot be null."); + } + 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.get(resourceGroupName, workspaceName, dataSourceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataSourceInner> object if successful. + */ + public PagedList listByWorkspace(final String resourceGroupName, final String workspaceName, final String filter) { + ServiceResponse> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @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> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataSourceInner> object + */ + public Observable> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final String filter) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataSourceInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String filter) { + return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataSourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName, final String filter) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (filter == null) { + throw new IllegalArgumentException("Parameter filter 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 String skiptoken = null; + return service.listByWorkspace(resourceGroupName, workspaceName, this.client.subscriptionId(), filter, skiptoken, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @param skiptoken Starting point of the collection of data source instances. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataSourceInner> object if successful. + */ + public PagedList listByWorkspace(final String resourceGroupName, final String workspaceName, final String filter, final String skiptoken) { + ServiceResponse> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @param skiptoken Starting point of the collection of data source instances. + * @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> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final String filter, final String skiptoken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @param skiptoken Starting point of the collection of data source instances. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataSourceInner> object + */ + public Observable> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final String filter, final String skiptoken) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName, filter, skiptoken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param filter The filter to apply on the operation. + * @param skiptoken Starting point of the collection of data source instances. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataSourceInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final String filter, final String skiptoken) { + return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param workspaceName The name of the workspace. + ServiceResponse> * @param filter The filter to apply on the operation. + ServiceResponse> * @param skiptoken Starting point of the collection of data source instances. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataSourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName, final String filter, final String skiptoken) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (filter == null) { + throw new IllegalArgumentException("Parameter filter 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.listByWorkspace(resourceGroupName, workspaceName, this.client.subscriptionId(), filter, skiptoken, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<DataSourceInner> object if successful. + */ + public PagedList listByWorkspaceNext(final String nextPageLink) { + ServiceResponse> response = listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByWorkspaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataSourceInner> object + */ + public Observable> listByWorkspaceNextAsync(final String nextPageLink) { + return listByWorkspaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<DataSourceInner> object + */ + public Observable>> listByWorkspaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets the first page of data source instances in a workspace with the link to the next page. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<DataSourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByWorkspaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DeletedWorkspacesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DeletedWorkspacesImpl.java new file mode 100644 index 000000000000..698cb74c8652 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DeletedWorkspacesImpl.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. + * def + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DeletedWorkspaces; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceModel; +import rx.Observable; +import rx.Completable; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; + +class DeletedWorkspacesImpl extends GroupableResourcesCoreImpl implements DeletedWorkspaces { + protected DeletedWorkspacesImpl(LogAnalyticsManager manager) { + super(manager.inner().deletedWorkspaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + return null; // NOP Retrieve by resource group not supported + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + DeletedWorkspacesInner client = this.inner(); + return Completable.error(new Throwable("Delete by RG not supported for this resource")); // NOP Delete by RG not supported + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + DeletedWorkspacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + DeletedWorkspacesInner 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 WorkspaceModel call(WorkspaceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + DeletedWorkspacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + DeletedWorkspacesInner 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 WorkspaceModel call(WorkspaceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + protected WorkspaceModelImpl wrapModel(WorkspaceInner inner) { + return new WorkspaceModelImpl(inner.name(), inner, manager()); + } + + @Override + protected WorkspaceModelImpl wrapModel(String name) { + return null; // Model is not creatable + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DeletedWorkspacesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DeletedWorkspacesInner.java new file mode 100644 index 000000000000..5e97bcd78750 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/DeletedWorkspacesInner.java @@ -0,0 +1,237 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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 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 DeletedWorkspaces. + */ +public class DeletedWorkspacesInner implements InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private DeletedWorkspacesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of DeletedWorkspacesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public DeletedWorkspacesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(DeletedWorkspacesService.class); + this.client = client; + } + + /** + * The interface defining all the services for DeletedWorkspaces to be + * used by Retrofit to perform actually REST calls. + */ + interface DeletedWorkspacesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DeletedWorkspaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces") + 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.loganalytics.v2020_03_01_preview.DeletedWorkspaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets recently deleted workspaces in a subscription, available for recovery. + * + * @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; + } + }; + } + + /** + * Gets recently deleted workspaces in a subscription, available for recovery. + * + * @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); + } + + /** + * Gets recently deleted workspaces in a subscription, available for recovery. + * + * @return the observable to the List<WorkspaceInner> 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; + } + }); + } + + /** + * Gets recently deleted workspaces in a subscription, available for recovery. + * + * @return the observable to the List<WorkspaceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets recently deleted workspaces in a resource group, available for recovery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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; + } + }; + } + + /** + * Gets recently deleted workspaces in a resource group, available for recovery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + } + + /** + * Gets recently deleted workspaces in a resource group, available for recovery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the observable to the List<WorkspaceInner> 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; + } + }); + } + + /** + * Gets recently deleted workspaces in a resource group, available for recovery. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the observable to the List<WorkspaceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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.listByResourceGroup(resourceGroupName, 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 = 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/GatewaysImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/GatewaysImpl.java new file mode 100644 index 000000000000..ca17018ad2f9 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/GatewaysImpl.java @@ -0,0 +1,32 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Gateways; +import rx.Completable; + +class GatewaysImpl extends WrapperImpl implements Gateways { + private final LogAnalyticsManager manager; + + GatewaysImpl(LogAnalyticsManager manager) { + super(manager.inner().gateways()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String gatewayId) { + return manager().gateways().deleteAsync(resourceGroupName, workspaceName, gatewayId); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/GatewaysInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/GatewaysInner.java new file mode 100644 index 000000000000..899feba670c1 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/GatewaysInner.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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +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 Gateways. + */ +public class GatewaysInner { + /** The Retrofit service to perform REST calls. */ + private GatewaysService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of GatewaysInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public GatewaysInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(GatewaysService.class); + this.client = client; + } + + /** + * The interface defining all the services for Gateways to be + * used by Retrofit to perform actually REST calls. + */ + interface GatewaysService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Gateways delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("gatewayId") String gatewayId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param gatewayId The Log Analytics gateway Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName, String gatewayId) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, gatewayId).toBlocking().single().body(); + } + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param gatewayId The Log Analytics gateway Id. + * @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 workspaceName, String gatewayId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, gatewayId), serviceCallback); + } + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param gatewayId The Log Analytics gateway Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String gatewayId) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, gatewayId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete a Log Analytics gateway. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param gatewayId The Log Analytics gateway Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String gatewayId) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (gatewayId == null) { + throw new IllegalArgumentException("Parameter gatewayId 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.delete(this.client.subscriptionId(), resourceGroupName, workspaceName, gatewayId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IdParsingUtils.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..0c327768100f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/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.loganalytics.v2020_03_01_preview.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/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePackImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePackImpl.java new file mode 100644 index 000000000000..a56919267720 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePackImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.IntelligencePack; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; + +class IntelligencePackImpl extends WrapperImpl implements IntelligencePack { + private final LogAnalyticsManager manager; + + IntelligencePackImpl(IntelligencePackInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public Boolean enabled() { + return this.inner().enabled(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePackInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePackInner.java new file mode 100644 index 000000000000..411d18fd83c1 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePackInner.java @@ -0,0 +1,96 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Intelligence Pack containing a string name and boolean indicating if it's + * enabled. + */ +public class IntelligencePackInner { + /** + * The name of the intelligence pack. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The enabled boolean for the intelligence pack. + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /** + * The display name of the intelligence pack. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Get the name of the intelligence pack. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the intelligence pack. + * + * @param name the name value to set + * @return the IntelligencePackInner object itself. + */ + public IntelligencePackInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the enabled boolean for the intelligence pack. + * + * @return the enabled value + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled boolean for the intelligence pack. + * + * @param enabled the enabled value to set + * @return the IntelligencePackInner object itself. + */ + public IntelligencePackInner withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the display name of the intelligence pack. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the display name of the intelligence pack. + * + * @param displayName the displayName value to set + * @return the IntelligencePackInner object itself. + */ + public IntelligencePackInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePacksImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePacksImpl.java new file mode 100644 index 000000000000..a628da8c6a2f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePacksImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.IntelligencePacks; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import rx.Completable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.IntelligencePack; + +class IntelligencePacksImpl extends WrapperImpl implements IntelligencePacks { + private final LogAnalyticsManager manager; + + IntelligencePacksImpl(LogAnalyticsManager manager) { + super(manager.inner().intelligencePacks()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + private IntelligencePackImpl wrapModel(IntelligencePackInner inner) { + return new IntelligencePackImpl(inner, manager()); + } + + @Override + public Completable disableAsync(String resourceGroupName, String workspaceName, String intelligencePackName) { + IntelligencePacksInner client = this.inner(); + return client.disableAsync(resourceGroupName, workspaceName, intelligencePackName).toCompletable(); + } + + @Override + public Completable enableAsync(String resourceGroupName, String workspaceName, String intelligencePackName) { + IntelligencePacksInner client = this.inner(); + return client.enableAsync(resourceGroupName, workspaceName, intelligencePackName).toCompletable(); + } + + @Override + public Observable listAsync(String resourceGroupName, String workspaceName) { + IntelligencePacksInner client = this.inner(); + return client.listAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public IntelligencePack call(IntelligencePackInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePacksInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePacksInner.java new file mode 100644 index 000000000000..e91edfce7bc5 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/IntelligencePacksInner.java @@ -0,0 +1,340 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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.POST; +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 IntelligencePacks. + */ +public class IntelligencePacksInner { + /** The Retrofit service to perform REST calls. */ + private IntelligencePacksService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of IntelligencePacksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public IntelligencePacksInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(IntelligencePacksService.class); + this.client = client; + } + + /** + * The interface defining all the services for IntelligencePacks to be + * used by Retrofit to perform actually REST calls. + */ + interface IntelligencePacksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.IntelligencePacks disable" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable") + Observable> disable(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("intelligencePackName") String intelligencePackName, @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.loganalytics.v2020_03_01_preview.IntelligencePacks enable" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable") + Observable> enable(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("intelligencePackName") String intelligencePackName, @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.loganalytics.v2020_03_01_preview.IntelligencePacks list" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Disables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be disabled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void disable(String resourceGroupName, String workspaceName, String intelligencePackName) { + disableWithServiceResponseAsync(resourceGroupName, workspaceName, intelligencePackName).toBlocking().single().body(); + } + + /** + * Disables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be disabled. + * @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 disableAsync(String resourceGroupName, String workspaceName, String intelligencePackName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(disableWithServiceResponseAsync(resourceGroupName, workspaceName, intelligencePackName), serviceCallback); + } + + /** + * Disables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be disabled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable disableAsync(String resourceGroupName, String workspaceName, String intelligencePackName) { + return disableWithServiceResponseAsync(resourceGroupName, workspaceName, intelligencePackName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Disables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be disabled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> disableWithServiceResponseAsync(String resourceGroupName, String workspaceName, String intelligencePackName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (intelligencePackName == null) { + throw new IllegalArgumentException("Parameter intelligencePackName is required and cannot be null."); + } + 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.disable(resourceGroupName, workspaceName, intelligencePackName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = disableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse disableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Enables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be enabled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void enable(String resourceGroupName, String workspaceName, String intelligencePackName) { + enableWithServiceResponseAsync(resourceGroupName, workspaceName, intelligencePackName).toBlocking().single().body(); + } + + /** + * Enables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be enabled. + * @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 enableAsync(String resourceGroupName, String workspaceName, String intelligencePackName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(enableWithServiceResponseAsync(resourceGroupName, workspaceName, intelligencePackName), serviceCallback); + } + + /** + * Enables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be enabled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable enableAsync(String resourceGroupName, String workspaceName, String intelligencePackName) { + return enableWithServiceResponseAsync(resourceGroupName, workspaceName, intelligencePackName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Enables an intelligence pack for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param intelligencePackName The name of the intelligence pack to be enabled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> enableWithServiceResponseAsync(String resourceGroupName, String workspaceName, String intelligencePackName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (intelligencePackName == null) { + throw new IllegalArgumentException("Parameter intelligencePackName is required and cannot be null."); + } + 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.enable(resourceGroupName, workspaceName, intelligencePackName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = enableDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse enableDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<IntelligencePackInner> object if successful. + */ + public List list(String resourceGroupName, String workspaceName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<IntelligencePackInner> object + */ + public Observable> listAsync(String resourceGroupName, String workspaceName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<IntelligencePackInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServiceImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServiceImpl.java new file mode 100644 index 000000000000..d1bc709718cf --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServiceImpl.java @@ -0,0 +1,140 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedService; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedServiceEntityStatus; +import java.util.Map; + +class LinkedServiceImpl extends CreatableUpdatableImpl implements LinkedService, LinkedService.Definition, LinkedService.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String linkedServiceName; + + LinkedServiceImpl(String name, LogAnalyticsManager manager) { + super(name, new LinkedServiceInner()); + this.manager = manager; + // Set resource name + this.linkedServiceName = name; + // + } + + LinkedServiceImpl(LinkedServiceInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.linkedServiceName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.linkedServiceName = IdParsingUtils.getValueFromIdByName(inner.id(), "linkedServices"); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LinkedServicesInner client = this.manager().inner().linkedServices(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.linkedServiceName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LinkedServicesInner client = this.manager().inner().linkedServices(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.linkedServiceName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LinkedServicesInner client = this.manager().inner().linkedServices(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.linkedServiceName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public LinkedServiceEntityStatus provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String resourceId() { + return this.inner().resourceId(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String writeAccessResourceId() { + return this.inner().writeAccessResourceId(); + } + + @Override + public LinkedServiceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public LinkedServiceImpl withProvisioningState(LinkedServiceEntityStatus provisioningState) { + this.inner().withProvisioningState(provisioningState); + return this; + } + + @Override + public LinkedServiceImpl withResourceId(String resourceId) { + this.inner().withResourceId(resourceId); + return this; + } + + @Override + public LinkedServiceImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public LinkedServiceImpl withWriteAccessResourceId(String writeAccessResourceId) { + this.inner().withWriteAccessResourceId(writeAccessResourceId); + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServiceInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServiceInner.java new file mode 100644 index 000000000000..7a80fa69fb79 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServiceInner.java @@ -0,0 +1,129 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedServiceEntityStatus; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The top level Linked service resource container. + */ +@JsonFlatten +public class LinkedServiceInner extends ProxyResource { + /** + * The resource id of the resource that will be linked to the workspace. + * This should be used for linking resources which require read access. + */ + @JsonProperty(value = "properties.resourceId") + private String resourceId; + + /** + * The resource id of the resource that will be linked to the workspace. + * This should be used for linking resources which require write access. + */ + @JsonProperty(value = "properties.writeAccessResourceId") + private String writeAccessResourceId; + + /** + * The provisioning state of the linked service. Possible values include: + * 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState") + private LinkedServiceEntityStatus provisioningState; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access. + * + * @param resourceId the resourceId value to set + * @return the LinkedServiceInner object itself. + */ + public LinkedServiceInner withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access. + * + * @return the writeAccessResourceId value + */ + public String writeAccessResourceId() { + return this.writeAccessResourceId; + } + + /** + * Set the resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access. + * + * @param writeAccessResourceId the writeAccessResourceId value to set + * @return the LinkedServiceInner object itself. + */ + public LinkedServiceInner withWriteAccessResourceId(String writeAccessResourceId) { + this.writeAccessResourceId = writeAccessResourceId; + return this; + } + + /** + * Get the provisioning state of the linked service. Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating'. + * + * @return the provisioningState value + */ + public LinkedServiceEntityStatus provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the linked service. Possible values include: 'Succeeded', 'Deleting', 'ProvisioningAccount', 'Updating'. + * + * @param provisioningState the provisioningState value to set + * @return the LinkedServiceInner object itself. + */ + public LinkedServiceInner withProvisioningState(LinkedServiceEntityStatus provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the LinkedServiceInner object itself. + */ + public LinkedServiceInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServicesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServicesImpl.java new file mode 100644 index 000000000000..ee9a181012ed --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServicesImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedServices; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedService; + +class LinkedServicesImpl extends WrapperImpl implements LinkedServices { + private final LogAnalyticsManager manager; + + LinkedServicesImpl(LogAnalyticsManager manager) { + super(manager.inner().linkedServices()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public LinkedServiceImpl define(String name) { + return wrapModel(name); + } + + private LinkedServiceImpl wrapModel(LinkedServiceInner inner) { + return new LinkedServiceImpl(inner, manager()); + } + + private LinkedServiceImpl wrapModel(String name) { + return new LinkedServiceImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + LinkedServicesInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public LinkedService call(LinkedServiceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String linkedServiceName) { + LinkedServicesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, linkedServiceName) + .flatMap(new Func1>() { + @Override + public Observable call(LinkedServiceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((LinkedService)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String linkedServiceName) { + LinkedServicesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, linkedServiceName).toCompletable(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServicesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServicesInner.java new file mode 100644 index 000000000000..91abb9726426 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedServicesInner.java @@ -0,0 +1,625 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 LinkedServices. + */ +public class LinkedServicesInner { + /** The Retrofit service to perform REST calls. */ + private LinkedServicesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of LinkedServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LinkedServicesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(LinkedServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for LinkedServices to be + * used by Retrofit to perform actually REST calls. + */ + interface LinkedServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedServices createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("linkedServiceName") String linkedServiceName, @Path("subscriptionId") String subscriptionId, @Body LinkedServiceInner parameters, @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.loganalytics.v2020_03_01_preview.LinkedServices beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("linkedServiceName") String linkedServiceName, @Path("subscriptionId") String subscriptionId, @Body LinkedServiceInner parameters, @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.loganalytics.v2020_03_01_preview.LinkedServices delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("linkedServiceName") String linkedServiceName, @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.loganalytics.v2020_03_01_preview.LinkedServices beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("linkedServiceName") String linkedServiceName, @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.loganalytics.v2020_03_01_preview.LinkedServices get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("linkedServiceName") String linkedServiceName, @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.loganalytics.v2020_03_01_preview.LinkedServices listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices") + Observable> listByWorkspace(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a linked service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LinkedServiceInner object if successful. + */ + public LinkedServiceInner createOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).toBlocking().last().body(); + } + + /** + * Create or update a linked service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters), serviceCallback); + } + + /** + * Create or update a linked service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).map(new Func1, LinkedServiceInner>() { + @Override + public LinkedServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a linked service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (linkedServiceName == null) { + throw new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, workspaceName, linkedServiceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a linked service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LinkedServiceInner object if successful. + */ + public LinkedServiceInner beginCreateOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a linked service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters), serviceCallback); + } + + /** + * Create or update a linked service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedServiceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).map(new Func1, LinkedServiceInner>() { + @Override + public LinkedServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a linked service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linkedServices resource + * @param parameters The parameters required to create or update a linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedServiceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (linkedServiceName == null) { + throw new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.beginCreateOrUpdate(resourceGroupName, workspaceName, linkedServiceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LinkedServiceInner object if successful. + */ + public LinkedServiceInner delete(String resourceGroupName, String workspaceName, String linkedServiceName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName).toBlocking().last().body(); + } + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @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 workspaceName, String linkedServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName), serviceCallback); + } + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String linkedServiceName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName).map(new Func1, LinkedServiceInner>() { + @Override + public LinkedServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String linkedServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (linkedServiceName == null) { + throw new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, workspaceName, linkedServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LinkedServiceInner object if successful. + */ + public LinkedServiceInner beginDelete(String resourceGroupName, String workspaceName, String linkedServiceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName).toBlocking().single().body(); + } + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @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 workspaceName, String linkedServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName), serviceCallback); + } + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedServiceInner object + */ + public Observable beginDeleteAsync(String resourceGroupName, String workspaceName, String linkedServiceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName).map(new Func1, LinkedServiceInner>() { + @Override + public LinkedServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedServiceInner object + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String linkedServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (linkedServiceName == null) { + throw new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, workspaceName, linkedServiceName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LinkedServiceInner object if successful. + */ + public LinkedServiceInner get(String resourceGroupName, String workspaceName, String linkedServiceName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName).toBlocking().single().body(); + } + + /** + * Gets a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String linkedServiceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName), serviceCallback); + } + + /** + * Gets a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedServiceInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String linkedServiceName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, linkedServiceName).map(new Func1, LinkedServiceInner>() { + @Override + public LinkedServiceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a linked service instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param linkedServiceName Name of the linked service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedServiceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String linkedServiceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (linkedServiceName == null) { + throw new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null."); + } + 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.get(resourceGroupName, workspaceName, linkedServiceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the linked services instances in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<LinkedServiceInner> object if successful. + */ + public List listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the linked services instances in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> listByWorkspaceAsync(String resourceGroupName, String workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the linked services instances in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LinkedServiceInner> object + */ + public Observable> listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets the linked services instances in a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LinkedServiceInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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.listByWorkspace(resourceGroupName, workspaceName, 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 = listByWorkspaceDelegate(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> listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsImpl.java new file mode 100644 index 000000000000..35561441b8ee --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsImpl.java @@ -0,0 +1,86 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSourceType; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedStorageAccounts; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedStorageAccountsResource; + +class LinkedStorageAccountsImpl extends WrapperImpl implements LinkedStorageAccounts { + private final LogAnalyticsManager manager; + + LinkedStorageAccountsImpl(LogAnalyticsManager manager) { + super(manager.inner().linkedStorageAccounts()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public LinkedStorageAccountsResourceImpl define(String name) { + return wrapModel(name); + } + + private LinkedStorageAccountsResourceImpl wrapModel(LinkedStorageAccountsResourceInner inner) { + return new LinkedStorageAccountsResourceImpl(inner, manager()); + } + + private LinkedStorageAccountsResourceImpl wrapModel(String name) { + return new LinkedStorageAccountsResourceImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + LinkedStorageAccountsInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public LinkedStorageAccountsResource call(LinkedStorageAccountsResourceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + LinkedStorageAccountsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, dataSourceType) + .flatMap(new Func1>() { + @Override + public Observable call(LinkedStorageAccountsResourceInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((LinkedStorageAccountsResource)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + LinkedStorageAccountsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, dataSourceType).toCompletable(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsInner.java new file mode 100644 index 000000000000..9d2da1672589 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsInner.java @@ -0,0 +1,543 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSourceType; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 LinkedStorageAccounts. + */ +public class LinkedStorageAccountsInner { + /** The Retrofit service to perform REST calls. */ + private LinkedStorageAccountsService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of LinkedStorageAccountsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public LinkedStorageAccountsInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(LinkedStorageAccountsService.class); + this.client = client; + } + + /** + * The interface defining all the services for LinkedStorageAccounts to be + * used by Retrofit to perform actually REST calls. + */ + interface LinkedStorageAccountsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedStorageAccounts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataSourceType") DataSourceType dataSourceType1, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body LinkedStorageAccountsResourceInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedStorageAccounts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataSourceType") DataSourceType dataSourceType1, @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.loganalytics.v2020_03_01_preview.LinkedStorageAccounts get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("dataSourceType") DataSourceType dataSourceType1, @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.loganalytics.v2020_03_01_preview.LinkedStorageAccounts listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts") + Observable> listByWorkspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or Update a link relation between current workspace and a group of storage accounts of a specific data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LinkedStorageAccountsResourceInner object if successful. + */ + public LinkedStorageAccountsResourceInner createOrUpdate(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType).toBlocking().single().body(); + } + + /** + * Create or Update a link relation between current workspace and a group of storage accounts of a specific data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType), serviceCallback); + } + + /** + * Create or Update a link relation between current workspace and a group of storage accounts of a specific data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedStorageAccountsResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType).map(new Func1, LinkedStorageAccountsResourceInner>() { + @Override + public LinkedStorageAccountsResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update a link relation between current workspace and a group of storage accounts of a specific data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedStorageAccountsResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataSourceType == null) { + throw new IllegalArgumentException("Parameter dataSourceType is required and cannot be null."); + } + 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."); + } + final List storageAccountIds = null; + LinkedStorageAccountsResourceInner parameters = new LinkedStorageAccountsResourceInner(); + parameters.withStorageAccountIds(null); + return service.createOrUpdate(resourceGroupName, workspaceName, dataSourceType, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Create or Update a link relation between current workspace and a group of storage accounts of a specific data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @param storageAccountIds Linked storage accounts resources ids. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LinkedStorageAccountsResourceInner object if successful. + */ + public LinkedStorageAccountsResourceInner createOrUpdate(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, List storageAccountIds) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds).toBlocking().single().body(); + } + + /** + * Create or Update a link relation between current workspace and a group of storage accounts of a specific data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @param storageAccountIds Linked storage accounts resources ids. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, List storageAccountIds, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds), serviceCallback); + } + + /** + * Create or Update a link relation between current workspace and a group of storage accounts of a specific data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @param storageAccountIds Linked storage accounts resources ids. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedStorageAccountsResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, List storageAccountIds) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType, storageAccountIds).map(new Func1, LinkedStorageAccountsResourceInner>() { + @Override + public LinkedStorageAccountsResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or Update a link relation between current workspace and a group of storage accounts of a specific data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @param storageAccountIds Linked storage accounts resources ids. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedStorageAccountsResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, List storageAccountIds) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataSourceType == null) { + throw new IllegalArgumentException("Parameter dataSourceType is required and cannot be null."); + } + 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."); + } + Validator.validate(storageAccountIds); + LinkedStorageAccountsResourceInner parameters = new LinkedStorageAccountsResourceInner(); + parameters.withStorageAccountIds(storageAccountIds); + return service.createOrUpdate(resourceGroupName, workspaceName, dataSourceType, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName, DataSourceType dataSourceType) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType).toBlocking().single().body(); + } + + /** + * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @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 workspaceName, DataSourceType dataSourceType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType), serviceCallback); + } + + /** + * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataSourceType == null) { + throw new IllegalArgumentException("Parameter dataSourceType is required and cannot be null."); + } + 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.delete(resourceGroupName, workspaceName, dataSourceType, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all linked storage account of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the LinkedStorageAccountsResourceInner object if successful. + */ + public LinkedStorageAccountsResourceInner get(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType).toBlocking().single().body(); + } + + /** + * Gets all linked storage account of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType), serviceCallback); + } + + /** + * Gets all linked storage account of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedStorageAccountsResourceInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, dataSourceType).map(new Func1, LinkedStorageAccountsResourceInner>() { + @Override + public LinkedStorageAccountsResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all linked storage account of a specific data source type associated with the specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param dataSourceType Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the LinkedStorageAccountsResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, DataSourceType dataSourceType) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (dataSourceType == null) { + throw new IllegalArgumentException("Parameter dataSourceType is required and cannot be null."); + } + 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.get(resourceGroupName, workspaceName, dataSourceType, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets all linked storage accounts associated with the specified workspace, storage accounts will be sorted by their data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<LinkedStorageAccountsResourceInner> object if successful. + */ + public List listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets all linked storage accounts associated with the specified workspace, storage accounts will be sorted by their data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> listByWorkspaceAsync(String resourceGroupName, String workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets all linked storage accounts associated with the specified workspace, storage accounts will be sorted by their data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LinkedStorageAccountsResourceInner> object + */ + public Observable> listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all linked storage accounts associated with the specified workspace, storage accounts will be sorted by their data source type. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<LinkedStorageAccountsResourceInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.listByWorkspace(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceDelegate(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> listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsResourceImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsResourceImpl.java new file mode 100644 index 000000000000..f3e213c8ad17 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsResourceImpl.java @@ -0,0 +1,118 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedStorageAccountsResource; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSourceType; + +class LinkedStorageAccountsResourceImpl extends CreatableUpdatableImpl implements LinkedStorageAccountsResource, LinkedStorageAccountsResource.Definition, LinkedStorageAccountsResource.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private DataSourceType dataSourceType; + private List cstorageAccountIds; + private List ustorageAccountIds; + + LinkedStorageAccountsResourceImpl(String name, LogAnalyticsManager manager) { + super(name, new LinkedStorageAccountsResourceInner()); + this.manager = manager; + // Set resource name + this.dataSourceType = DataSourceType.fromString(name); + // + } + + LinkedStorageAccountsResourceImpl(LinkedStorageAccountsResourceInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.dataSourceType = DataSourceType.fromString(inner.name()); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.dataSourceType = DataSourceType.valueOf(IdParsingUtils.getValueFromIdByName(inner.id(), "linkedStorageAccounts")); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + LinkedStorageAccountsInner client = this.manager().inner().linkedStorageAccounts(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.dataSourceType, this.cstorageAccountIds) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + LinkedStorageAccountsInner client = this.manager().inner().linkedStorageAccounts(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.dataSourceType, this.ustorageAccountIds) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + LinkedStorageAccountsInner client = this.manager().inner().linkedStorageAccounts(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.dataSourceType); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public DataSourceType dataSourceType() { + return this.inner().dataSourceType(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List storageAccountIds() { + return this.inner().storageAccountIds(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public LinkedStorageAccountsResourceImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public LinkedStorageAccountsResourceImpl withStorageAccountIds(List storageAccountIds) { + if (isInCreateMode()) { + this.cstorageAccountIds = storageAccountIds; + } else { + this.ustorageAccountIds = storageAccountIds; + } + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsResourceInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsResourceInner.java new file mode 100644 index 000000000000..11a699b26b86 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LinkedStorageAccountsResourceInner.java @@ -0,0 +1,64 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSourceType; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Linked storage accounts top level resource container. + */ +@JsonFlatten +public class LinkedStorageAccountsResourceInner extends ProxyResource { + /** + * Linked storage accounts type. Possible values include: 'CustomLogs', + * 'AzureWatson'. + */ + @JsonProperty(value = "properties.dataSourceType", access = JsonProperty.Access.WRITE_ONLY) + private DataSourceType dataSourceType; + + /** + * Linked storage accounts resources ids. + */ + @JsonProperty(value = "properties.storageAccountIds") + private List storageAccountIds; + + /** + * Get linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson'. + * + * @return the dataSourceType value + */ + public DataSourceType dataSourceType() { + return this.dataSourceType; + } + + /** + * Get linked storage accounts resources ids. + * + * @return the storageAccountIds value + */ + public List storageAccountIds() { + return this.storageAccountIds; + } + + /** + * Set linked storage accounts resources ids. + * + * @param storageAccountIds the storageAccountIds value to set + * @return the LinkedStorageAccountsResourceInner object itself. + */ + public LinkedStorageAccountsResourceInner withStorageAccountIds(List storageAccountIds) { + this.storageAccountIds = storageAccountIds; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LogAnalyticsManager.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LogAnalyticsManager.java new file mode 100644 index 000000000000..92c8b304288b --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/LogAnalyticsManager.java @@ -0,0 +1,327 @@ +/** + * 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.loganalytics.v2020_03_01_preview.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.loganalytics.v2020_03_01_preview.DataExports; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DataSources; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.IntelligencePacks; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedServices; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.LinkedStorageAccounts; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ManagementGroups; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Operations; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.OperationStatuses; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SharedKeysOperations; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Usages; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Workspaces; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.DeletedWorkspaces; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Clusters; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageInsightConfigs; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SavedSearches; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.AvailableServiceTiers; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Gateways; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Schemas; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurges; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Tables; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure LogAnalytics resource management. + */ +public final class LogAnalyticsManager extends ManagerCore { + private DataExports dataExports; + private DataSources dataSources; + private IntelligencePacks intelligencePacks; + private LinkedServices linkedServices; + private LinkedStorageAccounts linkedStorageAccounts; + private ManagementGroups managementGroups; + private Operations operations; + private OperationStatuses operationStatuses; + private SharedKeysOperations sharedKeysOperations; + private Usages usages; + private Workspaces workspaces; + private DeletedWorkspaces deletedWorkspaces; + private Clusters clusters; + private StorageInsightConfigs storageInsightConfigs; + private SavedSearches savedSearches; + private AvailableServiceTiers availableServiceTiers; + private Gateways gateways; + private Schemas schemas; + private WorkspacePurges workspacePurges; + private Tables tables; + /** + * Get a Configurable instance that can be used to create LogAnalyticsManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new LogAnalyticsManager.ConfigurableImpl(); + } + /** + * Creates an instance of LogAnalyticsManager that exposes LogAnalytics resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the LogAnalyticsManager + */ + public static LogAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new LogAnalyticsManager(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 LogAnalyticsManager that exposes LogAnalytics resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the LogAnalyticsManager + */ + public static LogAnalyticsManager authenticate(RestClient restClient, String subscriptionId) { + return new LogAnalyticsManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of LogAnalyticsManager that exposes LogAnalytics management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing LogAnalytics management API entry points that work across subscriptions + */ + LogAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage DataExports. + */ + public DataExports dataExports() { + if (this.dataExports == null) { + this.dataExports = new DataExportsImpl(this); + } + return this.dataExports; + } + + /** + * @return Entry point to manage DataSources. + */ + public DataSources dataSources() { + if (this.dataSources == null) { + this.dataSources = new DataSourcesImpl(this); + } + return this.dataSources; + } + + /** + * @return Entry point to manage IntelligencePacks. + */ + public IntelligencePacks intelligencePacks() { + if (this.intelligencePacks == null) { + this.intelligencePacks = new IntelligencePacksImpl(this); + } + return this.intelligencePacks; + } + + /** + * @return Entry point to manage LinkedServices. + */ + public LinkedServices linkedServices() { + if (this.linkedServices == null) { + this.linkedServices = new LinkedServicesImpl(this); + } + return this.linkedServices; + } + + /** + * @return Entry point to manage LinkedStorageAccounts. + */ + public LinkedStorageAccounts linkedStorageAccounts() { + if (this.linkedStorageAccounts == null) { + this.linkedStorageAccounts = new LinkedStorageAccountsImpl(this); + } + return this.linkedStorageAccounts; + } + + /** + * @return Entry point to manage ManagementGroups. + */ + public ManagementGroups managementGroups() { + if (this.managementGroups == null) { + this.managementGroups = new ManagementGroupsImpl(this); + } + return this.managementGroups; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage OperationStatuses. + */ + public OperationStatuses operationStatuses() { + if (this.operationStatuses == null) { + this.operationStatuses = new OperationStatusesImpl(this); + } + return this.operationStatuses; + } + + /** + * @return Entry point to manage SharedKeysOperations. + */ + public SharedKeysOperations sharedKeysOperations() { + if (this.sharedKeysOperations == null) { + this.sharedKeysOperations = new SharedKeysOperationsImpl(this); + } + return this.sharedKeysOperations; + } + + /** + * @return Entry point to manage Usages. + */ + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(this); + } + return this.usages; + } + + /** + * @return Entry point to manage Workspaces. + */ + public Workspaces workspaces() { + if (this.workspaces == null) { + this.workspaces = new WorkspacesImpl(this); + } + return this.workspaces; + } + + /** + * @return Entry point to manage DeletedWorkspaces. + */ + public DeletedWorkspaces deletedWorkspaces() { + if (this.deletedWorkspaces == null) { + this.deletedWorkspaces = new DeletedWorkspacesImpl(this); + } + return this.deletedWorkspaces; + } + + /** + * @return Entry point to manage Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @return Entry point to manage StorageInsightConfigs. + */ + public StorageInsightConfigs storageInsightConfigs() { + if (this.storageInsightConfigs == null) { + this.storageInsightConfigs = new StorageInsightConfigsImpl(this); + } + return this.storageInsightConfigs; + } + + /** + * @return Entry point to manage SavedSearches. + */ + public SavedSearches savedSearches() { + if (this.savedSearches == null) { + this.savedSearches = new SavedSearchesImpl(this); + } + return this.savedSearches; + } + + /** + * @return Entry point to manage AvailableServiceTiers. + */ + public AvailableServiceTiers availableServiceTiers() { + if (this.availableServiceTiers == null) { + this.availableServiceTiers = new AvailableServiceTiersImpl(this); + } + return this.availableServiceTiers; + } + + /** + * @return Entry point to manage Gateways. + */ + public Gateways gateways() { + if (this.gateways == null) { + this.gateways = new GatewaysImpl(this); + } + return this.gateways; + } + + /** + * @return Entry point to manage Schemas. + */ + public Schemas schemas() { + if (this.schemas == null) { + this.schemas = new SchemasImpl(this); + } + return this.schemas; + } + + /** + * @return Entry point to manage WorkspacePurges. + */ + public WorkspacePurges workspacePurges() { + if (this.workspacePurges == null) { + this.workspacePurges = new WorkspacePurgesImpl(this); + } + return this.workspacePurges; + } + + /** + * @return Entry point to manage Tables. + */ + public Tables tables() { + if (this.tables == null) { + this.tables = new TablesImpl(this); + } + return this.tables; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public LogAnalyticsManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return LogAnalyticsManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private LogAnalyticsManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new OperationalInsightsManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupImpl.java new file mode 100644 index 000000000000..d818b64ccf69 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ManagementGroup; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import org.joda.time.DateTime; + +class ManagementGroupImpl extends WrapperImpl implements ManagementGroup { + private final LogAnalyticsManager manager; + + ManagementGroupImpl(ManagementGroupInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public DateTime created() { + return this.inner().created(); + } + + @Override + public DateTime dataReceived() { + return this.inner().dataReceived(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Boolean isGateway() { + return this.inner().isGateway(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer serverCount() { + return this.inner().serverCount(); + } + + @Override + public String sku() { + return this.inner().sku(); + } + + @Override + public String version() { + return this.inner().version(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupInner.java new file mode 100644 index 000000000000..e09f02b540f0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupInner.java @@ -0,0 +1,229 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A management group that is connected to a workspace. + */ +@JsonFlatten +public class ManagementGroupInner { + /** + * The number of servers connected to the management group. + */ + @JsonProperty(value = "properties.serverCount") + private Integer serverCount; + + /** + * Gets or sets a value indicating whether the management group is a + * gateway. + */ + @JsonProperty(value = "properties.isGateway") + private Boolean isGateway; + + /** + * The name of the management group. + */ + @JsonProperty(value = "properties.name") + private String name; + + /** + * The unique ID of the management group. + */ + @JsonProperty(value = "properties.id") + private String id; + + /** + * The datetime that the management group was created. + */ + @JsonProperty(value = "properties.created") + private DateTime created; + + /** + * The last datetime that the management group received data. + */ + @JsonProperty(value = "properties.dataReceived") + private DateTime dataReceived; + + /** + * The version of System Center that is managing the management group. + */ + @JsonProperty(value = "properties.version") + private String version; + + /** + * The SKU of System Center that is managing the management group. + */ + @JsonProperty(value = "properties.sku") + private String sku; + + /** + * Get the number of servers connected to the management group. + * + * @return the serverCount value + */ + public Integer serverCount() { + return this.serverCount; + } + + /** + * Set the number of servers connected to the management group. + * + * @param serverCount the serverCount value to set + * @return the ManagementGroupInner object itself. + */ + public ManagementGroupInner withServerCount(Integer serverCount) { + this.serverCount = serverCount; + return this; + } + + /** + * Get gets or sets a value indicating whether the management group is a gateway. + * + * @return the isGateway value + */ + public Boolean isGateway() { + return this.isGateway; + } + + /** + * Set gets or sets a value indicating whether the management group is a gateway. + * + * @param isGateway the isGateway value to set + * @return the ManagementGroupInner object itself. + */ + public ManagementGroupInner withIsGateway(Boolean isGateway) { + this.isGateway = isGateway; + return this; + } + + /** + * Get the name of the management group. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the management group. + * + * @param name the name value to set + * @return the ManagementGroupInner object itself. + */ + public ManagementGroupInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the unique ID of the management group. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the unique ID of the management group. + * + * @param id the id value to set + * @return the ManagementGroupInner object itself. + */ + public ManagementGroupInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the datetime that the management group was created. + * + * @return the created value + */ + public DateTime created() { + return this.created; + } + + /** + * Set the datetime that the management group was created. + * + * @param created the created value to set + * @return the ManagementGroupInner object itself. + */ + public ManagementGroupInner withCreated(DateTime created) { + this.created = created; + return this; + } + + /** + * Get the last datetime that the management group received data. + * + * @return the dataReceived value + */ + public DateTime dataReceived() { + return this.dataReceived; + } + + /** + * Set the last datetime that the management group received data. + * + * @param dataReceived the dataReceived value to set + * @return the ManagementGroupInner object itself. + */ + public ManagementGroupInner withDataReceived(DateTime dataReceived) { + this.dataReceived = dataReceived; + return this; + } + + /** + * Get the version of System Center that is managing the management group. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of System Center that is managing the management group. + * + * @param version the version value to set + * @return the ManagementGroupInner object itself. + */ + public ManagementGroupInner withVersion(String version) { + this.version = version; + return this; + } + + /** + * Get the SKU of System Center that is managing the management group. + * + * @return the sku value + */ + public String sku() { + return this.sku; + } + + /** + * Set the SKU of System Center that is managing the management group. + * + * @param sku the sku value to set + * @return the ManagementGroupInner object itself. + */ + public ManagementGroupInner withSku(String sku) { + this.sku = sku; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupsImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupsImpl.java new file mode 100644 index 000000000000..be103c894a38 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupsImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ManagementGroups; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ManagementGroup; + +class ManagementGroupsImpl extends WrapperImpl implements ManagementGroups { + private final LogAnalyticsManager manager; + + ManagementGroupsImpl(LogAnalyticsManager manager) { + super(manager.inner().managementGroups()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + private ManagementGroupImpl wrapModel(ManagementGroupInner inner) { + return new ManagementGroupImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String workspaceName) { + ManagementGroupsInner client = this.inner(); + return client.listAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public ManagementGroup call(ManagementGroupInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupsInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupsInner.java new file mode 100644 index 000000000000..fbca195079ce --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/ManagementGroupsInner.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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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 ManagementGroups. + */ +public class ManagementGroupsInner { + /** The Retrofit service to perform REST calls. */ + private ManagementGroupsService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of ManagementGroupsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ManagementGroupsInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(ManagementGroupsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ManagementGroups to be + * used by Retrofit to perform actually REST calls. + */ + interface ManagementGroupsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ManagementGroups list" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of management groups connected to a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<ManagementGroupInner> object if successful. + */ + public List list(String resourceGroupName, String workspaceName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets a list of management groups connected to a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets a list of management groups connected to a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ManagementGroupInner> object + */ + public Observable> listAsync(String resourceGroupName, String workspaceName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of management groups connected to a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<ManagementGroupInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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(resourceGroupName, workspaceName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationImpl.java new file mode 100644 index 000000000000..25d99bf2a5fd --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final LogAnalyticsManager manager; + OperationImpl(OperationInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationInner.java new file mode 100644 index 000000000000..30125c6a10a9 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Supported operation of OperationalInsights resource provider. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Display metadata associated with the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get display metadata associated with the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set display metadata associated with the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusImpl.java new file mode 100644 index 000000000000..e1fdf67809d4 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusImpl.java @@ -0,0 +1,72 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.OperationStatus; +import com.microsoft.azure.arm.model.implementation.IndexableRefreshableWrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ErrorResponse; + +class OperationStatusImpl extends IndexableRefreshableWrapperImpl implements OperationStatus { + private final LogAnalyticsManager manager; + private String location; + private String asyncOperationId; + + OperationStatusImpl(OperationStatusInner inner, LogAnalyticsManager manager) { + super(null, inner); + this.manager = manager; + // set resource ancestor and positional variables + this.location = IdParsingUtils.getValueFromIdByName(inner.id(), "locations"); + this.asyncOperationId = IdParsingUtils.getValueFromIdByName(inner.id(), "operationStatuses"); + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + protected Observable getInnerAsync() { + OperationStatusesInner client = this.manager().inner().operationStatuses(); + return client.getAsync(this.location, this.asyncOperationId); + } + + + + @Override + public String endTime() { + return this.inner().endTime(); + } + + @Override + public ErrorResponse error() { + return this.inner().error(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String startTime() { + return this.inner().startTime(); + } + + @Override + public String status() { + return this.inner().status(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusInner.java new file mode 100644 index 000000000000..cc72a52fd509 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusInner.java @@ -0,0 +1,174 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ErrorResponse; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The status of operation. + */ +public class OperationStatusInner { + /** + * The operation Id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The operation name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The start time of the operation. + */ + @JsonProperty(value = "startTime") + private String startTime; + + /** + * The end time of the operation. + */ + @JsonProperty(value = "endTime") + private String endTime; + + /** + * The status of the operation. + */ + @JsonProperty(value = "status") + private String status; + + /** + * The error detail of the operation if any. + */ + @JsonProperty(value = "error") + private ErrorResponse error; + + /** + * Get the operation Id. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the operation Id. + * + * @param id the id value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the operation name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the operation name. + * + * @param name the name value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the start time of the operation. + * + * @return the startTime value + */ + public String startTime() { + return this.startTime; + } + + /** + * Set the start time of the operation. + * + * @param startTime the startTime value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStartTime(String startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the end time of the operation. + * + * @return the endTime value + */ + public String endTime() { + return this.endTime; + } + + /** + * Set the end time of the operation. + * + * @param endTime the endTime value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withEndTime(String endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the status of the operation. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status of the operation. + * + * @param status the status value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the error detail of the operation if any. + * + * @return the error value + */ + public ErrorResponse error() { + return this.error; + } + + /** + * Set the error detail of the operation if any. + * + * @param error the error value to set + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withError(ErrorResponse error) { + this.error = error; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusesImpl.java new file mode 100644 index 000000000000..5e3e9510f490 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusesImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.OperationStatuses; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.OperationStatus; + +class OperationStatusesImpl extends WrapperImpl implements OperationStatuses { + private final LogAnalyticsManager manager; + + OperationStatusesImpl(LogAnalyticsManager manager) { + super(manager.inner().operationStatuses()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + private OperationStatusImpl wrapModel(OperationStatusInner inner) { + return new OperationStatusImpl(inner, manager()); + } + + @Override + public Observable getAsync(String location, String asyncOperationId) { + OperationStatusesInner client = this.inner(); + return client.getAsync(location, asyncOperationId) + .flatMap(new Func1>() { + @Override + public Observable call(OperationStatusInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((OperationStatus)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusesInner.java new file mode 100644 index 000000000000..56fb2d1a5655 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationStatusesInner.java @@ -0,0 +1,146 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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.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 OperationStatuses. + */ +public class OperationStatusesInner { + /** The Retrofit service to perform REST calls. */ + private OperationStatusesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of OperationStatusesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationStatusesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(OperationStatusesService.class); + this.client = client; + } + + /** + * The interface defining all the services for OperationStatuses to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationStatusesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.OperationStatuses get" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}") + Observable> get(@Path("location") String location, @Path("asyncOperationId") String asyncOperationId, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the status of a long running azure asynchronous operation. + * + * @param location The region name of operation. + * @param asyncOperationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the OperationStatusInner object if successful. + */ + public OperationStatusInner get(String location, String asyncOperationId) { + return getWithServiceResponseAsync(location, asyncOperationId).toBlocking().single().body(); + } + + /** + * Get the status of a long running azure asynchronous operation. + * + * @param location The region name of operation. + * @param asyncOperationId The operation Id. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String location, String asyncOperationId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(location, asyncOperationId), serviceCallback); + } + + /** + * Get the status of a long running azure asynchronous operation. + * + * @param location The region name of operation. + * @param asyncOperationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable getAsync(String location, String asyncOperationId) { + return getWithServiceResponseAsync(location, asyncOperationId).map(new Func1, OperationStatusInner>() { + @Override + public OperationStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the status of a long running azure asynchronous operation. + * + * @param location The region name of operation. + * @param asyncOperationId The operation Id. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationStatusInner object + */ + public Observable> getWithServiceResponseAsync(String location, String asyncOperationId) { + if (location == null) { + throw new IllegalArgumentException("Parameter location is required and cannot be null."); + } + if (asyncOperationId == null) { + throw new IllegalArgumentException("Parameter asyncOperationId is required and cannot be null."); + } + 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.get(location, asyncOperationId, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationalInsightsManagementClientImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationalInsightsManagementClientImpl.java new file mode 100644 index 000000000000..bcb82c481204 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationalInsightsManagementClientImpl.java @@ -0,0 +1,462 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the OperationalInsightsManagementClientImpl class. + */ +public class OperationalInsightsManagementClientImpl extends AzureServiceClient { + /** 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; + } + + /** The API version to use for this operation. */ + private String apiVersion; + + /** + * Gets The API version to use for this operation. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + + /** The ID of the target subscription. */ + private String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public OperationalInsightsManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** 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 OperationalInsightsManagementClientImpl 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 OperationalInsightsManagementClientImpl 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 OperationalInsightsManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The DataExportsInner object to access its operations. + */ + private DataExportsInner dataExports; + + /** + * Gets the DataExportsInner object to access its operations. + * @return the DataExportsInner object. + */ + public DataExportsInner dataExports() { + return this.dataExports; + } + + /** + * The DataSourcesInner object to access its operations. + */ + private DataSourcesInner dataSources; + + /** + * Gets the DataSourcesInner object to access its operations. + * @return the DataSourcesInner object. + */ + public DataSourcesInner dataSources() { + return this.dataSources; + } + + /** + * The IntelligencePacksInner object to access its operations. + */ + private IntelligencePacksInner intelligencePacks; + + /** + * Gets the IntelligencePacksInner object to access its operations. + * @return the IntelligencePacksInner object. + */ + public IntelligencePacksInner intelligencePacks() { + return this.intelligencePacks; + } + + /** + * The LinkedServicesInner object to access its operations. + */ + private LinkedServicesInner linkedServices; + + /** + * Gets the LinkedServicesInner object to access its operations. + * @return the LinkedServicesInner object. + */ + public LinkedServicesInner linkedServices() { + return this.linkedServices; + } + + /** + * The LinkedStorageAccountsInner object to access its operations. + */ + private LinkedStorageAccountsInner linkedStorageAccounts; + + /** + * Gets the LinkedStorageAccountsInner object to access its operations. + * @return the LinkedStorageAccountsInner object. + */ + public LinkedStorageAccountsInner linkedStorageAccounts() { + return this.linkedStorageAccounts; + } + + /** + * The ManagementGroupsInner object to access its operations. + */ + private ManagementGroupsInner managementGroups; + + /** + * Gets the ManagementGroupsInner object to access its operations. + * @return the ManagementGroupsInner object. + */ + public ManagementGroupsInner managementGroups() { + return this.managementGroups; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The OperationStatusesInner object to access its operations. + */ + private OperationStatusesInner operationStatuses; + + /** + * Gets the OperationStatusesInner object to access its operations. + * @return the OperationStatusesInner object. + */ + public OperationStatusesInner operationStatuses() { + return this.operationStatuses; + } + + /** + * The SharedKeysOperationsInner object to access its operations. + */ + private SharedKeysOperationsInner sharedKeysOperations; + + /** + * Gets the SharedKeysOperationsInner object to access its operations. + * @return the SharedKeysOperationsInner object. + */ + public SharedKeysOperationsInner sharedKeysOperations() { + return this.sharedKeysOperations; + } + + /** + * The UsagesInner object to access its operations. + */ + private UsagesInner usages; + + /** + * Gets the UsagesInner object to access its operations. + * @return the UsagesInner object. + */ + public UsagesInner usages() { + return this.usages; + } + + /** + * 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; + } + + /** + * The DeletedWorkspacesInner object to access its operations. + */ + private DeletedWorkspacesInner deletedWorkspaces; + + /** + * Gets the DeletedWorkspacesInner object to access its operations. + * @return the DeletedWorkspacesInner object. + */ + public DeletedWorkspacesInner deletedWorkspaces() { + return this.deletedWorkspaces; + } + + /** + * The ClustersInner object to access its operations. + */ + private ClustersInner clusters; + + /** + * Gets the ClustersInner object to access its operations. + * @return the ClustersInner object. + */ + public ClustersInner clusters() { + return this.clusters; + } + + /** + * The StorageInsightConfigsInner object to access its operations. + */ + private StorageInsightConfigsInner storageInsightConfigs; + + /** + * Gets the StorageInsightConfigsInner object to access its operations. + * @return the StorageInsightConfigsInner object. + */ + public StorageInsightConfigsInner storageInsightConfigs() { + return this.storageInsightConfigs; + } + + /** + * The SavedSearchesInner object to access its operations. + */ + private SavedSearchesInner savedSearches; + + /** + * Gets the SavedSearchesInner object to access its operations. + * @return the SavedSearchesInner object. + */ + public SavedSearchesInner savedSearches() { + return this.savedSearches; + } + + /** + * The AvailableServiceTiersInner object to access its operations. + */ + private AvailableServiceTiersInner availableServiceTiers; + + /** + * Gets the AvailableServiceTiersInner object to access its operations. + * @return the AvailableServiceTiersInner object. + */ + public AvailableServiceTiersInner availableServiceTiers() { + return this.availableServiceTiers; + } + + /** + * The GatewaysInner object to access its operations. + */ + private GatewaysInner gateways; + + /** + * Gets the GatewaysInner object to access its operations. + * @return the GatewaysInner object. + */ + public GatewaysInner gateways() { + return this.gateways; + } + + /** + * The SchemasInner object to access its operations. + */ + private SchemasInner schemas; + + /** + * Gets the SchemasInner object to access its operations. + * @return the SchemasInner object. + */ + public SchemasInner schemas() { + return this.schemas; + } + + /** + * The WorkspacePurgesInner object to access its operations. + */ + private WorkspacePurgesInner workspacePurges; + + /** + * Gets the WorkspacePurgesInner object to access its operations. + * @return the WorkspacePurgesInner object. + */ + public WorkspacePurgesInner workspacePurges() { + return this.workspacePurges; + } + + /** + * The TablesInner object to access its operations. + */ + private TablesInner tables; + + /** + * Gets the TablesInner object to access its operations. + * @return the TablesInner object. + */ + public TablesInner tables() { + return this.tables; + } + + /** + * Initializes an instance of OperationalInsightsManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public OperationalInsightsManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of OperationalInsightsManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public OperationalInsightsManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of OperationalInsightsManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public OperationalInsightsManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2020-03-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.dataExports = new DataExportsInner(restClient().retrofit(), this); + this.dataSources = new DataSourcesInner(restClient().retrofit(), this); + this.intelligencePacks = new IntelligencePacksInner(restClient().retrofit(), this); + this.linkedServices = new LinkedServicesInner(restClient().retrofit(), this); + this.linkedStorageAccounts = new LinkedStorageAccountsInner(restClient().retrofit(), this); + this.managementGroups = new ManagementGroupsInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.operationStatuses = new OperationStatusesInner(restClient().retrofit(), this); + this.sharedKeysOperations = new SharedKeysOperationsInner(restClient().retrofit(), this); + this.usages = new UsagesInner(restClient().retrofit(), this); + this.workspaces = new WorkspacesInner(restClient().retrofit(), this); + this.deletedWorkspaces = new DeletedWorkspacesInner(restClient().retrofit(), this); + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.storageInsightConfigs = new StorageInsightConfigsInner(restClient().retrofit(), this); + this.savedSearches = new SavedSearchesInner(restClient().retrofit(), this); + this.availableServiceTiers = new AvailableServiceTiersInner(restClient().retrofit(), this); + this.gateways = new GatewaysInner(restClient().retrofit(), this); + this.schemas = new SchemasInner(restClient().retrofit(), this); + this.workspacePurges = new WorkspacePurgesInner(restClient().retrofit(), this); + this.tables = new TablesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * 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(), "OperationalInsightsManagementClient", "2020-03-01-preview"); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationsImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..ef20ac60ec34 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final LogAnalyticsManager manager; + + OperationsImpl(LogAnalyticsManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationsInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..1dd0003cdc2f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +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.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Operations list" }) + @GET("providers/Microsoft.OperationalInsights/operations") + Observable> list(@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.loganalytics.v2020_03_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @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(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available OperationalInsights Rest API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/PageImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..5b603f66023a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/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.loganalytics.v2020_03_01_preview.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/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/PageImpl1.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/PageImpl1.java new file mode 100644 index 000000000000..b4666af90ac3 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/PageImpl1.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.loganalytics.v2020_03_01_preview.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 PageImpl1 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + 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 PageImpl1 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 PageImpl1 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/PageImpl2.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/PageImpl2.java new file mode 100644 index 000000000000..203ddb229555 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/PageImpl2.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.loganalytics.v2020_03_01_preview.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 PageImpl2 implements Page { + /** + * The link to the next page. + */ + @JsonProperty("@odata.nextLink") + 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 PageImpl2 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 PageImpl2 setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchImpl.java new file mode 100644 index 000000000000..4ba86e50a251 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchImpl.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. + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SavedSearch; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Tag; + +class SavedSearchImpl extends CreatableUpdatableImpl implements SavedSearch, SavedSearch.Definition, SavedSearch.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String savedSearchId; + + SavedSearchImpl(String name, LogAnalyticsManager manager) { + super(name, new SavedSearchInner()); + this.manager = manager; + // Set resource name + this.savedSearchId = name; + // + } + + SavedSearchImpl(SavedSearchInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.savedSearchId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.savedSearchId = IdParsingUtils.getValueFromIdByName(inner.id(), "savedSearches"); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + SavedSearchesInner client = this.manager().inner().savedSearches(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.savedSearchId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + SavedSearchesInner client = this.manager().inner().savedSearches(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.savedSearchId, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + SavedSearchesInner client = this.manager().inner().savedSearches(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.savedSearchId); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String category() { + return this.inner().category(); + } + + @Override + public String displayName() { + return this.inner().displayName(); + } + + @Override + public String etag() { + return this.inner().etag(); + } + + @Override + public String functionAlias() { + return this.inner().functionAlias(); + } + + @Override + public String functionParameters() { + return this.inner().functionParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String query() { + return this.inner().query(); + } + + @Override + public List tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Long version() { + return this.inner().version(); + } + + @Override + public SavedSearchImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public SavedSearchImpl withCategory(String category) { + this.inner().withCategory(category); + return this; + } + + @Override + public SavedSearchImpl withDisplayName(String displayName) { + this.inner().withDisplayName(displayName); + return this; + } + + @Override + public SavedSearchImpl withQuery(String query) { + this.inner().withQuery(query); + return this; + } + + @Override + public SavedSearchImpl withEtag(String etag) { + this.inner().withEtag(etag); + return this; + } + + @Override + public SavedSearchImpl withFunctionAlias(String functionAlias) { + this.inner().withFunctionAlias(functionAlias); + return this; + } + + @Override + public SavedSearchImpl withFunctionParameters(String functionParameters) { + this.inner().withFunctionParameters(functionParameters); + return this; + } + + @Override + public SavedSearchImpl withTags(List tags) { + this.inner().withTags(tags); + return this; + } + + @Override + public SavedSearchImpl withVersion(Long version) { + this.inner().withVersion(version); + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchInner.java new file mode 100644 index 000000000000..5de77f9f2480 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchInner.java @@ -0,0 +1,236 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Tag; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Value object for saved search results. + */ +@JsonFlatten +public class SavedSearchInner extends ProxyResource { + /** + * The ETag of the saved search. + */ + @JsonProperty(value = "etag") + private String etag; + + /** + * The category of the saved search. This helps the user to find a saved + * search faster. + */ + @JsonProperty(value = "properties.category", required = true) + private String category; + + /** + * Saved search display name. + */ + @JsonProperty(value = "properties.displayName", required = true) + private String displayName; + + /** + * The query expression for the saved search. + */ + @JsonProperty(value = "properties.query", required = true) + private String query; + + /** + * The function alias if query serves as a function. + */ + @JsonProperty(value = "properties.functionAlias") + private String functionAlias; + + /** + * The optional function parameters if query serves as a function. Value + * should be in the following format: 'param-name1:type1 = default_value1, + * param-name2:type2 = default_value2'. For more examples and proper syntax + * please refer to + * https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + */ + @JsonProperty(value = "properties.functionParameters") + private String functionParameters; + + /** + * The version number of the query language. The current version is 2 and + * is the default. + */ + @JsonProperty(value = "properties.version") + private Long version; + + /** + * The tags attached to the saved search. + */ + @JsonProperty(value = "properties.tags") + private List tags; + + /** + * Get the ETag of the saved search. + * + * @return the etag value + */ + public String etag() { + return this.etag; + } + + /** + * Set the ETag of the saved search. + * + * @param etag the etag value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withEtag(String etag) { + this.etag = etag; + return this; + } + + /** + * Get the category of the saved search. This helps the user to find a saved search faster. + * + * @return the category value + */ + public String category() { + return this.category; + } + + /** + * Set the category of the saved search. This helps the user to find a saved search faster. + * + * @param category the category value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withCategory(String category) { + this.category = category; + return this; + } + + /** + * Get saved search display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set saved search display name. + * + * @param displayName the displayName value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the query expression for the saved search. + * + * @return the query value + */ + public String query() { + return this.query; + } + + /** + * Set the query expression for the saved search. + * + * @param query the query value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the function alias if query serves as a function. + * + * @return the functionAlias value + */ + public String functionAlias() { + return this.functionAlias; + } + + /** + * Set the function alias if query serves as a function. + * + * @param functionAlias the functionAlias value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withFunctionAlias(String functionAlias) { + this.functionAlias = functionAlias; + return this; + } + + /** + * Get the optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + * + * @return the functionParameters value + */ + public String functionParameters() { + return this.functionParameters; + } + + /** + * Set the optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + * + * @param functionParameters the functionParameters value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withFunctionParameters(String functionParameters) { + this.functionParameters = functionParameters; + return this; + } + + /** + * Get the version number of the query language. The current version is 2 and is the default. + * + * @return the version value + */ + public Long version() { + return this.version; + } + + /** + * Set the version number of the query language. The current version is 2 and is the default. + * + * @param version the version value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withVersion(Long version) { + this.version = version; + return this; + } + + /** + * Get the tags attached to the saved search. + * + * @return the tags value + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags attached to the saved search. + * + * @param tags the tags value to set + * @return the SavedSearchInner object itself. + */ + public SavedSearchInner withTags(List tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesImpl.java new file mode 100644 index 000000000000..2829e8f1c948 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesImpl.java @@ -0,0 +1,79 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SavedSearches; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SavedSearchesListResult; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SavedSearch; + +class SavedSearchesImpl extends WrapperImpl implements SavedSearches { + private final LogAnalyticsManager manager; + + SavedSearchesImpl(LogAnalyticsManager manager) { + super(manager.inner().savedSearches()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public SavedSearchImpl define(String name) { + return wrapModel(name); + } + + private SavedSearchImpl wrapModel(SavedSearchInner inner) { + return new SavedSearchImpl(inner, manager()); + } + + private SavedSearchImpl wrapModel(String name) { + return new SavedSearchImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + SavedSearchesInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public SavedSearchesListResult call(SavedSearchesListResultInner inner) { + return new SavedSearchesListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + SavedSearchesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, savedSearchId) + .flatMap(new Func1>() { + @Override + public Observable call(SavedSearchInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((SavedSearch)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + SavedSearchesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, savedSearchId).toCompletable(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesInner.java new file mode 100644 index 000000000000..8f814fd4dbb0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesInner.java @@ -0,0 +1,448 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.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 SavedSearches. + */ +public class SavedSearchesInner { + /** The Retrofit service to perform REST calls. */ + private SavedSearchesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of SavedSearchesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SavedSearchesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(SavedSearchesService.class); + this.client = client; + } + + /** + * The interface defining all the services for SavedSearches to be + * used by Retrofit to perform actually REST calls. + */ + interface SavedSearchesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SavedSearches delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("savedSearchId") String savedSearchId, @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.loganalytics.v2020_03_01_preview.SavedSearches createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("savedSearchId") String savedSearchId, @Query("api-version") String apiVersion, @Body SavedSearchInner parameters, @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.loganalytics.v2020_03_01_preview.SavedSearches get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("savedSearchId") String savedSearchId, @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.loganalytics.v2020_03_01_preview.SavedSearches listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches") + Observable> listByWorkspace(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName, String savedSearchId) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).toBlocking().single().body(); + } + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @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 workspaceName, String savedSearchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId), serviceCallback); + } + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified saved search in a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (savedSearchId == null) { + throw new IllegalArgumentException("Parameter savedSearchId 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.delete(this.client.subscriptionId(), resourceGroupName, workspaceName, savedSearchId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @param parameters The parameters required to save a search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SavedSearchInner object if successful. + */ + public SavedSearchInner createOrUpdate(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @param parameters The parameters required to save a search. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId, parameters), serviceCallback); + } + + /** + * Creates or updates a saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @param parameters The parameters required to save a search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId, parameters).map(new Func1, SavedSearchInner>() { + @Override + public SavedSearchInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @param parameters The parameters required to save a search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (savedSearchId == null) { + throw new IllegalArgumentException("Parameter savedSearchId 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, workspaceName, savedSearchId, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SavedSearchInner object if successful. + */ + public SavedSearchInner get(String resourceGroupName, String workspaceName, String savedSearchId) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).toBlocking().single().body(); + } + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String savedSearchId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId), serviceCallback); + } + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, savedSearchId).map(new Func1, SavedSearchInner>() { + @Override + public SavedSearchInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the specified saved search for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param savedSearchId The id of the saved search. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String savedSearchId) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (savedSearchId == null) { + throw new IllegalArgumentException("Parameter savedSearchId 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.get(this.client.subscriptionId(), resourceGroupName, workspaceName, savedSearchId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SavedSearchesListResultInner object if successful. + */ + public SavedSearchesListResultInner listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 listByWorkspaceAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchesListResultInner object + */ + public Observable listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, SavedSearchesListResultInner>() { + @Override + public SavedSearchesListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the saved searches for a given Log Analytics Workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SavedSearchesListResultInner object + */ + public Observable> listByWorkspaceWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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.listByWorkspace(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByWorkspaceDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesListResultImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesListResultImpl.java new file mode 100644 index 000000000000..dea4aa5e63e2 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesListResultImpl.java @@ -0,0 +1,32 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SavedSearchesListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class SavedSearchesListResultImpl extends WrapperImpl implements SavedSearchesListResult { + private final LogAnalyticsManager manager; + SavedSearchesListResultImpl(SavedSearchesListResultInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesListResultInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesListResultInner.java new file mode 100644 index 000000000000..f5a6503b2b5a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SavedSearchesListResultInner.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.loganalytics.v2020_03_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The saved search list operation response. + */ +public class SavedSearchesListResultInner { + /** + * The array of result values. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the array of result values. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the array of result values. + * + * @param value the value value to set + * @return the SavedSearchesListResultInner object itself. + */ + public SavedSearchesListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SchemasImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SchemasImpl.java new file mode 100644 index 000000000000..5996e72697a2 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SchemasImpl.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. + * abc + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Schemas; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SearchGetSchemaResponse; + +class SchemasImpl extends WrapperImpl implements Schemas { + private final LogAnalyticsManager manager; + + SchemasImpl(LogAnalyticsManager manager) { + super(manager.inner().schemas()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName) { + SchemasInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public SearchGetSchemaResponse call(SearchGetSchemaResponseInner inner) { + return new SearchGetSchemaResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SchemasInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SchemasInner.java new file mode 100644 index 000000000000..f1bbbb69e12f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SchemasInner.java @@ -0,0 +1,146 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 Schemas. + */ +public class SchemasInner { + /** The Retrofit service to perform REST calls. */ + private SchemasService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of SchemasInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SchemasInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(SchemasService.class); + this.client = client; + } + + /** + * The interface defining all the services for Schemas to be + * used by Retrofit to perform actually REST calls. + */ + interface SchemasService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Schemas get" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SearchGetSchemaResponseInner object if successful. + */ + public SearchGetSchemaResponseInner get(String resourceGroupName, String workspaceName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchGetSchemaResponseInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, SearchGetSchemaResponseInner>() { + @Override + public SearchGetSchemaResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the schema for a given workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SearchGetSchemaResponseInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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.get(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SearchGetSchemaResponseImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SearchGetSchemaResponseImpl.java new file mode 100644 index 000000000000..e05dec819784 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SearchGetSchemaResponseImpl.java @@ -0,0 +1,39 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SearchGetSchemaResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SearchMetadata; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SearchSchemaValue; + +class SearchGetSchemaResponseImpl extends WrapperImpl implements SearchGetSchemaResponse { + private final LogAnalyticsManager manager; + SearchGetSchemaResponseImpl(SearchGetSchemaResponseInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public SearchMetadata metadata() { + return this.inner().metadata(); + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SearchGetSchemaResponseInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SearchGetSchemaResponseInner.java new file mode 100644 index 000000000000..c23ad0c1ec28 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SearchGetSchemaResponseInner.java @@ -0,0 +1,72 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SearchMetadata; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SearchSchemaValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The get schema operation response. + */ +public class SearchGetSchemaResponseInner { + /** + * The metadata from search results. + */ + @JsonProperty(value = "metadata") + private SearchMetadata metadata; + + /** + * The array of result values. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the metadata from search results. + * + * @return the metadata value + */ + public SearchMetadata metadata() { + return this.metadata; + } + + /** + * Set the metadata from search results. + * + * @param metadata the metadata value to set + * @return the SearchGetSchemaResponseInner object itself. + */ + public SearchGetSchemaResponseInner withMetadata(SearchMetadata metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the array of result values. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the array of result values. + * + * @param value the value value to set + * @return the SearchGetSchemaResponseInner object itself. + */ + public SearchGetSchemaResponseInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysImpl.java new file mode 100644 index 000000000000..a9c814a3a70b --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SharedKeys; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class SharedKeysImpl extends WrapperImpl implements SharedKeys { + private final LogAnalyticsManager manager; + SharedKeysImpl(SharedKeysInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public String primarySharedKey() { + return this.inner().primarySharedKey(); + } + + @Override + public String secondarySharedKey() { + return this.inner().secondarySharedKey(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysInner.java new file mode 100644 index 000000000000..313ced6378fb --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysInner.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.loganalytics.v2020_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The shared keys for a workspace. + */ +public class SharedKeysInner { + /** + * The primary shared key of a workspace. + */ + @JsonProperty(value = "primarySharedKey") + private String primarySharedKey; + + /** + * The secondary shared key of a workspace. + */ + @JsonProperty(value = "secondarySharedKey") + private String secondarySharedKey; + + /** + * Get the primary shared key of a workspace. + * + * @return the primarySharedKey value + */ + public String primarySharedKey() { + return this.primarySharedKey; + } + + /** + * Set the primary shared key of a workspace. + * + * @param primarySharedKey the primarySharedKey value to set + * @return the SharedKeysInner object itself. + */ + public SharedKeysInner withPrimarySharedKey(String primarySharedKey) { + this.primarySharedKey = primarySharedKey; + return this; + } + + /** + * Get the secondary shared key of a workspace. + * + * @return the secondarySharedKey value + */ + public String secondarySharedKey() { + return this.secondarySharedKey; + } + + /** + * Set the secondary shared key of a workspace. + * + * @param secondarySharedKey the secondarySharedKey value to set + * @return the SharedKeysInner object itself. + */ + public SharedKeysInner withSecondarySharedKey(String secondarySharedKey) { + this.secondarySharedKey = secondarySharedKey; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysOperationsImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysOperationsImpl.java new file mode 100644 index 000000000000..1710329f83eb --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysOperationsImpl.java @@ -0,0 +1,54 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SharedKeysOperations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SharedKeys; + +class SharedKeysOperationsImpl extends WrapperImpl implements SharedKeysOperations { + private final LogAnalyticsManager manager; + + SharedKeysOperationsImpl(LogAnalyticsManager manager) { + super(manager.inner().sharedKeysOperations()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable getSharedKeysAsync(String resourceGroupName, String workspaceName) { + SharedKeysOperationsInner client = this.inner(); + return client.getSharedKeysAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public SharedKeys call(SharedKeysInner inner) { + return new SharedKeysImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateAsync(String resourceGroupName, String workspaceName) { + SharedKeysOperationsInner client = this.inner(); + return client.regenerateAsync(resourceGroupName, workspaceName) + .map(new Func1() { + @Override + public SharedKeys call(SharedKeysInner inner) { + return new SharedKeysImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysOperationsInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysOperationsInner.java new file mode 100644 index 000000000000..8be081d63581 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/SharedKeysOperationsInner.java @@ -0,0 +1,236 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 SharedKeysOperations. + */ +public class SharedKeysOperationsInner { + /** The Retrofit service to perform REST calls. */ + private SharedKeysOperationsService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of SharedKeysOperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public SharedKeysOperationsInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(SharedKeysOperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for SharedKeysOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface SharedKeysOperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.SharedKeysOperations getSharedKeys" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys") + Observable> getSharedKeys(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2020_03_01_preview.SharedKeysOperations regenerate" }) + @POST("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey") + Observable> regenerate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the shared keys for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedKeysInner object if successful. + */ + public SharedKeysInner getSharedKeys(String resourceGroupName, String workspaceName) { + return getSharedKeysWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets the shared keys for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 getSharedKeysAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getSharedKeysWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets the shared keys for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedKeysInner object + */ + public Observable getSharedKeysAsync(String resourceGroupName, String workspaceName) { + return getSharedKeysWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, SharedKeysInner>() { + @Override + public SharedKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the shared keys for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedKeysInner object + */ + public Observable> getSharedKeysWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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.getSharedKeys(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getSharedKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getSharedKeysDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SharedKeysInner object if successful. + */ + public SharedKeysInner regenerate(String resourceGroupName, String workspaceName) { + return regenerateWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 regenerateAsync(String resourceGroupName, String workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedKeysInner object + */ + public Observable regenerateAsync(String resourceGroupName, String workspaceName) { + return regenerateWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, SharedKeysInner>() { + @Override + public SharedKeysInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational Insights agents to the workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SharedKeysInner object + */ + public Observable> regenerateWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.regenerate(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightConfigsImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightConfigsImpl.java new file mode 100644 index 000000000000..4fde079f0af0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightConfigsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageInsightConfigs; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageInsight; + +class StorageInsightConfigsImpl extends WrapperImpl implements StorageInsightConfigs { + private final LogAnalyticsManager manager; + + StorageInsightConfigsImpl(LogAnalyticsManager manager) { + super(manager.inner().storageInsightConfigs()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public StorageInsightImpl define(String name) { + return wrapModel(name); + } + + private StorageInsightImpl wrapModel(StorageInsightInner inner) { + return new StorageInsightImpl(inner, manager()); + } + + private StorageInsightImpl wrapModel(String name) { + return new StorageInsightImpl(name, this.manager()); + } + + @Override + public Observable listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) { + StorageInsightConfigsInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public StorageInsight call(StorageInsightInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + StorageInsightConfigsInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, storageInsightName) + .flatMap(new Func1>() { + @Override + public Observable call(StorageInsightInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((StorageInsight)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + StorageInsightConfigsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, workspaceName, storageInsightName).toCompletable(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightConfigsInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightConfigsInner.java new file mode 100644 index 000000000000..76f0b2143f44 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightConfigsInner.java @@ -0,0 +1,608 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in StorageInsightConfigs. + */ +public class StorageInsightConfigsInner { + /** The Retrofit service to perform REST calls. */ + private StorageInsightConfigsService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of StorageInsightConfigsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public StorageInsightConfigsInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(StorageInsightConfigsService.class); + this.client = client; + } + + /** + * The interface defining all the services for StorageInsightConfigs to be + * used by Retrofit to perform actually REST calls. + */ + interface StorageInsightConfigsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageInsightConfigs createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("storageInsightName") String storageInsightName, @Path("subscriptionId") String subscriptionId, @Body StorageInsightInner parameters, @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.loganalytics.v2020_03_01_preview.StorageInsightConfigs get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("storageInsightName") String storageInsightName, @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.loganalytics.v2020_03_01_preview.StorageInsightConfigs delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("storageInsightName") String storageInsightName, @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.loganalytics.v2020_03_01_preview.StorageInsightConfigs listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs") + Observable> listByWorkspace(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2020_03_01_preview.StorageInsightConfigs listByWorkspaceNext" }) + @GET + Observable> listByWorkspaceNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Create or update a storage insight. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param parameters The parameters required to create or update a storage insight. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageInsightInner object if successful. + */ + public StorageInsightInner createOrUpdate(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a storage insight. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param parameters The parameters required to create or update a storage insight. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName, parameters), serviceCallback); + } + + /** + * Create or update a storage insight. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param parameters The parameters required to create or update a storage insight. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageInsightInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName, parameters).map(new Func1, StorageInsightInner>() { + @Override + public StorageInsightInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a storage insight. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param parameters The parameters required to create or update a storage insight. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageInsightInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (storageInsightName == null) { + throw new IllegalArgumentException("Parameter storageInsightName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.createOrUpdate(resourceGroupName, workspaceName, storageInsightName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageInsightInner object if successful. + */ + public StorageInsightInner get(String resourceGroupName, String workspaceName, String storageInsightName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName).toBlocking().single().body(); + } + + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String storageInsightName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName), serviceCallback); + } + + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageInsightInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName).map(new Func1, StorageInsightInner>() { + @Override + public StorageInsightInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a storage insight instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageInsightInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (storageInsightName == null) { + throw new IllegalArgumentException("Parameter storageInsightName is required and cannot be null."); + } + 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.get(resourceGroupName, workspaceName, storageInsightName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName, String storageInsightName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName).toBlocking().single().body(); + } + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @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 workspaceName, String storageInsightName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName), serviceCallback); + } + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, storageInsightName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a storageInsightsConfigs resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param storageInsightName Name of the storageInsightsConfigs resource + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, String storageInsightName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (storageInsightName == null) { + throw new IllegalArgumentException("Parameter storageInsightName is required and cannot be null."); + } + 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.delete(resourceGroupName, workspaceName, storageInsightName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageInsightInner> object if successful. + */ + public PagedList listByWorkspace(final String resourceGroupName, final String workspaceName) { + ServiceResponse> response = listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageInsightInner> object + */ + public Observable> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageInsightInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName) { + return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the storage insight instances within a workspace. + * + ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. + ServiceResponse> * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageInsightInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceSinglePageAsync(final String resourceGroupName, final String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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.listByWorkspace(resourceGroupName, workspaceName, 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 = listByWorkspaceDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<StorageInsightInner> object if successful. + */ + public PagedList listByWorkspaceNext(final String nextPageLink) { + ServiceResponse> response = listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listByWorkspaceNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByWorkspaceNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageInsightInner> object + */ + public Observable> listByWorkspaceNextAsync(final String nextPageLink) { + return listByWorkspaceNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the storage insight instances within a workspace. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<StorageInsightInner> object + */ + public Observable>> listByWorkspaceNextWithServiceResponseAsync(final String nextPageLink) { + return listByWorkspaceNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the storage insight instances within a workspace. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<StorageInsightInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByWorkspaceNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByWorkspaceNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByWorkspaceNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightImpl.java new file mode 100644 index 000000000000..4c971588ed58 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightImpl.java @@ -0,0 +1,158 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageInsight; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageAccount; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageInsightStatus; +import java.util.Map; + +class StorageInsightImpl extends CreatableUpdatableImpl implements StorageInsight, StorageInsight.Definition, StorageInsight.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String storageInsightName; + + StorageInsightImpl(String name, LogAnalyticsManager manager) { + super(name, new StorageInsightInner()); + this.manager = manager; + // Set resource name + this.storageInsightName = name; + // + } + + StorageInsightImpl(StorageInsightInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.storageInsightName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.storageInsightName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageInsightConfigs"); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + StorageInsightConfigsInner client = this.manager().inner().storageInsightConfigs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.storageInsightName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + StorageInsightConfigsInner client = this.manager().inner().storageInsightConfigs(); + return client.createOrUpdateAsync(this.resourceGroupName, this.workspaceName, this.storageInsightName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + StorageInsightConfigsInner client = this.manager().inner().storageInsightConfigs(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.storageInsightName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public List containers() { + return this.inner().containers(); + } + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public StorageInsightStatus status() { + return this.inner().status(); + } + + @Override + public StorageAccount storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public List tables() { + return this.inner().tables(); + } + + @Override + public Map tags() { + return this.inner().tags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StorageInsightImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + @Override + public StorageInsightImpl withStorageAccount(StorageAccount storageAccount) { + this.inner().withStorageAccount(storageAccount); + return this; + } + + @Override + public StorageInsightImpl withContainers(List containers) { + this.inner().withContainers(containers); + return this; + } + + @Override + public StorageInsightImpl withETag(String eTag) { + this.inner().withETag(eTag); + return this; + } + + @Override + public StorageInsightImpl withTables(List tables) { + this.inner().withTables(tables); + return this; + } + + @Override + public StorageInsightImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightInner.java new file mode 100644 index 000000000000..0a487be711d7 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/StorageInsightInner.java @@ -0,0 +1,169 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageAccount; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.StorageInsightStatus; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The top level storage insight resource container. + */ +@JsonFlatten +public class StorageInsightInner extends ProxyResource { + /** + * The names of the blob containers that the workspace should read. + */ + @JsonProperty(value = "properties.containers") + private List containers; + + /** + * The names of the Azure tables that the workspace should read. + */ + @JsonProperty(value = "properties.tables") + private List tables; + + /** + * The storage account connection details. + */ + @JsonProperty(value = "properties.storageAccount", required = true) + private StorageAccount storageAccount; + + /** + * The status of the storage insight. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private StorageInsightStatus status; + + /** + * The ETag of the storage insight. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the names of the blob containers that the workspace should read. + * + * @return the containers value + */ + public List containers() { + return this.containers; + } + + /** + * Set the names of the blob containers that the workspace should read. + * + * @param containers the containers value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the names of the Azure tables that the workspace should read. + * + * @return the tables value + */ + public List tables() { + return this.tables; + } + + /** + * Set the names of the Azure tables that the workspace should read. + * + * @param tables the tables value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withTables(List tables) { + this.tables = tables; + return this; + } + + /** + * Get the storage account connection details. + * + * @return the storageAccount value + */ + public StorageAccount storageAccount() { + return this.storageAccount; + } + + /** + * Set the storage account connection details. + * + * @param storageAccount the storageAccount value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withStorageAccount(StorageAccount storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Get the status of the storage insight. + * + * @return the status value + */ + public StorageInsightStatus status() { + return this.status; + } + + /** + * Get the ETag of the storage insight. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag of the storage insight. + * + * @param eTag the eTag value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the StorageInsightInner object itself. + */ + public StorageInsightInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TableImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TableImpl.java new file mode 100644 index 000000000000..ad72e2868d70 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TableImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Table; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class TableImpl extends CreatableUpdatableImpl implements Table, Table.Update { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String tableName; + private Integer uretentionInDays; + + TableImpl(String name, LogAnalyticsManager manager) { + super(name, new TableInner()); + this.manager = manager; + // Set resource name + this.tableName = name; + // + } + + TableImpl(TableInner inner, LogAnalyticsManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.tableName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups"); + this.workspaceName = IdParsingUtils.getValueFromIdByName(inner.id(), "workspaces"); + this.tableName = IdParsingUtils.getValueFromIdByName(inner.id(), "tables"); + // + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public Observable
createResourceAsync() { + TablesInner client = this.manager().inner().tables(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable
updateResourceAsync() { + TablesInner client = this.manager().inner().tables(); + return client.updateAsync(this.resourceGroupName, this.workspaceName, this.tableName, this.uretentionInDays) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TablesInner client = this.manager().inner().tables(); + return client.getAsync(this.resourceGroupName, this.workspaceName, this.tableName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public Integer retentionInDays() { + return this.inner().retentionInDays(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TableImpl withRetentionInDays(Integer retentionInDays) { + this.uretentionInDays = retentionInDays; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TableInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TableInner.java new file mode 100644 index 000000000000..18b4c2855871 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TableInner.java @@ -0,0 +1,47 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Workspace data table definition. + */ +@JsonFlatten +public class TableInner extends ProxyResource { + /** + * The data table data retention in days, between 30 and 730. Setting this + * property to null will default to the workspace retention. + */ + @JsonProperty(value = "properties.retentionInDays") + private Integer retentionInDays; + + /** + * Get the data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention. + * + * @return the retentionInDays value + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention. + * + * @param retentionInDays the retentionInDays value to set + * @return the TableInner object itself. + */ + public TableInner withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TablesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TablesImpl.java new file mode 100644 index 000000000000..18603fa5191d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TablesImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Tables; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Table; + +class TablesImpl extends WrapperImpl implements Tables { + private final LogAnalyticsManager manager; + + TablesImpl(LogAnalyticsManager manager) { + super(manager.inner().tables()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + private TableImpl wrapModel(TableInner inner) { + return new TableImpl(inner, manager()); + } + + @Override + public Observable
listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + TablesInner client = this.inner(); + return client.listByWorkspaceAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable
getAsync(String resourceGroupName, String workspaceName, String tableName) { + TablesInner client = this.inner(); + return client.getAsync(resourceGroupName, workspaceName, tableName) + .flatMap(new Func1>() { + @Override + public Observable
call(TableInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Table)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TablesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TablesInner.java new file mode 100644 index 000000000000..ed327a63b3e2 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/TablesInner.java @@ -0,0 +1,443 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.ErrorContractException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.PATCH; +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 Tables. + */ +public class TablesInner { + /** The Retrofit service to perform REST calls. */ + private TablesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of TablesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TablesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(TablesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tables to be + * used by Retrofit to perform actually REST calls. + */ + interface TablesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Tables listByWorkspace" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables") + Observable> listByWorkspace(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2020_03_01_preview.Tables update" }) + @PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TableInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Tables get" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("tableName") String tableName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the tables for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException 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<TableInner> object if successful. + */ + public List listByWorkspace(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets all the tables for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> listByWorkspaceAsync(String resourceGroupName, String workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets all the tables for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TableInner> object + */ + public Observable> listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the tables for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<TableInner> object + */ + public Observable>> listByWorkspaceWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.listByWorkspace(this.client.subscriptionId(), resourceGroupName, workspaceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByWorkspaceDelegate(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> listByWorkspaceDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorContractException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableInner object if successful. + */ + public TableInner update(String resourceGroupName, String workspaceName, String tableName) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName, tableName).toBlocking().single().body(); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @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 workspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, workspaceName, tableName), serviceCallback); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable updateAsync(String resourceGroupName, String workspaceName, String tableName) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String tableName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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 Integer retentionInDays = null; + TableInner parameters = new TableInner(); + parameters.withRetentionInDays(null); + return service.update(this.client.subscriptionId(), resourceGroupName, workspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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); + } + } + }); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param retentionInDays The data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableInner object if successful. + */ + public TableInner update(String resourceGroupName, String workspaceName, String tableName, Integer retentionInDays) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName, tableName, retentionInDays).toBlocking().single().body(); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param retentionInDays The data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention. + * @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 workspaceName, String tableName, Integer retentionInDays, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, workspaceName, tableName, retentionInDays), serviceCallback); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param retentionInDays The data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable updateAsync(String resourceGroupName, String workspaceName, String tableName, Integer retentionInDays) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName, tableName, retentionInDays).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a Log Analytics workspace table properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param retentionInDays The data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String workspaceName, String tableName, Integer retentionInDays) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + TableInner parameters = new TableInner(); + parameters.withRetentionInDays(retentionInDays); + return service.update(this.client.subscriptionId(), resourceGroupName, workspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, 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 ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + + /** + * Gets a Log Analytics workspace table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorContractException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableInner object if successful. + */ + public TableInner get(String resourceGroupName, String workspaceName, String tableName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, tableName).toBlocking().single().body(); + } + + /** + * Gets a Log Analytics workspace table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String workspaceName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, workspaceName, tableName), serviceCallback); + } + + /** + * Gets a Log Analytics workspace table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable getAsync(String resourceGroupName, String workspaceName, String tableName) { + return getWithServiceResponseAsync(resourceGroupName, workspaceName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a Log Analytics workspace table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param tableName The name of the table. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String workspaceName, String tableName) { + 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 (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.get(this.client.subscriptionId(), resourceGroupName, workspaceName, tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorContractException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorContractException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsageMetricImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsageMetricImpl.java new file mode 100644 index 000000000000..8030cb3856bc --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsageMetricImpl.java @@ -0,0 +1,62 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.UsageMetric; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.MetricName; +import org.joda.time.DateTime; + +class UsageMetricImpl extends WrapperImpl implements UsageMetric { + private final LogAnalyticsManager manager; + + UsageMetricImpl(UsageMetricInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public Double currentValue() { + return this.inner().currentValue(); + } + + @Override + public Double limit() { + return this.inner().limit(); + } + + @Override + public MetricName name() { + return this.inner().name(); + } + + @Override + public DateTime nextResetTime() { + return this.inner().nextResetTime(); + } + + @Override + public String quotaPeriod() { + return this.inner().quotaPeriod(); + } + + @Override + public String unit() { + return this.inner().unit(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsageMetricInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsageMetricInner.java new file mode 100644 index 000000000000..bc63a82c56d4 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsageMetricInner.java @@ -0,0 +1,176 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.MetricName; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A metric describing the usage of a resource. + */ +public class UsageMetricInner { + /** + * The name of the metric. + */ + @JsonProperty(value = "name") + private MetricName name; + + /** + * The units used for the metric. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * The current value of the metric. + */ + @JsonProperty(value = "currentValue") + private Double currentValue; + + /** + * The quota limit for the metric. + */ + @JsonProperty(value = "limit") + private Double limit; + + /** + * The time that the metric's value will reset. + */ + @JsonProperty(value = "nextResetTime") + private DateTime nextResetTime; + + /** + * The quota period that determines the length of time between value + * resets. + */ + @JsonProperty(value = "quotaPeriod") + private String quotaPeriod; + + /** + * Get the name of the metric. + * + * @return the name value + */ + public MetricName name() { + return this.name; + } + + /** + * Set the name of the metric. + * + * @param name the name value to set + * @return the UsageMetricInner object itself. + */ + public UsageMetricInner withName(MetricName name) { + this.name = name; + return this; + } + + /** + * Get the units used for the metric. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set the units used for the metric. + * + * @param unit the unit value to set + * @return the UsageMetricInner object itself. + */ + public UsageMetricInner withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get the current value of the metric. + * + * @return the currentValue value + */ + public Double currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the metric. + * + * @param currentValue the currentValue value to set + * @return the UsageMetricInner object itself. + */ + public UsageMetricInner withCurrentValue(Double currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the quota limit for the metric. + * + * @return the limit value + */ + public Double limit() { + return this.limit; + } + + /** + * Set the quota limit for the metric. + * + * @param limit the limit value to set + * @return the UsageMetricInner object itself. + */ + public UsageMetricInner withLimit(Double limit) { + this.limit = limit; + return this; + } + + /** + * Get the time that the metric's value will reset. + * + * @return the nextResetTime value + */ + public DateTime nextResetTime() { + return this.nextResetTime; + } + + /** + * Set the time that the metric's value will reset. + * + * @param nextResetTime the nextResetTime value to set + * @return the UsageMetricInner object itself. + */ + public UsageMetricInner withNextResetTime(DateTime nextResetTime) { + this.nextResetTime = nextResetTime; + return this; + } + + /** + * Get the quota period that determines the length of time between value resets. + * + * @return the quotaPeriod value + */ + public String quotaPeriod() { + return this.quotaPeriod; + } + + /** + * Set the quota period that determines the length of time between value resets. + * + * @param quotaPeriod the quotaPeriod value to set + * @return the UsageMetricInner object itself. + */ + public UsageMetricInner withQuotaPeriod(String quotaPeriod) { + this.quotaPeriod = quotaPeriod; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsagesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsagesImpl.java new file mode 100644 index 000000000000..5ed34883b99c --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsagesImpl.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Usages; +import rx.Observable; +import rx.functions.Func1; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.UsageMetric; + +class UsagesImpl extends WrapperImpl implements Usages { + private final LogAnalyticsManager manager; + + UsagesImpl(LogAnalyticsManager manager) { + super(manager.inner().usages()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + private UsageMetricImpl wrapModel(UsageMetricInner inner) { + return new UsageMetricImpl(inner, manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String workspaceName) { + UsagesInner client = this.inner(); + return client.listAsync(resourceGroupName, workspaceName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public UsageMetric call(UsageMetricInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsagesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsagesInner.java new file mode 100644 index 000000000000..bcdbe698ac2a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/UsagesInner.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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +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 Usages. + */ +public class UsagesInner { + /** The Retrofit service to perform REST calls. */ + private UsagesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of UsagesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public UsagesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(UsagesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Usages to be + * used by Retrofit to perform actually REST calls. + */ + interface UsagesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Usages list" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of usage metrics for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<UsageMetricInner> object if successful. + */ + public List list(String resourceGroupName, String workspaceName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets a list of usage metrics for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspaceName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets a list of usage metrics for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageMetricInner> object + */ + public Observable> listAsync(String resourceGroupName, String workspaceName) { + return listWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of usage metrics for a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<UsageMetricInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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(resourceGroupName, workspaceName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceImpl.java new file mode 100644 index 000000000000..02a0ccc468b1 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceImpl.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. + */ + +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Workspace; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePatch; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceSku; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceCapping; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.PublicNetworkAccessType; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.PrivateLinkScopedResource; +import rx.functions.Func1; + +class WorkspaceImpl extends GroupableResourceCoreImpl implements Workspace, Workspace.Definition, Workspace.Update { + private WorkspacePatch updateParameter; + WorkspaceImpl(String name, WorkspaceInner inner, LogAnalyticsManager manager) { + super(name, inner, manager); + this.updateParameter = new WorkspacePatch(); + } + + @Override + public Observable createResourceAsync() { + WorkspacesInner client = this.manager().inner().workspaces(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public WorkspaceInner call(WorkspaceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WorkspacesInner client = this.manager().inner().workspaces(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public WorkspaceInner call(WorkspaceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WorkspacesInner client = this.manager().inner().workspaces(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new WorkspacePatch(); + } + + @Override + public String customerId() { + return this.inner().customerId(); + } + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public List privateLinkScopedResources() { + return this.inner().privateLinkScopedResources(); + } + + @Override + public WorkspaceEntityStatus provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicNetworkAccessType publicNetworkAccessForIngestion() { + return this.inner().publicNetworkAccessForIngestion(); + } + + @Override + public PublicNetworkAccessType publicNetworkAccessForQuery() { + return this.inner().publicNetworkAccessForQuery(); + } + + @Override + public Integer retentionInDays() { + return this.inner().retentionInDays(); + } + + @Override + public WorkspaceSku sku() { + return this.inner().sku(); + } + + @Override + public WorkspaceCapping workspaceCapping() { + return this.inner().workspaceCapping(); + } + + @Override + public WorkspaceImpl withETag(String eTag) { + this.inner().withETag(eTag); + return this; + } + + @Override + public WorkspaceImpl withProvisioningState(WorkspaceEntityStatus provisioningState) { + if (isInCreateMode()) { + this.inner().withProvisioningState(provisioningState); + } else { + this.updateParameter.withProvisioningState(provisioningState); + } + return this; + } + + @Override + public WorkspaceImpl withPublicNetworkAccessForIngestion(PublicNetworkAccessType publicNetworkAccessForIngestion) { + if (isInCreateMode()) { + this.inner().withPublicNetworkAccessForIngestion(publicNetworkAccessForIngestion); + } else { + this.updateParameter.withPublicNetworkAccessForIngestion(publicNetworkAccessForIngestion); + } + return this; + } + + @Override + public WorkspaceImpl withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery) { + if (isInCreateMode()) { + this.inner().withPublicNetworkAccessForQuery(publicNetworkAccessForQuery); + } else { + this.updateParameter.withPublicNetworkAccessForQuery(publicNetworkAccessForQuery); + } + return this; + } + + @Override + public WorkspaceImpl withRetentionInDays(Integer retentionInDays) { + if (isInCreateMode()) { + this.inner().withRetentionInDays(retentionInDays); + } else { + this.updateParameter.withRetentionInDays(retentionInDays); + } + return this; + } + + @Override + public WorkspaceImpl withSku(WorkspaceSku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public WorkspaceImpl withWorkspaceCapping(WorkspaceCapping workspaceCapping) { + if (isInCreateMode()) { + this.inner().withWorkspaceCapping(workspaceCapping); + } else { + this.updateParameter.withWorkspaceCapping(workspaceCapping); + } + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceInner.java new file mode 100644 index 000000000000..93cd280d9ae6 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceInner.java @@ -0,0 +1,244 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceSku; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceCapping; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.PublicNetworkAccessType; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.PrivateLinkScopedResource; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The top level Workspace resource container. + */ +@JsonFlatten +public class WorkspaceInner extends Resource { + /** + * The provisioning state of the workspace. Possible values include: + * 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', + * 'ProvisioningAccount', 'Updating'. + */ + @JsonProperty(value = "properties.provisioningState") + private WorkspaceEntityStatus provisioningState; + + /** + * This is a read-only property. Represents the ID associated with the + * workspace. + */ + @JsonProperty(value = "properties.customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; + + /** + * The SKU of the workspace. + */ + @JsonProperty(value = "properties.sku") + private WorkspaceSku sku; + + /** + * The workspace data retention in days. -1 means Unlimited retention for + * the Unlimited Sku. 730 days is the maximum allowed for all other Skus. + */ + @JsonProperty(value = "properties.retentionInDays") + private Integer retentionInDays; + + /** + * The daily volume cap for ingestion. + */ + @JsonProperty(value = "properties.workspaceCapping") + private WorkspaceCapping workspaceCapping; + + /** + * The network access type for accessing Log Analytics ingestion. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccessForIngestion") + private PublicNetworkAccessType publicNetworkAccessForIngestion; + + /** + * The network access type for accessing Log Analytics query. Possible + * values include: 'Enabled', 'Disabled'. + */ + @JsonProperty(value = "properties.publicNetworkAccessForQuery") + private PublicNetworkAccessType publicNetworkAccessForQuery; + + /** + * List of linked private link scope resources. + */ + @JsonProperty(value = "properties.privateLinkScopedResources", access = JsonProperty.Access.WRITE_ONLY) + private List privateLinkScopedResources; + + /** + * The ETag of the workspace. + */ + @JsonProperty(value = "eTag") + private String eTag; + + /** + * Get the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating'. + * + * @return the provisioningState value + */ + public WorkspaceEntityStatus provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of the workspace. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating'. + * + * @param provisioningState the provisioningState value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withProvisioningState(WorkspaceEntityStatus provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get this is a read-only property. Represents the ID associated with the workspace. + * + * @return the customerId value + */ + public String customerId() { + return this.customerId; + } + + /** + * Get the SKU of the workspace. + * + * @return the sku value + */ + public WorkspaceSku sku() { + return this.sku; + } + + /** + * Set the SKU of the workspace. + * + * @param sku the sku value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withSku(WorkspaceSku sku) { + this.sku = sku; + return this; + } + + /** + * Get the workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus. + * + * @return the retentionInDays value + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus. + * + * @param retentionInDays the retentionInDays value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withRetentionInDays(Integer retentionInDays) { + this.retentionInDays = retentionInDays; + return this; + } + + /** + * Get the daily volume cap for ingestion. + * + * @return the workspaceCapping value + */ + public WorkspaceCapping workspaceCapping() { + return this.workspaceCapping; + } + + /** + * Set the daily volume cap for ingestion. + * + * @param workspaceCapping the workspaceCapping value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withWorkspaceCapping(WorkspaceCapping workspaceCapping) { + this.workspaceCapping = workspaceCapping; + return this; + } + + /** + * Get the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccessForIngestion value + */ + public PublicNetworkAccessType publicNetworkAccessForIngestion() { + return this.publicNetworkAccessForIngestion; + } + + /** + * Set the network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccessForIngestion the publicNetworkAccessForIngestion value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withPublicNetworkAccessForIngestion(PublicNetworkAccessType publicNetworkAccessForIngestion) { + this.publicNetworkAccessForIngestion = publicNetworkAccessForIngestion; + return this; + } + + /** + * Get the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled'. + * + * @return the publicNetworkAccessForQuery value + */ + public PublicNetworkAccessType publicNetworkAccessForQuery() { + return this.publicNetworkAccessForQuery; + } + + /** + * Set the network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled'. + * + * @param publicNetworkAccessForQuery the publicNetworkAccessForQuery value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withPublicNetworkAccessForQuery(PublicNetworkAccessType publicNetworkAccessForQuery) { + this.publicNetworkAccessForQuery = publicNetworkAccessForQuery; + return this; + } + + /** + * Get list of linked private link scope resources. + * + * @return the privateLinkScopedResources value + */ + public List privateLinkScopedResources() { + return this.privateLinkScopedResources; + } + + /** + * Get the ETag of the workspace. + * + * @return the eTag value + */ + public String eTag() { + return this.eTag; + } + + /** + * Set the ETag of the workspace. + * + * @param eTag the eTag value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withETag(String eTag) { + this.eTag = eTag; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceModelImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceModelImpl.java new file mode 100644 index 000000000000..c3375e3db16b --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspaceModelImpl.java @@ -0,0 +1,91 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceModel; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.PrivateLinkScopedResource; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.PublicNetworkAccessType; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceSku; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspaceCapping; + +class WorkspaceModelImpl extends GroupableResourceCoreImpl implements WorkspaceModel { + WorkspaceModelImpl(String name, WorkspaceInner inner, LogAnalyticsManager manager) { + super(name, inner, manager); + } + + @Override + public Observable createResourceAsync() { + DeletedWorkspacesInner client = this.manager().inner().deletedWorkspaces(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + DeletedWorkspacesInner client = this.manager().inner().deletedWorkspaces(); + return null; // NOP updateResourceAsync implementation as update is not supported + } + + @Override + protected Observable getInnerAsync() { + DeletedWorkspacesInner client = this.manager().inner().deletedWorkspaces(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + + + @Override + public String customerId() { + return this.inner().customerId(); + } + + @Override + public String eTag() { + return this.inner().eTag(); + } + + @Override + public List privateLinkScopedResources() { + return this.inner().privateLinkScopedResources(); + } + + @Override + public WorkspaceEntityStatus provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public PublicNetworkAccessType publicNetworkAccessForIngestion() { + return this.inner().publicNetworkAccessForIngestion(); + } + + @Override + public PublicNetworkAccessType publicNetworkAccessForQuery() { + return this.inner().publicNetworkAccessForQuery(); + } + + @Override + public Integer retentionInDays() { + return this.inner().retentionInDays(); + } + + @Override + public WorkspaceSku sku() { + return this.inner().sku(); + } + + @Override + public WorkspaceCapping workspaceCapping() { + return this.inner().workspaceCapping(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeResponseImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeResponseImpl.java new file mode 100644 index 000000000000..92ab7a9263a4 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeResponseImpl.java @@ -0,0 +1,31 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurgeResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class WorkspacePurgeResponseImpl extends WrapperImpl implements WorkspacePurgeResponse { + private final LogAnalyticsManager manager; + WorkspacePurgeResponseImpl(WorkspacePurgeResponseInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + @Override + public String operationId() { + return this.inner().operationId(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeResponseInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeResponseInner.java new file mode 100644 index 000000000000..96cdcea3813b --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeResponseInner.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.loganalytics.v2020_03_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response containing operationId for a specific purge action. + */ +public class WorkspacePurgeResponseInner { + /** + * Id to use when querying for status for a particular purge operation. + */ + @JsonProperty(value = "operationId", required = true) + private String operationId; + + /** + * Get id to use when querying for status for a particular purge operation. + * + * @return the operationId value + */ + public String operationId() { + return this.operationId; + } + + /** + * Set id to use when querying for status for a particular purge operation. + * + * @param operationId the operationId value to set + * @return the WorkspacePurgeResponseInner object itself. + */ + public WorkspacePurgeResponseInner withOperationId(String operationId) { + this.operationId = operationId; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeStatusResponseImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeStatusResponseImpl.java new file mode 100644 index 000000000000..f6ee51544676 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeStatusResponseImpl.java @@ -0,0 +1,39 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurgeStatusResponse; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.PurgeState; + +class WorkspacePurgeStatusResponseImpl extends WrapperImpl implements WorkspacePurgeStatusResponse { + private final LogAnalyticsManager manager; + private String resourceGroupName; + private String workspaceName; + private String purgeId; + + WorkspacePurgeStatusResponseImpl(WorkspacePurgeStatusResponseInner inner, LogAnalyticsManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LogAnalyticsManager manager() { + return this.manager; + } + + + + @Override + public PurgeState status() { + return this.inner().status(); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeStatusResponseInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeStatusResponseInner.java new file mode 100644 index 000000000000..c709936ffbba --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgeStatusResponseInner.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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.PurgeState; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Response containing status for a specific purge operation. + */ +public class WorkspacePurgeStatusResponseInner { + /** + * Status of the operation represented by the requested Id. Possible values + * include: 'pending', 'completed'. + */ + @JsonProperty(value = "status", required = true) + private PurgeState status; + + /** + * Get status of the operation represented by the requested Id. Possible values include: 'pending', 'completed'. + * + * @return the status value + */ + public PurgeState status() { + return this.status; + } + + /** + * Set status of the operation represented by the requested Id. Possible values include: 'pending', 'completed'. + * + * @param status the status value to set + * @return the WorkspacePurgeStatusResponseInner object itself. + */ + public WorkspacePurgeStatusResponseInner withStatus(PurgeState status) { + this.status = status; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgesImpl.java new file mode 100644 index 000000000000..f2bf232a43cd --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgesImpl.java @@ -0,0 +1,64 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurges; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurgeStatusResponse; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurgeResponse; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurgeBody; + +class WorkspacePurgesImpl extends WrapperImpl implements WorkspacePurges { + private final LogAnalyticsManager manager; + + WorkspacePurgesImpl(LogAnalyticsManager manager) { + super(manager.inner().workspacePurges()); + this.manager = manager; + } + + public LogAnalyticsManager manager() { + return this.manager; + } + + private WorkspacePurgeStatusResponseImpl wrapModel(WorkspacePurgeStatusResponseInner inner) { + return new WorkspacePurgeStatusResponseImpl(inner, manager()); + } + + @Override + public Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName, String purgeId) { + WorkspacePurgesInner client = this.inner(); + return client.getPurgeStatusAsync(resourceGroupName, workspaceName, purgeId) + .flatMap(new Func1>() { + @Override + public Observable call(WorkspacePurgeStatusResponseInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((WorkspacePurgeStatusResponse)wrapModel(inner)); + } + } + }); + } + + @Override + public Observable purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { + WorkspacePurgesInner client = this.inner(); + return client.purgeAsync(resourceGroupName, workspaceName, body) + .map(new Func1() { + @Override + public WorkspacePurgeResponse call(WorkspacePurgeResponseInner inner) { + return new WorkspacePurgeResponseImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgesInner.java new file mode 100644 index 000000000000..5ea79a4f40ab --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacePurgesInner.java @@ -0,0 +1,261 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurgeBody; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurgePurgeHeaders; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.ServiceResponseWithHeaders; +import com.microsoft.rest.Validator; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 WorkspacePurges. + */ +public class WorkspacePurgesInner { + /** The Retrofit service to perform REST calls. */ + private WorkspacePurgesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of WorkspacePurgesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WorkspacePurgesInner(Retrofit retrofit, OperationalInsightsManagementClientImpl client) { + this.service = retrofit.create(WorkspacePurgesService.class); + this.client = client; + } + + /** + * The interface defining all the services for WorkspacePurges to be + * used by Retrofit to perform actually REST calls. + */ + interface WorkspacePurgesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePurges purge" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge") + Observable> purge(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("workspaceName") String workspaceName, @Query("api-version") String apiVersion, @Body WorkspacePurgeBody 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.loganalytics.v2020_03_01_preview.WorkspacePurges getPurgeStatus" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}") + Observable> getPurgeStatus(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Path("workspaceName") String workspaceName, @Path("purgeId") String purgeId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspacePurgeResponseInner object if successful. + */ + public WorkspacePurgeResponseInner purge(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { + return purgeWithServiceResponseAsync(resourceGroupName, workspaceName, body).toBlocking().single().body(); + } + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @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 purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body, final ServiceCallback serviceCallback) { + return ServiceFuture.fromHeaderResponse(purgeWithServiceResponseAsync(resourceGroupName, workspaceName, body), serviceCallback); + } + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspacePurgeResponseInner object + */ + public Observable purgeAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { + return purgeWithServiceResponseAsync(resourceGroupName, workspaceName, body).map(new Func1, WorkspacePurgeResponseInner>() { + @Override + public WorkspacePurgeResponseInner call(ServiceResponseWithHeaders response) { + return response.body(); + } + }); + } + + /** + * Purges data in an Log Analytics workspace by a set of user-defined filters. + In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the execution of purge requests by sending a single command whose predicate includes all user identities that require purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge request to verify that the results are expected. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspacePurgeResponseInner object + */ + public Observable> purgeWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspacePurgeBody body) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName 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.purge(resourceGroupName, this.client.subscriptionId(), workspaceName, this.client.apiVersion(), body, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponseWithHeaders clientResponse = purgeDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponseWithHeaders purgeDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .buildWithHeaders(response, WorkspacePurgePurgeHeaders.class); + } + + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspacePurgeStatusResponseInner object if successful. + */ + public WorkspacePurgeStatusResponseInner getPurgeStatus(String resourceGroupName, String workspaceName, String purgeId) { + return getPurgeStatusWithServiceResponseAsync(resourceGroupName, workspaceName, purgeId).toBlocking().single().body(); + } + + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @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 getPurgeStatusAsync(String resourceGroupName, String workspaceName, String purgeId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getPurgeStatusWithServiceResponseAsync(resourceGroupName, workspaceName, purgeId), serviceCallback); + } + + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspacePurgeStatusResponseInner object + */ + public Observable getPurgeStatusAsync(String resourceGroupName, String workspaceName, String purgeId) { + return getPurgeStatusWithServiceResponseAsync(resourceGroupName, workspaceName, purgeId).map(new Func1, WorkspacePurgeStatusResponseInner>() { + @Override + public WorkspacePurgeStatusResponseInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets status of an ongoing purge operation. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspacePurgeStatusResponseInner object + */ + public Observable> getPurgeStatusWithServiceResponseAsync(String resourceGroupName, String workspaceName, String purgeId) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (purgeId == null) { + throw new IllegalArgumentException("Parameter purgeId 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.getPurgeStatus(resourceGroupName, this.client.subscriptionId(), workspaceName, purgeId, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getPurgeStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getPurgeStatusDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacesImpl.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacesImpl.java new file mode 100644 index 000000000000..5ed798d9f357 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacesImpl.java @@ -0,0 +1,138 @@ +/** + * 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.loganalytics.v2020_03_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Workspaces; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.Workspace; +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; + +class WorkspacesImpl extends GroupableResourcesCoreImpl implements Workspaces { + protected WorkspacesImpl(LogAnalyticsManager manager) { + super(manager.inner().workspaces(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + WorkspacesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + WorkspacesInner 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) { + WorkspacesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + WorkspacesInner 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 Workspace call(WorkspaceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + WorkspacesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + WorkspacesInner 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 Workspace call(WorkspaceInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public WorkspaceImpl define(String name) { + return wrapModel(name); + } + + @Override + protected WorkspaceImpl wrapModel(WorkspaceInner inner) { + return new WorkspaceImpl(inner.name(), inner, manager()); + } + + @Override + protected WorkspaceImpl wrapModel(String name) { + return new WorkspaceImpl(name, new WorkspaceInner(), this.manager()); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacesInner.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacesInner.java new file mode 100644 index 000000000000..c911bf17bca1 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/WorkspacesInner.java @@ -0,0 +1,932 @@ +/** + * 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.loganalytics.v2020_03_01_preview.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.CloudException; +import com.microsoft.azure.management.loganalytics.v2020_03_01_preview.WorkspacePatch; +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 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.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 Workspaces. + */ +public class WorkspacesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private WorkspacesService service; + /** The service client containing this operation class. */ + private OperationalInsightsManagementClientImpl 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, OperationalInsightsManagementClientImpl 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.loganalytics.v2020_03_01_preview.Workspaces list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces") + 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.loganalytics.v2020_03_01_preview.Workspaces listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @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.loganalytics.v2020_03_01_preview.Workspaces createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Body WorkspaceInner parameters, @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.loganalytics.v2020_03_01_preview.Workspaces beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Body WorkspaceInner parameters, @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.loganalytics.v2020_03_01_preview.Workspaces delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("force") Boolean force, @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.loganalytics.v2020_03_01_preview.Workspaces beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("force") Boolean force, @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.loganalytics.v2020_03_01_preview.Workspaces getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @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.loganalytics.v2020_03_01_preview.Workspaces update" }) + @PATCH("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("workspaceName") String workspaceName, @Path("subscriptionId") String subscriptionId, @Body WorkspacePatch parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the workspaces in a 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; + } + }; + } + + /** + * Gets the workspaces in a 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); + } + + /** + * Gets the workspaces in a subscription. + * + * @return the observable to the List<WorkspaceInner> 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; + } + }); + } + + /** + * Gets the workspaces in a subscription. + * + * @return the observable to the List<WorkspaceInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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; + } + }; + } + + /** + * Gets workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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); + } + + /** + * Gets workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the observable to the List<WorkspaceInner> 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; + } + }); + } + + /** + * Gets workspaces in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the observable to the List<WorkspaceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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.listByResourceGroup(resourceGroupName, 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 = 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceInner object if successful. + */ + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).toBlocking().last().body(); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters), serviceCallback); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).map(new Func1, WorkspaceInner>() { + @Override + public WorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, workspaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceInner object if successful. + */ + public WorkspaceInner beginCreateOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).toBlocking().single().body(); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters), serviceCallback); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).map(new Func1, WorkspaceInner>() { + @Override + public WorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to create or update a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.beginCreateOrUpdate(resourceGroupName, workspaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().last().body(); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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."); + } + final Boolean force = null; + Observable> observable = service.delete(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), force, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName, Boolean force) { + deleteWithServiceResponseAsync(resourceGroupName, workspaceName, force).toBlocking().last().body(); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. + * @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 workspaceName, Boolean force, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, workspaceName, force), serviceCallback); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String workspaceName, Boolean force) { + return deleteWithServiceResponseAsync(resourceGroupName, workspaceName, force).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, Boolean force) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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."); + } + Observable> observable = service.delete(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), force, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String workspaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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."); + } + final Boolean force = null; + return service.beginDelete(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), force, 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); + } + } + }); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 workspaceName, Boolean force) { + beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, force).toBlocking().single().body(); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. + * @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 workspaceName, Boolean force, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, force), serviceCallback); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String workspaceName, Boolean force) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, workspaceName, force).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To remove the workspace completely and release the name, use the force flag. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag cannot be recovered. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String workspaceName, Boolean force) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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.beginDelete(resourceGroupName, workspaceName, this.client.subscriptionId(), this.client.apiVersion(), force, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a workspace instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceInner object if successful. + */ + public WorkspaceInner getByResourceGroup(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceName).toBlocking().single().body(); + } + + /** + * Gets a workspace instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 workspaceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceName), serviceCallback); + } + + /** + * Gets a workspace instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String workspaceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, workspaceName).map(new Func1, WorkspaceInner>() { + @Override + public WorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a workspace instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String workspaceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + 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.getByResourceGroup(resourceGroupName, workspaceName, this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WorkspaceInner object if successful. + */ + public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).toBlocking().single().body(); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @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 workspaceName, WorkspacePatch parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters), serviceCallback); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable updateAsync(String resourceGroupName, String workspaceName, WorkspacePatch parameters) { + return updateWithServiceResponseAsync(resourceGroupName, workspaceName, parameters).map(new Func1, WorkspaceInner>() { + @Override + public WorkspaceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WorkspaceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String workspaceName, WorkspacePatch parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (workspaceName == null) { + throw new IllegalArgumentException("Parameter workspaceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters 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(parameters); + return service.update(resourceGroupName, workspaceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/package-info.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..3daea12a60c8 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/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 OperationalInsightsManagementClient. + * Operational Insights Client. + */ +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview.implementation; diff --git a/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/package-info.java b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/package-info.java new file mode 100644 index 000000000000..41a65d003a28 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_03_01_preview/src/main/java/com/microsoft/azure/management/loganalytics/v2020_03_01_preview/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 OperationalInsightsManagementClient. + * Operational Insights Client. + */ +package com.microsoft.azure.management.loganalytics.v2020_03_01_preview; diff --git a/sdk/loganalytics/pom.mgmt.xml b/sdk/loganalytics/pom.mgmt.xml index b15549b483a8..9686e1a90b09 100644 --- a/sdk/loganalytics/pom.mgmt.xml +++ b/sdk/loganalytics/pom.mgmt.xml @@ -10,5 +10,6 @@ 1.0.0 mgmt-v2015_03_20 + mgmt-v2020_03_01_preview diff --git a/sdk/storage/mgmt-v2019_04_01/pom.xml b/sdk/storage/mgmt-v2019_04_01/pom.xml index 1361108dba7e..46404863f38a 100644 --- a/sdk/storage/mgmt-v2019_04_01/pom.xml +++ b/sdk/storage/mgmt-v2019_04_01/pom.xml @@ -11,11 +11,11 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml azure-mgmt-storage - 1.0.0-beta-2 + 1.0.0-beta-3 jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ActiveDirectoryProperties.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ActiveDirectoryProperties.java new file mode 100644 index 000000000000..3769049e4e8a --- /dev/null +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/ActiveDirectoryProperties.java @@ -0,0 +1,174 @@ +/** + * 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.storage.v2019_04_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Settings properties for Active Directory (AD). + */ +public class ActiveDirectoryProperties { + /** + * Specifies the primary domain that the AD DNS server is authoritative + * for. + */ + @JsonProperty(value = "domainName", required = true) + private String domainName; + + /** + * Specifies the NetBIOS domain name. + */ + @JsonProperty(value = "netBiosDomainName", required = true) + private String netBiosDomainName; + + /** + * Specifies the Active Directory forest to get. + */ + @JsonProperty(value = "forestName", required = true) + private String forestName; + + /** + * Specifies the domain GUID. + */ + @JsonProperty(value = "domainGuid", required = true) + private String domainGuid; + + /** + * Specifies the security identifier (SID). + */ + @JsonProperty(value = "domainSid", required = true) + private String domainSid; + + /** + * Specifies the security identifier (SID) for Azure Storage. + */ + @JsonProperty(value = "azureStorageSid", required = true) + private String azureStorageSid; + + /** + * Get specifies the primary domain that the AD DNS server is authoritative for. + * + * @return the domainName value + */ + public String domainName() { + return this.domainName; + } + + /** + * Set specifies the primary domain that the AD DNS server is authoritative for. + * + * @param domainName the domainName value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainName(String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get specifies the NetBIOS domain name. + * + * @return the netBiosDomainName value + */ + public String netBiosDomainName() { + return this.netBiosDomainName; + } + + /** + * Set specifies the NetBIOS domain name. + * + * @param netBiosDomainName the netBiosDomainName value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withNetBiosDomainName(String netBiosDomainName) { + this.netBiosDomainName = netBiosDomainName; + return this; + } + + /** + * Get specifies the Active Directory forest to get. + * + * @return the forestName value + */ + public String forestName() { + return this.forestName; + } + + /** + * Set specifies the Active Directory forest to get. + * + * @param forestName the forestName value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withForestName(String forestName) { + this.forestName = forestName; + return this; + } + + /** + * Get specifies the domain GUID. + * + * @return the domainGuid value + */ + public String domainGuid() { + return this.domainGuid; + } + + /** + * Set specifies the domain GUID. + * + * @param domainGuid the domainGuid value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainGuid(String domainGuid) { + this.domainGuid = domainGuid; + return this; + } + + /** + * Get specifies the security identifier (SID). + * + * @return the domainSid value + */ + public String domainSid() { + return this.domainSid; + } + + /** + * Set specifies the security identifier (SID). + * + * @param domainSid the domainSid value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withDomainSid(String domainSid) { + this.domainSid = domainSid; + return this; + } + + /** + * Get specifies the security identifier (SID) for Azure Storage. + * + * @return the azureStorageSid value + */ + public String azureStorageSid() { + return this.azureStorageSid; + } + + /** + * Set specifies the security identifier (SID) for Azure Storage. + * + * @param azureStorageSid the azureStorageSid value to set + * @return the ActiveDirectoryProperties object itself. + */ + public ActiveDirectoryProperties withAzureStorageSid(String azureStorageSid) { + this.azureStorageSid = azureStorageSid; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureFilesIdentityBasedAuthentication.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureFilesIdentityBasedAuthentication.java index 8288488aa382..b4ff38db4818 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureFilesIdentityBasedAuthentication.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/AzureFilesIdentityBasedAuthentication.java @@ -16,13 +16,19 @@ public class AzureFilesIdentityBasedAuthentication { /** * Indicates the directory service used. Possible values include: 'None', - * 'AADDS'. + * 'AADDS', 'AD'. */ @JsonProperty(value = "directoryServiceOptions", required = true) private DirectoryServiceOptions directoryServiceOptions; /** - * Get indicates the directory service used. Possible values include: 'None', 'AADDS'. + * Required if choose AD. + */ + @JsonProperty(value = "activeDirectoryProperties") + private ActiveDirectoryProperties activeDirectoryProperties; + + /** + * Get indicates the directory service used. Possible values include: 'None', 'AADDS', 'AD'. * * @return the directoryServiceOptions value */ @@ -31,7 +37,7 @@ public DirectoryServiceOptions directoryServiceOptions() { } /** - * Set indicates the directory service used. Possible values include: 'None', 'AADDS'. + * Set indicates the directory service used. Possible values include: 'None', 'AADDS', 'AD'. * * @param directoryServiceOptions the directoryServiceOptions value to set * @return the AzureFilesIdentityBasedAuthentication object itself. @@ -41,4 +47,24 @@ public AzureFilesIdentityBasedAuthentication withDirectoryServiceOptions(Directo return this; } + /** + * Get required if choose AD. + * + * @return the activeDirectoryProperties value + */ + public ActiveDirectoryProperties activeDirectoryProperties() { + return this.activeDirectoryProperties; + } + + /** + * Set required if choose AD. + * + * @param activeDirectoryProperties the activeDirectoryProperties value to set + * @return the AzureFilesIdentityBasedAuthentication object itself. + */ + public AzureFilesIdentityBasedAuthentication withActiveDirectoryProperties(ActiveDirectoryProperties activeDirectoryProperties) { + this.activeDirectoryProperties = activeDirectoryProperties; + return this; + } + } diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DirectoryServiceOptions.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DirectoryServiceOptions.java index 9edcdeb415bf..7ab98383dc4b 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DirectoryServiceOptions.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/DirectoryServiceOptions.java @@ -22,6 +22,9 @@ public final class DirectoryServiceOptions extends ExpandableStringEnum { + /** Static value TLS1_0 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_0 = fromString("TLS1_0"); + + /** Static value TLS1_1 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_1 = fromString("TLS1_1"); + + /** Static value TLS1_2 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_2 = fromString("TLS1_2"); + + /** + * Creates or finds a MinimumTlsVersion from its string representation. + * @param name a name to look for + * @return the corresponding MinimumTlsVersion + */ + @JsonCreator + public static MinimumTlsVersion fromString(String name) { + return fromString(name, MinimumTlsVersion.class); + } + + /** + * @return known MinimumTlsVersion values + */ + public static Collection values() { + return values(MinimumTlsVersion.class); + } +} diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccount.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccount.java index 5a083c7fffb2..e258ec938615 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccount.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccount.java @@ -31,6 +31,11 @@ public interface StorageAccount extends HasInner, Resource, */ AccessTier accessTier(); + /** + * @return the allowBlobPublicAccess value. + */ + Boolean allowBlobPublicAccess(); + /** * @return the azureFilesIdentityBasedAuthentication value. */ @@ -91,6 +96,11 @@ public interface StorageAccount extends HasInner, Resource, */ DateTime lastGeoFailoverTime(); + /** + * @return the minimumTlsVersion value. + */ + MinimumTlsVersion minimumTlsVersion(); + /** * @return the networkRuleSet value. */ @@ -194,6 +204,18 @@ interface WithAccessTier { WithCreate withAccessTier(AccessTier accessTier); } + /** + * The stage of the storageaccount definition allowing to specify AllowBlobPublicAccess. + */ + interface WithAllowBlobPublicAccess { + /** + * Specifies allowBlobPublicAccess. + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property + * @return the next definition stage + */ + WithCreate withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + /** * The stage of the storageaccount definition allowing to specify AzureFilesIdentityBasedAuthentication. */ @@ -278,6 +300,18 @@ interface WithLargeFileSharesState { WithCreate withLargeFileSharesState(LargeFileSharesState largeFileSharesState); } + /** + * The stage of the storageaccount definition allowing to specify MinimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies minimumTlsVersion. + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + * @return the next definition stage + */ + WithCreate withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + /** * The stage of the storageaccount definition allowing to specify NetworkRuleSet. */ @@ -295,13 +329,13 @@ interface WithNetworkRuleSet { * 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.WithAccessTier, DefinitionStages.WithAzureFilesIdentityBasedAuthentication, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithLargeFileSharesState, DefinitionStages.WithNetworkRuleSet { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithAllowBlobPublicAccess, DefinitionStages.WithAzureFilesIdentityBasedAuthentication, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithLargeFileSharesState, DefinitionStages.WithMinimumTlsVersion, DefinitionStages.WithNetworkRuleSet { } } /** * The template for a StorageAccount update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAccessTier, UpdateStages.WithAzureFilesIdentityBasedAuthentication, UpdateStages.WithCustomDomain, UpdateStages.WithEnableHttpsTrafficOnly, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithKind, UpdateStages.WithLargeFileSharesState, UpdateStages.WithNetworkRuleSet, UpdateStages.WithSku { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAccessTier, UpdateStages.WithAllowBlobPublicAccess, UpdateStages.WithAzureFilesIdentityBasedAuthentication, UpdateStages.WithCustomDomain, UpdateStages.WithEnableHttpsTrafficOnly, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithKind, UpdateStages.WithLargeFileSharesState, UpdateStages.WithMinimumTlsVersion, UpdateStages.WithNetworkRuleSet, UpdateStages.WithSku { } /** @@ -320,6 +354,18 @@ interface WithAccessTier { Update withAccessTier(AccessTier accessTier); } + /** + * The stage of the storageaccount update allowing to specify AllowBlobPublicAccess. + */ + interface WithAllowBlobPublicAccess { + /** + * Specifies allowBlobPublicAccess. + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property + * @return the next update stage + */ + Update withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + /** * The stage of the storageaccount update allowing to specify AzureFilesIdentityBasedAuthentication. */ @@ -404,6 +450,18 @@ interface WithLargeFileSharesState { Update withLargeFileSharesState(LargeFileSharesState largeFileSharesState); } + /** + * The stage of the storageaccount update allowing to specify MinimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies minimumTlsVersion. + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + * @return the next update stage + */ + Update withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + /** * The stage of the storageaccount update allowing to specify NetworkRuleSet. */ diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCreateParameters.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCreateParameters.java index d8c7b7dc36f3..1335c4c60564 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCreateParameters.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountCreateParameters.java @@ -113,6 +113,21 @@ public class StorageAccountCreateParameters { @JsonProperty(value = "properties.largeFileSharesState") private LargeFileSharesState largeFileSharesState; + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Get required. Gets or sets the SKU name. * @@ -373,4 +388,44 @@ public StorageAccountCreateParameters withLargeFileSharesState(LargeFileSharesSt return this; } + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + } diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountRegenerateKeyParameters.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountRegenerateKeyParameters.java index 502d03a48816..270d9a9ecf34 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountRegenerateKeyParameters.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountRegenerateKeyParameters.java @@ -16,13 +16,13 @@ public class StorageAccountRegenerateKeyParameters { /** * The name of storage keys that want to be regenerated, possible values - * are key1, key2. + * are key1, key2, kerb1, kerb2. */ @JsonProperty(value = "keyName", required = true) private String keyName; /** - * Get the name of storage keys that want to be regenerated, possible values are key1, key2. + * Get the name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. * * @return the keyName value */ @@ -31,7 +31,7 @@ public String keyName() { } /** - * Set the name of storage keys that want to be regenerated, possible values are key1, key2. + * Set the name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. * * @param keyName the keyName value to set * @return the StorageAccountRegenerateKeyParameters object itself. diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java index 24f969061990..33f016b44c54 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccountUpdateParameters.java @@ -91,6 +91,21 @@ public class StorageAccountUpdateParameters { @JsonProperty(value = "properties.largeFileSharesState") private LargeFileSharesState largeFileSharesState; + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Optional. Indicates the type of storage account. Currently only * StorageV2 value supported by server. Possible values include: 'Storage', @@ -299,6 +314,46 @@ public StorageAccountUpdateParameters withLargeFileSharesState(LargeFileSharesSt return this; } + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + /** * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. * diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccounts.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccounts.java index a460ead84461..45a781046892 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccounts.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/StorageAccounts.java @@ -24,7 +24,7 @@ */ public interface StorageAccounts extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { /** - * Lists the access keys for the specified storage account. + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -34,11 +34,11 @@ public interface StorageAccounts extends SupportsCreating listKeysAsync(String resourceGroupName, String accountName); /** - * Regenerates one of the access keys for the specified storage account. + * Regenerates one of the access keys or Kerberos keys for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountImpl.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountImpl.java index 60397ba74a9f..428a070461d7 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountImpl.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountImpl.java @@ -22,6 +22,7 @@ import com.microsoft.azure.management.storage.v2019_04_01.Identity; import com.microsoft.azure.management.storage.v2019_04_01.Kind; import com.microsoft.azure.management.storage.v2019_04_01.LargeFileSharesState; +import com.microsoft.azure.management.storage.v2019_04_01.MinimumTlsVersion; import com.microsoft.azure.management.storage.v2019_04_01.NetworkRuleSet; import com.microsoft.azure.management.storage.v2019_04_01.Endpoints; import com.microsoft.azure.management.storage.v2019_04_01.ProvisioningState; @@ -89,6 +90,11 @@ public AccessTier accessTier() { return this.inner().accessTier(); } + @Override + public Boolean allowBlobPublicAccess() { + return this.inner().allowBlobPublicAccess(); + } + @Override public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { return this.inner().azureFilesIdentityBasedAuthentication(); @@ -149,6 +155,11 @@ public DateTime lastGeoFailoverTime() { return this.inner().lastGeoFailoverTime(); } + @Override + public MinimumTlsVersion minimumTlsVersion() { + return this.inner().minimumTlsVersion(); + } + @Override public NetworkRuleSet networkRuleSet() { return this.inner().networkRuleSet(); @@ -235,6 +246,16 @@ public StorageAccountImpl withAccessTier(AccessTier accessTier) { return this; } + @Override + public StorageAccountImpl withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (isInCreateMode()) { + this.createParameter.withAllowBlobPublicAccess(allowBlobPublicAccess); + } else { + this.updateParameter.withAllowBlobPublicAccess(allowBlobPublicAccess); + } + return this; + } + @Override public StorageAccountImpl withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { if (isInCreateMode()) { @@ -295,6 +316,16 @@ public StorageAccountImpl withLargeFileSharesState(LargeFileSharesState largeFil return this; } + @Override + public StorageAccountImpl withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (isInCreateMode()) { + this.createParameter.withMinimumTlsVersion(minimumTlsVersion); + } else { + this.updateParameter.withMinimumTlsVersion(minimumTlsVersion); + } + return this; + } + @Override public StorageAccountImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { if (isInCreateMode()) { diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountInner.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountInner.java index 8f4954da3403..7ca4a4b65317 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountInner.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountInner.java @@ -21,6 +21,7 @@ import com.microsoft.azure.management.storage.v2019_04_01.NetworkRuleSet; import com.microsoft.azure.management.storage.v2019_04_01.GeoReplicationStats; import com.microsoft.azure.management.storage.v2019_04_01.LargeFileSharesState; +import com.microsoft.azure.management.storage.v2019_04_01.MinimumTlsVersion; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -183,6 +184,21 @@ public class StorageAccountInner extends Resource { @JsonProperty(value = "properties.largeFileSharesState") private LargeFileSharesState largeFileSharesState; + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Get gets the SKU. * @@ -436,4 +452,44 @@ public StorageAccountInner withLargeFileSharesState(LargeFileSharesState largeFi return this; } + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + } diff --git a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsInner.java b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsInner.java index 8d7a6fa7381c..70fe3e1ae33e 100644 --- a/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsInner.java +++ b/sdk/storage/mgmt-v2019_04_01/src/main/java/com/microsoft/azure/management/storage/v2019_04_01/implementation/StorageAccountsInner.java @@ -17,6 +17,7 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.management.storage.v2019_04_01.AccountSasParameters; +import com.microsoft.azure.management.storage.v2019_04_01.ListKeyExpand; import com.microsoft.azure.management.storage.v2019_04_01.ServiceSasParameters; import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountCheckNameAvailabilityParameters; import com.microsoft.azure.management.storage.v2019_04_01.StorageAccountCreateParameters; @@ -48,8 +49,6 @@ import rx.Observable; import com.microsoft.azure.LongRunningFinalState; import com.microsoft.azure.LongRunningOperationOptions; -import com.microsoft.azure.LongRunningFinalState; -import com.microsoft.azure.LongRunningOperationOptions; /** * An instance of this class provides access to all the operations defined @@ -111,7 +110,7 @@ interface StorageAccountsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_04_01.StorageAccounts listKeys" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys") - Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listKeys(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$expand") ListKeyExpand expand, @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.storage.v2019_04_01.StorageAccounts regenerateKey" }) @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey") @@ -942,7 +941,7 @@ private ServiceResponse> listByResourceGroupDelega } /** - * Lists the access keys for the specified storage account. + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -956,7 +955,7 @@ public StorageAccountListKeysResultInner listKeys(String resourceGroupName, Stri } /** - * Lists the access keys for the specified storage account. + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -969,7 +968,7 @@ public ServiceFuture listKeysAsync(String res } /** - * Lists the access keys for the specified storage account. + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @@ -986,7 +985,7 @@ public StorageAccountListKeysResultInner call(ServiceResponse> listKeysWi if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final ListKeyExpand expand = null; + return service.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listKeysDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. Possible values include: 'kerb' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageAccountListKeysResultInner object if successful. + */ + public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName, ListKeyExpand expand) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName, expand).toBlocking().single().body(); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. Possible values include: 'kerb' + * @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 listKeysAsync(String resourceGroupName, String accountName, ListKeyExpand expand, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listKeysWithServiceResponseAsync(resourceGroupName, accountName, expand), serviceCallback); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. Possible values include: 'kerb' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName, ListKeyExpand expand) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName, expand).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param expand Specifies type of the key to be listed. Possible value is kerb. Possible values include: 'kerb' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName, ListKeyExpand expand) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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.listKeys(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), expand, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1028,11 +1111,11 @@ private ServiceResponse listKeysDelegate(Resp } /** - * Regenerates one of the access keys for the specified storage account. + * Regenerates one of the access keys or Kerberos keys for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. * @throws IllegalArgumentException thrown if parameters fail the validation * @throws CloudException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -1043,11 +1126,11 @@ public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, } /** - * Regenerates one of the access keys for the specified storage account. + * Regenerates one of the access keys or Kerberos keys for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -1057,11 +1140,11 @@ public ServiceFuture regenerateKeyAsync(Strin } /** - * Regenerates one of the access keys for the specified storage account. + * Regenerates one of the access keys or Kerberos keys for the specified storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2. + * @param keyName The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the StorageAccountListKeysResultInner object */ @@ -1075,11 +1158,11 @@ public StorageAccountListKeysResultInner call(ServiceResponse com.microsoft.azure azure-arm-parent - 1.3.0 - ../../parents/azure-arm-parent + 1.3.2 + ../../parents/azure-arm-parent/pom.xml azure-mgmt-storage - 1.0.0-beta-7 + 1.0.0-beta-8 jar Microsoft Azure SDK for Storage Management This package contains Microsoft Storage Management SDK. diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobContainer.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobContainer.java index 10aa2eb9602d..a8b2eccbbdeb 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobContainer.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/BlobContainer.java @@ -28,6 +28,16 @@ public interface BlobContainer extends HasInner, Indexable, */ String defaultEncryptionScope(); + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + /** * @return the denyEncryptionScopeOverride value. */ @@ -98,11 +108,21 @@ public interface BlobContainer extends HasInner, Indexable, */ PublicAccess publicAccess(); + /** + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + /** * @return the type value. */ String type(); + /** + * @return the version value. + */ + String version(); + /** * The entirety of the BlobContainer definition. */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Encryption.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Encryption.java index 37251e878db8..64f09ad06325 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Encryption.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Encryption.java @@ -28,6 +28,13 @@ public class Encryption { @JsonProperty(value = "keySource", required = true) private KeySource keySource; + /** + * A boolean indicating whether or not the service applies a secondary + * layer of encryption with platform managed keys for data at rest. + */ + @JsonProperty(value = "requireInfrastructureEncryption") + private Boolean requireInfrastructureEncryption; + /** * Properties provided by key vault. */ @@ -74,6 +81,26 @@ public Encryption withKeySource(KeySource keySource) { return this; } + /** + * Get a boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + * + * @return the requireInfrastructureEncryption value + */ + public Boolean requireInfrastructureEncryption() { + return this.requireInfrastructureEncryption; + } + + /** + * Set a boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + * + * @param requireInfrastructureEncryption the requireInfrastructureEncryption value to set + * @return the Encryption object itself. + */ + public Encryption withRequireInfrastructureEncryption(Boolean requireInfrastructureEncryption) { + this.requireInfrastructureEncryption = requireInfrastructureEncryption; + return this; + } + /** * Get properties provided by key vault. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShare.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShare.java index 28009ece01d0..ed4ca4f0c51d 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShare.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShare.java @@ -96,7 +96,7 @@ public interface FileShare extends HasInner, Indexable, Updatabl /** * @return the shareUsageBytes value. */ - Integer shareUsageBytes(); + Long shareUsageBytes(); /** * @return the type value. diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShareItem.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShareItem.java index 06ae922b8147..bd0f59102378 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShareItem.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/FileShareItem.java @@ -92,7 +92,7 @@ public interface FileShareItem extends HasInner, HasManager< /** * @return the shareUsageBytes value. */ - Integer shareUsageBytes(); + Long shareUsageBytes(); /** * @return the type value. diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainerItem.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainerItem.java index a1af2200a98c..58bd1dab9798 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainerItem.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainerItem.java @@ -24,6 +24,16 @@ public interface ListContainerItem extends HasInner, Has */ String defaultEncryptionScope(); + /** + * @return the deleted value. + */ + Boolean deleted(); + + /** + * @return the deletedTime value. + */ + DateTime deletedTime(); + /** * @return the denyEncryptionScopeOverride value. */ @@ -94,9 +104,19 @@ public interface ListContainerItem extends HasInner, Has */ PublicAccess publicAccess(); + /** + * @return the remainingRetentionDays value. + */ + Integer remainingRetentionDays(); + /** * @return the type value. */ String type(); + /** + * @return the version value. + */ + String version(); + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainersInclude.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainersInclude.java new file mode 100644 index 000000000000..df77251abc80 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListContainersInclude.java @@ -0,0 +1,38 @@ +/** + * 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.storage.v2019_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ListContainersInclude. + */ +public final class ListContainersInclude extends ExpandableStringEnum { + /** Static value deleted for ListContainersInclude. */ + public static final ListContainersInclude DELETED = fromString("deleted"); + + /** + * Creates or finds a ListContainersInclude from its string representation. + * @param name a name to look for + * @return the corresponding ListContainersInclude + */ + @JsonCreator + public static ListContainersInclude fromString(String name) { + return fromString(name, ListContainersInclude.class); + } + + /** + * @return known ListContainersInclude values + */ + public static Collection values() { + return values(ListContainersInclude.class); + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueue.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueue.java new file mode 100644 index 000000000000..74924e6c34b1 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueue.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.storage.v2019_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.ListQueueInner; +import java.util.Map; + +/** + * Type representing ListQueue. + */ +public interface ListQueue extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueueServices.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueueServices.java new file mode 100644 index 000000000000..66268e7cb332 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListQueueServices.java @@ -0,0 +1,27 @@ +/** + * 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.storage.v2019_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.ListQueueServicesInner; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.QueueServicePropertiesInner; +import java.util.List; + +/** + * Type representing ListQueueServices. + */ +public interface ListQueueServices extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListTableServices.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListTableServices.java new file mode 100644 index 000000000000..6e01a5bc4163 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ListTableServices.java @@ -0,0 +1,27 @@ +/** + * 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.storage.v2019_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.ListTableServicesInner; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.TableServicePropertiesInner; +import java.util.List; + +/** + * Type representing ListTableServices. + */ +public interface ListTableServices extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ManagementPolicyRule.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ManagementPolicyRule.java index a9fd9a117a19..e6acc3bff8e3 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ManagementPolicyRule.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/ManagementPolicyRule.java @@ -42,6 +42,8 @@ public class ManagementPolicyRule { /** * Creates an instance of ManagementPolicyRule class. + * @param name a rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + * @param definition an object that defines the Lifecycle rule. */ public ManagementPolicyRule() { type = "Lifecycle"; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/MinimumTlsVersion.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/MinimumTlsVersion.java new file mode 100644 index 000000000000..0880cb544509 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/MinimumTlsVersion.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.storage.v2019_06_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MinimumTlsVersion. + */ +public final class MinimumTlsVersion extends ExpandableStringEnum { + /** Static value TLS1_0 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_0 = fromString("TLS1_0"); + + /** Static value TLS1_1 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_1 = fromString("TLS1_1"); + + /** Static value TLS1_2 for MinimumTlsVersion. */ + public static final MinimumTlsVersion TLS1_2 = fromString("TLS1_2"); + + /** + * Creates or finds a MinimumTlsVersion from its string representation. + * @param name a name to look for + * @return the corresponding MinimumTlsVersion + */ + @JsonCreator + public static MinimumTlsVersion fromString(String name) { + return fromString(name, MinimumTlsVersion.class); + } + + /** + * @return known MinimumTlsVersion values + */ + public static Collection values() { + return values(MinimumTlsVersion.class); + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/PrivateEndpointConnections.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/PrivateEndpointConnections.java index 6e2dbbbf55bb..c97a7db538ee 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/PrivateEndpointConnections.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/PrivateEndpointConnections.java @@ -23,18 +23,28 @@ public interface PrivateEndpointConnections extends SupportsCreating getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName); + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + /** * Deletes the specified private endpoint connection associated with the storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Storage Account + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServiceProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServiceProperties.java new file mode 100644 index 000000000000..62376e516fd2 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServiceProperties.java @@ -0,0 +1,118 @@ +/** + * 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.storage.v2019_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.QueueServicePropertiesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import java.util.List; + +/** + * Type representing QueueServiceProperties. + */ +public interface QueueServiceProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the cors value. + */ + CorsRules cors(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the QueueServiceProperties definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCors, DefinitionStages.WithCreate { + } + + /** + * Grouping of QueueServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a QueueServiceProperties definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the queueserviceproperties definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCors withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the queueserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service + * @return the next definition stage + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a QueueServiceProperties update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCors { + } + + /** + * Grouping of QueueServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the queueserviceproperties update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service + * @return the next update stage + */ + Update withCors(CorsRules cors); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServices.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServices.java new file mode 100644 index 000000000000..e4823ffd0890 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/QueueServices.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.storage.v2019_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.QueueServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing QueueServices. + */ +public interface QueueServices extends SupportsCreating, HasInner { + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getServicePropertiesAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Queues.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Queues.java new file mode 100644 index 000000000000..3ab56be30d5f --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Queues.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.storage.v2019_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.QueuesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Queues. + */ +public interface Queues extends SupportsCreating, HasInner { + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String accountName, String queueName); + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String queueName); + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java index 51c2cbdb5b3b..d322576e0557 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccount.java @@ -32,6 +32,11 @@ public interface StorageAccount extends HasInner, Resource, */ AccessTier accessTier(); + /** + * @return the allowBlobPublicAccess value. + */ + Boolean allowBlobPublicAccess(); + /** * @return the azureFilesIdentityBasedAuthentication value. */ @@ -97,6 +102,11 @@ public interface StorageAccount extends HasInner, Resource, */ DateTime lastGeoFailoverTime(); + /** + * @return the minimumTlsVersion value. + */ + MinimumTlsVersion minimumTlsVersion(); + /** * @return the networkRuleSet value. */ @@ -210,6 +220,18 @@ interface WithAccessTier { WithCreate withAccessTier(AccessTier accessTier); } + /** + * The stage of the storageaccount definition allowing to specify AllowBlobPublicAccess. + */ + interface WithAllowBlobPublicAccess { + /** + * Specifies allowBlobPublicAccess. + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property + * @return the next definition stage + */ + WithCreate withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + /** * The stage of the storageaccount definition allowing to specify AzureFilesIdentityBasedAuthentication. */ @@ -294,6 +316,18 @@ interface WithLargeFileSharesState { WithCreate withLargeFileSharesState(LargeFileSharesState largeFileSharesState); } + /** + * The stage of the storageaccount definition allowing to specify MinimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies minimumTlsVersion. + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + * @return the next definition stage + */ + WithCreate withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + /** * The stage of the storageaccount definition allowing to specify NetworkRuleSet. */ @@ -323,13 +357,13 @@ interface WithRoutingPreference { * 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.WithAccessTier, DefinitionStages.WithAzureFilesIdentityBasedAuthentication, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithLargeFileSharesState, DefinitionStages.WithNetworkRuleSet, DefinitionStages.WithRoutingPreference { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAccessTier, DefinitionStages.WithAllowBlobPublicAccess, DefinitionStages.WithAzureFilesIdentityBasedAuthentication, DefinitionStages.WithCustomDomain, DefinitionStages.WithEnableHttpsTrafficOnly, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithIsHnsEnabled, DefinitionStages.WithLargeFileSharesState, DefinitionStages.WithMinimumTlsVersion, DefinitionStages.WithNetworkRuleSet, DefinitionStages.WithRoutingPreference { } } /** * The template for a StorageAccount update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAccessTier, UpdateStages.WithAzureFilesIdentityBasedAuthentication, UpdateStages.WithCustomDomain, UpdateStages.WithEnableHttpsTrafficOnly, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithKind, UpdateStages.WithLargeFileSharesState, UpdateStages.WithNetworkRuleSet, UpdateStages.WithRoutingPreference, UpdateStages.WithSku { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAccessTier, UpdateStages.WithAllowBlobPublicAccess, UpdateStages.WithAzureFilesIdentityBasedAuthentication, UpdateStages.WithCustomDomain, UpdateStages.WithEnableHttpsTrafficOnly, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithKind, UpdateStages.WithLargeFileSharesState, UpdateStages.WithMinimumTlsVersion, UpdateStages.WithNetworkRuleSet, UpdateStages.WithRoutingPreference, UpdateStages.WithSku { } /** @@ -348,6 +382,18 @@ interface WithAccessTier { Update withAccessTier(AccessTier accessTier); } + /** + * The stage of the storageaccount update allowing to specify AllowBlobPublicAccess. + */ + interface WithAllowBlobPublicAccess { + /** + * Specifies allowBlobPublicAccess. + * @param allowBlobPublicAccess Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property + * @return the next update stage + */ + Update withAllowBlobPublicAccess(Boolean allowBlobPublicAccess); + } + /** * The stage of the storageaccount update allowing to specify AzureFilesIdentityBasedAuthentication. */ @@ -432,6 +478,18 @@ interface WithLargeFileSharesState { Update withLargeFileSharesState(LargeFileSharesState largeFileSharesState); } + /** + * The stage of the storageaccount update allowing to specify MinimumTlsVersion. + */ + interface WithMinimumTlsVersion { + /** + * Specifies minimumTlsVersion. + * @param minimumTlsVersion Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2' + * @return the next update stage + */ + Update withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion); + } + /** * The stage of the storageaccount update allowing to specify NetworkRuleSet. */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCheckNameAvailabilityParameters.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCheckNameAvailabilityParameters.java index d9a0558516bf..1e4a2a57218c 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCheckNameAvailabilityParameters.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCheckNameAvailabilityParameters.java @@ -28,6 +28,7 @@ public class StorageAccountCheckNameAvailabilityParameters { /** * Creates an instance of StorageAccountCheckNameAvailabilityParameters class. + * @param name the storage account name. */ public StorageAccountCheckNameAvailabilityParameters() { type = "Microsoft.Storage/storageAccounts"; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCreateParameters.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCreateParameters.java index 18eca991e871..8c2edafeef99 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCreateParameters.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountCreateParameters.java @@ -120,6 +120,21 @@ public class StorageAccountCreateParameters { @JsonProperty(value = "properties.routingPreference") private RoutingPreference routingPreference; + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Get required. Gets or sets the SKU name. * @@ -400,4 +415,44 @@ public StorageAccountCreateParameters withRoutingPreference(RoutingPreference ro return this; } + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountCreateParameters object itself. + */ + public StorageAccountCreateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountUpdateParameters.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountUpdateParameters.java index bd416a923f65..c56a16cab52d 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountUpdateParameters.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageAccountUpdateParameters.java @@ -98,6 +98,21 @@ public class StorageAccountUpdateParameters { @JsonProperty(value = "properties.routingPreference") private RoutingPreference routingPreference; + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Optional. Indicates the type of storage account. Currently only * StorageV2 value supported by server. Possible values include: 'Storage', @@ -326,6 +341,46 @@ public StorageAccountUpdateParameters withRoutingPreference(RoutingPreference ro return this; } + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountUpdateParameters object itself. + */ + public StorageAccountUpdateParameters withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + /** * Get optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. Possible values include: 'Storage', 'StorageV2', 'BlobStorage', 'FileStorage', 'BlockBlobStorage'. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageQueue.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageQueue.java new file mode 100644 index 000000000000..79e93f7e19df --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/StorageQueue.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.storage.v2019_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageQueueInner; +import com.microsoft.azure.arm.model.Indexable; +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.storage.v2019_06_01.implementation.StorageManager; +import java.util.Map; + +/** + * Type representing StorageQueue. + */ +public interface StorageQueue extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the approximateMessageCount value. + */ + Integer approximateMessageCount(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the metadata value. + */ + Map metadata(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the StorageQueue definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithQueueService, DefinitionStages.WithMetadata, DefinitionStages.WithCreate { + } + + /** + * Grouping of StorageQueue definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a StorageQueue definition. + */ + interface Blank extends WithQueueService { + } + + /** + * The stage of the storagequeue definition allowing to specify QueueService. + */ + interface WithQueueService { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithMetadata withExistingQueueService(String resourceGroupName, String accountName); + } + + /** + * The stage of the storagequeue definition allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair that represents queue metadata + * @return the next definition stage + */ + WithCreate withMetadata(Map metadata); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a StorageQueue update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithMetadata { + } + + /** + * Grouping of StorageQueue update stages. + */ + interface UpdateStages { + /** + * The stage of the storagequeue update allowing to specify Metadata. + */ + interface WithMetadata { + /** + * Specifies metadata. + * @param metadata A name-value pair that represents queue metadata + * @return the next update stage + */ + Update withMetadata(Map metadata); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Table.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Table.java new file mode 100644 index 000000000000..db39ef8b176c --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Table.java @@ -0,0 +1,92 @@ +/** + * 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.storage.v2019_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.TableInner; +import com.microsoft.azure.arm.model.Indexable; +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.storage.v2019_06_01.implementation.StorageManager; + +/** + * Type representing Table. + */ +public interface Table extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the tableName value. + */ + String tableName(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Table definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithTableService, DefinitionStages.WithCreate { + } + + /** + * Grouping of Table definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Table definition. + */ + interface Blank extends WithTableService { + } + + /** + * The stage of the table definition allowing to specify TableService. + */ + interface WithTableService { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCreate withExistingTableService(String resourceGroupName, String accountName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable
{ + } + } + /** + * The template for a Table update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable
{ + } + + /** + * Grouping of Table update stages. + */ + interface UpdateStages { + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServiceProperties.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServiceProperties.java new file mode 100644 index 000000000000..f99dd7a7d56f --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServiceProperties.java @@ -0,0 +1,118 @@ +/** + * 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.storage.v2019_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.TableServicePropertiesInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.StorageManager; +import java.util.List; + +/** + * Type representing TableServiceProperties. + */ +public interface TableServiceProperties extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the cors value. + */ + CorsRules cors(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the TableServiceProperties definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithStorageAccount, DefinitionStages.WithCors, DefinitionStages.WithCreate { + } + + /** + * Grouping of TableServiceProperties definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a TableServiceProperties definition. + */ + interface Blank extends WithStorageAccount { + } + + /** + * The stage of the tableserviceproperties definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies resourceGroupName, accountName. + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only + * @return the next definition stage + */ + WithCors withExistingStorageAccount(String resourceGroupName, String accountName); + } + + /** + * The stage of the tableserviceproperties definition allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service + * @return the next definition stage + */ + WithCreate withCors(CorsRules cors); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a TableServiceProperties update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCors { + } + + /** + * Grouping of TableServiceProperties update stages. + */ + interface UpdateStages { + /** + * The stage of the tableserviceproperties update allowing to specify Cors. + */ + interface WithCors { + /** + * Specifies cors. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service + * @return the next update stage + */ + Update withCors(CorsRules cors); + } + + } +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServices.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServices.java new file mode 100644 index 000000000000..d0d900096989 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/TableServices.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.storage.v2019_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.TableServicesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing TableServices. + */ +public interface TableServices extends SupportsCreating, HasInner { + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(String resourceGroupName, String accountName); + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getServicePropertiesAsync(String resourceGroupName, String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Tables.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Tables.java new file mode 100644 index 000000000000..cbbd2b98cbc7 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/Tables.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.storage.v2019_06_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.implementation.TablesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tables. + */ +public interface Tables extends SupportsCreating, HasInner { + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable
getAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable
listAsync(final String resourceGroupName, final String accountName); + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerImpl.java index 9d17991161c9..849f6a8a74d1 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerImpl.java @@ -11,8 +11,8 @@ import com.microsoft.azure.management.storage.v2019_06_01.BlobContainer; import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; import rx.Observable; -import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import com.microsoft.azure.management.storage.v2019_06_01.LeaseStatus; import com.microsoft.azure.management.storage.v2019_06_01.LeaseState; import com.microsoft.azure.management.storage.v2019_06_01.LeaseDuration; @@ -82,6 +82,16 @@ public String defaultEncryptionScope() { return this.inner().defaultEncryptionScope(); } + @Override + public Boolean deleted() { + return this.inner().deleted(); + } + + @Override + public DateTime deletedTime() { + return this.inner().deletedTime(); + } + @Override public Boolean denyEncryptionScopeOverride() { return this.inner().denyEncryptionScopeOverride(); @@ -152,11 +162,21 @@ public PublicAccess publicAccess() { return this.inner().publicAccess(); } + @Override + public Integer remainingRetentionDays() { + return this.inner().remainingRetentionDays(); + } + @Override public String type() { return this.inner().type(); } + @Override + public String version() { + return this.inner().version(); + } + @Override public BlobContainerImpl withExistingBlobService(String resourceGroupName, String accountName) { this.resourceGroupName = resourceGroupName; diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerInner.java index 9272d7f5975d..8c4744c35e9a 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainerInner.java @@ -8,8 +8,8 @@ package com.microsoft.azure.management.storage.v2019_06_01.implementation; -import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import com.microsoft.azure.management.storage.v2019_06_01.LeaseStatus; import com.microsoft.azure.management.storage.v2019_06_01.LeaseState; import com.microsoft.azure.management.storage.v2019_06_01.LeaseDuration; @@ -26,6 +26,30 @@ */ @JsonFlatten public class BlobContainerInner extends AzureEntityResource { + /** + * The version of the deleted blob container. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Indicates whether the blob container was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /** + * Blob container deletion time. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletedTime; + + /** + * Remaining retention days for soft deleted blob container. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + /** * Default the container to use specified encryption scope for all writes. */ @@ -110,6 +134,42 @@ public class BlobContainerInner extends AzureEntityResource { @JsonProperty(value = "properties.hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) private Boolean hasImmutabilityPolicy; + /** + * Get the version of the deleted blob container. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get indicates whether the blob container was deleted. + * + * @return the deleted value + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get blob container deletion time. + * + * @return the deletedTime value + */ + public DateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + /** * Get default the container to use specified encryption scope for all writes. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainersInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainersInner.java index 1359df72b1e1..48e880fdf9e1 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainersInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/BlobContainersInner.java @@ -19,6 +19,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.BlobContainersGetImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2019_06_01.BlobContainersLockImmutabilityPolicyHeaders; import com.microsoft.azure.management.storage.v2019_06_01.LeaseContainerRequest; +import com.microsoft.azure.management.storage.v2019_06_01.ListContainersInclude; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; @@ -72,7 +73,7 @@ public BlobContainersInner(Retrofit retrofit, StorageManagementClientImpl client interface BlobContainersService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.BlobContainers list" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers") - Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @Query("$include") ListContainersInclude include, @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.storage.v2019_06_01.BlobContainers create" }) @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}") @@ -232,7 +233,8 @@ public Observable>> listSinglePageA } final String maxpagesize = null; final String filter = null; - return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + final ListContainersInclude include = null; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, include, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -253,13 +255,14 @@ public Observable>> call(Response list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { - ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter).toBlocking().single(); + public PagedList list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include).toBlocking().single(); return new PagedList(response.body()) { @Override public Page nextPage(String nextPageLink) { @@ -275,13 +278,14 @@ public Page nextPage(String nextPageLink) { * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. Possible values include: 'deleted' * @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(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListOperationCallback serviceCallback) { + public ServiceFuture> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include, final ListOperationCallback serviceCallback) { return AzureServiceFuture.fromPageResponse( - listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include), new Func1>>>() { @Override public Observable>> call(String nextPageLink) { @@ -298,11 +302,12 @@ public Observable>> call(String nex * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. * @param filter Optional. When specified, only container names starting with the filter will be listed. + * @param include Optional, used to include the properties for soft deleted blob containers. Possible values include: 'deleted' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList<ListContainerItemInner> object */ - public Observable> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { - return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter) + public Observable> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include) { + return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter, include) .map(new Func1>, Page>() { @Override public Page call(ServiceResponse> response) { @@ -318,11 +323,12 @@ public Page call(ServiceResponse>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { - return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter) + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include) { + return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter, include) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { @@ -342,10 +348,11 @@ public Observable>> call(ServiceRes ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. ServiceResponse> * @param maxpagesize Optional. Specified maximum number of containers that can be included in the list. ServiceResponse> * @param filter Optional. When specified, only container names starting with the filter will be listed. + ServiceResponse> * @param include Optional, used to include the properties for soft deleted blob containers. Possible values include: 'deleted' * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<ListContainerItemInner> object wrapped in {@link ServiceResponse} if successful. */ - public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListContainersInclude include) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -358,7 +365,7 @@ public Observable>> listSinglePageA if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, include, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareImpl.java index f76e6bfe6915..51ed93ec1c89 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareImpl.java @@ -145,7 +145,7 @@ public Integer shareQuota() { } @Override - public Integer shareUsageBytes() { + public Long shareUsageBytes() { return this.inner().shareUsageBytes(); } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareInner.java index b969495f3f54..4b8e06b288cf 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareInner.java @@ -107,7 +107,7 @@ public class FileShareInner extends AzureEntityResource { * value may not include all recently created or recently resized files. */ @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) - private Integer shareUsageBytes; + private Long shareUsageBytes; /** * Get returns the date and time the share was last modified. @@ -277,7 +277,7 @@ public String accessTierStatus() { * * @return the shareUsageBytes value */ - public Integer shareUsageBytes() { + public Long shareUsageBytes() { return this.shareUsageBytes; } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java index db81fb7c9d9a..018c7a644589 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemImpl.java @@ -99,7 +99,7 @@ public Integer shareQuota() { } @Override - public Integer shareUsageBytes() { + public Long shareUsageBytes() { return this.inner().shareUsageBytes(); } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemInner.java index 22ba754c4932..5a7043a5d710 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/FileShareItemInner.java @@ -106,7 +106,7 @@ public class FileShareItemInner extends AzureEntityResource { * value may not include all recently created or recently resized files. */ @JsonProperty(value = "properties.shareUsageBytes", access = JsonProperty.Access.WRITE_ONLY) - private Integer shareUsageBytes; + private Long shareUsageBytes; /** * Get returns the date and time the share was last modified. @@ -276,7 +276,7 @@ public String accessTierStatus() { * * @return the shareUsageBytes value */ - public Integer shareUsageBytes() { + public Long shareUsageBytes() { return this.shareUsageBytes; } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemImpl.java index ed7920196679..ca87cfc42da2 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemImpl.java @@ -10,8 +10,8 @@ import com.microsoft.azure.management.storage.v2019_06_01.ListContainerItem; import com.microsoft.azure.arm.model.implementation.WrapperImpl; -import com.microsoft.azure.management.storage.v2019_06_01.ImmutabilityPolicyProperties; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.ImmutabilityPolicyProperties; import com.microsoft.azure.management.storage.v2019_06_01.LeaseDuration; import com.microsoft.azure.management.storage.v2019_06_01.LeaseState; import com.microsoft.azure.management.storage.v2019_06_01.LeaseStatus; @@ -36,6 +36,16 @@ public String defaultEncryptionScope() { return this.inner().defaultEncryptionScope(); } + @Override + public Boolean deleted() { + return this.inner().deleted(); + } + + @Override + public DateTime deletedTime() { + return this.inner().deletedTime(); + } + @Override public Boolean denyEncryptionScopeOverride() { return this.inner().denyEncryptionScopeOverride(); @@ -106,9 +116,19 @@ public PublicAccess publicAccess() { return this.inner().publicAccess(); } + @Override + public Integer remainingRetentionDays() { + return this.inner().remainingRetentionDays(); + } + @Override public String type() { return this.inner().type(); } + @Override + public String version() { + return this.inner().version(); + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemInner.java index da02788d5c0f..62e39e241d98 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListContainerItemInner.java @@ -8,8 +8,8 @@ package com.microsoft.azure.management.storage.v2019_06_01.implementation; -import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import org.joda.time.DateTime; +import com.microsoft.azure.management.storage.v2019_06_01.PublicAccess; import com.microsoft.azure.management.storage.v2019_06_01.LeaseStatus; import com.microsoft.azure.management.storage.v2019_06_01.LeaseState; import com.microsoft.azure.management.storage.v2019_06_01.LeaseDuration; @@ -25,6 +25,30 @@ */ @JsonFlatten public class ListContainerItemInner extends AzureEntityResource { + /** + * The version of the deleted blob container. + */ + @JsonProperty(value = "properties.version", access = JsonProperty.Access.WRITE_ONLY) + private String version; + + /** + * Indicates whether the blob container was deleted. + */ + @JsonProperty(value = "properties.deleted", access = JsonProperty.Access.WRITE_ONLY) + private Boolean deleted; + + /** + * Blob container deletion time. + */ + @JsonProperty(value = "properties.deletedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime deletedTime; + + /** + * Remaining retention days for soft deleted blob container. + */ + @JsonProperty(value = "properties.remainingRetentionDays", access = JsonProperty.Access.WRITE_ONLY) + private Integer remainingRetentionDays; + /** * Default the container to use specified encryption scope for all writes. */ @@ -109,6 +133,42 @@ public class ListContainerItemInner extends AzureEntityResource { @JsonProperty(value = "properties.hasImmutabilityPolicy", access = JsonProperty.Access.WRITE_ONLY) private Boolean hasImmutabilityPolicy; + /** + * Get the version of the deleted blob container. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Get indicates whether the blob container was deleted. + * + * @return the deleted value + */ + public Boolean deleted() { + return this.deleted; + } + + /** + * Get blob container deletion time. + * + * @return the deletedTime value + */ + public DateTime deletedTime() { + return this.deletedTime; + } + + /** + * Get remaining retention days for soft deleted blob container. + * + * @return the remainingRetentionDays value + */ + public Integer remainingRetentionDays() { + return this.remainingRetentionDays; + } + /** * Get default the container to use specified encryption scope for all writes. * diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueImpl.java new file mode 100644 index 000000000000..95ee5715fb4f --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueImpl.java @@ -0,0 +1,47 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.ListQueue; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class ListQueueImpl extends WrapperImpl implements ListQueue { + private final StorageManager manager; + ListQueueImpl(ListQueueInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueInner.java new file mode 100644 index 000000000000..a411d56a9917 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueInner.java @@ -0,0 +1,47 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The ListQueueInner model. + */ +@JsonFlatten +public class ListQueueInner extends ProxyResource { + /** + * A name-value pair that represents queue metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * Get a name-value pair that represents queue metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set + * @return the ListQueueInner object itself. + */ + public ListQueueInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesImpl.java new file mode 100644 index 000000000000..1cebea163447 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesImpl.java @@ -0,0 +1,32 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.ListQueueServices; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ListQueueServicesImpl extends WrapperImpl implements ListQueueServices { + private final StorageManager manager; + ListQueueServicesImpl(ListQueueServicesInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesInner.java new file mode 100644 index 000000000000..57968f0626af --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListQueueServicesInner.java @@ -0,0 +1,33 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListQueueServicesInner model. + */ +public class ListQueueServicesInner { + /** + * List of queue services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get list of queue services returned. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesImpl.java new file mode 100644 index 000000000000..7dbbf3c0412e --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesImpl.java @@ -0,0 +1,32 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.ListTableServices; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; + +class ListTableServicesImpl extends WrapperImpl implements ListTableServices { + private final StorageManager manager; + ListTableServicesImpl(ListTableServicesInner inner, StorageManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesInner.java new file mode 100644 index 000000000000..8cb686b05d8b --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/ListTableServicesInner.java @@ -0,0 +1,33 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ListTableServicesInner model. + */ +public class ListTableServicesInner { + /** + * List of table services returned. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private List value; + + /** + * Get list of table services returned. + * + * @return the value value + */ + public List value() { + return this.value; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsImpl.java index 4820ca83aad2..0b85d517bf0d 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsImpl.java @@ -14,6 +14,7 @@ import rx.Completable; import rx.Observable; import rx.functions.Func1; +import java.util.List; import com.microsoft.azure.management.storage.v2019_06_01.PrivateEndpointConnection; class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { @@ -41,6 +42,24 @@ private PrivateEndpointConnectionImpl wrapModel(String name) { return new PrivateEndpointConnectionImpl(name, this.manager()); } + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMap(new Func1, Observable>() { + @Override + public Observable call(List innerList) { + return Observable.from(innerList); + } + }) + .map(new Func1() { + @Override + public PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + @Override public Observable getAsync(String resourceGroupName, String accountName, String privateEndpointConnectionName) { PrivateEndpointConnectionsInner client = this.inner(); diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsInner.java index 2807334b1d1a..d9759268d802 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/PrivateEndpointConnectionsInner.java @@ -10,12 +10,14 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; import com.microsoft.azure.management.storage.v2019_06_01.ErrorResponseException; 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 okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; @@ -55,6 +57,10 @@ public PrivateEndpointConnectionsInner(Retrofit retrofit, StorageManagementClien * used by Retrofit to perform actually REST calls. */ interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.PrivateEndpointConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.storage.v2019_06_01.PrivateEndpointConnections get" }) @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -69,12 +75,103 @@ interface PrivateEndpointConnectionsService { } + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<PrivateEndpointConnectionInner> object if successful. + */ + public List list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 accountName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateEndpointConnectionInner> object + */ + public Observable> listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the private endpoint connections associated with the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the List<PrivateEndpointConnectionInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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(resourceGroupName, accountName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Gets the specified private endpoint connection associated with the storage account. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Storage Account + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource * @throws IllegalArgumentException thrown if parameters fail the validation * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @@ -89,7 +186,7 @@ public PrivateEndpointConnectionInner get(String resourceGroupName, String accou * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Storage Account + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object @@ -103,7 +200,7 @@ public ServiceFuture getAsync(String resourceGro * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Storage Account + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateEndpointConnectionInner object */ @@ -121,7 +218,7 @@ public PrivateEndpointConnectionInner call(ServiceResponse getDelegate(Response putAsync(String resourceGro * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Storage Account + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource * @param properties The private endpoint connection properties. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PrivateEndpointConnectionInner object @@ -217,7 +314,7 @@ public PrivateEndpointConnectionInner call(ServiceResponse putDelegate(Response deleteAsync(String resourceGroupName, String accountN * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Storage Account + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ @@ -314,7 +411,7 @@ public Void call(ServiceResponse response) { * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Storage Account + * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure resource * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */ diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesImpl.java new file mode 100644 index 000000000000..659869d3f535 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesImpl.java @@ -0,0 +1,134 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.QueueServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; +import java.util.List; +import rx.functions.Func1; + +class QueueServicePropertiesImpl extends CreatableUpdatableImpl implements QueueServiceProperties, QueueServiceProperties.Definition, QueueServiceProperties.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private CorsRules ccors; + private CorsRules ucors; + + QueueServicePropertiesImpl(String name, StorageManager manager) { + super(name, new QueueServicePropertiesInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + QueueServicePropertiesImpl(QueueServicePropertiesInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + QueueServicesInner client = this.manager().inner().queueServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ccors) + .map(new Func1() { + @Override + public QueueServicePropertiesInner call(QueueServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + QueueServicesInner client = this.manager().inner().queueServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ucors) + .map(new Func1() { + @Override + public QueueServicePropertiesInner call(QueueServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + QueueServicesInner client = this.manager().inner().queueServices(); + return client.getServicePropertiesAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + @Override + public CorsRules cors() { + return this.inner().cors(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public QueueServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public QueueServicePropertiesImpl withCors(CorsRules cors) { + if (isInCreateMode()) { + this.ccors = cors; + } else { + this.ucors = cors; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesInner.java new file mode 100644 index 000000000000..bcccc6b10ceb --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicePropertiesInner.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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The properties of a storage account’s Queue service. + */ +@JsonFlatten +public class QueueServicePropertiesInner extends ProxyResource { + /** + * Specifies CORS rules for the Queue service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included + * in the request body, all CORS rules will be deleted, and CORS will be + * disabled for the Queue service. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * Get specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * + * @return the cors value + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * + * @param cors the cors value to set + * @return the QueueServicePropertiesInner object itself. + */ + public QueueServicePropertiesInner withCors(CorsRules cors) { + this.cors = cors; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesImpl.java new file mode 100644 index 000000000000..1e3e6bef4239 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesImpl.java @@ -0,0 +1,72 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.QueueServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_06_01.ListQueueServices; +import com.microsoft.azure.management.storage.v2019_06_01.QueueServiceProperties; + +class QueueServicesImpl extends WrapperImpl implements QueueServices { + private final StorageManager manager; + + QueueServicesImpl(StorageManager manager) { + super(manager.inner().queueServices()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public QueueServicePropertiesImpl define(String name) { + return wrapModel(name); + } + + private QueueServicePropertiesImpl wrapModel(QueueServicePropertiesInner inner) { + return new QueueServicePropertiesImpl(inner, manager()); + } + + private QueueServicePropertiesImpl wrapModel(String name) { + return new QueueServicePropertiesImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + QueueServicesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public ListQueueServices call(ListQueueServicesInner inner) { + return new ListQueueServicesImpl(inner, manager()); + } + }); + } + + @Override + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + QueueServicesInner client = this.inner(); + return client.getServicePropertiesAsync(resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(QueueServicePropertiesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((QueueServiceProperties)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesInner.java new file mode 100644 index 000000000000..9c5cc6a9a543 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueueServicesInner.java @@ -0,0 +1,422 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 QueueServices. + */ +public class QueueServicesInner { + /** The Retrofit service to perform REST calls. */ + private QueueServicesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of QueueServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QueueServicesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(QueueServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for QueueServices to be + * used by Retrofit to perform actually REST calls. + */ + interface QueueServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.QueueServices list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.storage.v2019_06_01.QueueServices setServiceProperties" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}") + Observable> setServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueServiceName") String queueServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body QueueServicePropertiesInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.QueueServices getServiceProperties" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}") + Observable> getServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueServiceName") String queueServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListQueueServicesInner object if successful. + */ + public ListQueueServicesInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListQueueServicesInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ListQueueServicesInner>() { + @Override + public ListQueueServicesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all queue services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListQueueServicesInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueueServicePropertiesInner object if successful. + */ + public QueueServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 setServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, QueueServicePropertiesInner>() { + @Override + public QueueServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + final String queueServiceName = "default"; + final CorsRules cors = null; + QueueServicePropertiesInner parameters = new QueueServicePropertiesInner(); + parameters.withCors(null); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), queueServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueueServicePropertiesInner object if successful. + */ + public QueueServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, CorsRules cors) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * @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 setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors).map(new Func1, QueueServicePropertiesInner>() { + @Override + public QueueServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName, CorsRules cors) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + Validator.validate(cors); + final String queueServiceName = "default"; + QueueServicePropertiesInner parameters = new QueueServicePropertiesInner(); + parameters.withCors(cors); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), queueServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the QueueServicePropertiesInner object if successful. + */ + public QueueServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 getServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, QueueServicePropertiesInner>() { + @Override + public QueueServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the QueueServicePropertiesInner object + */ + public Observable> getServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + final String queueServiceName = "default"; + return service.getServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), queueServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesImpl.java new file mode 100644 index 000000000000..09e623f81edf --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesImpl.java @@ -0,0 +1,82 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.Queues; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_06_01.StorageQueue; +import com.microsoft.azure.management.storage.v2019_06_01.ListQueue; + +class QueuesImpl extends WrapperImpl implements Queues { + private final StorageManager manager; + + QueuesImpl(StorageManager manager) { + super(manager.inner().queues()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public StorageQueueImpl define(String name) { + return wrapModel(name); + } + + private StorageQueueImpl wrapModel(StorageQueueInner inner) { + return new StorageQueueImpl(inner, manager()); + } + + private StorageQueueImpl wrapModel(String name) { + return new StorageQueueImpl(name, this.manager()); + } + + @Override + public Observable getAsync(String resourceGroupName, String accountName, String queueName) { + QueuesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, queueName) + .map(new Func1() { + @Override + public StorageQueue call(StorageQueueInner inner) { + return new StorageQueueImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String queueName) { + QueuesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, queueName).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String accountName) { + QueuesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ListQueue call(ListQueueInner inner) { + return new ListQueueImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesInner.java new file mode 100644 index 000000000000..1eea50046fd6 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/QueuesInner.java @@ -0,0 +1,1017 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +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.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Queues. + */ +public class QueuesInner { + /** The Retrofit service to perform REST calls. */ + private QueuesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of QueuesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public QueuesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(QueuesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Queues to be + * used by Retrofit to perform actually REST calls. + */ + interface QueuesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.Queues create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueName") String queueName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageQueueInner queue, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.Queues update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueName") String queueName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body StorageQueueInner queue, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.Queues get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueName") String queueName, @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.storage.v2019_06_01.Queues delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("queueName") String queueName, @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.storage.v2019_06_01.Queues list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Query("$maxpagesize") String maxpagesize, @Query("$filter") String filter, @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.storage.v2019_06_01.Queues listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageQueueInner object if successful. + */ + public StorageQueueInner create(String resourceGroupName, String accountName, String queueName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, queueName).toBlocking().single().body(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 accountName, String queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, queueName), serviceCallback); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String queueName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, queueName).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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 metadata = null; + StorageQueueInner queue = new StorageQueueInner(); + queue.withMetadata(null); + return service.create(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), queue, 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); + } + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageQueueInner object if successful. + */ + public StorageQueueInner create(String resourceGroupName, String accountName, String queueName, Map metadata) { + return createWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata).toBlocking().single().body(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @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 accountName, String queueName, Map metadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata), serviceCallback); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String queueName, Map metadata) { + return createWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName, Map metadata) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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(metadata); + StorageQueueInner queue = new StorageQueueInner(); + queue.withMetadata(metadata); + return service.create(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), queue, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageQueueInner object if successful. + */ + public StorageQueueInner update(String resourceGroupName, String accountName, String queueName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, queueName).toBlocking().single().body(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @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 accountName, String queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, queueName), serviceCallback); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String queueName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, queueName).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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 metadata = null; + StorageQueueInner queue = new StorageQueueInner(); + queue.withMetadata(null); + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), queue, 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); + } + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageQueueInner object if successful. + */ + public StorageQueueInner update(String resourceGroupName, String accountName, String queueName, Map metadata) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata).toBlocking().single().body(); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @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 accountName, String queueName, Map metadata, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata), serviceCallback); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String queueName, Map metadata) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, queueName, metadata).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new queue with the specified queue name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param metadata A name-value pair that represents queue metadata. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName, Map metadata) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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(metadata); + StorageQueueInner queue = new StorageQueueInner(); + queue.withMetadata(metadata); + return service.update(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), queue, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the StorageQueueInner object if successful. + */ + public StorageQueueInner get(String resourceGroupName, String accountName, String queueName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, queueName).toBlocking().single().body(); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, queueName), serviceCallback); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String queueName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, queueName).map(new Func1, StorageQueueInner>() { + @Override + public StorageQueueInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the StorageQueueInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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.get(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String queueName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, queueName).toBlocking().single().body(); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String queueName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, queueName), serviceCallback); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String queueName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, queueName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the queue with the specified queue name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param queueName A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String queueName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (queueName == null) { + throw new IllegalArgumentException("Parameter queueName 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.delete(resourceGroupName, accountName, this.client.subscriptionId(), queueName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ListQueueInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + final String maxpagesize = null; + final String filter = null; + return service.list(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ListQueueInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @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(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + return listWithServiceResponseAsync(resourceGroupName, accountName, maxpagesize, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response + * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + return listSinglePageAsync(resourceGroupName, accountName, maxpagesize, filter) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ServiceResponse> * @param maxpagesize Optional, a maximum number of queues that should be included in a list queue response + ServiceResponse> * @param filter Optional, When specified, only the queues with a name starting with the given filter will be listed. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final String maxpagesize, final String filter) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), maxpagesize, filter, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ListQueueInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ListQueueInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the queues under the specified storage account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ListQueueInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java index 985236d8be2c..3e957a03eb6c 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountImpl.java @@ -23,6 +23,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.Identity; import com.microsoft.azure.management.storage.v2019_06_01.Kind; import com.microsoft.azure.management.storage.v2019_06_01.LargeFileSharesState; +import com.microsoft.azure.management.storage.v2019_06_01.MinimumTlsVersion; import com.microsoft.azure.management.storage.v2019_06_01.NetworkRuleSet; import com.microsoft.azure.management.storage.v2019_06_01.Endpoints; import java.util.ArrayList; @@ -93,6 +94,11 @@ public AccessTier accessTier() { return this.inner().accessTier(); } + @Override + public Boolean allowBlobPublicAccess() { + return this.inner().allowBlobPublicAccess(); + } + @Override public AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication() { return this.inner().azureFilesIdentityBasedAuthentication(); @@ -163,6 +169,11 @@ public DateTime lastGeoFailoverTime() { return this.inner().lastGeoFailoverTime(); } + @Override + public MinimumTlsVersion minimumTlsVersion() { + return this.inner().minimumTlsVersion(); + } + @Override public NetworkRuleSet networkRuleSet() { return this.inner().networkRuleSet(); @@ -260,6 +271,16 @@ public StorageAccountImpl withAccessTier(AccessTier accessTier) { return this; } + @Override + public StorageAccountImpl withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + if (isInCreateMode()) { + this.createParameter.withAllowBlobPublicAccess(allowBlobPublicAccess); + } else { + this.updateParameter.withAllowBlobPublicAccess(allowBlobPublicAccess); + } + return this; + } + @Override public StorageAccountImpl withAzureFilesIdentityBasedAuthentication(AzureFilesIdentityBasedAuthentication azureFilesIdentityBasedAuthentication) { if (isInCreateMode()) { @@ -320,6 +341,16 @@ public StorageAccountImpl withLargeFileSharesState(LargeFileSharesState largeFil return this; } + @Override + public StorageAccountImpl withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + if (isInCreateMode()) { + this.createParameter.withMinimumTlsVersion(minimumTlsVersion); + } else { + this.updateParameter.withMinimumTlsVersion(minimumTlsVersion); + } + return this; + } + @Override public StorageAccountImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { if (isInCreateMode()) { diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java index b56f7d38739b..4511c646115f 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java @@ -23,6 +23,7 @@ import com.microsoft.azure.management.storage.v2019_06_01.LargeFileSharesState; import java.util.List; import com.microsoft.azure.management.storage.v2019_06_01.RoutingPreference; +import com.microsoft.azure.management.storage.v2019_06_01.MinimumTlsVersion; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -205,6 +206,21 @@ public class StorageAccountInner extends Resource { @JsonProperty(value = "properties.blobRestoreStatus", access = JsonProperty.Access.WRITE_ONLY) private BlobRestoreStatusInner blobRestoreStatus; + /** + * Allow or disallow public access to all blobs or containers in the + * storage account. The default interpretation is true for this property. + */ + @JsonProperty(value = "properties.allowBlobPublicAccess") + private Boolean allowBlobPublicAccess; + + /** + * Set the minimum TLS version to be permitted on requests to storage. The + * default interpretation is TLS 1.0 for this property. Possible values + * include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + */ + @JsonProperty(value = "properties.minimumTlsVersion") + private MinimumTlsVersion minimumTlsVersion; + /** * Get gets the SKU. * @@ -496,4 +512,44 @@ public BlobRestoreStatusInner blobRestoreStatus() { return this.blobRestoreStatus; } + /** + * Get allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @return the allowBlobPublicAccess value + */ + public Boolean allowBlobPublicAccess() { + return this.allowBlobPublicAccess; + } + + /** + * Set allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. + * + * @param allowBlobPublicAccess the allowBlobPublicAccess value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withAllowBlobPublicAccess(Boolean allowBlobPublicAccess) { + this.allowBlobPublicAccess = allowBlobPublicAccess; + return this; + } + + /** + * Get set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @return the minimumTlsVersion value + */ + public MinimumTlsVersion minimumTlsVersion() { + return this.minimumTlsVersion; + } + + /** + * Set set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. Possible values include: 'TLS1_0', 'TLS1_1', 'TLS1_2'. + * + * @param minimumTlsVersion the minimumTlsVersion value to set + * @return the StorageAccountInner object itself. + */ + public StorageAccountInner withMinimumTlsVersion(MinimumTlsVersion minimumTlsVersion) { + this.minimumTlsVersion = minimumTlsVersion; + return this; + } + } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManagementClientImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManagementClientImpl.java index 518cd6f65496..70c6c8a1e111 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManagementClientImpl.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManagementClientImpl.java @@ -303,6 +303,58 @@ public FileSharesInner fileShares() { return this.fileShares; } + /** + * The QueueServicesInner object to access its operations. + */ + private QueueServicesInner queueServices; + + /** + * Gets the QueueServicesInner object to access its operations. + * @return the QueueServicesInner object. + */ + public QueueServicesInner queueServices() { + return this.queueServices; + } + + /** + * The QueuesInner object to access its operations. + */ + private QueuesInner queues; + + /** + * Gets the QueuesInner object to access its operations. + * @return the QueuesInner object. + */ + public QueuesInner queues() { + return this.queues; + } + + /** + * The TableServicesInner object to access its operations. + */ + private TableServicesInner tableServices; + + /** + * Gets the TableServicesInner object to access its operations. + * @return the TableServicesInner object. + */ + public TableServicesInner tableServices() { + return this.tableServices; + } + + /** + * The TablesInner object to access its operations. + */ + private TablesInner tables; + + /** + * Gets the TablesInner object to access its operations. + * @return the TablesInner object. + */ + public TablesInner tables() { + return this.tables; + } + /** * Initializes an instance of StorageManagementClient client. * @@ -351,6 +403,10 @@ protected void initialize() { this.blobContainers = new BlobContainersInner(restClient().retrofit(), this); this.fileServices = new FileServicesInner(restClient().retrofit(), this); this.fileShares = new FileSharesInner(restClient().retrofit(), this); + this.queueServices = new QueueServicesInner(restClient().retrofit(), this); + this.queues = new QueuesInner(restClient().retrofit(), this); + this.tableServices = new TableServicesInner(restClient().retrofit(), this); + this.tables = new TablesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManager.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManager.java index 0b8c11bad860..34506014b3fd 100644 --- a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManager.java +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageManager.java @@ -29,6 +29,10 @@ import com.microsoft.azure.management.storage.v2019_06_01.BlobContainers; import com.microsoft.azure.management.storage.v2019_06_01.FileServices; import com.microsoft.azure.management.storage.v2019_06_01.FileShares; +import com.microsoft.azure.management.storage.v2019_06_01.QueueServices; +import com.microsoft.azure.management.storage.v2019_06_01.Queues; +import com.microsoft.azure.management.storage.v2019_06_01.TableServices; +import com.microsoft.azure.management.storage.v2019_06_01.Tables; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -49,6 +53,10 @@ public final class StorageManager extends ManagerCore implements StorageQueue, StorageQueue.Definition, StorageQueue.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String queueName; + private Map cmetadata; + private Map umetadata; + + StorageQueueImpl(String name, StorageManager manager) { + super(name, new StorageQueueInner()); + this.manager = manager; + // Set resource name + this.queueName = name; + // + } + + StorageQueueImpl(StorageQueueInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.queueName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.queueName = IdParsingUtils.getValueFromIdByName(inner.id(), "queues"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.createAsync(this.resourceGroupName, this.accountName, this.queueName, this.cmetadata) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + QueuesInner client = this.manager().inner().queues(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.queueName, this.umetadata) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + QueuesInner client = this.manager().inner().queues(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public Integer approximateMessageCount() { + return this.inner().approximateMessageCount(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public Map metadata() { + return this.inner().metadata(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public StorageQueueImpl withExistingQueueService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public StorageQueueImpl withMetadata(Map metadata) { + if (isInCreateMode()) { + this.cmetadata = metadata; + } else { + this.umetadata = metadata; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageQueueInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageQueueInner.java new file mode 100644 index 000000000000..5b3036489050 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageQueueInner.java @@ -0,0 +1,64 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The StorageQueueInner model. + */ +@JsonFlatten +public class StorageQueueInner extends ProxyResource { + /** + * A name-value pair that represents queue metadata. + */ + @JsonProperty(value = "properties.metadata") + private Map metadata; + + /** + * Integer indicating an approximate number of messages in the queue. This + * number is not lower than the actual number of messages in the queue, but + * could be higher. + */ + @JsonProperty(value = "properties.approximateMessageCount", access = JsonProperty.Access.WRITE_ONLY) + private Integer approximateMessageCount; + + /** + * Get a name-value pair that represents queue metadata. + * + * @return the metadata value + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set a name-value pair that represents queue metadata. + * + * @param metadata the metadata value to set + * @return the StorageQueueInner object itself. + */ + public StorageQueueInner withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher. + * + * @return the approximateMessageCount value + */ + public Integer approximateMessageCount() { + return this.approximateMessageCount; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableImpl.java new file mode 100644 index 000000000000..174b1a15de25 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableImpl.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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.Table; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; + +class TableImpl extends CreatableUpdatableImpl implements Table, Table.Definition, Table.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private String tableName; + + TableImpl(String name, StorageManager manager) { + super(name, new TableInner()); + this.manager = manager; + // Set resource name + this.tableName = name; + // + } + + TableImpl(TableInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.tableName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + this.tableName = IdParsingUtils.getValueFromIdByName(inner.id(), "tables"); + // + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable
createResourceAsync() { + TablesInner client = this.manager().inner().tables(); + return client.createAsync(this.resourceGroupName, this.accountName, this.tableName) + .map(innerToFluentMap(this)); + } + + @Override + public Observable
updateResourceAsync() { + TablesInner client = this.manager().inner().tables(); + return client.updateAsync(this.resourceGroupName, this.accountName, this.tableName) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TablesInner client = this.manager().inner().tables(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String tableName() { + return this.inner().tableName(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TableImpl withExistingTableService(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableInner.java new file mode 100644 index 000000000000..01cffb1f8922 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableInner.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.storage.v2019_06_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Properties of the table, including Id, resource name, resource type. + */ +@JsonFlatten +public class TableInner extends ProxyResource { + /** + * Table name under the specified account. + */ + @JsonProperty(value = "properties.tableName", access = JsonProperty.Access.WRITE_ONLY) + private String tableName; + + /** + * Get table name under the specified account. + * + * @return the tableName value + */ + public String tableName() { + return this.tableName; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesImpl.java new file mode 100644 index 000000000000..0c882ac539a2 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesImpl.java @@ -0,0 +1,134 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.TableServiceProperties; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; +import java.util.List; +import rx.functions.Func1; + +class TableServicePropertiesImpl extends CreatableUpdatableImpl implements TableServiceProperties, TableServiceProperties.Definition, TableServiceProperties.Update { + private final StorageManager manager; + private String resourceGroupName; + private String accountName; + private CorsRules ccors; + private CorsRules ucors; + + TableServicePropertiesImpl(String name, StorageManager manager) { + super(name, new TableServicePropertiesInner()); + this.manager = manager; + // Set resource name + this.accountName = name; + // + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + TableServicePropertiesImpl(TableServicePropertiesInner inner, StorageManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.accountName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "storageAccounts"); + // + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + @Override + public StorageManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TableServicesInner client = this.manager().inner().tableServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ccors) + .map(new Func1() { + @Override + public TableServicePropertiesInner call(TableServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TableServicesInner client = this.manager().inner().tableServices(); + return client.setServicePropertiesAsync(this.resourceGroupName, this.accountName, this.ucors) + .map(new Func1() { + @Override + public TableServicePropertiesInner call(TableServicePropertiesInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TableServicesInner client = this.manager().inner().tableServices(); + return client.getServicePropertiesAsync(this.resourceGroupName, this.accountName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.ccors = new CorsRules(); + this.ucors = new CorsRules(); + } + + @Override + public CorsRules cors() { + return this.inner().cors(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TableServicePropertiesImpl withExistingStorageAccount(String resourceGroupName, String accountName) { + this.resourceGroupName = resourceGroupName; + this.accountName = accountName; + return this; + } + + @Override + public TableServicePropertiesImpl withCors(CorsRules cors) { + if (isInCreateMode()) { + this.ccors = cors; + } else { + this.ucors = cors; + } + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesInner.java new file mode 100644 index 000000000000..2fa362eaf211 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicePropertiesInner.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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The properties of a storage account’s Table service. + */ +@JsonFlatten +public class TableServicePropertiesInner extends ProxyResource { + /** + * Specifies CORS rules for the Table service. You can include up to five + * CorsRule elements in the request. If no CorsRule elements are included + * in the request body, all CORS rules will be deleted, and CORS will be + * disabled for the Table service. + */ + @JsonProperty(value = "properties.cors") + private CorsRules cors; + + /** + * Get specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * + * @return the cors value + */ + public CorsRules cors() { + return this.cors; + } + + /** + * Set specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * + * @param cors the cors value to set + * @return the TableServicePropertiesInner object itself. + */ + public TableServicePropertiesInner withCors(CorsRules cors) { + this.cors = cors; + return this; + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesImpl.java new file mode 100644 index 000000000000..967b37394bfd --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesImpl.java @@ -0,0 +1,72 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.TableServices; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.management.storage.v2019_06_01.ListTableServices; +import com.microsoft.azure.management.storage.v2019_06_01.TableServiceProperties; + +class TableServicesImpl extends WrapperImpl implements TableServices { + private final StorageManager manager; + + TableServicesImpl(StorageManager manager) { + super(manager.inner().tableServices()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public TableServicePropertiesImpl define(String name) { + return wrapModel(name); + } + + private TableServicePropertiesImpl wrapModel(TableServicePropertiesInner inner) { + return new TableServicePropertiesImpl(inner, manager()); + } + + private TableServicePropertiesImpl wrapModel(String name) { + return new TableServicePropertiesImpl(name, this.manager()); + } + + @Override + public Observable listAsync(String resourceGroupName, String accountName) { + TableServicesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .map(new Func1() { + @Override + public ListTableServices call(ListTableServicesInner inner) { + return new ListTableServicesImpl(inner, manager()); + } + }); + } + + @Override + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + TableServicesInner client = this.inner(); + return client.getServicePropertiesAsync(resourceGroupName, accountName) + .flatMap(new Func1>() { + @Override + public Observable call(TableServicePropertiesInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((TableServiceProperties)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesInner.java new file mode 100644 index 000000000000..9611c3bab832 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TableServicesInner.java @@ -0,0 +1,422 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.storage.v2019_06_01.CorsRules; +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 okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +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 TableServices. + */ +public class TableServicesInner { + /** The Retrofit service to perform REST calls. */ + private TableServicesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of TableServicesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TableServicesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(TableServicesService.class); + this.client = client; + } + + /** + * The interface defining all the services for TableServices to be + * used by Retrofit to perform actually REST calls. + */ + interface TableServicesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.TableServices list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.storage.v2019_06_01.TableServices setServiceProperties" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}") + Observable> setServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableServiceName") String tableServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TableServicePropertiesInner parameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.TableServices getServiceProperties" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}") + Observable> getServiceProperties(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableServiceName") String tableServiceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ListTableServicesInner object if successful. + */ + public ListTableServicesInner list(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListTableServicesInner object + */ + public Observable listAsync(String resourceGroupName, String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, ListTableServicesInner>() { + @Override + public ListTableServicesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * List all table services for the storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ListTableServicesInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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(resourceGroupName, accountName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableServicePropertiesInner object if successful. + */ + public TableServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 setServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, TableServicePropertiesInner>() { + @Override + public TableServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + final String tableServiceName = "default"; + final CorsRules cors = null; + TableServicePropertiesInner parameters = new TableServicePropertiesInner(); + parameters.withCors(null); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), tableServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableServicePropertiesInner object if successful. + */ + public TableServicePropertiesInner setServiceProperties(String resourceGroupName, String accountName, CorsRules cors) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors).toBlocking().single().body(); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * @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 setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors), serviceCallback); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable setServicePropertiesAsync(String resourceGroupName, String accountName, CorsRules cors) { + return setServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName, cors).map(new Func1, TableServicePropertiesInner>() { + @Override + public TableServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param cors Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable> setServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName, CorsRules cors) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + Validator.validate(cors); + final String tableServiceName = "default"; + TableServicePropertiesInner parameters = new TableServicePropertiesInner(); + parameters.withCors(cors); + return service.setServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), tableServiceName, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = setServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse setServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableServicePropertiesInner object if successful. + */ + public TableServicePropertiesInner getServiceProperties(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().body(); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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 getServicePropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable getServicePropertiesAsync(String resourceGroupName, String accountName) { + return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, TableServicePropertiesInner>() { + @Override + public TableServicePropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableServicePropertiesInner object + */ + public Observable> getServicePropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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."); + } + final String tableServiceName = "default"; + return service.getServiceProperties(resourceGroupName, accountName, this.client.subscriptionId(), tableServiceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getServicePropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getServicePropertiesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesImpl.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesImpl.java new file mode 100644 index 000000000000..befb6d68c6b0 --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.storage.v2019_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.storage.v2019_06_01.Tables; +import rx.Completable; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.storage.v2019_06_01.Table; + +class TablesImpl extends WrapperImpl implements Tables { + private final StorageManager manager; + + TablesImpl(StorageManager manager) { + super(manager.inner().tables()); + this.manager = manager; + } + + public StorageManager manager() { + return this.manager; + } + + @Override + public TableImpl define(String name) { + return wrapModel(name); + } + + private TableImpl wrapModel(TableInner inner) { + return new TableImpl(inner, manager()); + } + + private TableImpl wrapModel(String name) { + return new TableImpl(name, this.manager()); + } + + @Override + public Observable
getAsync(String resourceGroupName, String accountName, String tableName) { + TablesInner client = this.inner(); + return client.getAsync(resourceGroupName, accountName, tableName) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return new TableImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String accountName, String tableName) { + TablesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, accountName, tableName).toCompletable(); + } + + @Override + public Observable
listAsync(final String resourceGroupName, final String accountName) { + TablesInner client = this.inner(); + return client.listAsync(resourceGroupName, accountName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Table call(TableInner inner) { + return new TableImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesInner.java b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesInner.java new file mode 100644 index 000000000000..02f10a72f05f --- /dev/null +++ b/sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/TablesInner.java @@ -0,0 +1,694 @@ +/** + * 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.storage.v2019_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +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 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.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Tables. + */ +public class TablesInner { + /** The Retrofit service to perform REST calls. */ + private TablesService service; + /** The service client containing this operation class. */ + private StorageManagementClientImpl client; + + /** + * Initializes an instance of TablesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TablesInner(Retrofit retrofit, StorageManagementClientImpl client) { + this.service = retrofit.create(TablesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tables to be + * used by Retrofit to perform actually REST calls. + */ + interface TablesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.storage.v2019_06_01.Tables create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + Observable> create(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableName") String tableName, @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.storage.v2019_06_01.Tables update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableName") String tableName, @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.storage.v2019_06_01.Tables get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}") + Observable> get(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableName") String tableName, @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.storage.v2019_06_01.Tables delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @Path("subscriptionId") String subscriptionId, @Path("tableName") String tableName, @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.storage.v2019_06_01.Tables list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables") + Observable> list(@Path("resourceGroupName") String resourceGroupName, @Path("accountName") String accountName, @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.storage.v2019_06_01.Tables listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableInner object if successful. + */ + public TableInner create(String resourceGroupName, String accountName, String tableName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable createAsync(String resourceGroupName, String accountName, String tableName) { + return createWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.create(resourceGroupName, accountName, this.client.subscriptionId(), tableName, this.client.apiVersion(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableInner object if successful. + */ + public TableInner update(String resourceGroupName, String accountName, String tableName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @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 accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, String tableName) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new table with the specified table name, under the specified account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.update(resourceGroupName, accountName, this.client.subscriptionId(), tableName, this.client.apiVersion(), this.client.acceptLanguage(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TableInner object if successful. + */ + public TableInner get(String resourceGroupName, String accountName, String tableName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable getAsync(String resourceGroupName, String accountName, String tableName) { + return getWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, TableInner>() { + @Override + public TableInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TableInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.get(resourceGroupName, accountName, this.client.subscriptionId(), tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String accountName, String tableName) { + deleteWithServiceResponseAsync(resourceGroupName, accountName, tableName).toBlocking().single().body(); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String accountName, String tableName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, accountName, tableName), serviceCallback); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String accountName, String tableName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName, tableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the table with the specified table name, under the specified account if it exists. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param tableName A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName, String tableName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (tableName == null) { + throw new IllegalArgumentException("Parameter tableName 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.delete(resourceGroupName, accountName, this.client.subscriptionId(), tableName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TableInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String accountName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @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(final String resourceGroupName, final String accountName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, accountName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TableInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TableInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { + return listSinglePageAsync(resourceGroupName, accountName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + ServiceResponse> * @param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive. + ServiceResponse> * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (accountName == null) { + throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); + } + 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(resourceGroupName, accountName, 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); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TableInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @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> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TableInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TableInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all the tables under the specified storage account. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TableInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +}