diff --git a/api-specs.json b/api-specs.json
index edc09c15e1f7..2a8bf9a376c9 100644
--- a/api-specs.json
+++ b/api-specs.json
@@ -160,6 +160,10 @@
"source": "specification/machinelearningservices/resource-manager/readme.md",
"args": "--multiapi --fluent"
},
+ "maintenance/resource-manager": {
+ "source": "specification/maintenance/resource-manager/readme.md",
+ "args": "--multiapi --fluent"
+ },
"mariadb/resource-manager": {
"source": "specification/mariadb/resource-manager/readme.md",
"args": "--multiapi --fluent"
diff --git a/sdk/maintenance/ci.mgmt.yml b/sdk/maintenance/ci.mgmt.yml
new file mode 100644
index 000000000000..a50c0e578b16
--- /dev/null
+++ b/sdk/maintenance/ci.mgmt.yml
@@ -0,0 +1,74 @@
+resources:
+ repositories:
+ - repository: azure-sdk-build-tools
+ type: git
+ name: internal/azure-sdk-build-tools
+
+trigger:
+ branches:
+ include:
+ - master
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/maintenance/
+ exclude:
+ - sdk/maintenance/microsoft-azure
+
+pr:
+ branches:
+ include:
+ - master
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/maintenance/
+ exclude:
+ - sdk/maintenance/microsoft-azure
+
+
+variables:
+ BuildOptions: '--batch-mode -Dgpg.skip -Dmaven.wagon.http.pool=false'
+ ServiceDirectory: maintenance
+ ProfileFlag: ''
+
+jobs:
+ - job: 'Build'
+
+ variables:
+ - template: ../../eng/pipelines/templates/variables/globals.yml
+
+ strategy:
+ matrix:
+ Java 8:
+ ArtifactName: 'packages'
+ JavaVersion: '1.8'
+ Java 7:
+ ArtifactName: 'packages'
+ JavaVersion: '1.7'
+
+ pool:
+ vmImage: 'ubuntu-16.04'
+
+ steps:
+ - task: Maven@3
+ displayName: 'Build'
+ inputs:
+ mavenPomFile: sdk/$(ServiceDirectory)/pom.mgmt.xml
+ goals: 'compile'
+ options: '$(BuildOptions) $(ProfileFlag) "-DpackageOutputDirectory=$(Build.ArtifactStagingDirectory)" -DskipTests'
+ mavenOptions: '$(MemoryOptions) $(LoggingOptions)'
+ javaHomeOption: 'JDKVersion'
+ jdkVersionOption: $(JavaVersion)
+ jdkArchitectureOption: 'x64'
+ publishJUnitResults: false
+
+ - task: PublishTestResults@2
+ condition: succeededOrFailed()
+ inputs:
+ mergeTestResults: true
+ testRunTitle: 'On Java $(JavaVersion)'
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/pom.xml b/sdk/maintenance/mgmt-v2018_06_01_preview/pom.xml
new file mode 100644
index 000000000000..6b2230fbe7f1
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/pom.xml
@@ -0,0 +1,135 @@
+
+
+ 4.0.0
+ com.microsoft.azure.maintenance.v2018_06_01_preview
+
+ com.microsoft.azure
+ azure-arm-parent
+ 1.2.0
+ ../../../pom.management.xml
+
+ azure-mgmt-maintenance
+ 1.0.0-beta
+ jar
+ Microsoft Azure SDK for Maintenance Management
+ This package contains Microsoft Maintenance 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/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ApplyUpdate.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ApplyUpdate.java
new file mode 100644
index 000000000000..d41cfb7de0d0
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ApplyUpdate.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.MaintenanceManager;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.ApplyUpdateInner;
+import org.joda.time.DateTime;
+
+/**
+ * Type representing ApplyUpdate.
+ */
+public interface ApplyUpdate extends HasInner, HasManager {
+ /**
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * @return the lastUpdateTime value.
+ */
+ DateTime lastUpdateTime();
+
+ /**
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * @return the resourceId value.
+ */
+ String resourceId();
+
+ /**
+ * @return the status value.
+ */
+ UpdateStatus status();
+
+ /**
+ * @return the type value.
+ */
+ String type();
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ApplyUpdates.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ApplyUpdates.java
new file mode 100644
index 000000000000..99b855d62353
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ApplyUpdates.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.maintenance.v2018_06_01_preview;
+
+import rx.Observable;
+
+/**
+ * Type representing ApplyUpdates.
+ */
+public interface ApplyUpdates {
+ /**
+ * Track Updates to resource with parent.
+ * Track maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable getParentAsync(String resourceGroupName, String resourceParentType, String resourceParentName, String providerName, String resourceType, String resourceName, String applyUpdateName);
+
+ /**
+ * Track Updates to resource.
+ * Track maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable getAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String applyUpdateName);
+
+ /**
+ * Apply Updates to resource with parent.
+ * Apply maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable createOrUpdateParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName);
+
+ /**
+ * Apply Updates to resource.
+ * Apply maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable createOrUpdateAsync(String resourceGroupName, String providerName, String resourceType, String resourceName);
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ConfigurationAssignment.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ConfigurationAssignment.java
new file mode 100644
index 000000000000..f5651aeeaee3
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ConfigurationAssignment.java
@@ -0,0 +1,222 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.ConfigurationAssignmentInner;
+import com.microsoft.azure.arm.model.Indexable;
+import com.microsoft.azure.arm.model.Updatable;
+import com.microsoft.azure.arm.model.Appliable;
+import com.microsoft.azure.arm.model.Creatable;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.MaintenanceManager;
+
+/**
+ * Type representing ConfigurationAssignment.
+ */
+public interface ConfigurationAssignment extends HasInner, Indexable, Updatable, HasManager {
+ /**
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * @return the location value.
+ */
+ String location();
+
+ /**
+ * @return the maintenanceConfigurationId value.
+ */
+ String maintenanceConfigurationId();
+
+ /**
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * @return the resourceId value.
+ */
+ String resourceId();
+
+ /**
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * The entirety of the ConfigurationAssignment definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithProvider, DefinitionStages.WithResourceParentType, DefinitionStages.WithResourceParentName, DefinitionStages.WithResourceType, DefinitionStages.WithResourceName, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * Grouping of ConfigurationAssignment definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of a ConfigurationAssignment definition.
+ */
+ interface Blank extends WithProvider {
+ }
+
+ /**
+ * The stage of the configurationassignment definition allowing to specify Provider.
+ */
+ interface WithProvider {
+ /**
+ * Specifies resourceGroupName, providerName.
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @return the next definition stage
+ */
+ WithResourceParentType withExistingProvider(String resourceGroupName, String providerName);
+ }
+
+ /**
+ * The stage of the configurationassignment definition allowing to specify ResourceParentType.
+ */
+ interface WithResourceParentType {
+ /**
+ * Specifies resourceParentType.
+ * @param resourceParentType Resource parent type
+ * @return the next definition stage
+ */
+ WithResourceParentName withResourceParentType(String resourceParentType);
+ }
+
+ /**
+ * The stage of the configurationassignment definition allowing to specify ResourceParentName.
+ */
+ interface WithResourceParentName {
+ /**
+ * Specifies resourceParentName.
+ * @param resourceParentName Resource parent identifier
+ * @return the next definition stage
+ */
+ WithResourceType withResourceParentName(String resourceParentName);
+ }
+
+ /**
+ * The stage of the configurationassignment definition allowing to specify ResourceType.
+ */
+ interface WithResourceType {
+ /**
+ * Specifies resourceType.
+ * @param resourceType Resource type
+ * @return the next definition stage
+ */
+ WithResourceName withResourceType(String resourceType);
+ }
+
+ /**
+ * The stage of the configurationassignment definition allowing to specify ResourceName.
+ */
+ interface WithResourceName {
+ /**
+ * Specifies resourceName.
+ * @param resourceName Resource identifier
+ * @return the next definition stage
+ */
+ WithCreate withResourceName(String resourceName);
+ }
+
+ /**
+ * The stage of the configurationassignment definition allowing to specify Location.
+ */
+ interface WithLocation {
+ /**
+ * Specifies location.
+ * @param location Location of the resource
+ * @return the next definition stage
+ */
+ WithCreate withLocation(String location);
+ }
+
+ /**
+ * The stage of the configurationassignment definition allowing to specify MaintenanceConfigurationId.
+ */
+ interface WithMaintenanceConfigurationId {
+ /**
+ * Specifies maintenanceConfigurationId.
+ * @param maintenanceConfigurationId The maintenance configuration Id
+ * @return the next definition stage
+ */
+ WithCreate withMaintenanceConfigurationId(String maintenanceConfigurationId);
+ }
+
+ /**
+ * The stage of the configurationassignment definition allowing to specify ResourceId.
+ */
+ interface WithResourceId {
+ /**
+ * Specifies resourceId.
+ * @param resourceId The unique resourceId
+ * @return the next definition stage
+ */
+ WithCreate withResourceId(String resourceId);
+ }
+
+ /**
+ * The stage of the definition which contains all the minimum required inputs for
+ * the resource to be created (via {@link WithCreate#create()}), but also allows
+ * for any other optional settings to be specified.
+ */
+ interface WithCreate extends Creatable, DefinitionStages.WithLocation, DefinitionStages.WithMaintenanceConfigurationId, DefinitionStages.WithResourceId {
+ }
+ }
+ /**
+ * The template for a ConfigurationAssignment update operation, containing all the settings that can be modified.
+ */
+ interface Update extends Appliable, UpdateStages.WithLocation, UpdateStages.WithMaintenanceConfigurationId, UpdateStages.WithResourceId {
+ }
+
+ /**
+ * Grouping of ConfigurationAssignment update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the configurationassignment update allowing to specify Location.
+ */
+ interface WithLocation {
+ /**
+ * Specifies location.
+ * @param location Location of the resource
+ * @return the next update stage
+ */
+ Update withLocation(String location);
+ }
+
+ /**
+ * The stage of the configurationassignment update allowing to specify MaintenanceConfigurationId.
+ */
+ interface WithMaintenanceConfigurationId {
+ /**
+ * Specifies maintenanceConfigurationId.
+ * @param maintenanceConfigurationId The maintenance configuration Id
+ * @return the next update stage
+ */
+ Update withMaintenanceConfigurationId(String maintenanceConfigurationId);
+ }
+
+ /**
+ * The stage of the configurationassignment update allowing to specify ResourceId.
+ */
+ interface WithResourceId {
+ /**
+ * Specifies resourceId.
+ * @param resourceId The unique resourceId
+ * @return the next update stage
+ */
+ Update withResourceId(String resourceId);
+ }
+
+ }
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ConfigurationAssignments.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ConfigurationAssignments.java
new file mode 100644
index 000000000000..653fadd9c271
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ConfigurationAssignments.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import com.microsoft.azure.arm.collection.SupportsCreating;
+import rx.Completable;
+import rx.Observable;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.ConfigurationAssignmentInner;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.ConfigurationAssignmentsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing ConfigurationAssignments.
+ */
+public interface ConfigurationAssignments extends SupportsCreating, HasInner {
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable deleteParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName);
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable createOrUpdateAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment);
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable deleteAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName);
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName);
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listAsync(String resourceGroupName, String providerName, String resourceType, String resourceName);
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ErrorDetails.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ErrorDetails.java
new file mode 100644
index 000000000000..9aa7d019c0ac
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ErrorDetails.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.maintenance.v2018_06_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * An error response details received from the Azure Maintenance service.
+ */
+public class ErrorDetails {
+ /**
+ * Service-defined error code. This code serves as a sub-status for the
+ * HTTP error code specified in the response.
+ */
+ @JsonProperty(value = "code")
+ private String code;
+
+ /**
+ * Human-readable representation of the error.
+ */
+ @JsonProperty(value = "message")
+ private String message;
+
+ /**
+ * Get service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
+ *
+ * @return the code value
+ */
+ public String code() {
+ return this.code;
+ }
+
+ /**
+ * Set service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.
+ *
+ * @param code the code value to set
+ * @return the ErrorDetails object itself.
+ */
+ public ErrorDetails withCode(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Get human-readable representation of the error.
+ *
+ * @return the message value
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set human-readable representation of the error.
+ *
+ * @param message the message value to set
+ * @return the ErrorDetails object itself.
+ */
+ public ErrorDetails withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ImpactType.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ImpactType.java
new file mode 100644
index 000000000000..eca44d4bcb65
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/ImpactType.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.maintenance.v2018_06_01_preview;
+
+import java.util.Collection;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.microsoft.rest.ExpandableStringEnum;
+
+/**
+ * Defines values for ImpactType.
+ */
+public final class ImpactType extends ExpandableStringEnum {
+ /** Static value None for ImpactType. */
+ public static final ImpactType NONE = fromString("None");
+
+ /** Static value Freeze for ImpactType. */
+ public static final ImpactType FREEZE = fromString("Freeze");
+
+ /** Static value Restart for ImpactType. */
+ public static final ImpactType RESTART = fromString("Restart");
+
+ /** Static value Redeploy for ImpactType. */
+ public static final ImpactType REDEPLOY = fromString("Redeploy");
+
+ /**
+ * Creates or finds a ImpactType from its string representation.
+ * @param name a name to look for
+ * @return the corresponding ImpactType
+ */
+ @JsonCreator
+ public static ImpactType fromString(String name) {
+ return fromString(name, ImpactType.class);
+ }
+
+ /**
+ * @return known ImpactType values
+ */
+ public static Collection values() {
+ return values(ImpactType.class);
+ }
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceConfiguration.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceConfiguration.java
new file mode 100644
index 000000000000..168d5ae9e718
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceConfiguration.java
@@ -0,0 +1,156 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.Resource;
+import com.microsoft.azure.arm.resources.models.GroupableResourceCore;
+import com.microsoft.azure.arm.resources.models.HasResourceGroup;
+import com.microsoft.azure.arm.model.Refreshable;
+import com.microsoft.azure.arm.model.Updatable;
+import com.microsoft.azure.arm.model.Appliable;
+import com.microsoft.azure.arm.model.Creatable;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.MaintenanceManager;
+import java.util.Map;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.MaintenanceConfigurationInner;
+
+/**
+ * Type representing MaintenanceConfiguration.
+ */
+public interface MaintenanceConfiguration extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager {
+ /**
+ * @return the extensionProperties value.
+ */
+ Map extensionProperties();
+
+ /**
+ * @return the maintenanceScope value.
+ */
+ MaintenanceScope maintenanceScope();
+
+ /**
+ * @return the namespace value.
+ */
+ String namespace();
+
+ /**
+ * The entirety of the MaintenanceConfiguration definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * Grouping of MaintenanceConfiguration definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of a MaintenanceConfiguration definition.
+ */
+ interface Blank extends GroupableResourceCore.DefinitionWithRegion {
+ }
+
+ /**
+ * The stage of the MaintenanceConfiguration definition allowing to specify the resource group.
+ */
+ interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup {
+ }
+
+ /**
+ * The stage of the maintenanceconfiguration definition allowing to specify ExtensionProperties.
+ */
+ interface WithExtensionProperties {
+ /**
+ * Specifies extensionProperties.
+ * @param extensionProperties Gets or sets extensionProperties of the maintenanceConfiguration
+ * @return the next definition stage
+ */
+ WithCreate withExtensionProperties(Map extensionProperties);
+ }
+
+ /**
+ * The stage of the maintenanceconfiguration definition allowing to specify MaintenanceScope.
+ */
+ interface WithMaintenanceScope {
+ /**
+ * Specifies maintenanceScope.
+ * @param maintenanceScope Gets or sets maintenanceScope of the configuration. Possible values include: 'All', 'Host', 'Resource', 'InResource'
+ * @return the next definition stage
+ */
+ WithCreate withMaintenanceScope(MaintenanceScope maintenanceScope);
+ }
+
+ /**
+ * The stage of the maintenanceconfiguration definition allowing to specify Namespace.
+ */
+ interface WithNamespace {
+ /**
+ * Specifies namespace.
+ * @param namespace Gets or sets namespace of the resource
+ * @return the next definition stage
+ */
+ WithCreate withNamespace(String namespace);
+ }
+
+ /**
+ * 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.WithExtensionProperties, DefinitionStages.WithMaintenanceScope, DefinitionStages.WithNamespace {
+ }
+ }
+ /**
+ * The template for a MaintenanceConfiguration update operation, containing all the settings that can be modified.
+ */
+ interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithExtensionProperties, UpdateStages.WithMaintenanceScope, UpdateStages.WithNamespace {
+ }
+
+ /**
+ * Grouping of MaintenanceConfiguration update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the maintenanceconfiguration update allowing to specify ExtensionProperties.
+ */
+ interface WithExtensionProperties {
+ /**
+ * Specifies extensionProperties.
+ * @param extensionProperties Gets or sets extensionProperties of the maintenanceConfiguration
+ * @return the next update stage
+ */
+ Update withExtensionProperties(Map extensionProperties);
+ }
+
+ /**
+ * The stage of the maintenanceconfiguration update allowing to specify MaintenanceScope.
+ */
+ interface WithMaintenanceScope {
+ /**
+ * Specifies maintenanceScope.
+ * @param maintenanceScope Gets or sets maintenanceScope of the configuration. Possible values include: 'All', 'Host', 'Resource', 'InResource'
+ * @return the next update stage
+ */
+ Update withMaintenanceScope(MaintenanceScope maintenanceScope);
+ }
+
+ /**
+ * The stage of the maintenanceconfiguration update allowing to specify Namespace.
+ */
+ interface WithNamespace {
+ /**
+ * Specifies namespace.
+ * @param namespace Gets or sets namespace of the resource
+ * @return the next update stage
+ */
+ Update withNamespace(String namespace);
+ }
+
+ }
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceConfigurations.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceConfigurations.java
new file mode 100644
index 000000000000..199238faf6c5
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceConfigurations.java
@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import com.microsoft.azure.arm.collection.SupportsCreating;
+import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup;
+import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion;
+import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup;
+import rx.Observable;
+import com.microsoft.azure.arm.collection.SupportsListing;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.MaintenanceConfigurationsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing MaintenanceConfigurations.
+ */
+public interface MaintenanceConfigurations extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListing, HasInner {
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceError.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceError.java
new file mode 100644
index 000000000000..ac45958f393b
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceError.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * An error response received from the Azure Maintenance service.
+ */
+public class MaintenanceError {
+ /**
+ * Details of the error.
+ */
+ @JsonProperty(value = "error")
+ private ErrorDetails error;
+
+ /**
+ * Get details of the error.
+ *
+ * @return the error value
+ */
+ public ErrorDetails error() {
+ return this.error;
+ }
+
+ /**
+ * Set details of the error.
+ *
+ * @param error the error value to set
+ * @return the MaintenanceError object itself.
+ */
+ public MaintenanceError withError(ErrorDetails error) {
+ this.error = error;
+ return this;
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceErrorException.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceErrorException.java
new file mode 100644
index 000000000000..dacd03cc1094
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceErrorException.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.maintenance.v2018_06_01_preview;
+
+import com.microsoft.rest.RestException;
+import okhttp3.ResponseBody;
+import retrofit2.Response;
+
+/**
+ * Exception thrown for an invalid response with MaintenanceError information.
+ */
+public class MaintenanceErrorException extends RestException {
+ /**
+ * Initializes a new instance of the MaintenanceErrorException class.
+ *
+ * @param message the exception message or the response content if a message is not available
+ * @param response the HTTP response
+ */
+ public MaintenanceErrorException(final String message, final Response response) {
+ super(message, response);
+ }
+
+ /**
+ * Initializes a new instance of the MaintenanceErrorException 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 MaintenanceErrorException(final String message, final Response response, final MaintenanceError body) {
+ super(message, response, body);
+ }
+
+ @Override
+ public MaintenanceError body() {
+ return (MaintenanceError) super.body();
+ }
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceScope.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceScope.java
new file mode 100644
index 000000000000..03158518bd3c
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/MaintenanceScope.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.maintenance.v2018_06_01_preview;
+
+import java.util.Collection;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.microsoft.rest.ExpandableStringEnum;
+
+/**
+ * Defines values for MaintenanceScope.
+ */
+public final class MaintenanceScope extends ExpandableStringEnum {
+ /** Static value All for MaintenanceScope. */
+ public static final MaintenanceScope ALL = fromString("All");
+
+ /** Static value Host for MaintenanceScope. */
+ public static final MaintenanceScope HOST = fromString("Host");
+
+ /** Static value Resource for MaintenanceScope. */
+ public static final MaintenanceScope RESOURCE = fromString("Resource");
+
+ /** Static value InResource for MaintenanceScope. */
+ public static final MaintenanceScope IN_RESOURCE = fromString("InResource");
+
+ /**
+ * Creates or finds a MaintenanceScope from its string representation.
+ * @param name a name to look for
+ * @return the corresponding MaintenanceScope
+ */
+ @JsonCreator
+ public static MaintenanceScope fromString(String name) {
+ return fromString(name, MaintenanceScope.class);
+ }
+
+ /**
+ * @return known MaintenanceScope values
+ */
+ public static Collection values() {
+ return values(MaintenanceScope.class);
+ }
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Operation.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Operation.java
new file mode 100644
index 000000000000..26ebef713a2d
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Operation.java
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.MaintenanceManager;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.OperationInner;
+
+/**
+ * Type representing Operation.
+ */
+public interface Operation extends HasInner, HasManager {
+ /**
+ * @return the display value.
+ */
+ OperationInfo display();
+
+ /**
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * @return the origin value.
+ */
+ String origin();
+
+ /**
+ * @return the properties value.
+ */
+ Object properties();
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/OperationInfo.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/OperationInfo.java
new file mode 100644
index 000000000000..04621fbd63f8
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/OperationInfo.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.maintenance.v2018_06_01_preview;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Information about an operation.
+ */
+public class OperationInfo {
+ /**
+ * Name of the provider.
+ */
+ @JsonProperty(value = "provider")
+ private String provider;
+
+ /**
+ * Name of the resource type.
+ */
+ @JsonProperty(value = "resource")
+ private String resource;
+
+ /**
+ * Name of the operation.
+ */
+ @JsonProperty(value = "operation")
+ private String operation;
+
+ /**
+ * Description of the operation.
+ */
+ @JsonProperty(value = "description")
+ private String description;
+
+ /**
+ * Get name of the provider.
+ *
+ * @return the provider value
+ */
+ public String provider() {
+ return this.provider;
+ }
+
+ /**
+ * Set name of the provider.
+ *
+ * @param provider the provider value to set
+ * @return the OperationInfo object itself.
+ */
+ public OperationInfo withProvider(String provider) {
+ this.provider = provider;
+ return this;
+ }
+
+ /**
+ * Get name of the resource type.
+ *
+ * @return the resource value
+ */
+ public String resource() {
+ return this.resource;
+ }
+
+ /**
+ * Set name of the resource type.
+ *
+ * @param resource the resource value to set
+ * @return the OperationInfo object itself.
+ */
+ public OperationInfo withResource(String resource) {
+ this.resource = resource;
+ return this;
+ }
+
+ /**
+ * Get name of the operation.
+ *
+ * @return the operation value
+ */
+ public String operation() {
+ return this.operation;
+ }
+
+ /**
+ * Set name of the operation.
+ *
+ * @param operation the operation value to set
+ * @return the OperationInfo object itself.
+ */
+ public OperationInfo withOperation(String operation) {
+ this.operation = operation;
+ return this;
+ }
+
+ /**
+ * Get description of the operation.
+ *
+ * @return the description value
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Set description of the operation.
+ *
+ * @param description the description value to set
+ * @return the OperationInfo object itself.
+ */
+ public OperationInfo withDescription(String description) {
+ this.description = description;
+ return this;
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Operations.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Operations.java
new file mode 100644
index 000000000000..3454918e750b
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Operations.java
@@ -0,0 +1,28 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import rx.Observable;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.OperationsInner;
+import com.microsoft.azure.arm.model.HasInner;
+
+/**
+ * Type representing Operations.
+ */
+public interface Operations extends HasInner {
+ /**
+ * List available operations.
+ * List the available operations supported by the Microsoft.Maintenance resource provider.
+ *
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listAsync();
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Update.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Update.java
new file mode 100644
index 000000000000..5e0705c254f0
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Update.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import com.microsoft.azure.arm.model.HasInner;
+import com.microsoft.azure.arm.resources.models.HasManager;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.MaintenanceManager;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation.UpdateInner;
+import org.joda.time.DateTime;
+
+/**
+ * Type representing Update.
+ */
+public interface Update extends HasInner, HasManager {
+ /**
+ * @return the impactDurationInSec value.
+ */
+ Integer impactDurationInSec();
+
+ /**
+ * @return the impactType value.
+ */
+ ImpactType impactType();
+
+ /**
+ * @return the maintenanceScope value.
+ */
+ MaintenanceScope maintenanceScope();
+
+ /**
+ * @return the notBefore value.
+ */
+ DateTime notBefore();
+
+ /**
+ * @return the resourceId value.
+ */
+ String resourceId();
+
+ /**
+ * @return the status value.
+ */
+ UpdateStatus status();
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/UpdateStatus.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/UpdateStatus.java
new file mode 100644
index 000000000000..c177cf90e946
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/UpdateStatus.java
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import java.util.Collection;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.microsoft.rest.ExpandableStringEnum;
+
+/**
+ * Defines values for UpdateStatus.
+ */
+public final class UpdateStatus extends ExpandableStringEnum {
+ /** Static value Pending for UpdateStatus. */
+ public static final UpdateStatus PENDING = fromString("Pending");
+
+ /** Static value InProgress for UpdateStatus. */
+ public static final UpdateStatus IN_PROGRESS = fromString("InProgress");
+
+ /** Static value Completed for UpdateStatus. */
+ public static final UpdateStatus COMPLETED = fromString("Completed");
+
+ /** Static value RetryNow for UpdateStatus. */
+ public static final UpdateStatus RETRY_NOW = fromString("RetryNow");
+
+ /** Static value RetryLater for UpdateStatus. */
+ public static final UpdateStatus RETRY_LATER = fromString("RetryLater");
+
+ /**
+ * Creates or finds a UpdateStatus from its string representation.
+ * @param name a name to look for
+ * @return the corresponding UpdateStatus
+ */
+ @JsonCreator
+ public static UpdateStatus fromString(String name) {
+ return fromString(name, UpdateStatus.class);
+ }
+
+ /**
+ * @return known UpdateStatus values
+ */
+ public static Collection values() {
+ return values(UpdateStatus.class);
+ }
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Updates.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Updates.java
new file mode 100644
index 000000000000..d050b66ef1d1
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/Updates.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview;
+
+import rx.Observable;
+
+/**
+ * Type representing Updates.
+ */
+public interface Updates {
+ /**
+ * Get Updates to resource.
+ * Get updates to resources.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName);
+
+ /**
+ * Get Updates to resource.
+ * Get updates to resources.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable for the request
+ */
+ Observable listAsync(String resourceGroupName, String providerName, String resourceType, String resourceName);
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdateImpl.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdateImpl.java
new file mode 100644
index 000000000000..79878545aa6a
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdateImpl.java
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation;
+
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.ApplyUpdate;
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import org.joda.time.DateTime;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.UpdateStatus;
+
+class ApplyUpdateImpl extends WrapperImpl implements ApplyUpdate {
+ private final MaintenanceManager manager;
+ ApplyUpdateImpl(ApplyUpdateInner inner, MaintenanceManager manager) {
+ super(inner);
+ this.manager = manager;
+ }
+
+ @Override
+ public MaintenanceManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public String id() {
+ return this.inner().id();
+ }
+
+ @Override
+ public DateTime lastUpdateTime() {
+ return this.inner().lastUpdateTime();
+ }
+
+ @Override
+ public String name() {
+ return this.inner().name();
+ }
+
+ @Override
+ public String resourceId() {
+ return this.inner().resourceId();
+ }
+
+ @Override
+ public UpdateStatus status() {
+ return this.inner().status();
+ }
+
+ @Override
+ public String type() {
+ return this.inner().type();
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdateInner.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdateInner.java
new file mode 100644
index 000000000000..7f192e862260
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdateInner.java
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation;
+
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.UpdateStatus;
+import org.joda.time.DateTime;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+import com.microsoft.azure.ProxyResource;
+
+/**
+ * Apply Update request.
+ */
+@JsonFlatten
+public class ApplyUpdateInner extends ProxyResource {
+ /**
+ * The status. Possible values include: 'Pending', 'InProgress',
+ * 'Completed', 'RetryNow', 'RetryLater'.
+ */
+ @JsonProperty(value = "properties.status")
+ private UpdateStatus status;
+
+ /**
+ * The resourceId.
+ */
+ @JsonProperty(value = "properties.resourceId")
+ private String resourceId;
+
+ /**
+ * Last Update time.
+ */
+ @JsonProperty(value = "properties.lastUpdateTime")
+ private DateTime lastUpdateTime;
+
+ /**
+ * Get the status. Possible values include: 'Pending', 'InProgress', 'Completed', 'RetryNow', 'RetryLater'.
+ *
+ * @return the status value
+ */
+ public UpdateStatus status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status. Possible values include: 'Pending', 'InProgress', 'Completed', 'RetryNow', 'RetryLater'.
+ *
+ * @param status the status value to set
+ * @return the ApplyUpdateInner object itself.
+ */
+ public ApplyUpdateInner withStatus(UpdateStatus status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the resourceId.
+ *
+ * @return the resourceId value
+ */
+ public String resourceId() {
+ return this.resourceId;
+ }
+
+ /**
+ * Set the resourceId.
+ *
+ * @param resourceId the resourceId value to set
+ * @return the ApplyUpdateInner object itself.
+ */
+ public ApplyUpdateInner withResourceId(String resourceId) {
+ this.resourceId = resourceId;
+ return this;
+ }
+
+ /**
+ * Get last Update time.
+ *
+ * @return the lastUpdateTime value
+ */
+ public DateTime lastUpdateTime() {
+ return this.lastUpdateTime;
+ }
+
+ /**
+ * Set last Update time.
+ *
+ * @param lastUpdateTime the lastUpdateTime value to set
+ * @return the ApplyUpdateInner object itself.
+ */
+ public ApplyUpdateInner withLastUpdateTime(DateTime lastUpdateTime) {
+ this.lastUpdateTime = lastUpdateTime;
+ return this;
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdatesImpl.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdatesImpl.java
new file mode 100644
index 000000000000..3adadefd7ff1
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdatesImpl.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ * abc
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.ApplyUpdates;
+import rx.functions.Func1;
+import rx.Observable;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.ApplyUpdate;
+
+class ApplyUpdatesImpl extends WrapperImpl implements ApplyUpdates {
+ private final MaintenanceManager manager;
+
+ ApplyUpdatesImpl(MaintenanceManager manager) {
+ super(manager.inner().applyUpdates());
+ this.manager = manager;
+ }
+
+ public MaintenanceManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public Observable getParentAsync(String resourceGroupName, String resourceParentType, String resourceParentName, String providerName, String resourceType, String resourceName, String applyUpdateName) {
+ ApplyUpdatesInner client = this.inner();
+ return client.getParentAsync(resourceGroupName, resourceParentType, resourceParentName, providerName, resourceType, resourceName, applyUpdateName)
+ .map(new Func1() {
+ @Override
+ public ApplyUpdate call(ApplyUpdateInner inner) {
+ return new ApplyUpdateImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable getAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String applyUpdateName) {
+ ApplyUpdatesInner client = this.inner();
+ return client.getAsync(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName)
+ .map(new Func1() {
+ @Override
+ public ApplyUpdate call(ApplyUpdateInner inner) {
+ return new ApplyUpdateImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable createOrUpdateParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
+ ApplyUpdatesInner client = this.inner();
+ return client.createOrUpdateParentAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName)
+ .map(new Func1() {
+ @Override
+ public ApplyUpdate call(ApplyUpdateInner inner) {
+ return new ApplyUpdateImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable createOrUpdateAsync(String resourceGroupName, String providerName, String resourceType, String resourceName) {
+ ApplyUpdatesInner client = this.inner();
+ return client.createOrUpdateAsync(resourceGroupName, providerName, resourceType, resourceName)
+ .map(new Func1() {
+ @Override
+ public ApplyUpdate call(ApplyUpdateInner inner) {
+ return new ApplyUpdateImpl(inner, manager());
+ }
+ });
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdatesInner.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdatesInner.java
new file mode 100644
index 000000000000..78de9592f2da
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ApplyUpdatesInner.java
@@ -0,0 +1,531 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation;
+
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.CloudException;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import java.io.IOException;
+import okhttp3.ResponseBody;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.Path;
+import retrofit2.http.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 ApplyUpdates.
+ */
+public class ApplyUpdatesInner {
+ /** The Retrofit service to perform REST calls. */
+ private ApplyUpdatesService service;
+ /** The service client containing this operation class. */
+ private MaintenanceManagementClientImpl client;
+
+ /**
+ * Initializes an instance of ApplyUpdatesInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public ApplyUpdatesInner(Retrofit retrofit, MaintenanceManagementClientImpl client) {
+ this.service = retrofit.create(ApplyUpdatesService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ApplyUpdates to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface ApplyUpdatesService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.maintenance.v2018_06_01_preview.ApplyUpdates getParent" })
+ @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}")
+ Observable> getParent(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("resourceParentType") String resourceParentType, @Path("resourceParentName") String resourceParentName, @Path("providerName") String providerName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @Path("applyUpdateName") String applyUpdateName, @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.maintenance.v2018_06_01_preview.ApplyUpdates get" })
+ @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}")
+ Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @Path("applyUpdateName") String applyUpdateName, @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.maintenance.v2018_06_01_preview.ApplyUpdates createOrUpdateParent" })
+ @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default")
+ Observable> createOrUpdateParent(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceParentType") String resourceParentType, @Path("resourceParentName") String resourceParentName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @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.maintenance.v2018_06_01_preview.ApplyUpdates createOrUpdate" })
+ @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default")
+ Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Track Updates to resource with parent.
+ * Track maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ApplyUpdateInner object if successful.
+ */
+ public ApplyUpdateInner getParent(String resourceGroupName, String resourceParentType, String resourceParentName, String providerName, String resourceType, String resourceName, String applyUpdateName) {
+ return getParentWithServiceResponseAsync(resourceGroupName, resourceParentType, resourceParentName, providerName, resourceType, resourceName, applyUpdateName).toBlocking().single().body();
+ }
+
+ /**
+ * Track Updates to resource with parent.
+ * Track maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture getParentAsync(String resourceGroupName, String resourceParentType, String resourceParentName, String providerName, String resourceType, String resourceName, String applyUpdateName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(getParentWithServiceResponseAsync(resourceGroupName, resourceParentType, resourceParentName, providerName, resourceType, resourceName, applyUpdateName), serviceCallback);
+ }
+
+ /**
+ * Track Updates to resource with parent.
+ * Track maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ApplyUpdateInner object
+ */
+ public Observable getParentAsync(String resourceGroupName, String resourceParentType, String resourceParentName, String providerName, String resourceType, String resourceName, String applyUpdateName) {
+ return getParentWithServiceResponseAsync(resourceGroupName, resourceParentType, resourceParentName, providerName, resourceType, resourceName, applyUpdateName).map(new Func1, ApplyUpdateInner>() {
+ @Override
+ public ApplyUpdateInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Track Updates to resource with parent.
+ * Track maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ApplyUpdateInner object
+ */
+ public Observable> getParentWithServiceResponseAsync(String resourceGroupName, String resourceParentType, String resourceParentName, String providerName, String resourceType, String resourceName, String applyUpdateName) {
+ 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 (resourceParentType == null) {
+ throw new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.");
+ }
+ if (resourceParentName == null) {
+ throw new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.");
+ }
+ if (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
+ }
+ if (applyUpdateName == null) {
+ throw new IllegalArgumentException("Parameter applyUpdateName 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.getParent(this.client.subscriptionId(), resourceGroupName, resourceParentType, resourceParentName, providerName, resourceType, resourceName, applyUpdateName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = getParentDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse getParentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+ /**
+ * Track Updates to resource.
+ * Track maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ApplyUpdateInner object if successful.
+ */
+ public ApplyUpdateInner get(String resourceGroupName, String providerName, String resourceType, String resourceName, String applyUpdateName) {
+ return getWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName).toBlocking().single().body();
+ }
+
+ /**
+ * Track Updates to resource.
+ * Track maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture getAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String applyUpdateName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName), serviceCallback);
+ }
+
+ /**
+ * Track Updates to resource.
+ * Track maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ApplyUpdateInner object
+ */
+ public Observable getAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String applyUpdateName) {
+ return getWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, applyUpdateName).map(new Func1, ApplyUpdateInner>() {
+ @Override
+ public ApplyUpdateInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Track Updates to resource.
+ * Track maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param applyUpdateName applyUpdate Id
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ApplyUpdateInner object
+ */
+ public Observable> getWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String applyUpdateName) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
+ }
+ if (applyUpdateName == null) {
+ throw new IllegalArgumentException("Parameter applyUpdateName is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.get(this.client.subscriptionId(), resourceGroupName, providerName, resourceType, resourceName, applyUpdateName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = getDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+ /**
+ * Apply Updates to resource with parent.
+ * Apply maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ApplyUpdateInner object if successful.
+ */
+ public ApplyUpdateInner createOrUpdateParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
+ return createOrUpdateParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName).toBlocking().single().body();
+ }
+
+ /**
+ * Apply Updates to resource with parent.
+ * Apply maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @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 createOrUpdateParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(createOrUpdateParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName), serviceCallback);
+ }
+
+ /**
+ * Apply Updates to resource with parent.
+ * Apply maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ApplyUpdateInner object
+ */
+ public Observable createOrUpdateParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
+ return createOrUpdateParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName).map(new Func1, ApplyUpdateInner>() {
+ @Override
+ public ApplyUpdateInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Apply Updates to resource with parent.
+ * Apply maintenance updates to resource with parent.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ApplyUpdateInner object
+ */
+ public Observable> createOrUpdateParentWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceParentType == null) {
+ throw new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.");
+ }
+ if (resourceParentName == null) {
+ throw new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName 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.createOrUpdateParent(this.client.subscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = createOrUpdateParentDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse createOrUpdateParentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+ /**
+ * Apply Updates to resource.
+ * Apply maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ApplyUpdateInner object if successful.
+ */
+ public ApplyUpdateInner createOrUpdate(String resourceGroupName, String providerName, String resourceType, String resourceName) {
+ return createOrUpdateWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName).toBlocking().single().body();
+ }
+
+ /**
+ * Apply Updates to resource.
+ * Apply maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @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 providerName, String resourceType, String resourceName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName), serviceCallback);
+ }
+
+ /**
+ * Apply Updates to resource.
+ * Apply maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ApplyUpdateInner object
+ */
+ public Observable createOrUpdateAsync(String resourceGroupName, String providerName, String resourceType, String resourceName) {
+ return createOrUpdateWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName).map(new Func1, ApplyUpdateInner>() {
+ @Override
+ public ApplyUpdateInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Apply Updates to resource.
+ * Apply maintenance updates to resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ApplyUpdateInner object
+ */
+ public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceType, String resourceName) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName 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.createOrUpdate(this.client.subscriptionId(), resourceGroupName, providerName, resourceType, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = createOrUpdateDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentImpl.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentImpl.java
new file mode 100644
index 000000000000..d00b3ac2ee85
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentImpl.java
@@ -0,0 +1,159 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation;
+
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.ConfigurationAssignment;
+import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl;
+import rx.Observable;
+
+class ConfigurationAssignmentImpl extends CreatableUpdatableImpl implements ConfigurationAssignment, ConfigurationAssignment.Definition, ConfigurationAssignment.Update {
+ private final MaintenanceManager manager;
+ private String resourceGroupName;
+ private String providerName;
+ private String resourceParentType;
+ private String resourceParentName;
+ private String resourceType;
+ private String resourceName;
+ private String configurationAssignmentName;
+
+ ConfigurationAssignmentImpl(String name, MaintenanceManager manager) {
+ super(name, new ConfigurationAssignmentInner());
+ this.manager = manager;
+ // Set resource name
+ this.configurationAssignmentName = name;
+ //
+ }
+
+ ConfigurationAssignmentImpl(ConfigurationAssignmentInner inner, MaintenanceManager manager) {
+ super(inner.name(), inner);
+ this.manager = manager;
+ // Set resource name
+ this.configurationAssignmentName = inner.name();
+ // set resource ancestor and positional variables
+ this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourcegroups");
+ this.providerName = IdParsingUtils.getValueFromIdByName(inner.id(), "providers");
+ this.configurationAssignmentName = IdParsingUtils.getValueFromIdByName(inner.id(), "configurationAssignments");
+ this.resourceParentType = IdParsingUtils.getValueFromIdByPosition(inner.id(), 6);
+ this.resourceParentName = IdParsingUtils.getValueFromIdByPosition(inner.id(), 7);
+ this.resourceType = IdParsingUtils.getValueFromIdByPosition(inner.id(), 8);
+ this.resourceName = IdParsingUtils.getValueFromIdByPosition(inner.id(), 9);
+ //
+ }
+
+ @Override
+ public MaintenanceManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public Observable createResourceAsync() {
+ ConfigurationAssignmentsInner client = this.manager().inner().configurationAssignments();
+ return client.createOrUpdateParentAsync(this.resourceGroupName, this.providerName, this.resourceParentType, this.resourceParentName, this.resourceType, this.resourceName, this.configurationAssignmentName, this.inner())
+ .map(innerToFluentMap(this));
+ }
+
+ @Override
+ public Observable updateResourceAsync() {
+ ConfigurationAssignmentsInner client = this.manager().inner().configurationAssignments();
+ return client.createOrUpdateParentAsync(this.resourceGroupName, this.providerName, this.resourceParentType, this.resourceParentName, this.resourceType, this.resourceName, this.configurationAssignmentName, this.inner())
+ .map(innerToFluentMap(this));
+ }
+
+ @Override
+ protected Observable getInnerAsync() {
+ ConfigurationAssignmentsInner client = this.manager().inner().configurationAssignments();
+ return null; // NOP getInnerAsync implementation as get is not supported
+ }
+
+ @Override
+ public boolean isInCreateMode() {
+ return this.inner().id() == null;
+ }
+
+
+ @Override
+ public String id() {
+ return this.inner().id();
+ }
+
+ @Override
+ public String location() {
+ return this.inner().location();
+ }
+
+ @Override
+ public String maintenanceConfigurationId() {
+ return this.inner().maintenanceConfigurationId();
+ }
+
+ @Override
+ public String name() {
+ return this.inner().name();
+ }
+
+ @Override
+ public String resourceId() {
+ return this.inner().resourceId();
+ }
+
+ @Override
+ public String type() {
+ return this.inner().type();
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl withExistingProvider(String resourceGroupName, String providerName) {
+ this.resourceGroupName = resourceGroupName;
+ this.providerName = providerName;
+ return this;
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl withResourceParentType(String resourceParentType) {
+ this.resourceParentType = resourceParentType;
+ return this;
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl withResourceParentName(String resourceParentName) {
+ this.resourceParentName = resourceParentName;
+ return this;
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl withResourceType(String resourceType) {
+ this.resourceType = resourceType;
+ return this;
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl withResourceName(String resourceName) {
+ this.resourceName = resourceName;
+ return this;
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl withLocation(String location) {
+ this.inner().withLocation(location);
+ return this;
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl withMaintenanceConfigurationId(String maintenanceConfigurationId) {
+ this.inner().withMaintenanceConfigurationId(maintenanceConfigurationId);
+ return this;
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl withResourceId(String resourceId) {
+ this.inner().withResourceId(resourceId);
+ return this;
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentInner.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentInner.java
new file mode 100644
index 000000000000..ee87202bfd2a
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentInner.java
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.microsoft.rest.serializer.JsonFlatten;
+import com.microsoft.azure.ProxyResource;
+
+/**
+ * Configuration Assignment.
+ */
+@JsonFlatten
+public class ConfigurationAssignmentInner extends ProxyResource {
+ /**
+ * Location of the resource.
+ */
+ @JsonProperty(value = "location")
+ private String location;
+
+ /**
+ * The maintenance configuration Id.
+ */
+ @JsonProperty(value = "properties.maintenanceConfigurationId")
+ private String maintenanceConfigurationId;
+
+ /**
+ * The unique resourceId.
+ */
+ @JsonProperty(value = "properties.resourceId")
+ private String resourceId;
+
+ /**
+ * Get location of the resource.
+ *
+ * @return the location value
+ */
+ public String location() {
+ return this.location;
+ }
+
+ /**
+ * Set location of the resource.
+ *
+ * @param location the location value to set
+ * @return the ConfigurationAssignmentInner object itself.
+ */
+ public ConfigurationAssignmentInner withLocation(String location) {
+ this.location = location;
+ return this;
+ }
+
+ /**
+ * Get the maintenance configuration Id.
+ *
+ * @return the maintenanceConfigurationId value
+ */
+ public String maintenanceConfigurationId() {
+ return this.maintenanceConfigurationId;
+ }
+
+ /**
+ * Set the maintenance configuration Id.
+ *
+ * @param maintenanceConfigurationId the maintenanceConfigurationId value to set
+ * @return the ConfigurationAssignmentInner object itself.
+ */
+ public ConfigurationAssignmentInner withMaintenanceConfigurationId(String maintenanceConfigurationId) {
+ this.maintenanceConfigurationId = maintenanceConfigurationId;
+ return this;
+ }
+
+ /**
+ * Get the unique resourceId.
+ *
+ * @return the resourceId value
+ */
+ public String resourceId() {
+ return this.resourceId;
+ }
+
+ /**
+ * Set the unique resourceId.
+ *
+ * @param resourceId the resourceId value to set
+ * @return the ConfigurationAssignmentInner object itself.
+ */
+ public ConfigurationAssignmentInner withResourceId(String resourceId) {
+ this.resourceId = resourceId;
+ return this;
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentsImpl.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentsImpl.java
new file mode 100644
index 000000000000..ebc10f536dd0
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentsImpl.java
@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ *
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation;
+
+import com.microsoft.azure.arm.model.implementation.WrapperImpl;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.ConfigurationAssignments;
+import rx.functions.Func1;
+import rx.Observable;
+import java.util.List;
+import com.microsoft.azure.management.maintenance.v2018_06_01_preview.ConfigurationAssignment;
+
+class ConfigurationAssignmentsImpl extends WrapperImpl implements ConfigurationAssignments {
+ private final MaintenanceManager manager;
+
+ ConfigurationAssignmentsImpl(MaintenanceManager manager) {
+ super(manager.inner().configurationAssignments());
+ this.manager = manager;
+ }
+
+ public MaintenanceManager manager() {
+ return this.manager;
+ }
+
+ @Override
+ public ConfigurationAssignmentImpl define(String name) {
+ return wrapModel(name);
+ }
+
+ private ConfigurationAssignmentImpl wrapModel(ConfigurationAssignmentInner inner) {
+ return new ConfigurationAssignmentImpl(inner, manager());
+ }
+
+ private ConfigurationAssignmentImpl wrapModel(String name) {
+ return new ConfigurationAssignmentImpl(name, this.manager());
+ }
+
+ @Override
+ public Observable deleteParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName) {
+ ConfigurationAssignmentsInner client = this.inner();
+ return client.deleteParentAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName)
+ .map(new Func1() {
+ @Override
+ public ConfigurationAssignment call(ConfigurationAssignmentInner inner) {
+ return new ConfigurationAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable createOrUpdateAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
+ ConfigurationAssignmentsInner client = this.inner();
+ return client.createOrUpdateAsync(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, configurationAssignment)
+ .map(new Func1() {
+ @Override
+ public ConfigurationAssignment call(ConfigurationAssignmentInner inner) {
+ return new ConfigurationAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable deleteAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName) {
+ ConfigurationAssignmentsInner client = this.inner();
+ return client.deleteAsync(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName)
+ .map(new Func1() {
+ @Override
+ public ConfigurationAssignment call(ConfigurationAssignmentInner inner) {
+ return new ConfigurationAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable listParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
+ ConfigurationAssignmentsInner client = this.inner();
+ return client.listParentAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName)
+ .flatMap(new Func1, Observable>() {
+ @Override
+ public Observable call(List innerList) {
+ return Observable.from(innerList);
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public ConfigurationAssignment call(ConfigurationAssignmentInner inner) {
+ return new ConfigurationAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+ @Override
+ public Observable listAsync(String resourceGroupName, String providerName, String resourceType, String resourceName) {
+ ConfigurationAssignmentsInner client = this.inner();
+ return client.listAsync(resourceGroupName, providerName, resourceType, resourceName)
+ .flatMap(new Func1, Observable>() {
+ @Override
+ public Observable call(List innerList) {
+ return Observable.from(innerList);
+ }
+ })
+ .map(new Func1() {
+ @Override
+ public ConfigurationAssignment call(ConfigurationAssignmentInner inner) {
+ return new ConfigurationAssignmentImpl(inner, manager());
+ }
+ });
+ }
+
+}
diff --git a/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentsInner.java b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentsInner.java
new file mode 100644
index 000000000000..0635e4044ff8
--- /dev/null
+++ b/sdk/maintenance/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/maintenance/v2018_06_01_preview/implementation/ConfigurationAssignmentsInner.java
@@ -0,0 +1,805 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ *
+ * Code generated by Microsoft (R) AutoRest Code Generator.
+ */
+
+package com.microsoft.azure.management.maintenance.v2018_06_01_preview.implementation;
+
+import retrofit2.Retrofit;
+import com.google.common.reflect.TypeToken;
+import com.microsoft.azure.CloudException;
+import com.microsoft.rest.ServiceCallback;
+import com.microsoft.rest.ServiceFuture;
+import com.microsoft.rest.ServiceResponse;
+import com.microsoft.rest.Validator;
+import java.io.IOException;
+import java.util.List;
+import okhttp3.ResponseBody;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.Headers;
+import retrofit2.http.HTTP;
+import retrofit2.http.Path;
+import retrofit2.http.PUT;
+import retrofit2.http.Query;
+import retrofit2.Response;
+import rx.functions.Func1;
+import rx.Observable;
+
+/**
+ * An instance of this class provides access to all the operations defined
+ * in ConfigurationAssignments.
+ */
+public class ConfigurationAssignmentsInner {
+ /** The Retrofit service to perform REST calls. */
+ private ConfigurationAssignmentsService service;
+ /** The service client containing this operation class. */
+ private MaintenanceManagementClientImpl client;
+
+ /**
+ * Initializes an instance of ConfigurationAssignmentsInner.
+ *
+ * @param retrofit the Retrofit instance built from a Retrofit Builder.
+ * @param client the instance of the service client containing this operation class.
+ */
+ public ConfigurationAssignmentsInner(Retrofit retrofit, MaintenanceManagementClientImpl client) {
+ this.service = retrofit.create(ConfigurationAssignmentsService.class);
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ConfigurationAssignments to be
+ * used by Retrofit to perform actually REST calls.
+ */
+ interface ConfigurationAssignmentsService {
+ @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.maintenance.v2018_06_01_preview.ConfigurationAssignments createOrUpdateParent" })
+ @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}")
+ Observable> createOrUpdateParent(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceParentType") String resourceParentType, @Path("resourceParentName") String resourceParentName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @Path("configurationAssignmentName") String configurationAssignmentName, @Body ConfigurationAssignmentInner configurationAssignment, @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.maintenance.v2018_06_01_preview.ConfigurationAssignments deleteParent" })
+ @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}", method = "DELETE", hasBody = true)
+ Observable> deleteParent(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceParentType") String resourceParentType, @Path("resourceParentName") String resourceParentName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @Path("configurationAssignmentName") String configurationAssignmentName, @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.maintenance.v2018_06_01_preview.ConfigurationAssignments createOrUpdate" })
+ @PUT("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}")
+ Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @Path("configurationAssignmentName") String configurationAssignmentName, @Body ConfigurationAssignmentInner configurationAssignment, @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.maintenance.v2018_06_01_preview.ConfigurationAssignments delete" })
+ @HTTP(path = "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}", method = "DELETE", hasBody = true)
+ Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @Path("configurationAssignmentName") String configurationAssignmentName, @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.maintenance.v2018_06_01_preview.ConfigurationAssignments listParent" })
+ @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments")
+ Observable> listParent(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceParentType") String resourceParentType, @Path("resourceParentName") String resourceParentName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @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.maintenance.v2018_06_01_preview.ConfigurationAssignments list" })
+ @GET("subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments")
+ Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("providerName") String providerName, @Path("resourceType") String resourceType, @Path("resourceName") String resourceName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
+
+ }
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ConfigurationAssignmentInner object if successful.
+ */
+ public ConfigurationAssignmentInner createOrUpdateParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
+ return createOrUpdateParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment).toBlocking().single().body();
+ }
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @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 createOrUpdateParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(createOrUpdateParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment), serviceCallback);
+ }
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ConfigurationAssignmentInner object
+ */
+ public Observable createOrUpdateParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
+ return createOrUpdateParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment).map(new Func1, ConfigurationAssignmentInner>() {
+ @Override
+ public ConfigurationAssignmentInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ConfigurationAssignmentInner object
+ */
+ public Observable> createOrUpdateParentWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceParentType == null) {
+ throw new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.");
+ }
+ if (resourceParentName == null) {
+ throw new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
+ }
+ if (configurationAssignmentName == null) {
+ throw new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.");
+ }
+ if (configurationAssignment == null) {
+ throw new IllegalArgumentException("Parameter configurationAssignment 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(configurationAssignment);
+ return service.createOrUpdateParent(this.client.subscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = createOrUpdateParentDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse createOrUpdateParentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ConfigurationAssignmentInner object if successful.
+ */
+ public ConfigurationAssignmentInner deleteParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName) {
+ return deleteParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName).toBlocking().single().body();
+ }
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture deleteParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(deleteParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName), serviceCallback);
+ }
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ConfigurationAssignmentInner object
+ */
+ public Observable deleteParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName) {
+ return deleteParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName).map(new Func1, ConfigurationAssignmentInner>() {
+ @Override
+ public ConfigurationAssignmentInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ConfigurationAssignmentInner object
+ */
+ public Observable> deleteParentWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, String configurationAssignmentName) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceParentType == null) {
+ throw new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.");
+ }
+ if (resourceParentName == null) {
+ throw new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
+ }
+ if (configurationAssignmentName == null) {
+ throw new IllegalArgumentException("Parameter configurationAssignmentName 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.deleteParent(this.client.subscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = deleteParentDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse deleteParentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ConfigurationAssignmentInner object if successful.
+ */
+ public ConfigurationAssignmentInner createOrUpdate(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
+ return createOrUpdateWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, configurationAssignment).toBlocking().single().body();
+ }
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @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 providerName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, configurationAssignment), serviceCallback);
+ }
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ConfigurationAssignmentInner object
+ */
+ public Observable createOrUpdateAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
+ return createOrUpdateWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, configurationAssignment).map(new Func1, ConfigurationAssignmentInner>() {
+ @Override
+ public ConfigurationAssignmentInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Create configuration assignment.
+ * Register configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Configuration assignment name
+ * @param configurationAssignment The configurationAssignment
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ConfigurationAssignmentInner object
+ */
+ public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
+ }
+ if (configurationAssignmentName == null) {
+ throw new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.");
+ }
+ if (configurationAssignment == null) {
+ throw new IllegalArgumentException("Parameter configurationAssignment 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(configurationAssignment);
+ return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, configurationAssignment, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = createOrUpdateDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse createOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the ConfigurationAssignmentInner object if successful.
+ */
+ public ConfigurationAssignmentInner delete(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName) {
+ return deleteWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName).toBlocking().single().body();
+ }
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture deleteAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName, final ServiceCallback serviceCallback) {
+ return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName), serviceCallback);
+ }
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ConfigurationAssignmentInner object
+ */
+ public Observable deleteAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName) {
+ return deleteWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName).map(new Func1, ConfigurationAssignmentInner>() {
+ @Override
+ public ConfigurationAssignmentInner call(ServiceResponse response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * Unregister configuration for resource.
+ * Unregister configuration for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param configurationAssignmentName Unique configuration assignment name
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the ConfigurationAssignmentInner object
+ */
+ public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, String configurationAssignmentName) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
+ }
+ if (configurationAssignmentName == null) {
+ throw new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.delete(this.client.subscriptionId(), resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>() {
+ @Override
+ public Observable> call(Response response) {
+ try {
+ ServiceResponse clientResponse = deleteDelegate(response);
+ return Observable.just(clientResponse);
+ } catch (Throwable t) {
+ return Observable.error(t);
+ }
+ }
+ });
+ }
+
+ private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the List<ConfigurationAssignmentInner> object if successful.
+ */
+ public List listParent(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
+ return listParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName).toBlocking().single().body();
+ }
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @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> listParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName), serviceCallback);
+ }
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<ConfigurationAssignmentInner> object
+ */
+ public Observable> listParentAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
+ return listParentWithServiceResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName).map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceParentType Resource parent type
+ * @param resourceParentName Resource parent identifier
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<ConfigurationAssignmentInner> object
+ */
+ public Observable>> listParentWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceParentType == null) {
+ throw new IllegalArgumentException("Parameter resourceParentType is required and cannot be null.");
+ }
+ if (resourceParentName == null) {
+ throw new IllegalArgumentException("Parameter resourceParentName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName 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.listParent(this.client.subscriptionId(), resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
+ .flatMap(new Func1, Observable>>>() {
+ @Override
+ public Observable>> call(Response response) {
+ try {
+ ServiceResponse> result = listParentDelegate(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> listParentDelegate(Response response) throws CloudException, IOException, IllegalArgumentException {
+ return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter())
+ .register(200, new TypeToken>() { }.getType())
+ .registerError(CloudException.class)
+ .build(response);
+ }
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @throws CloudException thrown if the request is rejected by server
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
+ * @return the List<ConfigurationAssignmentInner> object if successful.
+ */
+ public List list(String resourceGroupName, String providerName, String resourceType, String resourceName) {
+ return listWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName).toBlocking().single().body();
+ }
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @param serviceCallback the async ServiceCallback to handle successful and failed responses.
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the {@link ServiceFuture} object
+ */
+ public ServiceFuture> listAsync(String resourceGroupName, String providerName, String resourceType, String resourceName, final ServiceCallback> serviceCallback) {
+ return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName), serviceCallback);
+ }
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<ConfigurationAssignmentInner> object
+ */
+ public Observable> listAsync(String resourceGroupName, String providerName, String resourceType, String resourceName) {
+ return listWithServiceResponseAsync(resourceGroupName, providerName, resourceType, resourceName).map(new Func1>, List>() {
+ @Override
+ public List call(ServiceResponse> response) {
+ return response.body();
+ }
+ });
+ }
+
+ /**
+ * List configurationAssignments for resource.
+ * List configurationAssignments for resource.
+ *
+ * @param resourceGroupName Resource group name
+ * @param providerName Resource provider name
+ * @param resourceType Resource type
+ * @param resourceName Resource identifier
+ * @throws IllegalArgumentException thrown if parameters fail the validation
+ * @return the observable to the List<ConfigurationAssignmentInner> object
+ */
+ public Observable>> listWithServiceResponseAsync(String resourceGroupName, String providerName, String resourceType, String resourceName) {
+ 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 (providerName == null) {
+ throw new IllegalArgumentException("Parameter providerName is required and cannot be null.");
+ }
+ if (resourceType == null) {
+ throw new IllegalArgumentException("Parameter resourceType is required and cannot be null.");
+ }
+ if (resourceName == null) {
+ throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
+ }
+ if (this.client.apiVersion() == null) {
+ throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
+ }
+ return service.list(this.client.subscriptionId(), resourceGroupName, providerName, resourceType, resourceName, 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