Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR sql/resource-manager] Add managed instances swagger to 2018-06-01-preview #4095

Merged
merged 3 commits into from
Jun 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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<MaintenanceWindowFrequency> {
/** 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<MaintenanceWindowFrequency> values() {
return values(MaintenanceWindowFrequency.class);
}
}
Original file line number Diff line number Diff line change
@@ -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<Integer> dates;

/**
* Specifies days in a week when maintenance window is to be opened.
*/
@JsonProperty(value = "scheduledDays")
private List<String> 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<Integer> 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<Integer> 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<Integer> 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<String> 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<String> 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<Integer> 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<Integer> 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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,4 @@
* Type representing ManagedInstances.
*/
public interface ManagedInstances extends SupportsCreating<ManagedInstance.DefinitionStages.Blank>, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup<ManagedInstance>, SupportsListingByResourceGroup<ManagedInstance>, SupportsListing<ManagedInstance>, HasInner<ManagedInstancesInner> {
/**
* 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<ManagedInstance> listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName);

}
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,6 @@ public ManagedInstanceImpl define(String name) {
return wrapModel(name);
}

@Override
public Observable<ManagedInstance> listByInstancePoolAsync(final String resourceGroupName, final String instancePoolName) {
ManagedInstancesInner client = this.inner();
return client.listByInstancePoolAsync(resourceGroupName, instancePoolName)
.flatMapIterable(new Func1<Page<ManagedInstanceInner>, Iterable<ManagedInstanceInner>>() {
@Override
public Iterable<ManagedInstanceInner> call(Page<ManagedInstanceInner> page) {
return page.items();
}
})
.map(new Func1<ManagedInstanceInner, ManagedInstance>() {
@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());
Expand Down
Loading