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 mgmt-v2016_11_01] [T2] datalakestore for python track2 #6231

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 5 additions & 3 deletions sdk/datalakestore/mgmt-v2016_11_01/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<parent>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-arm-parent</artifactId>
<version>1.2.0</version>
<relativePath>../../parents/azure-arm-parent</relativePath>
<version>1.1.0</version>
<relativePath>../../../pom.management.xml</relativePath>
</parent>
<artifactId>azure-mgmt-datalakestore</artifactId>
<version>1.0.0-beta-2</version>
<version>1.0.0-beta</version>
<packaging>jar</packaging>
<name>Microsoft Azure SDK for DataLakeStore Management</name>
<description>This package contains Microsoft DataLakeStore Management SDK.</description>
Expand Down Expand Up @@ -71,6 +71,8 @@
<artifactId>azure-arm-client-runtime</artifactId>
<type>test-jar</type>
<scope>test</scope>
<!--Below version for test jar needs to be removed, this will be done as part of v1-runtime 1.6.7-->
<version>1.6.5</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ interface WithFirewallRules {
* @param firewallRules The list of firewall rules associated with this Data Lake Store account
* @return the next definition stage
*/
WithCreate withFirewallRulesForCreate(List<CreateFirewallRuleWithAccountParameters> firewallRules);
WithCreate withFirewallRules(List<CreateFirewallRuleWithAccountParameters> firewallRules);
}

/**
Expand Down Expand Up @@ -249,7 +249,7 @@ interface WithTrustedIdProviders {
* @param trustedIdProviders The list of trusted identity providers associated with this Data Lake Store account
* @return the next definition stage
*/
WithCreate withTrustedIdProvidersForCreate(List<CreateTrustedIdProviderWithAccountParameters> trustedIdProviders);
WithCreate withTrustedIdProviders(List<CreateTrustedIdProviderWithAccountParameters> trustedIdProviders);
}

/**
Expand All @@ -273,7 +273,7 @@ interface WithVirtualNetworkRules {
* @param virtualNetworkRules The list of virtual network rules associated with this Data Lake Store account
* @return the next definition stage
*/
WithCreate withVirtualNetworkRulesForCreate(List<CreateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules);
WithCreate withVirtualNetworkRules(List<CreateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules);
}

/**
Expand Down Expand Up @@ -339,7 +339,7 @@ interface WithFirewallRules {
* @param firewallRules The list of firewall rules associated with this Data Lake Store account
* @return the next update stage
*/
Update withFirewallRulesForUpdate(List<UpdateFirewallRuleWithAccountParameters> firewallRules);
Update withFirewallRules(List<UpdateFirewallRuleWithAccountParameters> firewallRules);
}

/**
Expand Down Expand Up @@ -375,7 +375,7 @@ interface WithTrustedIdProviders {
* @param trustedIdProviders The list of trusted identity providers associated with this Data Lake Store account
* @return the next update stage
*/
Update withTrustedIdProvidersForUpdate(List<UpdateTrustedIdProviderWithAccountParameters> trustedIdProviders);
Update withTrustedIdProviders(List<UpdateTrustedIdProviderWithAccountParameters> trustedIdProviders);
}

