diff --git a/sdk/loganalytics/mgmt-v2020_10_01/pom.xml b/sdk/loganalytics/mgmt-v2020_10_01/pom.xml new file mode 100644 index 000000000000..f6ffeafb696d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.loganalytics.v2020_10_01 + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/AssociatedWorkspace.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/AssociatedWorkspace.java new file mode 100644 index 000000000000..c52e01fc8b67 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/AssociatedWorkspace.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2020_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The list of Log Analytics workspaces associated with the cluster. + */ +public class AssociatedWorkspace { + /** + * The id of the assigned workspace. + */ + @JsonProperty(value = "workspaceId", access = JsonProperty.Access.WRITE_ONLY) + private String workspaceId; + + /** + * The name id the assigned workspace. + */ + @JsonProperty(value = "workspaceName", access = JsonProperty.Access.WRITE_ONLY) + private String workspaceName; + + /** + * The ResourceId id the assigned workspace. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /** + * The time of workspace association. + */ + @JsonProperty(value = "associateDate", access = JsonProperty.Access.WRITE_ONLY) + private String associateDate; + + /** + * Get the id of the assigned workspace. + * + * @return the workspaceId value + */ + public String workspaceId() { + return this.workspaceId; + } + + /** + * Get the name id the assigned workspace. + * + * @return the workspaceName value + */ + public String workspaceName() { + return this.workspaceName; + } + + /** + * Get the ResourceId id the assigned workspace. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the time of workspace association. + * + * @return the associateDate value + */ + public String associateDate() { + return this.associateDate; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/AzureEntityResource.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/AzureEntityResource.java new file mode 100644 index 000000000000..4a24d971a217 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * The resource model definition for an 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/BillingType.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/BillingType.java new file mode 100644 index 000000000000..b6996e7e86ce --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/BillingType.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_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BillingType. + */ +public final class BillingType extends ExpandableStringEnum { + /** Static value Cluster for BillingType. */ + public static final BillingType CLUSTER = fromString("Cluster"); + + /** Static value Workspaces for BillingType. */ + public static final BillingType WORKSPACES = fromString("Workspaces"); + + /** + * Creates or finds a BillingType from its string representation. + * @param name a name to look for + * @return the corresponding BillingType + */ + @JsonCreator + public static BillingType fromString(String name) { + return fromString(name, BillingType.class); + } + + /** + * @return known BillingType values + */ + public static Collection values() { + return values(BillingType.class); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/CapacityReservationProperties.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/CapacityReservationProperties.java new file mode 100644 index 000000000000..bdf1dc7c2dc7 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/CapacityReservationProperties.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_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Capacity Reservation properties. + */ +public class CapacityReservationProperties { + /** + * The last time Sku was updated. + */ + @JsonProperty(value = "lastSkuUpdate", access = JsonProperty.Access.WRITE_ONLY) + private String lastSkuUpdate; + + /** + * Minimum CapacityReservation value in GB. + */ + @JsonProperty(value = "minCapacity", access = JsonProperty.Access.WRITE_ONLY) + private Long minCapacity; + + /** + * Maximum CapacityReservation value in GB. + */ + @JsonProperty(value = "maxCapacity", access = JsonProperty.Access.WRITE_ONLY) + private Long maxCapacity; + + /** + * Get the last time Sku was updated. + * + * @return the lastSkuUpdate value + */ + public String lastSkuUpdate() { + return this.lastSkuUpdate; + } + + /** + * Get minimum CapacityReservation value in GB. + * + * @return the minCapacity value + */ + public Long minCapacity() { + return this.minCapacity; + } + + /** + * Get maximum CapacityReservation value in GB. + * + * @return the maxCapacity value + */ + public Long maxCapacity() { + return this.maxCapacity; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Cluster.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Cluster.java new file mode 100644 index 000000000000..d7e037fc7479 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Cluster.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_10_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.loganalytics.v2020_10_01.implementation.LogAnalyticsManager; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_10_01.implementation.ClusterInner; + +/** + * Type representing Cluster. + */ +public interface Cluster extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the associatedWorkspaces value. + */ + List associatedWorkspaces(); + + /** + * @return the billingType value. + */ + BillingType billingType(); + + /** + * @return the capacityReservationProperties value. + */ + CapacityReservationProperties capacityReservationProperties(); + + /** + * @return the clusterId value. + */ + String clusterId(); + + /** + * @return the createdDate value. + */ + String createdDate(); + + /** + * @return the identity value. + */ + Identity identity(); + + /** + * @return the isAvailabilityZonesEnabled value. + */ + Boolean isAvailabilityZonesEnabled(); + + /** + * @return the isDoubleEncryptionEnabled value. + */ + Boolean isDoubleEncryptionEnabled(); + + /** + * @return the keyVaultProperties value. + */ + KeyVaultProperties keyVaultProperties(); + + /** + * @return the lastModifiedDate value. + */ + String lastModifiedDate(); + + /** + * @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 AssociatedWorkspaces. + */ + interface WithAssociatedWorkspaces { + /** + * Specifies associatedWorkspaces. + * @param associatedWorkspaces The list of Log Analytics workspaces associated with the cluster + * @return the next definition stage + */ + WithCreate withAssociatedWorkspaces(List associatedWorkspaces); + } + + /** + * The stage of the cluster definition allowing to specify BillingType. + */ + interface WithBillingType { + /** + * Specifies billingType. + * @param billingType Configures whether billing will be only on the cluster or each workspace will be billed by its proportional use. This does not change the overall billing, only how it will be distributed. Default value is 'Cluster'. Possible values include: 'Cluster', 'Workspaces' + * @return the next definition stage + */ + WithCreate withBillingType(BillingType billingType); + } + + /** + * The stage of the cluster definition allowing to specify CapacityReservationProperties. + */ + interface WithCapacityReservationProperties { + /** + * Specifies capacityReservationProperties. + * @param capacityReservationProperties Additional properties for capacity reservation + * @return the next definition stage + */ + WithCreate withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties); + } + + /** + * 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 IsAvailabilityZonesEnabled. + */ + interface WithIsAvailabilityZonesEnabled { + /** + * Specifies isAvailabilityZonesEnabled. + * @param isAvailabilityZonesEnabled Sets whether the cluster will support availability zones. This can be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be modified after cluster creation. Default value is 'true' if region supports Availability Zones + * @return the next definition stage + */ + WithCreate withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled); + } + + /** + * The stage of the cluster definition allowing to specify IsDoubleEncryptionEnabled. + */ + interface WithIsDoubleEncryptionEnabled { + /** + * Specifies isDoubleEncryptionEnabled. + * @param isDoubleEncryptionEnabled Configures whether cluster will use double encryption. This Property can not be modified after cluster creation. Default value is 'true' + * @return the next definition stage + */ + WithCreate withIsDoubleEncryptionEnabled(Boolean isDoubleEncryptionEnabled); + } + + /** + * 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 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.WithAssociatedWorkspaces, DefinitionStages.WithBillingType, DefinitionStages.WithCapacityReservationProperties, DefinitionStages.WithIdentity, DefinitionStages.WithIsAvailabilityZonesEnabled, DefinitionStages.WithIsDoubleEncryptionEnabled, DefinitionStages.WithKeyVaultProperties, DefinitionStages.WithSku { + } + } + /** + * The template for a Cluster update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithIdentity, UpdateStages.WithKeyVaultProperties, UpdateStages.WithSku { + } + + /** + * Grouping of Cluster update stages. + */ + interface UpdateStages { + /** + * The stage of the cluster update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the resource + * @return the next update stage + */ + Update withIdentity(Identity identity); + } + + /** + * 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterEntityStatus.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterEntityStatus.java new file mode 100644 index 000000000000..ce67fb3bd878 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterPatch.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterPatch.java new file mode 100644 index 000000000000..5dca62b54db5 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterPatch.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.loganalytics.v2020_10_01; + +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 identity of the resource. + */ + @JsonProperty(value = "identity") + private Identity identity; + + /** + * 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 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 ClusterPatch object itself. + */ + public ClusterPatch 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 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterSku.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterSku.java new file mode 100644 index 000000000000..d2aa8f5fd2b6 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterSkuNameEnum.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ClusterSkuNameEnum.java new file mode 100644 index 000000000000..cecba5fd871e --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Clusters.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Clusters.java new file mode 100644 index 000000000000..3bf518a74e41 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_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 com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/DataIngestionStatus.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/DataIngestionStatus.java new file mode 100644 index 000000000000..a594d80b4db0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/DeletedWorkspaces.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/DeletedWorkspaces.java new file mode 100644 index 000000000000..d2a6aa74a73f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorAdditionalInfo.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorAdditionalInfo.java new file mode 100644 index 000000000000..9234561dd7e7 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorDetail.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorDetail.java new file mode 100644 index 000000000000..8ca8a240273e --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorDetail.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_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The error detail. + */ +public class ErrorDetail { + /** + * 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorResponse.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorResponse.java new file mode 100644 index 000000000000..1ca21a3e3656 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorResponse.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Error response. + * Common error response for all Azure Resource Manager APIs to return error + * details for failed operations. (This also follows the OData error response + * format.). + */ +public class ErrorResponse { + /** + * The error object. + */ + @JsonProperty(value = "error") + private ErrorDetail error; + + /** + * Get the error object. + * + * @return the error value + */ + public ErrorDetail error() { + return this.error; + } + + /** + * Set the error object. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorDetail error) { + this.error = error; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorResponseException.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorResponseException.java new file mode 100644 index 000000000000..c73d216dfadc --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/ErrorResponseException.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_10_01; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException 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 ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Identity.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Identity.java new file mode 100644 index 000000000000..82bf8e2b225c --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Identity.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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_10_01; + +import java.util.Map; +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 type of identity used for the resource. The type 'SystemAssigned, + * UserAssigned' includes both an implicitly created identity and a set of + * user assigned identities. Possible values include: 'SystemAssigned', + * 'UserAssigned', 'None'. + */ + @JsonProperty(value = "type", required = true) + private IdentityType type; + + /** + * The list of user identities associated with the resource. 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 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 type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. Possible values include: 'SystemAssigned', 'UserAssigned', 'None'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. Possible values include: 'SystemAssigned', 'UserAssigned', 'None'. + * + * @param type the type value to set + * @return the Identity object itself. + */ + public Identity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the list of user identities associated with the resource. 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 resource. 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 Identity object itself. + */ + public Identity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/IdentityType.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/IdentityType.java new file mode 100644 index 000000000000..5000b92821b0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/IdentityType.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_10_01; + +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 UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/KeyVaultProperties.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/KeyVaultProperties.java new file mode 100644 index 000000000000..7c12487045af --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/KeyVaultProperties.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.loganalytics.v2020_10_01; + +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; + + /** + * Selected key minimum required size. + */ + @JsonProperty(value = "keyRsaSize") + private Integer keyRsaSize; + + /** + * 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; + } + + /** + * Get selected key minimum required size. + * + * @return the keyRsaSize value + */ + public Integer keyRsaSize() { + return this.keyRsaSize; + } + + /** + * Set selected key minimum required size. + * + * @param keyRsaSize the keyRsaSize value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyRsaSize(Integer keyRsaSize) { + this.keyRsaSize = keyRsaSize; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Operation.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Operation.java new file mode 100644 index 000000000000..761e99bc6935 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_10_01.implementation.LogAnalyticsManager; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/OperationDisplay.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/OperationDisplay.java new file mode 100644 index 000000000000..49fdd11cd0f4 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_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.loganalytics.v2020_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Operations.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Operations.java new file mode 100644 index 000000000000..4169011c8f89 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_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.loganalytics.v2020_10_01; + +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/PrivateLinkScopedResource.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/PrivateLinkScopedResource.java new file mode 100644 index 000000000000..6c08bb8e756d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/PublicNetworkAccessType.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/PublicNetworkAccessType.java new file mode 100644 index 000000000000..22460ab82acc --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/UserIdentityProperties.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/UserIdentityProperties.java new file mode 100644 index 000000000000..3f3f91a09bba --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/UserIdentityProperties.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_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * User assigned identity properties. + */ +public class UserIdentityProperties { + /** + * 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/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Workspace.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Workspace.java new file mode 100644 index 000000000000..fbe5b3f372cd --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Workspace.java @@ -0,0 +1,299 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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_10_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.loganalytics.v2020_10_01.implementation.LogAnalyticsManager; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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 forceCmkForQuery value. + */ + Boolean forceCmkForQuery(); + + /** + * @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 ForceCmkForQuery. + */ + interface WithForceCmkForQuery { + /** + * Specifies forceCmkForQuery. + * @param forceCmkForQuery Indicates whether customer managed storage is mandatory for query management + * @return the next definition stage + */ + WithCreate withForceCmkForQuery(Boolean forceCmkForQuery); + } + + /** + * 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, between 30 and 730 + * @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.WithForceCmkForQuery, 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.WithForceCmkForQuery, 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 ForceCmkForQuery. + */ + interface WithForceCmkForQuery { + /** + * Specifies forceCmkForQuery. + * @param forceCmkForQuery Indicates whether customer managed storage is mandatory for query management + * @return the next update stage + */ + Update withForceCmkForQuery(Boolean forceCmkForQuery); + } + + /** + * 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, between 30 and 730 + * @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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceCapping.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceCapping.java new file mode 100644 index 000000000000..f83c8b41bcf1 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The daily volume cap for ingestion. + */ +public class WorkspaceCapping { + /** + * The workspace daily quota for ingestion. + */ + @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. + * + * @return the dailyQuotaGb value + */ + public Double dailyQuotaGb() { + return this.dailyQuotaGb; + } + + /** + * Set the workspace daily quota for ingestion. + * + * @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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceEntityStatus.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceEntityStatus.java new file mode 100644 index 000000000000..702b9701467b --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01; + +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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceModel.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceModel.java new file mode 100644 index 000000000000..05da2aceaa7d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceModel.java @@ -0,0 +1,74 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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_10_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.resources.models.HasManager; +import com.microsoft.azure.management.loganalytics.v2020_10_01.implementation.LogAnalyticsManager; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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 forceCmkForQuery value. + */ + Boolean forceCmkForQuery(); + + /** + * @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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspacePatch.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspacePatch.java new file mode 100644 index 000000000000..6669155b7d93 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspacePatch.java @@ -0,0 +1,265 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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_10_01; + +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, between 30 and 730. + */ + @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; + + /** + * Indicates whether customer managed storage is mandatory for query + * management. + */ + @JsonProperty(value = "properties.forceCmkForQuery") + private Boolean forceCmkForQuery; + + /** + * 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, between 30 and 730. + * + * @return the retentionInDays value + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the workspace data retention in days, between 30 and 730. + * + * @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 indicates whether customer managed storage is mandatory for query management. + * + * @return the forceCmkForQuery value + */ + public Boolean forceCmkForQuery() { + return this.forceCmkForQuery; + } + + /** + * Set indicates whether customer managed storage is mandatory for query management. + * + * @param forceCmkForQuery the forceCmkForQuery value to set + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withForceCmkForQuery(Boolean forceCmkForQuery) { + this.forceCmkForQuery = forceCmkForQuery; + 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceSku.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceSku.java new file mode 100644 index 000000000000..3315600ce780 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceSku.java @@ -0,0 +1,103 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.loganalytics.v2020_10_01; + +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', + * 'LACluster'. + */ + @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', 'LACluster'. + * + * @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', 'LACluster'. + * + * @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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceSkuNameEnum.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceSkuNameEnum.java new file mode 100644 index 000000000000..c699f9f27ae9 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/WorkspaceSkuNameEnum.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.loganalytics.v2020_10_01; + +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"); + + /** Static value LACluster for WorkspaceSkuNameEnum. */ + public static final WorkspaceSkuNameEnum LACLUSTER = fromString("LACluster"); + + /** + * 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Workspaces.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/Workspaces.java new file mode 100644 index 000000000000..7bd26c87008a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_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 com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClusterImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClusterImpl.java new file mode 100644 index 000000000000..d8d5bafadd06 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClusterImpl.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT 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_10_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_10_01.Cluster; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_10_01.ClusterPatch; +import com.microsoft.azure.management.loganalytics.v2020_10_01.Identity; +import com.microsoft.azure.management.loganalytics.v2020_10_01.ClusterSku; +import com.microsoft.azure.management.loganalytics.v2020_10_01.ClusterEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_10_01.BillingType; +import com.microsoft.azure.management.loganalytics.v2020_10_01.KeyVaultProperties; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_10_01.AssociatedWorkspace; +import com.microsoft.azure.management.loganalytics.v2020_10_01.CapacityReservationProperties; +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 List associatedWorkspaces() { + return this.inner().associatedWorkspaces(); + } + + @Override + public BillingType billingType() { + return this.inner().billingType(); + } + + @Override + public CapacityReservationProperties capacityReservationProperties() { + return this.inner().capacityReservationProperties(); + } + + @Override + public String clusterId() { + return this.inner().clusterId(); + } + + @Override + public String createdDate() { + return this.inner().createdDate(); + } + + @Override + public Identity identity() { + return this.inner().identity(); + } + + @Override + public Boolean isAvailabilityZonesEnabled() { + return this.inner().isAvailabilityZonesEnabled(); + } + + @Override + public Boolean isDoubleEncryptionEnabled() { + return this.inner().isDoubleEncryptionEnabled(); + } + + @Override + public KeyVaultProperties keyVaultProperties() { + return this.inner().keyVaultProperties(); + } + + @Override + public String lastModifiedDate() { + return this.inner().lastModifiedDate(); + } + + @Override + public ClusterEntityStatus provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public ClusterSku sku() { + return this.inner().sku(); + } + + @Override + public ClusterImpl withAssociatedWorkspaces(List associatedWorkspaces) { + this.inner().withAssociatedWorkspaces(associatedWorkspaces); + return this; + } + + @Override + public ClusterImpl withBillingType(BillingType billingType) { + this.inner().withBillingType(billingType); + return this; + } + + @Override + public ClusterImpl withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties) { + this.inner().withCapacityReservationProperties(capacityReservationProperties); + return this; + } + + @Override + public ClusterImpl withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled) { + this.inner().withIsAvailabilityZonesEnabled(isAvailabilityZonesEnabled); + return this; + } + + @Override + public ClusterImpl withIsDoubleEncryptionEnabled(Boolean isDoubleEncryptionEnabled) { + this.inner().withIsDoubleEncryptionEnabled(isDoubleEncryptionEnabled); + return this; + } + + @Override + public ClusterImpl withIdentity(Identity identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClusterInner.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClusterInner.java new file mode 100644 index 000000000000..5fc6c2566145 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClusterInner.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.loganalytics.v2020_10_01.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_10_01.Identity; +import com.microsoft.azure.management.loganalytics.v2020_10_01.ClusterSku; +import com.microsoft.azure.management.loganalytics.v2020_10_01.ClusterEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_10_01.BillingType; +import com.microsoft.azure.management.loganalytics.v2020_10_01.KeyVaultProperties; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_10_01.AssociatedWorkspace; +import com.microsoft.azure.management.loganalytics.v2020_10_01.CapacityReservationProperties; +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 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; + + /** + * Configures whether cluster will use double encryption. This Property can + * not be modified after cluster creation. Default value is 'true'. + */ + @JsonProperty(value = "properties.isDoubleEncryptionEnabled") + private Boolean isDoubleEncryptionEnabled; + + /** + * Sets whether the cluster will support availability zones. This can be + * set as true only in regions where Azure Data Explorer support + * Availability Zones. This Property can not be modified after cluster + * creation. Default value is 'true' if region supports Availability Zones. + */ + @JsonProperty(value = "properties.isAvailabilityZonesEnabled") + private Boolean isAvailabilityZonesEnabled; + + /** + * Configures whether billing will be only on the cluster or each workspace + * will be billed by its proportional use. This does not change the overall + * billing, only how it will be distributed. Default value is 'Cluster'. + * Possible values include: 'Cluster', 'Workspaces'. + */ + @JsonProperty(value = "properties.billingType") + private BillingType billingType; + + /** + * The associated key properties. + */ + @JsonProperty(value = "properties.keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * The last time the cluster was updated. + */ + @JsonProperty(value = "properties.lastModifiedDate", access = JsonProperty.Access.WRITE_ONLY) + private String lastModifiedDate; + + /** + * The cluster creation time. + */ + @JsonProperty(value = "properties.createdDate", access = JsonProperty.Access.WRITE_ONLY) + private String createdDate; + + /** + * The list of Log Analytics workspaces associated with the cluster. + */ + @JsonProperty(value = "properties.associatedWorkspaces") + private List associatedWorkspaces; + + /** + * Additional properties for capacity reservation. + */ + @JsonProperty(value = "properties.capacityReservationProperties") + private CapacityReservationProperties capacityReservationProperties; + + /** + * 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 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 configures whether cluster will use double encryption. This Property can not be modified after cluster creation. Default value is 'true'. + * + * @return the isDoubleEncryptionEnabled value + */ + public Boolean isDoubleEncryptionEnabled() { + return this.isDoubleEncryptionEnabled; + } + + /** + * Set configures whether cluster will use double encryption. This Property can not be modified after cluster creation. Default value is 'true'. + * + * @param isDoubleEncryptionEnabled the isDoubleEncryptionEnabled value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withIsDoubleEncryptionEnabled(Boolean isDoubleEncryptionEnabled) { + this.isDoubleEncryptionEnabled = isDoubleEncryptionEnabled; + return this; + } + + /** + * Get sets whether the cluster will support availability zones. This can be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be modified after cluster creation. Default value is 'true' if region supports Availability Zones. + * + * @return the isAvailabilityZonesEnabled value + */ + public Boolean isAvailabilityZonesEnabled() { + return this.isAvailabilityZonesEnabled; + } + + /** + * Set sets whether the cluster will support availability zones. This can be set as true only in regions where Azure Data Explorer support Availability Zones. This Property can not be modified after cluster creation. Default value is 'true' if region supports Availability Zones. + * + * @param isAvailabilityZonesEnabled the isAvailabilityZonesEnabled value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled) { + this.isAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + return this; + } + + /** + * Get configures whether billing will be only on the cluster or each workspace will be billed by its proportional use. This does not change the overall billing, only how it will be distributed. Default value is 'Cluster'. Possible values include: 'Cluster', 'Workspaces'. + * + * @return the billingType value + */ + public BillingType billingType() { + return this.billingType; + } + + /** + * Set configures whether billing will be only on the cluster or each workspace will be billed by its proportional use. This does not change the overall billing, only how it will be distributed. Default value is 'Cluster'. Possible values include: 'Cluster', 'Workspaces'. + * + * @param billingType the billingType value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withBillingType(BillingType billingType) { + this.billingType = billingType; + return this; + } + + /** + * 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; + } + + /** + * Get the last time the cluster was updated. + * + * @return the lastModifiedDate value + */ + public String lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * Get the cluster creation time. + * + * @return the createdDate value + */ + public String createdDate() { + return this.createdDate; + } + + /** + * Get the list of Log Analytics workspaces associated with the cluster. + * + * @return the associatedWorkspaces value + */ + public List associatedWorkspaces() { + return this.associatedWorkspaces; + } + + /** + * Set the list of Log Analytics workspaces associated with the cluster. + * + * @param associatedWorkspaces the associatedWorkspaces value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withAssociatedWorkspaces(List associatedWorkspaces) { + this.associatedWorkspaces = associatedWorkspaces; + return this; + } + + /** + * Get additional properties for capacity reservation. + * + * @return the capacityReservationProperties value + */ + public CapacityReservationProperties capacityReservationProperties() { + return this.capacityReservationProperties; + } + + /** + * Set additional properties for capacity reservation. + * + * @param capacityReservationProperties the capacityReservationProperties value to set + * @return the ClusterInner object itself. + */ + public ClusterInner withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties) { + this.capacityReservationProperties = capacityReservationProperties; + return this; + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClustersImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClustersImpl.java new file mode 100644 index 000000000000..a0b7aa26331f --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_10_01.Clusters; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClustersInner.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/ClustersInner.java new file mode 100644 index 000000000000..c731e8f7438c --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_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.ListOperationCallback; +import com.microsoft.azure.management.loganalytics.v2020_10_01.ClusterPatch; +import com.microsoft.azure.management.loganalytics.v2020_10_01.ErrorResponseException; +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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the Log Analytics clusters in a subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, 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(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Gets the 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/DeletedWorkspacesImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/DeletedWorkspacesImpl.java new file mode 100644 index 000000000000..c6522d5b631d --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_10_01.DeletedWorkspaces; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/DeletedWorkspacesInner.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/DeletedWorkspacesInner.java new file mode 100644 index 000000000000..b82ec565ccd2 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.loganalytics.v2020_10_01.ErrorResponseException; +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_10_01.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_10_01.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() { + PageImpl1 page = new PageImpl1<>(); + 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) { + PageImpl1 page = new PageImpl1<>(); + 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.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) { + PageImpl1 page = new PageImpl1<>(); + 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) { + PageImpl1 page = new PageImpl1<>(); + 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/IdParsingUtils.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..4dff6461e3fc --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_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.loganalytics.v2020_10_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/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/LogAnalyticsManager.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/LogAnalyticsManager.java new file mode 100644 index 000000000000..4d70bc06a0a0 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/LogAnalyticsManager.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.loganalytics.v2020_10_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.loganalytics.v2020_10_01.Clusters; +import com.microsoft.azure.management.loganalytics.v2020_10_01.Operations; +import com.microsoft.azure.management.loganalytics.v2020_10_01.Workspaces; +import com.microsoft.azure.management.loganalytics.v2020_10_01.DeletedWorkspaces; +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 Clusters clusters; + private Operations operations; + private Workspaces workspaces; + private DeletedWorkspaces deletedWorkspaces; + /** + * 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 Clusters. + */ + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(this); + } + return this.clusters; + } + + /** + * @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 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; + } + + /** + * 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..a84311444fe3 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_10_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationInner.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationInner.java new file mode 100644 index 000000000000..b2ccfe78a9c8 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationalInsightsManagementClientImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationalInsightsManagementClientImpl.java new file mode 100644 index 000000000000..822cb348e0db --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationalInsightsManagementClientImpl.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.loganalytics.v2020_10_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 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 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 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 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 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 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 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; + } + + /** + * 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-10-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.clusters = new ClustersInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.workspaces = new WorkspacesInner(restClient().retrofit(), this); + this.deletedWorkspaces = new DeletedWorkspacesInner(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-10-01"); + } +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationsImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..41f55a101183 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_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.loganalytics.v2020_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.loganalytics.v2020_10_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationsInner.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..c684e69bfb00 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_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.loganalytics.v2020_10_01.implementation; + +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_10_01.ErrorResponseException; +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_10_01.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_10_01.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/PageImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/PageImpl.java new file mode 100644 index 000000000000..cf4233269114 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_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.loganalytics.v2020_10_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/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/PageImpl1.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/PageImpl1.java new file mode 100644 index 000000000000..cb107a47a207 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_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.loganalytics.v2020_10_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/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceImpl.java new file mode 100644 index 000000000000..3f1e70844e50 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceImpl.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.loganalytics.v2020_10_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_10_01.Workspace; +import rx.Observable; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspacePatch; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceSku; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceCapping; +import com.microsoft.azure.management.loganalytics.v2020_10_01.PublicNetworkAccessType; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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 Boolean forceCmkForQuery() { + return this.inner().forceCmkForQuery(); + } + + @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 withForceCmkForQuery(Boolean forceCmkForQuery) { + if (isInCreateMode()) { + this.inner().withForceCmkForQuery(forceCmkForQuery); + } else { + this.updateParameter.withForceCmkForQuery(forceCmkForQuery); + } + 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceInner.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceInner.java new file mode 100644 index 000000000000..0d60e014bb3c --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceInner.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_10_01.implementation; + +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceSku; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceCapping; +import com.microsoft.azure.management.loganalytics.v2020_10_01.PublicNetworkAccessType; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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, between 30 and 730. + */ + @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; + + /** + * Indicates whether customer managed storage is mandatory for query + * management. + */ + @JsonProperty(value = "properties.forceCmkForQuery") + private Boolean forceCmkForQuery; + + /** + * 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, between 30 and 730. + * + * @return the retentionInDays value + */ + public Integer retentionInDays() { + return this.retentionInDays; + } + + /** + * Set the workspace data retention in days, between 30 and 730. + * + * @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 indicates whether customer managed storage is mandatory for query management. + * + * @return the forceCmkForQuery value + */ + public Boolean forceCmkForQuery() { + return this.forceCmkForQuery; + } + + /** + * Set indicates whether customer managed storage is mandatory for query management. + * + * @param forceCmkForQuery the forceCmkForQuery value to set + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withForceCmkForQuery(Boolean forceCmkForQuery) { + this.forceCmkForQuery = forceCmkForQuery; + 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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceModelImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceModelImpl.java new file mode 100644 index 000000000000..157ccfb78559 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspaceModelImpl.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_10_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceModel; +import rx.Observable; +import java.util.List; +import com.microsoft.azure.management.loganalytics.v2020_10_01.PrivateLinkScopedResource; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceEntityStatus; +import com.microsoft.azure.management.loganalytics.v2020_10_01.PublicNetworkAccessType; +import com.microsoft.azure.management.loganalytics.v2020_10_01.WorkspaceSku; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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 Boolean forceCmkForQuery() { + return this.inner().forceCmkForQuery(); + } + + @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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspacesImpl.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspacesImpl.java new file mode 100644 index 000000000000..7fca6f781538 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.loganalytics.v2020_10_01.Workspaces; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspacesInner.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/WorkspacesInner.java new file mode 100644 index 000000000000..e247b49be766 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_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.management.loganalytics.v2020_10_01.ErrorResponseException; +import com.microsoft.azure.management.loganalytics.v2020_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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_10_01.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() { + PageImpl1 page = new PageImpl1<>(); + 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) { + PageImpl1 page = new PageImpl1<>(); + 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.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) { + PageImpl1 page = new PageImpl1<>(); + 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) { + PageImpl1 page = new PageImpl1<>(); + 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, 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(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String 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 ErrorResponseException, 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(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the 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 ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/package-info.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/implementation/package-info.java new file mode 100644 index 000000000000..dfe0eff31c20 --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01.implementation; diff --git a/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/package-info.java b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/package-info.java new file mode 100644 index 000000000000..e7658b1b858a --- /dev/null +++ b/sdk/loganalytics/mgmt-v2020_10_01/src/main/java/com/microsoft/azure/management/loganalytics/v2020_10_01/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_10_01;