From 61c3d0100aaa24cc8cf464175ac1df2f314eba6f Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 25 Jun 2019 00:38:15 +0000 Subject: [PATCH 1/3] Generated from b7686a6e1f952f5232bd315382a2cb1547ff8648 Add managed instances swagger to 2018-06-01-preview - update examples + readme.md --- .../sql/v2018_06_01_preview/IdentityType.java | 38 + .../MaintenanceWindowFrequency.java | 47 + .../MaintenanceWindowSettings.java | 222 +++ .../v2018_06_01_preview/ManagedInstance.java | 581 +++++++ .../ManagedInstanceLicenseType.java | 41 + .../ManagedInstanceProxyOverride.java | 44 + .../ManagedInstanceUpdate.java | 575 +++++++ .../v2018_06_01_preview/ManagedInstances.java | 68 + .../ManagedServerCreateMode.java | 41 + .../v2018_06_01_preview/ResourceIdentity.java | 76 + .../implementation/ManagedInstanceImpl.java | 428 +++++ .../implementation/ManagedInstanceInner.java | 582 +++++++ .../implementation/ManagedInstancesImpl.java | 117 ++ .../implementation/ManagedInstancesInner.java | 1387 +++++++++++++++++ .../SqlManagementClientImpl.java | 14 + .../implementation/SqlManager.java | 12 + 16 files changed, 4273 insertions(+) create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/IdentityType.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/MaintenanceWindowFrequency.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/MaintenanceWindowSettings.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstance.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceLicenseType.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceProxyOverride.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceUpdate.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstances.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedServerCreateMode.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ResourceIdentity.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceImpl.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceInner.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstancesImpl.java create mode 100644 sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstancesInner.java diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/IdentityType.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/IdentityType.java new file mode 100644 index 000000000000..3f3e8108ef51 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/IdentityType.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for IdentityType. + */ +public final class IdentityType extends ExpandableStringEnum { + /** Static value SystemAssigned for IdentityType. */ + public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Creates or finds a IdentityType from its string representation. + * @param name a name to look for + * @return the corresponding IdentityType + */ + @JsonCreator + public static IdentityType fromString(String name) { + return fromString(name, IdentityType.class); + } + + /** + * @return known IdentityType values + */ + public static Collection values() { + return values(IdentityType.class); + } +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/MaintenanceWindowFrequency.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/MaintenanceWindowFrequency.java new file mode 100644 index 000000000000..f9f787b271c1 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/MaintenanceWindowFrequency.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.sql.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MaintenanceWindowFrequency. + */ +public final class MaintenanceWindowFrequency extends ExpandableStringEnum { + /** Static value NonRecurrent for MaintenanceWindowFrequency. */ + public static final MaintenanceWindowFrequency NON_RECURRENT = fromString("NonRecurrent"); + + /** Static value Weekly for MaintenanceWindowFrequency. */ + public static final MaintenanceWindowFrequency WEEKLY = fromString("Weekly"); + + /** Static value Monthly for MaintenanceWindowFrequency. */ + public static final MaintenanceWindowFrequency MONTHLY = fromString("Monthly"); + + /** Static value Flexible for MaintenanceWindowFrequency. */ + public static final MaintenanceWindowFrequency FLEXIBLE = fromString("Flexible"); + + /** + * Creates or finds a MaintenanceWindowFrequency from its string representation. + * @param name a name to look for + * @return the corresponding MaintenanceWindowFrequency + */ + @JsonCreator + public static MaintenanceWindowFrequency fromString(String name) { + return fromString(name, MaintenanceWindowFrequency.class); + } + + /** + * @return known MaintenanceWindowFrequency values + */ + public static Collection values() { + return values(MaintenanceWindowFrequency.class); + } +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/MaintenanceWindowSettings.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/MaintenanceWindowSettings.java new file mode 100644 index 000000000000..b102b32baa87 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/MaintenanceWindowSettings.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.sql.v2018_06_01_preview; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of managed instance maintenance window. + */ +public class MaintenanceWindowSettings { + /** + * Specifies time of upgrade for maintenance window of managed instance. + */ + @JsonProperty(value = "timeOfUpgrade") + private String timeOfUpgrade; + + /** + * Specifies days of the month when maintenance window is to be opened. + */ + @JsonProperty(value = "dates") + private List dates; + + /** + * Specifies days in a week when maintenance window is to be opened. + */ + @JsonProperty(value = "scheduledDays") + private List scheduledDays; + + /** + * Specifies weeks on which the maintenance window should be opened. E.g. + * if '1,3' is provided and for ScheduledDays Sunday is provided, + * that means that window is to be opened on Sunday every first and third + * week. + */ + @JsonProperty(value = "scheduledWeeks") + private List scheduledWeeks; + + /** + * Specifies one off start time for a maintenance window. This is the time + * when window will be opened for the first time. + */ + @JsonProperty(value = "oneOffStartTime") + private DateTime oneOffStartTime; + + /** + * Specifies frequency of a maintenance window. + * None - No recurring pattern, + * Daily - Daily window; specified by days of week, + * Monthly - Monthly window; specified by dates in a month, + * Flexible - Flexible window; specified by week numbers and days of week. + * Possible values include: 'NonRecurrent', 'Weekly', 'Monthly', + * 'Flexible'. + */ + @JsonProperty(value = "frequency", required = true) + private MaintenanceWindowFrequency frequency; + + /** + * Specifies the timezone for which the window will be set. See reference + * for TimezoneId of ManagedInstance. + */ + @JsonProperty(value = "customerTimeZone", required = true) + private String customerTimeZone; + + /** + * Get specifies time of upgrade for maintenance window of managed instance. + * + * @return the timeOfUpgrade value + */ + public String timeOfUpgrade() { + return this.timeOfUpgrade; + } + + /** + * Set specifies time of upgrade for maintenance window of managed instance. + * + * @param timeOfUpgrade the timeOfUpgrade value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withTimeOfUpgrade(String timeOfUpgrade) { + this.timeOfUpgrade = timeOfUpgrade; + return this; + } + + /** + * Get specifies days of the month when maintenance window is to be opened. + * + * @return the dates value + */ + public List dates() { + return this.dates; + } + + /** + * Set specifies days of the month when maintenance window is to be opened. + * + * @param dates the dates value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withDates(List dates) { + this.dates = dates; + return this; + } + + /** + * Get specifies days in a week when maintenance window is to be opened. + * + * @return the scheduledDays value + */ + public List scheduledDays() { + return this.scheduledDays; + } + + /** + * Set specifies days in a week when maintenance window is to be opened. + * + * @param scheduledDays the scheduledDays value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withScheduledDays(List scheduledDays) { + this.scheduledDays = scheduledDays; + return this; + } + + /** + * Get specifies weeks on which the maintenance window should be opened. E.g. if '1,3' is provided and for ScheduledDays Sunday is provided, + that means that window is to be opened on Sunday every first and third week. + * + * @return the scheduledWeeks value + */ + public List scheduledWeeks() { + return this.scheduledWeeks; + } + + /** + * Set specifies weeks on which the maintenance window should be opened. E.g. if '1,3' is provided and for ScheduledDays Sunday is provided, + that means that window is to be opened on Sunday every first and third week. + * + * @param scheduledWeeks the scheduledWeeks value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withScheduledWeeks(List scheduledWeeks) { + this.scheduledWeeks = scheduledWeeks; + return this; + } + + /** + * Get specifies one off start time for a maintenance window. This is the time when window will be opened for the first time. + * + * @return the oneOffStartTime value + */ + public DateTime oneOffStartTime() { + return this.oneOffStartTime; + } + + /** + * Set specifies one off start time for a maintenance window. This is the time when window will be opened for the first time. + * + * @param oneOffStartTime the oneOffStartTime value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withOneOffStartTime(DateTime oneOffStartTime) { + this.oneOffStartTime = oneOffStartTime; + return this; + } + + /** + * Get specifies frequency of a maintenance window. + None - No recurring pattern, + Daily - Daily window; specified by days of week, + Monthly - Monthly window; specified by dates in a month, + Flexible - Flexible window; specified by week numbers and days of week. Possible values include: 'NonRecurrent', 'Weekly', 'Monthly', 'Flexible'. + * + * @return the frequency value + */ + public MaintenanceWindowFrequency frequency() { + return this.frequency; + } + + /** + * Set specifies frequency of a maintenance window. + None - No recurring pattern, + Daily - Daily window; specified by days of week, + Monthly - Monthly window; specified by dates in a month, + Flexible - Flexible window; specified by week numbers and days of week. Possible values include: 'NonRecurrent', 'Weekly', 'Monthly', 'Flexible'. + * + * @param frequency the frequency value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withFrequency(MaintenanceWindowFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get specifies the timezone for which the window will be set. See reference for TimezoneId of ManagedInstance. + * + * @return the customerTimeZone value + */ + public String customerTimeZone() { + return this.customerTimeZone; + } + + /** + * Set specifies the timezone for which the window will be set. See reference for TimezoneId of ManagedInstance. + * + * @param customerTimeZone the customerTimeZone value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withCustomerTimeZone(String customerTimeZone) { + this.customerTimeZone = customerTimeZone; + return this; + } + +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstance.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstance.java new file mode 100644 index 000000000000..412bec59c583 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstance.java @@ -0,0 +1,581 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.sql.v2018_06_01_preview.implementation.ManagedInstanceInner; +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.sql.v2018_06_01_preview.implementation.SqlManager; +import org.joda.time.DateTime; +import java.util.Map; + +/** + * Type representing ManagedInstance. + */ +public interface ManagedInstance extends HasInner, Indexable, Updatable, HasManager { + /** + * @return the administratorLogin value. + */ + String administratorLogin(); + + /** + * @return the administratorLoginPassword value. + */ + String administratorLoginPassword(); + + /** + * @return the collation value. + */ + String collation(); + + /** + * @return the dnsZone value. + */ + String dnsZone(); + + /** + * @return the dnsZonePartner value. + */ + String dnsZonePartner(); + + /** + * @return the fullyQualifiedDomainName value. + */ + String fullyQualifiedDomainName(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the identity value. + */ + ResourceIdentity identity(); + + /** + * @return the instancePoolId value. + */ + String instancePoolId(); + + /** + * @return the licenseType value. + */ + ManagedInstanceLicenseType licenseType(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the maintenanceWindowSettings value. + */ + MaintenanceWindowSettings maintenanceWindowSettings(); + + /** + * @return the managedInstanceCreateMode value. + */ + ManagedServerCreateMode managedInstanceCreateMode(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the proxyOverride value. + */ + ManagedInstanceProxyOverride proxyOverride(); + + /** + * @return the publicDataEndpointEnabled value. + */ + Boolean publicDataEndpointEnabled(); + + /** + * @return the restorePointInTime value. + */ + DateTime restorePointInTime(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the sourceManagedInstanceId value. + */ + String sourceManagedInstanceId(); + + /** + * @return the state value. + */ + String state(); + + /** + * @return the storageSizeInGB value. + */ + Integer storageSizeInGB(); + + /** + * @return the subnetId value. + */ + String subnetId(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the timezoneId value. + */ + String timezoneId(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the vCores value. + */ + Integer vCores(); + + /** + * The entirety of the ManagedInstance definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithInstancePool, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of ManagedInstance definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ManagedInstance definition. + */ + interface Blank extends WithInstancePool { + } + + /** + * The stage of the managedinstance definition allowing to specify InstancePool. + */ + interface WithInstancePool { + /** + * Specifies resourceGroupName. + */ + WithLocation withExistingInstancePool(String resourceGroupName); + } + + /** + * The stage of the managedinstance definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the managedinstance definition allowing to specify AdministratorLogin. + */ + interface WithAdministratorLogin { + /** + * Specifies administratorLogin. + */ + WithCreate withAdministratorLogin(String administratorLogin); + } + + /** + * The stage of the managedinstance definition allowing to specify AdministratorLoginPassword. + */ + interface WithAdministratorLoginPassword { + /** + * Specifies administratorLoginPassword. + */ + WithCreate withAdministratorLoginPassword(String administratorLoginPassword); + } + + /** + * The stage of the managedinstance definition allowing to specify Collation. + */ + interface WithCollation { + /** + * Specifies collation. + */ + WithCreate withCollation(String collation); + } + + /** + * The stage of the managedinstance definition allowing to specify DnsZonePartner. + */ + interface WithDnsZonePartner { + /** + * Specifies dnsZonePartner. + */ + WithCreate withDnsZonePartner(String dnsZonePartner); + } + + /** + * The stage of the managedinstance definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + */ + WithCreate withIdentity(ResourceIdentity identity); + } + + /** + * The stage of the managedinstance definition allowing to specify InstancePoolId. + */ + interface WithInstancePoolId { + /** + * Specifies instancePoolId. + */ + WithCreate withInstancePoolId(String instancePoolId); + } + + /** + * The stage of the managedinstance definition allowing to specify LicenseType. + */ + interface WithLicenseType { + /** + * Specifies licenseType. + */ + WithCreate withLicenseType(ManagedInstanceLicenseType licenseType); + } + + /** + * The stage of the managedinstance definition allowing to specify MaintenanceWindowSettings. + */ + interface WithMaintenanceWindowSettings { + /** + * Specifies maintenanceWindowSettings. + */ + WithCreate withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings); + } + + /** + * The stage of the managedinstance definition allowing to specify ManagedInstanceCreateMode. + */ + interface WithManagedInstanceCreateMode { + /** + * Specifies managedInstanceCreateMode. + */ + WithCreate withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode); + } + + /** + * The stage of the managedinstance definition allowing to specify ProxyOverride. + */ + interface WithProxyOverride { + /** + * Specifies proxyOverride. + */ + WithCreate withProxyOverride(ManagedInstanceProxyOverride proxyOverride); + } + + /** + * The stage of the managedinstance definition allowing to specify PublicDataEndpointEnabled. + */ + interface WithPublicDataEndpointEnabled { + /** + * Specifies publicDataEndpointEnabled. + */ + WithCreate withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled); + } + + /** + * The stage of the managedinstance definition allowing to specify RestorePointInTime. + */ + interface WithRestorePointInTime { + /** + * Specifies restorePointInTime. + */ + WithCreate withRestorePointInTime(DateTime restorePointInTime); + } + + /** + * The stage of the managedinstance definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the managedinstance definition allowing to specify SourceManagedInstanceId. + */ + interface WithSourceManagedInstanceId { + /** + * Specifies sourceManagedInstanceId. + */ + WithCreate withSourceManagedInstanceId(String sourceManagedInstanceId); + } + + /** + * The stage of the managedinstance definition allowing to specify StorageSizeInGB. + */ + interface WithStorageSizeInGB { + /** + * Specifies storageSizeInGB. + */ + WithCreate withStorageSizeInGB(Integer storageSizeInGB); + } + + /** + * The stage of the managedinstance definition allowing to specify SubnetId. + */ + interface WithSubnetId { + /** + * Specifies subnetId. + */ + WithCreate withSubnetId(String subnetId); + } + + /** + * The stage of the managedinstance definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the managedinstance definition allowing to specify TimezoneId. + */ + interface WithTimezoneId { + /** + * Specifies timezoneId. + */ + WithCreate withTimezoneId(String timezoneId); + } + + /** + * The stage of the managedinstance definition allowing to specify VCores. + */ + interface WithVCores { + /** + * Specifies vCores. + */ + WithCreate withVCores(Integer vCores); + } + + /** + * 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.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithInstancePoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithMaintenanceWindowSettings, DefinitionStages.WithManagedInstanceCreateMode, DefinitionStages.WithProxyOverride, DefinitionStages.WithPublicDataEndpointEnabled, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSku, DefinitionStages.WithSourceManagedInstanceId, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithTags, DefinitionStages.WithTimezoneId, DefinitionStages.WithVCores { + } + } + /** + * The template for a ManagedInstance update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithInstancePoolId, UpdateStages.WithLicenseType, UpdateStages.WithMaintenanceWindowSettings, UpdateStages.WithManagedInstanceCreateMode, UpdateStages.WithProxyOverride, UpdateStages.WithPublicDataEndpointEnabled, UpdateStages.WithRestorePointInTime, UpdateStages.WithSku, UpdateStages.WithSourceManagedInstanceId, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithTags, UpdateStages.WithTimezoneId, UpdateStages.WithVCores { + } + + /** + * Grouping of ManagedInstance update stages. + */ + interface UpdateStages { + /** + * The stage of the managedinstance update allowing to specify AdministratorLogin. + */ + interface WithAdministratorLogin { + /** + * Specifies administratorLogin. + */ + Update withAdministratorLogin(String administratorLogin); + } + + /** + * The stage of the managedinstance update allowing to specify AdministratorLoginPassword. + */ + interface WithAdministratorLoginPassword { + /** + * Specifies administratorLoginPassword. + */ + Update withAdministratorLoginPassword(String administratorLoginPassword); + } + + /** + * The stage of the managedinstance update allowing to specify Collation. + */ + interface WithCollation { + /** + * Specifies collation. + */ + Update withCollation(String collation); + } + + /** + * The stage of the managedinstance update allowing to specify DnsZonePartner. + */ + interface WithDnsZonePartner { + /** + * Specifies dnsZonePartner. + */ + Update withDnsZonePartner(String dnsZonePartner); + } + + /** + * The stage of the managedinstance update allowing to specify InstancePoolId. + */ + interface WithInstancePoolId { + /** + * Specifies instancePoolId. + */ + Update withInstancePoolId(String instancePoolId); + } + + /** + * The stage of the managedinstance update allowing to specify LicenseType. + */ + interface WithLicenseType { + /** + * Specifies licenseType. + */ + Update withLicenseType(ManagedInstanceLicenseType licenseType); + } + + /** + * The stage of the managedinstance update allowing to specify MaintenanceWindowSettings. + */ + interface WithMaintenanceWindowSettings { + /** + * Specifies maintenanceWindowSettings. + */ + Update withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings); + } + + /** + * The stage of the managedinstance update allowing to specify ManagedInstanceCreateMode. + */ + interface WithManagedInstanceCreateMode { + /** + * Specifies managedInstanceCreateMode. + */ + Update withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode); + } + + /** + * The stage of the managedinstance update allowing to specify ProxyOverride. + */ + interface WithProxyOverride { + /** + * Specifies proxyOverride. + */ + Update withProxyOverride(ManagedInstanceProxyOverride proxyOverride); + } + + /** + * The stage of the managedinstance update allowing to specify PublicDataEndpointEnabled. + */ + interface WithPublicDataEndpointEnabled { + /** + * Specifies publicDataEndpointEnabled. + */ + Update withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled); + } + + /** + * The stage of the managedinstance update allowing to specify RestorePointInTime. + */ + interface WithRestorePointInTime { + /** + * Specifies restorePointInTime. + */ + Update withRestorePointInTime(DateTime restorePointInTime); + } + + /** + * The stage of the managedinstance update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(Sku sku); + } + + /** + * The stage of the managedinstance update allowing to specify SourceManagedInstanceId. + */ + interface WithSourceManagedInstanceId { + /** + * Specifies sourceManagedInstanceId. + */ + Update withSourceManagedInstanceId(String sourceManagedInstanceId); + } + + /** + * The stage of the managedinstance update allowing to specify StorageSizeInGB. + */ + interface WithStorageSizeInGB { + /** + * Specifies storageSizeInGB. + */ + Update withStorageSizeInGB(Integer storageSizeInGB); + } + + /** + * The stage of the managedinstance update allowing to specify SubnetId. + */ + interface WithSubnetId { + /** + * Specifies subnetId. + */ + Update withSubnetId(String subnetId); + } + + /** + * The stage of the managedinstance update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + /** + * The stage of the managedinstance update allowing to specify TimezoneId. + */ + interface WithTimezoneId { + /** + * Specifies timezoneId. + */ + Update withTimezoneId(String timezoneId); + } + + /** + * The stage of the managedinstance update allowing to specify VCores. + */ + interface WithVCores { + /** + * Specifies vCores. + */ + Update withVCores(Integer vCores); + } + + } +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceLicenseType.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceLicenseType.java new file mode 100644 index 000000000000..15add2f1065d --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceLicenseType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedInstanceLicenseType. + */ +public final class ManagedInstanceLicenseType extends ExpandableStringEnum { + /** Static value LicenseIncluded for ManagedInstanceLicenseType. */ + public static final ManagedInstanceLicenseType LICENSE_INCLUDED = fromString("LicenseIncluded"); + + /** Static value BasePrice for ManagedInstanceLicenseType. */ + public static final ManagedInstanceLicenseType BASE_PRICE = fromString("BasePrice"); + + /** + * Creates or finds a ManagedInstanceLicenseType from its string representation. + * @param name a name to look for + * @return the corresponding ManagedInstanceLicenseType + */ + @JsonCreator + public static ManagedInstanceLicenseType fromString(String name) { + return fromString(name, ManagedInstanceLicenseType.class); + } + + /** + * @return known ManagedInstanceLicenseType values + */ + public static Collection values() { + return values(ManagedInstanceLicenseType.class); + } +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceProxyOverride.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceProxyOverride.java new file mode 100644 index 000000000000..58fa06c5df64 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceProxyOverride.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.sql.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedInstanceProxyOverride. + */ +public final class ManagedInstanceProxyOverride extends ExpandableStringEnum { + /** Static value Proxy for ManagedInstanceProxyOverride. */ + public static final ManagedInstanceProxyOverride PROXY = fromString("Proxy"); + + /** Static value Redirect for ManagedInstanceProxyOverride. */ + public static final ManagedInstanceProxyOverride REDIRECT = fromString("Redirect"); + + /** Static value Default for ManagedInstanceProxyOverride. */ + public static final ManagedInstanceProxyOverride DEFAULT = fromString("Default"); + + /** + * Creates or finds a ManagedInstanceProxyOverride from its string representation. + * @param name a name to look for + * @return the corresponding ManagedInstanceProxyOverride + */ + @JsonCreator + public static ManagedInstanceProxyOverride fromString(String name) { + return fromString(name, ManagedInstanceProxyOverride.class); + } + + /** + * @return known ManagedInstanceProxyOverride values + */ + public static Collection values() { + return values(ManagedInstanceProxyOverride.class); + } +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceUpdate.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceUpdate.java new file mode 100644 index 000000000000..f6cca3243564 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceUpdate.java @@ -0,0 +1,575 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview; + +import org.joda.time.DateTime; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * An update request for an Azure SQL Database managed instance. + */ +@JsonFlatten +public class ManagedInstanceUpdate { + /** + * Managed instance sku. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Specifies the mode of database creation. + * + * Default: Regular instance creation. + * + * Restore: Creates an instance by restoring a set of backups to specific + * point in time. RestorePointInTime and SourceManagedInstanceId must be + * specified. Possible values include: 'Default', 'PointInTimeRestore'. + */ + @JsonProperty(value = "properties.managedInstanceCreateMode") + private ManagedServerCreateMode managedInstanceCreateMode; + + /** + * The fully qualified domain name of the managed instance. + */ + @JsonProperty(value = "properties.fullyQualifiedDomainName", access = JsonProperty.Access.WRITE_ONLY) + private String fullyQualifiedDomainName; + + /** + * Administrator username for the managed instance. Can only be specified + * when the managed instance is being created (and is required for + * creation). + */ + @JsonProperty(value = "properties.administratorLogin") + private String administratorLogin; + + /** + * The administrator login password (required for managed instance + * creation). + */ + @JsonProperty(value = "properties.administratorLoginPassword") + private String administratorLoginPassword; + + /** + * Subnet resource ID for the managed instance. + */ + @JsonProperty(value = "properties.subnetId") + private String subnetId; + + /** + * The state of the managed instance. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * The license type. Possible values are 'LicenseIncluded' (regular price + * inclusive of a new SQL license) and 'BasePrice' (discounted AHB price + * for bringing your own SQL licenses). Possible values include: + * 'LicenseIncluded', 'BasePrice'. + */ + @JsonProperty(value = "properties.licenseType") + private ManagedInstanceLicenseType licenseType; + + /** + * The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. + */ + @JsonProperty(value = "properties.vCores") + private Integer vCores; + + /** + * Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments + * of 32 GB allowed only. + */ + @JsonProperty(value = "properties.storageSizeInGB") + private Integer storageSizeInGB; + + /** + * Collation of the managed instance. + */ + @JsonProperty(value = "properties.collation") + private String collation; + + /** + * The Dns Zone that the managed instance is in. + */ + @JsonProperty(value = "properties.dnsZone", access = JsonProperty.Access.WRITE_ONLY) + private String dnsZone; + + /** + * The resource id of another managed instance whose DNS zone this managed + * instance will share after creation. + */ + @JsonProperty(value = "properties.dnsZonePartner") + private String dnsZonePartner; + + /** + * Whether or not the public data endpoint is enabled. + */ + @JsonProperty(value = "properties.publicDataEndpointEnabled") + private Boolean publicDataEndpointEnabled; + + /** + * The resource identifier of the source managed instance associated with + * create operation of this instance. + */ + @JsonProperty(value = "properties.sourceManagedInstanceId") + private String sourceManagedInstanceId; + + /** + * Specifies the point in time (ISO8601 format) of the source database that + * will be restored to create the new database. + */ + @JsonProperty(value = "properties.restorePointInTime") + private DateTime restorePointInTime; + + /** + * Connection type used for connecting to the instance. Possible values + * include: 'Proxy', 'Redirect', 'Default'. + */ + @JsonProperty(value = "properties.proxyOverride") + private ManagedInstanceProxyOverride proxyOverride; + + /** + * Id of the timezone. Allowed values are timezones supported by Windows. + * Windows keeps details on supported timezones, including the id, in + * registry under + * KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time + * Zones. + * You can get those registry values via SQL Server by querying SELECT name + * AS timezone_id FROM sys.time_zone_info. + * List of Ids can also be obtained by executing + * [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + * An example of valid timezone id is "Pacific Standard Time" or "W. Europe + * Standard Time". + */ + @JsonProperty(value = "properties.timezoneId") + private String timezoneId; + + /** + * The Id of the instance pool this managed server belongs to. + */ + @JsonProperty(value = "properties.instancePoolId") + private String instancePoolId; + + /** + * Specifies maintenance window settings for a managed instance. + */ + @JsonProperty(value = "properties.maintenanceWindowSettings") + private MaintenanceWindowSettings maintenanceWindowSettings; + + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get managed instance sku. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set managed instance sku. + * + * @param sku the sku value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore'. + * + * @return the managedInstanceCreateMode value + */ + public ManagedServerCreateMode managedInstanceCreateMode() { + return this.managedInstanceCreateMode; + } + + /** + * Set specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore'. + * + * @param managedInstanceCreateMode the managedInstanceCreateMode value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { + this.managedInstanceCreateMode = managedInstanceCreateMode; + return this; + } + + /** + * Get the fully qualified domain name of the managed instance. + * + * @return the fullyQualifiedDomainName value + */ + public String fullyQualifiedDomainName() { + return this.fullyQualifiedDomainName; + } + + /** + * Get administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). + * + * @return the administratorLogin value + */ + public String administratorLogin() { + return this.administratorLogin; + } + + /** + * Set administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). + * + * @param administratorLogin the administratorLogin value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withAdministratorLogin(String administratorLogin) { + this.administratorLogin = administratorLogin; + return this; + } + + /** + * Get the administrator login password (required for managed instance creation). + * + * @return the administratorLoginPassword value + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the administrator login password (required for managed instance creation). + * + * @param administratorLoginPassword the administratorLoginPassword value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + + /** + * Get subnet resource ID for the managed instance. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set subnet resource ID for the managed instance. + * + * @param subnetId the subnetId value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the state of the managed instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get the license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice'. + * + * @return the licenseType value + */ + public ManagedInstanceLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice'. + * + * @param licenseType the licenseType value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withLicenseType(ManagedInstanceLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. + * + * @return the vCores value + */ + public Integer vCores() { + return this.vCores; + } + + /** + * Set the number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. + * + * @param vCores the vCores value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withVCores(Integer vCores) { + this.vCores = vCores; + return this; + } + + /** + * Get storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. + * + * @return the storageSizeInGB value + */ + public Integer storageSizeInGB() { + return this.storageSizeInGB; + } + + /** + * Set storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. + * + * @param storageSizeInGB the storageSizeInGB value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withStorageSizeInGB(Integer storageSizeInGB) { + this.storageSizeInGB = storageSizeInGB; + return this; + } + + /** + * Get collation of the managed instance. + * + * @return the collation value + */ + public String collation() { + return this.collation; + } + + /** + * Set collation of the managed instance. + * + * @param collation the collation value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withCollation(String collation) { + this.collation = collation; + return this; + } + + /** + * Get the Dns Zone that the managed instance is in. + * + * @return the dnsZone value + */ + public String dnsZone() { + return this.dnsZone; + } + + /** + * Get the resource id of another managed instance whose DNS zone this managed instance will share after creation. + * + * @return the dnsZonePartner value + */ + public String dnsZonePartner() { + return this.dnsZonePartner; + } + + /** + * Set the resource id of another managed instance whose DNS zone this managed instance will share after creation. + * + * @param dnsZonePartner the dnsZonePartner value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withDnsZonePartner(String dnsZonePartner) { + this.dnsZonePartner = dnsZonePartner; + return this; + } + + /** + * Get whether or not the public data endpoint is enabled. + * + * @return the publicDataEndpointEnabled value + */ + public Boolean publicDataEndpointEnabled() { + return this.publicDataEndpointEnabled; + } + + /** + * Set whether or not the public data endpoint is enabled. + * + * @param publicDataEndpointEnabled the publicDataEndpointEnabled value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled) { + this.publicDataEndpointEnabled = publicDataEndpointEnabled; + return this; + } + + /** + * Get the resource identifier of the source managed instance associated with create operation of this instance. + * + * @return the sourceManagedInstanceId value + */ + public String sourceManagedInstanceId() { + return this.sourceManagedInstanceId; + } + + /** + * Set the resource identifier of the source managed instance associated with create operation of this instance. + * + * @param sourceManagedInstanceId the sourceManagedInstanceId value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withSourceManagedInstanceId(String sourceManagedInstanceId) { + this.sourceManagedInstanceId = sourceManagedInstanceId; + return this; + } + + /** + * Get specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + * + * @return the restorePointInTime value + */ + public DateTime restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + * + * @param restorePointInTime the restorePointInTime value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withRestorePointInTime(DateTime restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; + } + + /** + * Get connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default'. + * + * @return the proxyOverride value + */ + public ManagedInstanceProxyOverride proxyOverride() { + return this.proxyOverride; + } + + /** + * Set connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default'. + * + * @param proxyOverride the proxyOverride value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withProxyOverride(ManagedInstanceProxyOverride proxyOverride) { + this.proxyOverride = proxyOverride; + return this; + } + + /** + * Get id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + * + * @return the timezoneId value + */ + public String timezoneId() { + return this.timezoneId; + } + + /** + * Set id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + * + * @param timezoneId the timezoneId value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withTimezoneId(String timezoneId) { + this.timezoneId = timezoneId; + return this; + } + + /** + * Get the Id of the instance pool this managed server belongs to. + * + * @return the instancePoolId value + */ + public String instancePoolId() { + return this.instancePoolId; + } + + /** + * Set the Id of the instance pool this managed server belongs to. + * + * @param instancePoolId the instancePoolId value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withInstancePoolId(String instancePoolId) { + this.instancePoolId = instancePoolId; + return this; + } + + /** + * Get specifies maintenance window settings for a managed instance. + * + * @return the maintenanceWindowSettings value + */ + public MaintenanceWindowSettings maintenanceWindowSettings() { + return this.maintenanceWindowSettings; + } + + /** + * Set specifies maintenance window settings for a managed instance. + * + * @param maintenanceWindowSettings the maintenanceWindowSettings value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { + this.maintenanceWindowSettings = maintenanceWindowSettings; + return this; + } + + /** + * Get resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set resource tags. + * + * @param tags the tags value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstances.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstances.java new file mode 100644 index 000000000000..13c10cae8766 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstances.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.sql.v2018_06_01_preview.implementation.ManagedInstancesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ManagedInstances. + */ +public interface ManagedInstances extends SupportsCreating, HasInner { + /** + * Gets a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getByResourceGroupAsync(String resourceGroupName, String managedInstanceName); + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String managedInstanceName); + + /** + * Gets a list of managed instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByResourceGroupAsync(final String resourceGroupName); + + /** + * Gets a list of all managed instances in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param instancePoolName The instance pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName); + +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedServerCreateMode.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedServerCreateMode.java new file mode 100644 index 000000000000..dbf9d8062961 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedServerCreateMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ManagedServerCreateMode. + */ +public final class ManagedServerCreateMode extends ExpandableStringEnum { + /** Static value Default for ManagedServerCreateMode. */ + public static final ManagedServerCreateMode DEFAULT = fromString("Default"); + + /** Static value PointInTimeRestore for ManagedServerCreateMode. */ + public static final ManagedServerCreateMode POINT_IN_TIME_RESTORE = fromString("PointInTimeRestore"); + + /** + * Creates or finds a ManagedServerCreateMode from its string representation. + * @param name a name to look for + * @return the corresponding ManagedServerCreateMode + */ + @JsonCreator + public static ManagedServerCreateMode fromString(String name) { + return fromString(name, ManagedServerCreateMode.class); + } + + /** + * @return known ManagedServerCreateMode values + */ + public static Collection values() { + return values(ManagedServerCreateMode.class); + } +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ResourceIdentity.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ResourceIdentity.java new file mode 100644 index 000000000000..4c202dd46162 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ResourceIdentity.java @@ -0,0 +1,76 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview; + +import java.util.UUID; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure Active Directory identity configuration for a resource. + */ +public class ResourceIdentity { + /** + * The Azure Active Directory principal id. + */ + @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) + private UUID principalId; + + /** + * The identity type. Set this to 'SystemAssigned' in order to + * automatically create and assign an Azure Active Directory principal for + * the resource. Possible values include: 'SystemAssigned'. + */ + @JsonProperty(value = "type") + private IdentityType type; + + /** + * The Azure Active Directory tenant id. + */ + @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) + private UUID tenantId; + + /** + * Get the Azure Active Directory principal id. + * + * @return the principalId value + */ + public UUID principalId() { + return this.principalId; + } + + /** + * Get the identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned'. + * + * @return the type value + */ + public IdentityType type() { + return this.type; + } + + /** + * Set the identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource. Possible values include: 'SystemAssigned'. + * + * @param type the type value to set + * @return the ResourceIdentity object itself. + */ + public ResourceIdentity withType(IdentityType type) { + this.type = type; + return this; + } + + /** + * Get the Azure Active Directory tenant id. + * + * @return the tenantId value + */ + public UUID tenantId() { + return this.tenantId; + } + +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceImpl.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceImpl.java new file mode 100644 index 000000000000..eaa89f93e335 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceImpl.java @@ -0,0 +1,428 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstance; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceUpdate; +import org.joda.time.DateTime; +import java.util.Map; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ResourceIdentity; +import com.microsoft.azure.management.sql.v2018_06_01_preview.Sku; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedServerCreateMode; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceLicenseType; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceProxyOverride; +import com.microsoft.azure.management.sql.v2018_06_01_preview.MaintenanceWindowSettings; +import rx.functions.Func1; + +class ManagedInstanceImpl extends CreatableUpdatableImpl implements ManagedInstance, ManagedInstance.Definition, ManagedInstance.Update { + private final SqlManager manager; + private String resourceGroupName; + private String managedInstanceName; + private ManagedInstanceUpdate updateParameter; + + ManagedInstanceImpl(String name, SqlManager manager) { + super(name, new ManagedInstanceInner()); + this.manager = manager; + // Set resource name + this.managedInstanceName = name; + // + this.updateParameter = new ManagedInstanceUpdate(); + } + + ManagedInstanceImpl(ManagedInstanceInner inner, SqlManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.managedInstanceName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.managedInstanceName = IdParsingUtils.getValueFromIdByName(inner.id(), "managedInstances"); + // + this.updateParameter = new ManagedInstanceUpdate(); + } + + @Override + public SqlManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ManagedInstancesInner client = this.manager().inner().managedInstances(); + return client.createOrUpdateAsync(this.resourceGroupName, this.managedInstanceName, this.inner()) + .map(new Func1() { + @Override + public ManagedInstanceInner call(ManagedInstanceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ManagedInstancesInner client = this.manager().inner().managedInstances(); + return client.updateAsync(this.resourceGroupName, this.managedInstanceName, this.updateParameter) + .map(new Func1() { + @Override + public ManagedInstanceInner call(ManagedInstanceInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ManagedInstancesInner client = this.manager().inner().managedInstances(); + return null; // NOP getInnerAsync implementation as get is not supported + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ManagedInstanceUpdate(); + } + + @Override + public String administratorLogin() { + return this.inner().administratorLogin(); + } + + @Override + public String administratorLoginPassword() { + return this.inner().administratorLoginPassword(); + } + + @Override + public String collation() { + return this.inner().collation(); + } + + @Override + public String dnsZone() { + return this.inner().dnsZone(); + } + + @Override + public String dnsZonePartner() { + return this.inner().dnsZonePartner(); + } + + @Override + public String fullyQualifiedDomainName() { + return this.inner().fullyQualifiedDomainName(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ResourceIdentity identity() { + return this.inner().identity(); + } + + @Override + public String instancePoolId() { + return this.inner().instancePoolId(); + } + + @Override + public ManagedInstanceLicenseType licenseType() { + return this.inner().licenseType(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public MaintenanceWindowSettings maintenanceWindowSettings() { + return this.inner().maintenanceWindowSettings(); + } + + @Override + public ManagedServerCreateMode managedInstanceCreateMode() { + return this.inner().managedInstanceCreateMode(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ManagedInstanceProxyOverride proxyOverride() { + return this.inner().proxyOverride(); + } + + @Override + public Boolean publicDataEndpointEnabled() { + return this.inner().publicDataEndpointEnabled(); + } + + @Override + public DateTime restorePointInTime() { + return this.inner().restorePointInTime(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public String sourceManagedInstanceId() { + return this.inner().sourceManagedInstanceId(); + } + + @Override + public String state() { + return this.inner().state(); + } + + @Override + public Integer storageSizeInGB() { + return this.inner().storageSizeInGB(); + } + + @Override + public String subnetId() { + return this.inner().subnetId(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String timezoneId() { + return this.inner().timezoneId(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public Integer vCores() { + return this.inner().vCores(); + } + + @Override + public ManagedInstanceImpl withExistingInstancePool(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + @Override + public ManagedInstanceImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ManagedInstanceImpl withIdentity(ResourceIdentity identity) { + this.inner().withIdentity(identity); + return this; + } + + @Override + public ManagedInstanceImpl withAdministratorLogin(String administratorLogin) { + if (isInCreateMode()) { + this.inner().withAdministratorLogin(administratorLogin); + } else { + this.updateParameter.withAdministratorLogin(administratorLogin); + } + return this; + } + + @Override + public ManagedInstanceImpl withAdministratorLoginPassword(String administratorLoginPassword) { + if (isInCreateMode()) { + this.inner().withAdministratorLoginPassword(administratorLoginPassword); + } else { + this.updateParameter.withAdministratorLoginPassword(administratorLoginPassword); + } + return this; + } + + @Override + public ManagedInstanceImpl withCollation(String collation) { + if (isInCreateMode()) { + this.inner().withCollation(collation); + } else { + this.updateParameter.withCollation(collation); + } + return this; + } + + @Override + public ManagedInstanceImpl withDnsZonePartner(String dnsZonePartner) { + if (isInCreateMode()) { + this.inner().withDnsZonePartner(dnsZonePartner); + } else { + this.updateParameter.withDnsZonePartner(dnsZonePartner); + } + return this; + } + + @Override + public ManagedInstanceImpl withInstancePoolId(String instancePoolId) { + if (isInCreateMode()) { + this.inner().withInstancePoolId(instancePoolId); + } else { + this.updateParameter.withInstancePoolId(instancePoolId); + } + return this; + } + + @Override + public ManagedInstanceImpl withLicenseType(ManagedInstanceLicenseType licenseType) { + if (isInCreateMode()) { + this.inner().withLicenseType(licenseType); + } else { + this.updateParameter.withLicenseType(licenseType); + } + return this; + } + + @Override + public ManagedInstanceImpl withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { + if (isInCreateMode()) { + this.inner().withMaintenanceWindowSettings(maintenanceWindowSettings); + } else { + this.updateParameter.withMaintenanceWindowSettings(maintenanceWindowSettings); + } + return this; + } + + @Override + public ManagedInstanceImpl withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { + if (isInCreateMode()) { + this.inner().withManagedInstanceCreateMode(managedInstanceCreateMode); + } else { + this.updateParameter.withManagedInstanceCreateMode(managedInstanceCreateMode); + } + return this; + } + + @Override + public ManagedInstanceImpl withProxyOverride(ManagedInstanceProxyOverride proxyOverride) { + if (isInCreateMode()) { + this.inner().withProxyOverride(proxyOverride); + } else { + this.updateParameter.withProxyOverride(proxyOverride); + } + return this; + } + + @Override + public ManagedInstanceImpl withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled) { + if (isInCreateMode()) { + this.inner().withPublicDataEndpointEnabled(publicDataEndpointEnabled); + } else { + this.updateParameter.withPublicDataEndpointEnabled(publicDataEndpointEnabled); + } + return this; + } + + @Override + public ManagedInstanceImpl withRestorePointInTime(DateTime restorePointInTime) { + if (isInCreateMode()) { + this.inner().withRestorePointInTime(restorePointInTime); + } else { + this.updateParameter.withRestorePointInTime(restorePointInTime); + } + return this; + } + + @Override + public ManagedInstanceImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public ManagedInstanceImpl withSourceManagedInstanceId(String sourceManagedInstanceId) { + if (isInCreateMode()) { + this.inner().withSourceManagedInstanceId(sourceManagedInstanceId); + } else { + this.updateParameter.withSourceManagedInstanceId(sourceManagedInstanceId); + } + return this; + } + + @Override + public ManagedInstanceImpl withStorageSizeInGB(Integer storageSizeInGB) { + if (isInCreateMode()) { + this.inner().withStorageSizeInGB(storageSizeInGB); + } else { + this.updateParameter.withStorageSizeInGB(storageSizeInGB); + } + return this; + } + + @Override + public ManagedInstanceImpl withSubnetId(String subnetId) { + if (isInCreateMode()) { + this.inner().withSubnetId(subnetId); + } else { + this.updateParameter.withSubnetId(subnetId); + } + return this; + } + + @Override + public ManagedInstanceImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public ManagedInstanceImpl withTimezoneId(String timezoneId) { + if (isInCreateMode()) { + this.inner().withTimezoneId(timezoneId); + } else { + this.updateParameter.withTimezoneId(timezoneId); + } + return this; + } + + @Override + public ManagedInstanceImpl withVCores(Integer vCores) { + if (isInCreateMode()) { + this.inner().withVCores(vCores); + } else { + this.updateParameter.withVCores(vCores); + } + return this; + } + +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceInner.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceInner.java new file mode 100644 index 000000000000..fb8c0cacffa8 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceInner.java @@ -0,0 +1,582 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview.implementation; + +import com.microsoft.azure.management.sql.v2018_06_01_preview.ResourceIdentity; +import com.microsoft.azure.management.sql.v2018_06_01_preview.Sku; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedServerCreateMode; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceLicenseType; +import org.joda.time.DateTime; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceProxyOverride; +import com.microsoft.azure.management.sql.v2018_06_01_preview.MaintenanceWindowSettings; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An Azure SQL managed instance. + */ +@JsonFlatten +public class ManagedInstanceInner extends Resource { + /** + * The Azure Active Directory identity of the managed instance. + */ + @JsonProperty(value = "identity") + private ResourceIdentity identity; + + /** + * Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, + * BC_Gen4, BC_Gen5. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * Specifies the mode of database creation. + * + * Default: Regular instance creation. + * + * Restore: Creates an instance by restoring a set of backups to specific + * point in time. RestorePointInTime and SourceManagedInstanceId must be + * specified. Possible values include: 'Default', 'PointInTimeRestore'. + */ + @JsonProperty(value = "properties.managedInstanceCreateMode") + private ManagedServerCreateMode managedInstanceCreateMode; + + /** + * The fully qualified domain name of the managed instance. + */ + @JsonProperty(value = "properties.fullyQualifiedDomainName", access = JsonProperty.Access.WRITE_ONLY) + private String fullyQualifiedDomainName; + + /** + * Administrator username for the managed instance. Can only be specified + * when the managed instance is being created (and is required for + * creation). + */ + @JsonProperty(value = "properties.administratorLogin") + private String administratorLogin; + + /** + * The administrator login password (required for managed instance + * creation). + */ + @JsonProperty(value = "properties.administratorLoginPassword") + private String administratorLoginPassword; + + /** + * Subnet resource ID for the managed instance. + */ + @JsonProperty(value = "properties.subnetId") + private String subnetId; + + /** + * The state of the managed instance. + */ + @JsonProperty(value = "properties.state", access = JsonProperty.Access.WRITE_ONLY) + private String state; + + /** + * The license type. Possible values are 'LicenseIncluded' (regular price + * inclusive of a new SQL license) and 'BasePrice' (discounted AHB price + * for bringing your own SQL licenses). Possible values include: + * 'LicenseIncluded', 'BasePrice'. + */ + @JsonProperty(value = "properties.licenseType") + private ManagedInstanceLicenseType licenseType; + + /** + * The number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. + */ + @JsonProperty(value = "properties.vCores") + private Integer vCores; + + /** + * Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments + * of 32 GB allowed only. + */ + @JsonProperty(value = "properties.storageSizeInGB") + private Integer storageSizeInGB; + + /** + * Collation of the managed instance. + */ + @JsonProperty(value = "properties.collation") + private String collation; + + /** + * The Dns Zone that the managed instance is in. + */ + @JsonProperty(value = "properties.dnsZone", access = JsonProperty.Access.WRITE_ONLY) + private String dnsZone; + + /** + * The resource id of another managed instance whose DNS zone this managed + * instance will share after creation. + */ + @JsonProperty(value = "properties.dnsZonePartner") + private String dnsZonePartner; + + /** + * Whether or not the public data endpoint is enabled. + */ + @JsonProperty(value = "properties.publicDataEndpointEnabled") + private Boolean publicDataEndpointEnabled; + + /** + * The resource identifier of the source managed instance associated with + * create operation of this instance. + */ + @JsonProperty(value = "properties.sourceManagedInstanceId") + private String sourceManagedInstanceId; + + /** + * Specifies the point in time (ISO8601 format) of the source database that + * will be restored to create the new database. + */ + @JsonProperty(value = "properties.restorePointInTime") + private DateTime restorePointInTime; + + /** + * Connection type used for connecting to the instance. Possible values + * include: 'Proxy', 'Redirect', 'Default'. + */ + @JsonProperty(value = "properties.proxyOverride") + private ManagedInstanceProxyOverride proxyOverride; + + /** + * Id of the timezone. Allowed values are timezones supported by Windows. + * Windows keeps details on supported timezones, including the id, in + * registry under + * KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time + * Zones. + * You can get those registry values via SQL Server by querying SELECT name + * AS timezone_id FROM sys.time_zone_info. + * List of Ids can also be obtained by executing + * [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + * An example of valid timezone id is "Pacific Standard Time" or "W. Europe + * Standard Time". + */ + @JsonProperty(value = "properties.timezoneId") + private String timezoneId; + + /** + * The Id of the instance pool this managed server belongs to. + */ + @JsonProperty(value = "properties.instancePoolId") + private String instancePoolId; + + /** + * Specifies maintenance window settings for a managed instance. + */ + @JsonProperty(value = "properties.maintenanceWindowSettings") + private MaintenanceWindowSettings maintenanceWindowSettings; + + /** + * Get the Azure Active Directory identity of the managed instance. + * + * @return the identity value + */ + public ResourceIdentity identity() { + return this.identity; + } + + /** + * Set the Azure Active Directory identity of the managed instance. + * + * @param identity the identity value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withIdentity(ResourceIdentity identity) { + this.identity = identity; + return this; + } + + /** + * Get managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5. + * + * @param sku the sku value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore'. + * + * @return the managedInstanceCreateMode value + */ + public ManagedServerCreateMode managedInstanceCreateMode() { + return this.managedInstanceCreateMode; + } + + /** + * Set specifies the mode of database creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore'. + * + * @param managedInstanceCreateMode the managedInstanceCreateMode value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { + this.managedInstanceCreateMode = managedInstanceCreateMode; + return this; + } + + /** + * Get the fully qualified domain name of the managed instance. + * + * @return the fullyQualifiedDomainName value + */ + public String fullyQualifiedDomainName() { + return this.fullyQualifiedDomainName; + } + + /** + * Get administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). + * + * @return the administratorLogin value + */ + public String administratorLogin() { + return this.administratorLogin; + } + + /** + * Set administrator username for the managed instance. Can only be specified when the managed instance is being created (and is required for creation). + * + * @param administratorLogin the administratorLogin value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withAdministratorLogin(String administratorLogin) { + this.administratorLogin = administratorLogin; + return this; + } + + /** + * Get the administrator login password (required for managed instance creation). + * + * @return the administratorLoginPassword value + */ + public String administratorLoginPassword() { + return this.administratorLoginPassword; + } + + /** + * Set the administrator login password (required for managed instance creation). + * + * @param administratorLoginPassword the administratorLoginPassword value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withAdministratorLoginPassword(String administratorLoginPassword) { + this.administratorLoginPassword = administratorLoginPassword; + return this; + } + + /** + * Get subnet resource ID for the managed instance. + * + * @return the subnetId value + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set subnet resource ID for the managed instance. + * + * @param subnetId the subnetId value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the state of the managed instance. + * + * @return the state value + */ + public String state() { + return this.state; + } + + /** + * Get the license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice'. + * + * @return the licenseType value + */ + public ManagedInstanceLicenseType licenseType() { + return this.licenseType; + } + + /** + * Set the license type. Possible values are 'LicenseIncluded' (regular price inclusive of a new SQL license) and 'BasePrice' (discounted AHB price for bringing your own SQL licenses). Possible values include: 'LicenseIncluded', 'BasePrice'. + * + * @param licenseType the licenseType value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withLicenseType(ManagedInstanceLicenseType licenseType) { + this.licenseType = licenseType; + return this; + } + + /** + * Get the number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. + * + * @return the vCores value + */ + public Integer vCores() { + return this.vCores; + } + + /** + * Set the number of vCores. Allowed values: 8, 16, 24, 32, 40, 64, 80. + * + * @param vCores the vCores value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withVCores(Integer vCores) { + this.vCores = vCores; + return this; + } + + /** + * Get storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. + * + * @return the storageSizeInGB value + */ + public Integer storageSizeInGB() { + return this.storageSizeInGB; + } + + /** + * Set storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. + * + * @param storageSizeInGB the storageSizeInGB value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withStorageSizeInGB(Integer storageSizeInGB) { + this.storageSizeInGB = storageSizeInGB; + return this; + } + + /** + * Get collation of the managed instance. + * + * @return the collation value + */ + public String collation() { + return this.collation; + } + + /** + * Set collation of the managed instance. + * + * @param collation the collation value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withCollation(String collation) { + this.collation = collation; + return this; + } + + /** + * Get the Dns Zone that the managed instance is in. + * + * @return the dnsZone value + */ + public String dnsZone() { + return this.dnsZone; + } + + /** + * Get the resource id of another managed instance whose DNS zone this managed instance will share after creation. + * + * @return the dnsZonePartner value + */ + public String dnsZonePartner() { + return this.dnsZonePartner; + } + + /** + * Set the resource id of another managed instance whose DNS zone this managed instance will share after creation. + * + * @param dnsZonePartner the dnsZonePartner value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withDnsZonePartner(String dnsZonePartner) { + this.dnsZonePartner = dnsZonePartner; + return this; + } + + /** + * Get whether or not the public data endpoint is enabled. + * + * @return the publicDataEndpointEnabled value + */ + public Boolean publicDataEndpointEnabled() { + return this.publicDataEndpointEnabled; + } + + /** + * Set whether or not the public data endpoint is enabled. + * + * @param publicDataEndpointEnabled the publicDataEndpointEnabled value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withPublicDataEndpointEnabled(Boolean publicDataEndpointEnabled) { + this.publicDataEndpointEnabled = publicDataEndpointEnabled; + return this; + } + + /** + * Get the resource identifier of the source managed instance associated with create operation of this instance. + * + * @return the sourceManagedInstanceId value + */ + public String sourceManagedInstanceId() { + return this.sourceManagedInstanceId; + } + + /** + * Set the resource identifier of the source managed instance associated with create operation of this instance. + * + * @param sourceManagedInstanceId the sourceManagedInstanceId value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withSourceManagedInstanceId(String sourceManagedInstanceId) { + this.sourceManagedInstanceId = sourceManagedInstanceId; + return this; + } + + /** + * Get specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + * + * @return the restorePointInTime value + */ + public DateTime restorePointInTime() { + return this.restorePointInTime; + } + + /** + * Set specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. + * + * @param restorePointInTime the restorePointInTime value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withRestorePointInTime(DateTime restorePointInTime) { + this.restorePointInTime = restorePointInTime; + return this; + } + + /** + * Get connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default'. + * + * @return the proxyOverride value + */ + public ManagedInstanceProxyOverride proxyOverride() { + return this.proxyOverride; + } + + /** + * Set connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default'. + * + * @param proxyOverride the proxyOverride value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withProxyOverride(ManagedInstanceProxyOverride proxyOverride) { + this.proxyOverride = proxyOverride; + return this; + } + + /** + * Get id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + * + * @return the timezoneId value + */ + public String timezoneId() { + return this.timezoneId; + } + + /** + * Set id of the timezone. Allowed values are timezones supported by Windows. + Windows keeps details on supported timezones, including the id, in registry under + KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones. + You can get those registry values via SQL Server by querying SELECT name AS timezone_id FROM sys.time_zone_info. + List of Ids can also be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + * + * @param timezoneId the timezoneId value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withTimezoneId(String timezoneId) { + this.timezoneId = timezoneId; + return this; + } + + /** + * Get the Id of the instance pool this managed server belongs to. + * + * @return the instancePoolId value + */ + public String instancePoolId() { + return this.instancePoolId; + } + + /** + * Set the Id of the instance pool this managed server belongs to. + * + * @param instancePoolId the instancePoolId value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withInstancePoolId(String instancePoolId) { + this.instancePoolId = instancePoolId; + return this; + } + + /** + * Get specifies maintenance window settings for a managed instance. + * + * @return the maintenanceWindowSettings value + */ + public MaintenanceWindowSettings maintenanceWindowSettings() { + return this.maintenanceWindowSettings; + } + + /** + * Set specifies maintenance window settings for a managed instance. + * + * @param maintenanceWindowSettings the maintenanceWindowSettings value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { + this.maintenanceWindowSettings = maintenanceWindowSettings; + return this; + } + +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstancesImpl.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstancesImpl.java new file mode 100644 index 000000000000..30d8b2db103f --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstancesImpl.java @@ -0,0 +1,117 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstance; + +class ManagedInstancesImpl extends WrapperImpl implements ManagedInstances { + private final SqlManager manager; + + ManagedInstancesImpl(SqlManager manager) { + super(manager.inner().managedInstances()); + this.manager = manager; + } + + public SqlManager manager() { + return this.manager; + } + + @Override + public ManagedInstanceImpl define(String name) { + return wrapModel(name); + } + + private ManagedInstanceImpl wrapModel(ManagedInstanceInner inner) { + return new ManagedInstanceImpl(inner, manager()); + } + + private ManagedInstanceImpl wrapModel(String name) { + return new ManagedInstanceImpl(name, this.manager()); + } + + @Override + public Observable getByResourceGroupAsync(String resourceGroupName, String managedInstanceName) { + ManagedInstancesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, managedInstanceName) + .map(new Func1() { + @Override + public ManagedInstance call(ManagedInstanceInner inner) { + return new ManagedInstanceImpl(inner, manager()); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String managedInstanceName) { + ManagedInstancesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, managedInstanceName).toCompletable(); + } + + @Override + public Observable listByResourceGroupAsync(final String resourceGroupName) { + ManagedInstancesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ManagedInstance call(ManagedInstanceInner inner) { + return new ManagedInstanceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync() { + ManagedInstancesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ManagedInstance call(ManagedInstanceInner inner) { + return new ManagedInstanceImpl(inner, manager()); + } + }); + } + + @Override + public Observable listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName) { + ManagedInstancesInner client = this.inner(); + return client.listByInstancePoolAsync(resourceGroupName, instancePoolName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public ManagedInstance call(ManagedInstanceInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstancesInner.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstancesInner.java new file mode 100644 index 000000000000..202817e3ab41 --- /dev/null +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstancesInner.java @@ -0,0 +1,1387 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.sql.v2018_06_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceUpdate; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in ManagedInstances. + */ +public class ManagedInstancesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private ManagedInstancesService service; + /** The service client containing this operation class. */ + private SqlManagementClientImpl client; + + /** + * Initializes an instance of ManagedInstancesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ManagedInstancesInner(Retrofit retrofit, SqlManagementClientImpl client) { + this.service = retrofit.create(ManagedInstancesService.class); + this.client = client; + } + + /** + * The interface defining all the services for ManagedInstances to be + * used by Retrofit to perform actually REST calls. + */ + interface ManagedInstancesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances listByInstancePool" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances") + Observable> listByInstancePool(@Path("resourceGroupName") String resourceGroupName, @Path("instancePoolName") String instancePoolName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances") + Observable> listByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}") + Observable> getByResourceGroup(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}") + Observable> createOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Body ManagedInstanceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}") + Observable> beginCreateOrUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Body ManagedInstanceInner parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}") + Observable> update(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Body ManagedInstanceUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}") + Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Body ManagedInstanceUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances listByInstancePoolNext" }) + @GET + Observable> listByInstancePoolNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param instancePoolName The instance pool 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 PagedList<ManagedInstanceInner> object if successful. + */ + public PagedList listByInstancePool(final String resourceGroupName, final String instancePoolName) { + ServiceResponse> response = listByInstancePoolSinglePageAsync(resourceGroupName, instancePoolName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByInstancePoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param instancePoolName The instance pool 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> listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByInstancePoolSinglePageAsync(resourceGroupName, instancePoolName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByInstancePoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param instancePoolName The instance pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable> listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName) { + return listByInstancePoolWithServiceResponseAsync(resourceGroupName, instancePoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param instancePoolName The instance pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable>> listByInstancePoolWithServiceResponseAsync(final String resourceGroupName, final String instancePoolName) { + return listByInstancePoolSinglePageAsync(resourceGroupName, instancePoolName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByInstancePoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all managed instances in an instance pool. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + ServiceResponse> * @param instancePoolName The instance pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByInstancePoolSinglePageAsync(final String resourceGroupName, final String instancePoolName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (instancePoolName == null) { + throw new IllegalArgumentException("Parameter instancePoolName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByInstancePool(resourceGroupName, instancePoolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByInstancePoolDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByInstancePoolDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ManagedInstanceInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of managed instances in a resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(resourceGroupName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ManagedInstanceInner object if successful. + */ + public ManagedInstanceInner getByResourceGroup(String resourceGroupName, String managedInstanceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, managedInstanceName).toBlocking().single().body(); + } + + /** + * Gets a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String managedInstanceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, managedInstanceName), serviceCallback); + } + + /** + * Gets a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagedInstanceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String managedInstanceName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, managedInstanceName).map(new Func1, ManagedInstanceInner>() { + @Override + public ManagedInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagedInstanceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String managedInstanceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(resourceGroupName, managedInstanceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @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 ManagedInstanceInner object if successful. + */ + public ManagedInstanceInner createOrUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).toBlocking().last().body(); + } + + /** + * Creates or updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @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 managedInstanceName, ManagedInstanceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters), serviceCallback); + } + + /** + * Creates or updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1, ManagedInstanceInner>() { + @Override + public ManagedInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.createOrUpdate(resourceGroupName, managedInstanceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates or updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @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 ManagedInstanceInner object if successful. + */ + public ManagedInstanceInner beginCreateOrUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).toBlocking().single().body(); + } + + /** + * Creates or updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters), serviceCallback); + } + + /** + * Creates or updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagedInstanceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1, ManagedInstanceInner>() { + @Override + public ManagedInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagedInstanceInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceInner parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginCreateOrUpdate(resourceGroupName, managedInstanceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String managedInstanceName) { + deleteWithServiceResponseAsync(resourceGroupName, managedInstanceName).toBlocking().last().body(); + } + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String managedInstanceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, managedInstanceName), serviceCallback); + } + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String managedInstanceName) { + return deleteWithServiceResponseAsync(resourceGroupName, managedInstanceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String managedInstanceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(resourceGroupName, managedInstanceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String managedInstanceName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, managedInstanceName).toBlocking().single().body(); + } + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String managedInstanceName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, managedInstanceName), serviceCallback); + } + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String managedInstanceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, managedInstanceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String managedInstanceName) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(resourceGroupName, managedInstanceName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @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 ManagedInstanceInner object if successful. + */ + public ManagedInstanceInner update(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).toBlocking().last().body(); + } + + /** + * Updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters), serviceCallback); + } + + /** + * Updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) { + return updateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1, ManagedInstanceInner>() { + @Override + public ManagedInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.update(resourceGroupName, managedInstanceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @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 ManagedInstanceInner object if successful. + */ + public ManagedInstanceInner beginUpdate(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).toBlocking().single().body(); + } + + /** + * Updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @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 beginUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters), serviceCallback); + } + + /** + * Updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagedInstanceInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, managedInstanceName, parameters).map(new Func1, ManagedInstanceInner>() { + @Override + public ManagedInstanceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a managed instance. + * + * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. + * @param managedInstanceName The name of the managed instance. + * @param parameters The requested managed instance resource state. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ManagedInstanceInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String managedInstanceName, ManagedInstanceUpdate parameters) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (managedInstanceName == null) { + throw new IllegalArgumentException("Parameter managedInstanceName is required and cannot be null."); + } + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginUpdate(resourceGroupName, managedInstanceName, this.client.subscriptionId(), parameters, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ManagedInstanceInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ManagedInstanceInner> object if successful. + */ + public PagedList listByInstancePoolNext(final String nextPageLink) { + ServiceResponse> response = listByInstancePoolNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByInstancePoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByInstancePoolNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByInstancePoolNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByInstancePoolNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable> listByInstancePoolNextAsync(final String nextPageLink) { + return listByInstancePoolNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all managed instances in an instance pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable>> listByInstancePoolNextWithServiceResponseAsync(final String nextPageLink) { + return listByInstancePoolNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByInstancePoolNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all managed instances in an instance pool. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByInstancePoolNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByInstancePoolNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByInstancePoolNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByInstancePoolNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ManagedInstanceInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of managed instances in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of managed instances in a resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ManagedInstanceInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets a list of all managed instances in the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ManagedInstanceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Gets a list of all managed instances in the subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SqlManagementClientImpl.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SqlManagementClientImpl.java index 589a26517025..8cc7b56c907e 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SqlManagementClientImpl.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SqlManagementClientImpl.java @@ -210,6 +210,19 @@ public UsagesInner usages() { return this.usages; } + /** + * The ManagedInstancesInner object to access its operations. + */ + private ManagedInstancesInner managedInstances; + + /** + * Gets the ManagedInstancesInner object to access its operations. + * @return the ManagedInstancesInner object. + */ + public ManagedInstancesInner managedInstances() { + return this.managedInstances; + } + /** * Initializes an instance of SqlManagementClient client. * @@ -251,6 +264,7 @@ protected void initialize() { this.serverVulnerabilityAssessments = new ServerVulnerabilityAssessmentsInner(restClient().retrofit(), this); this.instancePools = new InstancePoolsInner(restClient().retrofit(), this); this.usages = new UsagesInner(restClient().retrofit(), this); + this.managedInstances = new ManagedInstancesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SqlManager.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SqlManager.java index af7d285860ea..829d6869a410 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SqlManager.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/SqlManager.java @@ -22,6 +22,7 @@ import com.microsoft.azure.management.sql.v2018_06_01_preview.ServerVulnerabilityAssessments; import com.microsoft.azure.management.sql.v2018_06_01_preview.InstancePools; import com.microsoft.azure.management.sql.v2018_06_01_preview.Usages; +import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstances; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -35,6 +36,7 @@ public final class SqlManager extends ManagerCore Date: Tue, 25 Jun 2019 01:06:37 +0000 Subject: [PATCH 2/3] Generated from 877069981fd62a109f5452f5d147341c4109f511 Update 2015-05-01 managedInstances.json --- .../MaintenanceWindowFrequency.java | 47 ++++ .../MaintenanceWindowSettings.java | 222 ++++++++++++++++ .../v2015_05_01_preview/ManagedInstance.java | 29 ++- .../ManagedInstanceUpdate.java | 26 ++ .../v2015_05_01_preview/ManagedInstances.java | 10 - .../implementation/ManagedInstanceImpl.java | 16 ++ .../implementation/ManagedInstanceInner.java | 27 ++ .../implementation/ManagedInstancesImpl.java | 18 -- .../implementation/ManagedInstancesInner.java | 242 ------------------ 9 files changed, 365 insertions(+), 272 deletions(-) create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/MaintenanceWindowFrequency.java create mode 100644 sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/MaintenanceWindowSettings.java diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/MaintenanceWindowFrequency.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/MaintenanceWindowFrequency.java new file mode 100644 index 000000000000..e609be6d5426 --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/MaintenanceWindowFrequency.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.sql.v2015_05_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for MaintenanceWindowFrequency. + */ +public final class MaintenanceWindowFrequency extends ExpandableStringEnum { + /** Static value NonRecurrent for MaintenanceWindowFrequency. */ + public static final MaintenanceWindowFrequency NON_RECURRENT = fromString("NonRecurrent"); + + /** Static value Weekly for MaintenanceWindowFrequency. */ + public static final MaintenanceWindowFrequency WEEKLY = fromString("Weekly"); + + /** Static value Monthly for MaintenanceWindowFrequency. */ + public static final MaintenanceWindowFrequency MONTHLY = fromString("Monthly"); + + /** Static value Flexible for MaintenanceWindowFrequency. */ + public static final MaintenanceWindowFrequency FLEXIBLE = fromString("Flexible"); + + /** + * Creates or finds a MaintenanceWindowFrequency from its string representation. + * @param name a name to look for + * @return the corresponding MaintenanceWindowFrequency + */ + @JsonCreator + public static MaintenanceWindowFrequency fromString(String name) { + return fromString(name, MaintenanceWindowFrequency.class); + } + + /** + * @return known MaintenanceWindowFrequency values + */ + public static Collection values() { + return values(MaintenanceWindowFrequency.class); + } +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/MaintenanceWindowSettings.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/MaintenanceWindowSettings.java new file mode 100644 index 000000000000..af73da30ecbb --- /dev/null +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/MaintenanceWindowSettings.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.sql.v2015_05_01_preview; + +import java.util.List; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of managed instance maintenance window. + */ +public class MaintenanceWindowSettings { + /** + * Specifies time of upgrade for maintenance window of managed instance. + */ + @JsonProperty(value = "timeOfUpgrade") + private String timeOfUpgrade; + + /** + * Specifies days of the month when maintenance window is to be opened. + */ + @JsonProperty(value = "dates") + private List dates; + + /** + * Specifies days in a week when maintenance window is to be opened. + */ + @JsonProperty(value = "scheduledDays") + private List scheduledDays; + + /** + * Specifies weeks on which the maintenance window should be opened. E.g. + * if '1,3' is provided and for ScheduledDays Sunday is provided, + * that means that window is to be opened on Sunday every first and third + * week. + */ + @JsonProperty(value = "scheduledWeeks") + private List scheduledWeeks; + + /** + * Specifies one off start time for a maintenance window. This is the time + * when window will be opened for the first time. + */ + @JsonProperty(value = "oneOffStartTime") + private DateTime oneOffStartTime; + + /** + * Specifies frequency of a maintenance window. + * None - No recurring pattern, + * Daily - Daily window; specified by days of week, + * Monthly - Monthly window; specified by dates in a month, + * Flexible - Flexible window; specified by week numbers and days of week. + * Possible values include: 'NonRecurrent', 'Weekly', 'Monthly', + * 'Flexible'. + */ + @JsonProperty(value = "frequency", required = true) + private MaintenanceWindowFrequency frequency; + + /** + * Specifies the timezone for which the window will be set. See reference + * for TimezoneId of ManagedInstance. + */ + @JsonProperty(value = "customerTimeZone", required = true) + private String customerTimeZone; + + /** + * Get specifies time of upgrade for maintenance window of managed instance. + * + * @return the timeOfUpgrade value + */ + public String timeOfUpgrade() { + return this.timeOfUpgrade; + } + + /** + * Set specifies time of upgrade for maintenance window of managed instance. + * + * @param timeOfUpgrade the timeOfUpgrade value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withTimeOfUpgrade(String timeOfUpgrade) { + this.timeOfUpgrade = timeOfUpgrade; + return this; + } + + /** + * Get specifies days of the month when maintenance window is to be opened. + * + * @return the dates value + */ + public List dates() { + return this.dates; + } + + /** + * Set specifies days of the month when maintenance window is to be opened. + * + * @param dates the dates value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withDates(List dates) { + this.dates = dates; + return this; + } + + /** + * Get specifies days in a week when maintenance window is to be opened. + * + * @return the scheduledDays value + */ + public List scheduledDays() { + return this.scheduledDays; + } + + /** + * Set specifies days in a week when maintenance window is to be opened. + * + * @param scheduledDays the scheduledDays value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withScheduledDays(List scheduledDays) { + this.scheduledDays = scheduledDays; + return this; + } + + /** + * Get specifies weeks on which the maintenance window should be opened. E.g. if '1,3' is provided and for ScheduledDays Sunday is provided, + that means that window is to be opened on Sunday every first and third week. + * + * @return the scheduledWeeks value + */ + public List scheduledWeeks() { + return this.scheduledWeeks; + } + + /** + * Set specifies weeks on which the maintenance window should be opened. E.g. if '1,3' is provided and for ScheduledDays Sunday is provided, + that means that window is to be opened on Sunday every first and third week. + * + * @param scheduledWeeks the scheduledWeeks value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withScheduledWeeks(List scheduledWeeks) { + this.scheduledWeeks = scheduledWeeks; + return this; + } + + /** + * Get specifies one off start time for a maintenance window. This is the time when window will be opened for the first time. + * + * @return the oneOffStartTime value + */ + public DateTime oneOffStartTime() { + return this.oneOffStartTime; + } + + /** + * Set specifies one off start time for a maintenance window. This is the time when window will be opened for the first time. + * + * @param oneOffStartTime the oneOffStartTime value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withOneOffStartTime(DateTime oneOffStartTime) { + this.oneOffStartTime = oneOffStartTime; + return this; + } + + /** + * Get specifies frequency of a maintenance window. + None - No recurring pattern, + Daily - Daily window; specified by days of week, + Monthly - Monthly window; specified by dates in a month, + Flexible - Flexible window; specified by week numbers and days of week. Possible values include: 'NonRecurrent', 'Weekly', 'Monthly', 'Flexible'. + * + * @return the frequency value + */ + public MaintenanceWindowFrequency frequency() { + return this.frequency; + } + + /** + * Set specifies frequency of a maintenance window. + None - No recurring pattern, + Daily - Daily window; specified by days of week, + Monthly - Monthly window; specified by dates in a month, + Flexible - Flexible window; specified by week numbers and days of week. Possible values include: 'NonRecurrent', 'Weekly', 'Monthly', 'Flexible'. + * + * @param frequency the frequency value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withFrequency(MaintenanceWindowFrequency frequency) { + this.frequency = frequency; + return this; + } + + /** + * Get specifies the timezone for which the window will be set. See reference for TimezoneId of ManagedInstance. + * + * @return the customerTimeZone value + */ + public String customerTimeZone() { + return this.customerTimeZone; + } + + /** + * Set specifies the timezone for which the window will be set. See reference for TimezoneId of ManagedInstance. + * + * @param customerTimeZone the customerTimeZone value to set + * @return the MaintenanceWindowSettings object itself. + */ + public MaintenanceWindowSettings withCustomerTimeZone(String customerTimeZone) { + this.customerTimeZone = customerTimeZone; + return this; + } + +} diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java index 6076d497ae63..99bba7d2a1e6 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java @@ -70,6 +70,11 @@ public interface ManagedInstance extends HasInner, Resourc */ ManagedInstanceLicenseType licenseType(); + /** + * @return the maintenanceWindowSettings value. + */ + MaintenanceWindowSettings maintenanceWindowSettings(); + /** * @return the managedInstanceCreateMode value. */ @@ -217,6 +222,16 @@ interface WithLicenseType { WithCreate withLicenseType(ManagedInstanceLicenseType licenseType); } + /** + * The stage of the managedinstance update allowing to specify MaintenanceWindowSettings. + */ + interface WithMaintenanceWindowSettings { + /** + * Specifies maintenanceWindowSettings. + */ + WithCreate withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings); + } + /** * The stage of the managedinstance update allowing to specify ManagedInstanceCreateMode. */ @@ -322,13 +337,13 @@ interface WithVCores { * 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.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithInstancePoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithManagedInstanceCreateMode, DefinitionStages.WithProxyOverride, DefinitionStages.WithPublicDataEndpointEnabled, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSku, DefinitionStages.WithSourceManagedInstanceId, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithTimezoneId, DefinitionStages.WithVCores { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithInstancePoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithMaintenanceWindowSettings, DefinitionStages.WithManagedInstanceCreateMode, DefinitionStages.WithProxyOverride, DefinitionStages.WithPublicDataEndpointEnabled, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSku, DefinitionStages.WithSourceManagedInstanceId, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithTimezoneId, DefinitionStages.WithVCores { } } /** * The template for a ManagedInstance update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithInstancePoolId, UpdateStages.WithLicenseType, UpdateStages.WithManagedInstanceCreateMode, UpdateStages.WithProxyOverride, UpdateStages.WithPublicDataEndpointEnabled, UpdateStages.WithRestorePointInTime, UpdateStages.WithSku, UpdateStages.WithSourceManagedInstanceId, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithTimezoneId, UpdateStages.WithVCores { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithInstancePoolId, UpdateStages.WithLicenseType, UpdateStages.WithMaintenanceWindowSettings, UpdateStages.WithManagedInstanceCreateMode, UpdateStages.WithProxyOverride, UpdateStages.WithPublicDataEndpointEnabled, UpdateStages.WithRestorePointInTime, UpdateStages.WithSku, UpdateStages.WithSourceManagedInstanceId, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithTimezoneId, UpdateStages.WithVCores { } /** @@ -395,6 +410,16 @@ interface WithLicenseType { Update withLicenseType(ManagedInstanceLicenseType licenseType); } + /** + * The stage of the managedinstance {0} allowing to specify MaintenanceWindowSettings. + */ + interface WithMaintenanceWindowSettings { + /** + * Specifies maintenanceWindowSettings. + */ + Update withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings); + } + /** * The stage of the managedinstance {0} allowing to specify ManagedInstanceCreateMode. */ diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java index 5ce66ed3f1a5..95f5d090e4a8 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java @@ -159,6 +159,12 @@ public class ManagedInstanceUpdate { @JsonProperty(value = "properties.instancePoolId") private String instancePoolId; + /** + * Specifies maintenance window settings for a managed instance. + */ + @JsonProperty(value = "properties.maintenanceWindowSettings") + private MaintenanceWindowSettings maintenanceWindowSettings; + /** * Resource tags. */ @@ -526,6 +532,26 @@ public ManagedInstanceUpdate withInstancePoolId(String instancePoolId) { return this; } + /** + * Get specifies maintenance window settings for a managed instance. + * + * @return the maintenanceWindowSettings value + */ + public MaintenanceWindowSettings maintenanceWindowSettings() { + return this.maintenanceWindowSettings; + } + + /** + * Set specifies maintenance window settings for a managed instance. + * + * @param maintenanceWindowSettings the maintenanceWindowSettings value to set + * @return the ManagedInstanceUpdate object itself. + */ + public ManagedInstanceUpdate withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { + this.maintenanceWindowSettings = maintenanceWindowSettings; + return this; + } + /** * Get resource tags. * diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstances.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstances.java index 3d47531e94ea..c3949792e198 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstances.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstances.java @@ -22,14 +22,4 @@ * Type representing ManagedInstances. */ public interface ManagedInstances extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { - /** - * Gets a list of all managed instances in an instance pool. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param instancePoolName The instance pool name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName); - } diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java index a8518ba8dfc7..918ba661ca6d 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java @@ -18,6 +18,7 @@ import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedServerCreateMode; import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceLicenseType; import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceProxyOverride; +import com.microsoft.azure.management.sql.v2015_05_01_preview.MaintenanceWindowSettings; import rx.functions.Func1; class ManagedInstanceImpl extends GroupableResourceCoreImpl implements ManagedInstance, ManagedInstance.Definition, ManagedInstance.Update { @@ -115,6 +116,11 @@ public ManagedInstanceLicenseType licenseType() { return this.inner().licenseType(); } + @Override + public MaintenanceWindowSettings maintenanceWindowSettings() { + return this.inner().maintenanceWindowSettings(); + } + @Override public ManagedServerCreateMode managedInstanceCreateMode() { return this.inner().managedInstanceCreateMode(); @@ -236,6 +242,16 @@ public ManagedInstanceImpl withLicenseType(ManagedInstanceLicenseType licenseTyp return this; } + @Override + public ManagedInstanceImpl withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { + if (isInCreateMode()) { + this.inner().withMaintenanceWindowSettings(maintenanceWindowSettings); + } else { + this.updateParameter.withMaintenanceWindowSettings(maintenanceWindowSettings); + } + return this; + } + @Override public ManagedInstanceImpl withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { if (isInCreateMode()) { diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java index c1ce6158e575..e0d01a3893db 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java @@ -14,6 +14,7 @@ import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceLicenseType; import org.joda.time.DateTime; import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceProxyOverride; +import com.microsoft.azure.management.sql.v2015_05_01_preview.MaintenanceWindowSettings; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -171,6 +172,12 @@ public class ManagedInstanceInner extends Resource { @JsonProperty(value = "properties.instancePoolId") private String instancePoolId; + /** + * Specifies maintenance window settings for a managed instance. + */ + @JsonProperty(value = "properties.maintenanceWindowSettings") + private MaintenanceWindowSettings maintenanceWindowSettings; + /** * Get the Azure Active Directory identity of the managed instance. * @@ -552,4 +559,24 @@ public ManagedInstanceInner withInstancePoolId(String instancePoolId) { return this; } + /** + * Get specifies maintenance window settings for a managed instance. + * + * @return the maintenanceWindowSettings value + */ + public MaintenanceWindowSettings maintenanceWindowSettings() { + return this.maintenanceWindowSettings; + } + + /** + * Set specifies maintenance window settings for a managed instance. + * + * @param maintenanceWindowSettings the maintenanceWindowSettings value to set + * @return the ManagedInstanceInner object itself. + */ + public ManagedInstanceInner withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { + this.maintenanceWindowSettings = maintenanceWindowSettings; + return this; + } + } diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesImpl.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesImpl.java index 01f59dd6e278..97820344672d 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesImpl.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesImpl.java @@ -125,24 +125,6 @@ public ManagedInstanceImpl define(String name) { return wrapModel(name); } - @Override - public Observable listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName) { - ManagedInstancesInner client = this.inner(); - return client.listByInstancePoolAsync(resourceGroupName, instancePoolName) - .flatMapIterable(new Func1, Iterable>() { - @Override - public Iterable call(Page page) { - return page.items(); - } - }) - .map(new Func1() { - @Override - public ManagedInstance call(ManagedInstanceInner inner) { - return new ManagedInstanceImpl(inner.name(), inner, manager()); - } - }); - } - @Override protected ManagedInstanceImpl wrapModel(ManagedInstanceInner inner) { return new ManagedInstanceImpl(inner.name(), inner, manager()); diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java index 4c395d62b04d..4118fa516c9c 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstancesInner.java @@ -98,10 +98,6 @@ interface ManagedInstancesService { @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}") Observable> beginUpdate(@Path("resourceGroupName") String resourceGroupName, @Path("managedInstanceName") String managedInstanceName, @Path("subscriptionId") String subscriptionId, @Body ManagedInstanceUpdate parameters, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstances listByInstancePool" }) - @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances") - Observable> listByInstancePool(@Path("resourceGroupName") String resourceGroupName, @Path("instancePoolName") String instancePoolName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstances list" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -110,10 +106,6 @@ interface ManagedInstancesService { @GET Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstances listByInstancePoolNext" }) - @GET - Observable> listByInstancePoolNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstances listNext" }) @GET Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -821,129 +813,6 @@ private ServiceResponse beginUpdateDelegate(Response listByInstancePool(final String resourceGroupName, final String instancePoolName) { - ServiceResponse> response = listByInstancePoolSinglePageAsync(resourceGroupName, instancePoolName).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listByInstancePoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Gets a list of all managed instances in an instance pool. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param instancePoolName The instance pool 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> listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listByInstancePoolSinglePageAsync(resourceGroupName, instancePoolName), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listByInstancePoolNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Gets a list of all managed instances in an instance pool. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param instancePoolName The instance pool name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ManagedInstanceInner> object - */ - public Observable> listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName) { - return listByInstancePoolWithServiceResponseAsync(resourceGroupName, instancePoolName) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Gets a list of all managed instances in an instance pool. - * - * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - * @param instancePoolName The instance pool name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ManagedInstanceInner> object - */ - public Observable>> listByInstancePoolWithServiceResponseAsync(final String resourceGroupName, final String instancePoolName) { - return listByInstancePoolSinglePageAsync(resourceGroupName, instancePoolName) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listByInstancePoolNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Gets a list of all managed instances in an instance pool. - * - ServiceResponse> * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. - ServiceResponse> * @param instancePoolName The instance pool name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listByInstancePoolSinglePageAsync(final String resourceGroupName, final String instancePoolName) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (instancePoolName == null) { - throw new IllegalArgumentException("Parameter instancePoolName is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); - } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listByInstancePool(resourceGroupName, instancePoolName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByInstancePoolDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByInstancePoolDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Gets a list of all managed instances in the subscription. * @@ -1162,117 +1031,6 @@ private ServiceResponse> listByResourceGroupNextD .build(response); } - /** - * Gets a list of all managed instances in an instance pool. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the PagedList<ManagedInstanceInner> object if successful. - */ - public PagedList listByInstancePoolNext(final String nextPageLink) { - ServiceResponse> response = listByInstancePoolNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listByInstancePoolNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Gets a list of all managed instances in an instance pool. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listByInstancePoolNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listByInstancePoolNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listByInstancePoolNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Gets a list of all managed instances in an instance pool. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ManagedInstanceInner> object - */ - public Observable> listByInstancePoolNextAsync(final String nextPageLink) { - return listByInstancePoolNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Gets a list of all managed instances in an instance pool. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<ManagedInstanceInner> object - */ - public Observable>> listByInstancePoolNextWithServiceResponseAsync(final String nextPageLink) { - return listByInstancePoolNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listByInstancePoolNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Gets a list of all managed instances in an instance pool. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<ManagedInstanceInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listByInstancePoolNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listByInstancePoolNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listByInstancePoolNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listByInstancePoolNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Gets a list of all managed instances in the subscription. * From 321725e28d05f5a0cd4ce8af59dcbae1c6f5b305 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 25 Jun 2019 19:16:46 +0000 Subject: [PATCH 3/3] Generated from 1b3affbe12db0534680b3a83f81c9a98b1cc3d59 Remove maintenance window setting properties from managed instance swaggers --- .../v2015_05_01_preview/ManagedInstance.java | 29 ++----------------- .../ManagedInstanceUpdate.java | 26 ----------------- .../implementation/ManagedInstanceImpl.java | 16 ---------- .../implementation/ManagedInstanceInner.java | 27 ----------------- .../v2018_06_01_preview/ManagedInstance.java | 29 ++----------------- .../ManagedInstanceUpdate.java | 26 ----------------- .../implementation/ManagedInstanceImpl.java | 16 ---------- .../implementation/ManagedInstanceInner.java | 27 ----------------- 8 files changed, 4 insertions(+), 192 deletions(-) diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java index 99bba7d2a1e6..6076d497ae63 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstance.java @@ -70,11 +70,6 @@ public interface ManagedInstance extends HasInner, Resourc */ ManagedInstanceLicenseType licenseType(); - /** - * @return the maintenanceWindowSettings value. - */ - MaintenanceWindowSettings maintenanceWindowSettings(); - /** * @return the managedInstanceCreateMode value. */ @@ -222,16 +217,6 @@ interface WithLicenseType { WithCreate withLicenseType(ManagedInstanceLicenseType licenseType); } - /** - * The stage of the managedinstance update allowing to specify MaintenanceWindowSettings. - */ - interface WithMaintenanceWindowSettings { - /** - * Specifies maintenanceWindowSettings. - */ - WithCreate withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings); - } - /** * The stage of the managedinstance update allowing to specify ManagedInstanceCreateMode. */ @@ -337,13 +322,13 @@ interface WithVCores { * 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.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithInstancePoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithMaintenanceWindowSettings, DefinitionStages.WithManagedInstanceCreateMode, DefinitionStages.WithProxyOverride, DefinitionStages.WithPublicDataEndpointEnabled, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSku, DefinitionStages.WithSourceManagedInstanceId, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithTimezoneId, DefinitionStages.WithVCores { + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithInstancePoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithManagedInstanceCreateMode, DefinitionStages.WithProxyOverride, DefinitionStages.WithPublicDataEndpointEnabled, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSku, DefinitionStages.WithSourceManagedInstanceId, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithTimezoneId, DefinitionStages.WithVCores { } } /** * The template for a ManagedInstance update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithInstancePoolId, UpdateStages.WithLicenseType, UpdateStages.WithMaintenanceWindowSettings, UpdateStages.WithManagedInstanceCreateMode, UpdateStages.WithProxyOverride, UpdateStages.WithPublicDataEndpointEnabled, UpdateStages.WithRestorePointInTime, UpdateStages.WithSku, UpdateStages.WithSourceManagedInstanceId, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithTimezoneId, UpdateStages.WithVCores { + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithInstancePoolId, UpdateStages.WithLicenseType, UpdateStages.WithManagedInstanceCreateMode, UpdateStages.WithProxyOverride, UpdateStages.WithPublicDataEndpointEnabled, UpdateStages.WithRestorePointInTime, UpdateStages.WithSku, UpdateStages.WithSourceManagedInstanceId, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithTimezoneId, UpdateStages.WithVCores { } /** @@ -410,16 +395,6 @@ interface WithLicenseType { Update withLicenseType(ManagedInstanceLicenseType licenseType); } - /** - * The stage of the managedinstance {0} allowing to specify MaintenanceWindowSettings. - */ - interface WithMaintenanceWindowSettings { - /** - * Specifies maintenanceWindowSettings. - */ - Update withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings); - } - /** * The stage of the managedinstance {0} allowing to specify ManagedInstanceCreateMode. */ diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java index 95f5d090e4a8..5ce66ed3f1a5 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/ManagedInstanceUpdate.java @@ -159,12 +159,6 @@ public class ManagedInstanceUpdate { @JsonProperty(value = "properties.instancePoolId") private String instancePoolId; - /** - * Specifies maintenance window settings for a managed instance. - */ - @JsonProperty(value = "properties.maintenanceWindowSettings") - private MaintenanceWindowSettings maintenanceWindowSettings; - /** * Resource tags. */ @@ -532,26 +526,6 @@ public ManagedInstanceUpdate withInstancePoolId(String instancePoolId) { return this; } - /** - * Get specifies maintenance window settings for a managed instance. - * - * @return the maintenanceWindowSettings value - */ - public MaintenanceWindowSettings maintenanceWindowSettings() { - return this.maintenanceWindowSettings; - } - - /** - * Set specifies maintenance window settings for a managed instance. - * - * @param maintenanceWindowSettings the maintenanceWindowSettings value to set - * @return the ManagedInstanceUpdate object itself. - */ - public ManagedInstanceUpdate withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { - this.maintenanceWindowSettings = maintenanceWindowSettings; - return this; - } - /** * Get resource tags. * diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java index 918ba661ca6d..a8518ba8dfc7 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceImpl.java @@ -18,7 +18,6 @@ import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedServerCreateMode; import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceLicenseType; import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceProxyOverride; -import com.microsoft.azure.management.sql.v2015_05_01_preview.MaintenanceWindowSettings; import rx.functions.Func1; class ManagedInstanceImpl extends GroupableResourceCoreImpl implements ManagedInstance, ManagedInstance.Definition, ManagedInstance.Update { @@ -116,11 +115,6 @@ public ManagedInstanceLicenseType licenseType() { return this.inner().licenseType(); } - @Override - public MaintenanceWindowSettings maintenanceWindowSettings() { - return this.inner().maintenanceWindowSettings(); - } - @Override public ManagedServerCreateMode managedInstanceCreateMode() { return this.inner().managedInstanceCreateMode(); @@ -242,16 +236,6 @@ public ManagedInstanceImpl withLicenseType(ManagedInstanceLicenseType licenseTyp return this; } - @Override - public ManagedInstanceImpl withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { - if (isInCreateMode()) { - this.inner().withMaintenanceWindowSettings(maintenanceWindowSettings); - } else { - this.updateParameter.withMaintenanceWindowSettings(maintenanceWindowSettings); - } - return this; - } - @Override public ManagedInstanceImpl withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { if (isInCreateMode()) { diff --git a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java index e0d01a3893db..c1ce6158e575 100644 --- a/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java +++ b/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/ManagedInstanceInner.java @@ -14,7 +14,6 @@ import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceLicenseType; import org.joda.time.DateTime; import com.microsoft.azure.management.sql.v2015_05_01_preview.ManagedInstanceProxyOverride; -import com.microsoft.azure.management.sql.v2015_05_01_preview.MaintenanceWindowSettings; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -172,12 +171,6 @@ public class ManagedInstanceInner extends Resource { @JsonProperty(value = "properties.instancePoolId") private String instancePoolId; - /** - * Specifies maintenance window settings for a managed instance. - */ - @JsonProperty(value = "properties.maintenanceWindowSettings") - private MaintenanceWindowSettings maintenanceWindowSettings; - /** * Get the Azure Active Directory identity of the managed instance. * @@ -559,24 +552,4 @@ public ManagedInstanceInner withInstancePoolId(String instancePoolId) { return this; } - /** - * Get specifies maintenance window settings for a managed instance. - * - * @return the maintenanceWindowSettings value - */ - public MaintenanceWindowSettings maintenanceWindowSettings() { - return this.maintenanceWindowSettings; - } - - /** - * Set specifies maintenance window settings for a managed instance. - * - * @param maintenanceWindowSettings the maintenanceWindowSettings value to set - * @return the ManagedInstanceInner object itself. - */ - public ManagedInstanceInner withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { - this.maintenanceWindowSettings = maintenanceWindowSettings; - return this; - } - } diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstance.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstance.java index 412bec59c583..c1cfa1055c84 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstance.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstance.java @@ -78,11 +78,6 @@ public interface ManagedInstance extends HasInner, Indexab */ String location(); - /** - * @return the maintenanceWindowSettings value. - */ - MaintenanceWindowSettings maintenanceWindowSettings(); - /** * @return the managedInstanceCreateMode value. */ @@ -259,16 +254,6 @@ interface WithLicenseType { WithCreate withLicenseType(ManagedInstanceLicenseType licenseType); } - /** - * The stage of the managedinstance definition allowing to specify MaintenanceWindowSettings. - */ - interface WithMaintenanceWindowSettings { - /** - * Specifies maintenanceWindowSettings. - */ - WithCreate withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings); - } - /** * The stage of the managedinstance definition allowing to specify ManagedInstanceCreateMode. */ @@ -384,13 +369,13 @@ interface WithVCores { * 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.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithInstancePoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithMaintenanceWindowSettings, DefinitionStages.WithManagedInstanceCreateMode, DefinitionStages.WithProxyOverride, DefinitionStages.WithPublicDataEndpointEnabled, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSku, DefinitionStages.WithSourceManagedInstanceId, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithTags, DefinitionStages.WithTimezoneId, DefinitionStages.WithVCores { + interface WithCreate extends Creatable, DefinitionStages.WithAdministratorLogin, DefinitionStages.WithAdministratorLoginPassword, DefinitionStages.WithCollation, DefinitionStages.WithDnsZonePartner, DefinitionStages.WithIdentity, DefinitionStages.WithInstancePoolId, DefinitionStages.WithLicenseType, DefinitionStages.WithManagedInstanceCreateMode, DefinitionStages.WithProxyOverride, DefinitionStages.WithPublicDataEndpointEnabled, DefinitionStages.WithRestorePointInTime, DefinitionStages.WithSku, DefinitionStages.WithSourceManagedInstanceId, DefinitionStages.WithStorageSizeInGB, DefinitionStages.WithSubnetId, DefinitionStages.WithTags, DefinitionStages.WithTimezoneId, DefinitionStages.WithVCores { } } /** * The template for a ManagedInstance update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithInstancePoolId, UpdateStages.WithLicenseType, UpdateStages.WithMaintenanceWindowSettings, UpdateStages.WithManagedInstanceCreateMode, UpdateStages.WithProxyOverride, UpdateStages.WithPublicDataEndpointEnabled, UpdateStages.WithRestorePointInTime, UpdateStages.WithSku, UpdateStages.WithSourceManagedInstanceId, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithTags, UpdateStages.WithTimezoneId, UpdateStages.WithVCores { + interface Update extends Appliable, UpdateStages.WithAdministratorLogin, UpdateStages.WithAdministratorLoginPassword, UpdateStages.WithCollation, UpdateStages.WithDnsZonePartner, UpdateStages.WithInstancePoolId, UpdateStages.WithLicenseType, UpdateStages.WithManagedInstanceCreateMode, UpdateStages.WithProxyOverride, UpdateStages.WithPublicDataEndpointEnabled, UpdateStages.WithRestorePointInTime, UpdateStages.WithSku, UpdateStages.WithSourceManagedInstanceId, UpdateStages.WithStorageSizeInGB, UpdateStages.WithSubnetId, UpdateStages.WithTags, UpdateStages.WithTimezoneId, UpdateStages.WithVCores { } /** @@ -457,16 +442,6 @@ interface WithLicenseType { Update withLicenseType(ManagedInstanceLicenseType licenseType); } - /** - * The stage of the managedinstance update allowing to specify MaintenanceWindowSettings. - */ - interface WithMaintenanceWindowSettings { - /** - * Specifies maintenanceWindowSettings. - */ - Update withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings); - } - /** * The stage of the managedinstance update allowing to specify ManagedInstanceCreateMode. */ diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceUpdate.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceUpdate.java index f6cca3243564..0c20255f357d 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceUpdate.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/ManagedInstanceUpdate.java @@ -159,12 +159,6 @@ public class ManagedInstanceUpdate { @JsonProperty(value = "properties.instancePoolId") private String instancePoolId; - /** - * Specifies maintenance window settings for a managed instance. - */ - @JsonProperty(value = "properties.maintenanceWindowSettings") - private MaintenanceWindowSettings maintenanceWindowSettings; - /** * Resource tags. */ @@ -532,26 +526,6 @@ public ManagedInstanceUpdate withInstancePoolId(String instancePoolId) { return this; } - /** - * Get specifies maintenance window settings for a managed instance. - * - * @return the maintenanceWindowSettings value - */ - public MaintenanceWindowSettings maintenanceWindowSettings() { - return this.maintenanceWindowSettings; - } - - /** - * Set specifies maintenance window settings for a managed instance. - * - * @param maintenanceWindowSettings the maintenanceWindowSettings value to set - * @return the ManagedInstanceUpdate object itself. - */ - public ManagedInstanceUpdate withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { - this.maintenanceWindowSettings = maintenanceWindowSettings; - return this; - } - /** * Get resource tags. * diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceImpl.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceImpl.java index eaa89f93e335..46de347ec953 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceImpl.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceImpl.java @@ -19,7 +19,6 @@ import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedServerCreateMode; import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceLicenseType; import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceProxyOverride; -import com.microsoft.azure.management.sql.v2018_06_01_preview.MaintenanceWindowSettings; import rx.functions.Func1; class ManagedInstanceImpl extends CreatableUpdatableImpl implements ManagedInstance, ManagedInstance.Definition, ManagedInstance.Update { @@ -152,11 +151,6 @@ public String location() { return this.inner().location(); } - @Override - public MaintenanceWindowSettings maintenanceWindowSettings() { - return this.inner().maintenanceWindowSettings(); - } - @Override public ManagedServerCreateMode managedInstanceCreateMode() { return this.inner().managedInstanceCreateMode(); @@ -305,16 +299,6 @@ public ManagedInstanceImpl withLicenseType(ManagedInstanceLicenseType licenseTyp return this; } - @Override - public ManagedInstanceImpl withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { - if (isInCreateMode()) { - this.inner().withMaintenanceWindowSettings(maintenanceWindowSettings); - } else { - this.updateParameter.withMaintenanceWindowSettings(maintenanceWindowSettings); - } - return this; - } - @Override public ManagedInstanceImpl withManagedInstanceCreateMode(ManagedServerCreateMode managedInstanceCreateMode) { if (isInCreateMode()) { diff --git a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceInner.java b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceInner.java index fb8c0cacffa8..4d6fb0e76619 100644 --- a/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceInner.java +++ b/sql/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/sql/v2018_06_01_preview/implementation/ManagedInstanceInner.java @@ -14,7 +14,6 @@ import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceLicenseType; import org.joda.time.DateTime; import com.microsoft.azure.management.sql.v2018_06_01_preview.ManagedInstanceProxyOverride; -import com.microsoft.azure.management.sql.v2018_06_01_preview.MaintenanceWindowSettings; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; import com.microsoft.azure.Resource; @@ -172,12 +171,6 @@ public class ManagedInstanceInner extends Resource { @JsonProperty(value = "properties.instancePoolId") private String instancePoolId; - /** - * Specifies maintenance window settings for a managed instance. - */ - @JsonProperty(value = "properties.maintenanceWindowSettings") - private MaintenanceWindowSettings maintenanceWindowSettings; - /** * Get the Azure Active Directory identity of the managed instance. * @@ -559,24 +552,4 @@ public ManagedInstanceInner withInstancePoolId(String instancePoolId) { return this; } - /** - * Get specifies maintenance window settings for a managed instance. - * - * @return the maintenanceWindowSettings value - */ - public MaintenanceWindowSettings maintenanceWindowSettings() { - return this.maintenanceWindowSettings; - } - - /** - * Set specifies maintenance window settings for a managed instance. - * - * @param maintenanceWindowSettings the maintenanceWindowSettings value to set - * @return the ManagedInstanceInner object itself. - */ - public ManagedInstanceInner withMaintenanceWindowSettings(MaintenanceWindowSettings maintenanceWindowSettings) { - this.maintenanceWindowSettings = maintenanceWindowSettings; - return this; - } - }