/**
Expand All @@ -399,7 +399,7 @@ interface WithVirtualNetworkRules {
* @param virtualNetworkRules The list of virtual network rules associated with this Data Lake Store account
* @return the next update stage
*/
Update withVirtualNetworkRulesForUpdate(List<UpdateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules);
Update withVirtualNetworkRules(List<UpdateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
* Type representing Locations.
*/
public interface Locations extends HasInner<LocationsInner> {
/**
* Gets the current usage count and the limit for the resources of the location under the subscription.
*
* @param location The resource location without whitespace.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<Usage> getUsageAsync(String location);

/**
* Gets subscription-level properties and limits for Data Lake Store specified by resource location.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.datalakestore.v2016_11_01;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.UsageInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.datalakestore.v2016_11_01.implementation.DataLakeStoreManager;

/**
* Type representing Usage.
*/
public interface Usage extends HasInner<UsageInner>, HasManager<DataLakeStoreManager> {
/**
* @return the currentValue value.
*/
Integer currentValue();

/**
* @return the id value.
*/
String id();

/**
* @return the limit value.
*/
Integer limit();

/**
* @return the name value.
*/
UsageName name();

/**
* @return the unit value.
*/
UsageUnit unit();

}
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.datalakestore.v2016_11_01;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* The usage names that can be used.
*/
public class UsageName {
/**
* Gets a string describing the resource name.
*/
@JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
private String value;

/**
* Gets a localized string describing the resource name.
*/
@JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY)
private String localizedValue;

/**
* Get gets a string describing the resource name.
*
* @return the value value
*/
public String value() {
return this.value;
}

/**
* Get gets a localized string describing the resource name.
*
* @return the localizedValue value
*/
public String localizedValue() {
return this.localizedValue;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.datalakestore.v2016_11_01;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
* Defines values for UsageUnit.
*/
public enum UsageUnit {
/** Enum value Count. */
COUNT("Count"),

/** Enum value Bytes. */
BYTES("Bytes"),

/** Enum value Seconds. */
SECONDS("Seconds"),

/** Enum value Percent. */
PERCENT("Percent"),

/** Enum value CountsPerSecond. */
COUNTS_PER_SECOND("CountsPerSecond"),

/** Enum value BytesPerSecond. */
BYTES_PER_SECOND("BytesPerSecond");

/** The actual serialized value for a UsageUnit instance. */
private String value;

UsageUnit(String value) {
this.value = value;
}

/**
* Parses a serialized value to a UsageUnit instance.
*
* @param value the serialized value to parse.
* @return the parsed UsageUnit object, or null if unable to parse.
*/
@JsonCreator
public static UsageUnit fromString(String value) {
UsageUnit[] items = UsageUnit.values();
for (UsageUnit item : items) {
if (item.toString().equalsIgnoreCase(value)) {
return item;
}
}
return null;
}

@JsonValue
@Override
public String toString() {
return this.value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public DataLakeStoreAccountImpl withEncryptionState(EncryptionState encryptionSt
}

@Override
public DataLakeStoreAccountImpl withFirewallRulesForCreate(List<CreateFirewallRuleWithAccountParameters> firewallRules) {
public DataLakeStoreAccountImpl withFirewallRules(List<CreateFirewallRuleWithAccountParameters> firewallRules) {
this.createParameter.withFirewallRules(firewallRules);
return this;
}
Expand All @@ -232,13 +232,13 @@ public DataLakeStoreAccountImpl withIdentity(EncryptionIdentity identity) {
}

@Override
public DataLakeStoreAccountImpl withTrustedIdProvidersForCreate(List<CreateTrustedIdProviderWithAccountParameters> trustedIdProviders) {
public DataLakeStoreAccountImpl withTrustedIdProviders(List<CreateTrustedIdProviderWithAccountParameters> trustedIdProviders) {
this.createParameter.withTrustedIdProviders(trustedIdProviders);
return this;
}

@Override
public DataLakeStoreAccountImpl withVirtualNetworkRulesForCreate(List<CreateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules) {
public DataLakeStoreAccountImpl withVirtualNetworkRules(List<CreateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules) {
this.createParameter.withVirtualNetworkRules(virtualNetworkRules);
return this;
}
Expand All @@ -250,19 +250,19 @@ public DataLakeStoreAccountImpl withEncryptionConfig(UpdateEncryptionConfig encr
}

@Override
public DataLakeStoreAccountImpl withFirewallRulesForUpdate(List<UpdateFirewallRuleWithAccountParameters> firewallRules) {
public DataLakeStoreAccountImpl withFirewallRules(List<UpdateFirewallRuleWithAccountParameters> firewallRules) {
this.updateParameter.withFirewallRules(firewallRules);
return this;
}

@Override
public DataLakeStoreAccountImpl withTrustedIdProvidersForUpdate(List<UpdateTrustedIdProviderWithAccountParameters> trustedIdProviders) {
public DataLakeStoreAccountImpl withTrustedIdProviders(List<UpdateTrustedIdProviderWithAccountParameters> trustedIdProviders) {
this.updateParameter.withTrustedIdProviders(trustedIdProviders);
return this;
}

@Override
public DataLakeStoreAccountImpl withVirtualNetworkRulesForUpdate(List<UpdateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules) {
public DataLakeStoreAccountImpl withVirtualNetworkRules(List<UpdateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules) {
this.updateParameter.withVirtualNetworkRules(virtualNetworkRules);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FirewallRuleImpl extends CreatableUpdatableImpl<FirewallRule, FirewallRule
this.manager = manager;
// Set resource name
this.firewallRuleName = inner.name();
// resource ancestor names
// set resource ancestor and positional variables
this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups");
this.accountName = IdParsingUtils.getValueFromIdByName(inner.id(), "accounts");
this.firewallRuleName = IdParsingUtils.getValueFromIdByName(inner.id(), "firewallRules");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ public FirewallRule call(FirewallRuleInner inner) {
public Observable<FirewallRule> getAsync(String resourceGroupName, String accountName, String firewallRuleName) {
FirewallRulesInner client = this.inner();
return client.getAsync(resourceGroupName, accountName, firewallRuleName)
.map(new Func1<FirewallRuleInner, FirewallRule>() {
.flatMap(new Func1<FirewallRuleInner, Observable<FirewallRule>>() {
@Override
public FirewallRule call(FirewallRuleInner inner) {
return wrapModel(inner);
public Observable<FirewallRule> call(FirewallRuleInner inner) {
if (inner == null) {
return Observable.empty();
} else {
return Observable.just((FirewallRule)wrapModel(inner));
}
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* abc
*
*/

package com.microsoft.azure.management.datalakestore.v2016_11_01.implementation;

import com.microsoft.azure.arm.model.implementation.WrapperImpl;
import com.microsoft.azure.management.datalakestore.v2016_11_01.Locations;
import rx.functions.Func1;
import rx.Observable;
import rx.functions.Func1;
import java.util.List;
import com.microsoft.azure.management.datalakestore.v2016_11_01.Usage;
import com.microsoft.azure.management.datalakestore.v2016_11_01.CapabilityInformation;

class LocationsImpl extends WrapperImpl<LocationsInner> implements Locations {
Expand All @@ -27,6 +29,28 @@ public DataLakeStoreManager manager() {
return this.manager;
}

private UsageImpl wrapModel(UsageInner inner) {
return new UsageImpl(inner, manager());
}

@Override
public Observable<Usage> getUsageAsync(String location) {
LocationsInner client = this.inner();
return client.getUsageAsync(location)
.flatMap(new Func1<List<UsageInner>, Observable<UsageInner>>() {
@Override
public Observable<UsageInner> call(List<UsageInner> innerList) {
return Observable.from(innerList);
}
})
.map(new Func1<UsageInner, Usage>() {
@Override
public Usage call(UsageInner inner) {
return wrapModel(inner);
}
});
}

@Override
public Observable<CapabilityInformation> getCapabilityAsync(String location) {
LocationsInner client = this.inner();
Expand Down
Loading