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 azure-resourcemanager-netapp] [NetAppFiles] Code generation Fix for csharp autorest codegen #553

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
4 changes: 3 additions & 1 deletion sdk/netapp/azure-resourcemanager-netapp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.9 (Unreleased)
## 1.0.0-beta.1 (2022-05-25)

- Azure Resource Manager NetAppFiles client library for Java. This package contains Microsoft Azure SDK for NetAppFiles Management SDK. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2022-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
4 changes: 2 additions & 2 deletions sdk/netapp/azure-resourcemanager-netapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager NetAppFiles client library for Java.

This package contains Microsoft Azure SDK for NetAppFiles Management SDK. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2021-10-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for NetAppFiles Management SDK. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2022-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-netapp</artifactId>
<version>1.0.0-beta.8</version>
<version>1.0.0-beta.9</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
380 changes: 311 additions & 69 deletions sdk/netapp/azure-resourcemanager-netapp/SAMPLE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/netapp/azure-resourcemanager-netapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for NetAppFiles Management</name>
<description>This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2021-10-01.</description>
<description>This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2022-01-01.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
Expand All @@ -36,6 +38,7 @@
import com.azure.resourcemanager.netapp.implementation.SubvolumesImpl;
import com.azure.resourcemanager.netapp.implementation.VaultsImpl;
import com.azure.resourcemanager.netapp.implementation.VolumeGroupsImpl;
import com.azure.resourcemanager.netapp.implementation.VolumeQuotaRulesImpl;
import com.azure.resourcemanager.netapp.implementation.VolumesImpl;
import com.azure.resourcemanager.netapp.models.AccountBackups;
import com.azure.resourcemanager.netapp.models.Accounts;
Expand All @@ -50,6 +53,7 @@
import com.azure.resourcemanager.netapp.models.Subvolumes;
import com.azure.resourcemanager.netapp.models.Vaults;
import com.azure.resourcemanager.netapp.models.VolumeGroups;
import com.azure.resourcemanager.netapp.models.VolumeQuotaRules;
import com.azure.resourcemanager.netapp.models.Volumes;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
Expand Down Expand Up @@ -82,6 +86,8 @@ public final class NetAppFilesManager {

private BackupPolicies backupPolicies;

private VolumeQuotaRules volumeQuotaRules;

private Vaults vaults;

private VolumeGroups volumeGroups;
Expand Down Expand Up @@ -115,6 +121,19 @@ public static NetAppFilesManager authenticate(TokenCredential credential, AzureP
return configure().authenticate(credential, profile);
}

/**
* Creates an instance of NetAppFiles service API entry point.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the NetAppFiles service API instance.
*/
public static NetAppFilesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new NetAppFilesManager(httpPipeline, profile, null);
}

/**
* Gets a Configurable instance that can be used to create NetAppFilesManager with optional configuration.
*
Expand All @@ -126,13 +145,14 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
private final List<String> scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private RetryOptions retryOptions;
private Duration defaultPollInterval;

private Configurable() {
Expand Down Expand Up @@ -193,16 +213,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
*/
public Configurable withRetryOptions(RetryOptions retryOptions) {
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
return this;
}

/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
* @param defaultPollInterval the default poll interval.
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand All @@ -224,7 +259,7 @@ public NetAppFilesManager authenticate(TokenCredential credential, AzureProfile
.append("-")
.append("com.azure.resourcemanager.netapp")
.append("/")
.append("1.0.0-beta.8");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -242,10 +277,15 @@ public NetAppFilesManager authenticate(TokenCredential credential, AzureProfile
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
if (retryOptions != null) {
retryPolicy = new RetryPolicy(retryOptions);
} else {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
Expand Down Expand Up @@ -276,23 +316,35 @@ public NetAppFilesManager authenticate(TokenCredential credential, AzureProfile
}
}

/** @return Resource collection API of Operations. */
/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/** @return Resource collection API of NetAppResources. */
/**
* Gets the resource collection API of NetAppResources.
*
* @return Resource collection API of NetAppResources.
*/
public NetAppResources netAppResources() {
if (this.netAppResources == null) {
this.netAppResources = new NetAppResourcesImpl(clientObject.getNetAppResources(), this);
}
return netAppResources;
}

/** @return Resource collection API of NetAppResourceQuotaLimits. */
/**
* Gets the resource collection API of NetAppResourceQuotaLimits.
*
* @return Resource collection API of NetAppResourceQuotaLimits.
*/
public NetAppResourceQuotaLimits netAppResourceQuotaLimits() {
if (this.netAppResourceQuotaLimits == null) {
this.netAppResourceQuotaLimits =
Expand All @@ -301,87 +353,143 @@ public NetAppResourceQuotaLimits netAppResourceQuotaLimits() {
return netAppResourceQuotaLimits;
}

/** @return Resource collection API of Accounts. */
/**
* Gets the resource collection API of Accounts. It manages NetAppAccount.
*
* @return Resource collection API of Accounts.
*/
public Accounts accounts() {
if (this.accounts == null) {
this.accounts = new AccountsImpl(clientObject.getAccounts(), this);
}
return accounts;
}

/** @return Resource collection API of Pools. */
/**
* Gets the resource collection API of Pools. It manages CapacityPool.
*
* @return Resource collection API of Pools.
*/
public Pools pools() {
if (this.pools == null) {
this.pools = new PoolsImpl(clientObject.getPools(), this);
}
return pools;
}

/** @return Resource collection API of Volumes. */
/**
* Gets the resource collection API of Volumes. It manages Volume.
*
* @return Resource collection API of Volumes.
*/
public Volumes volumes() {
if (this.volumes == null) {
this.volumes = new VolumesImpl(clientObject.getVolumes(), this);
}
return volumes;
}

/** @return Resource collection API of Snapshots. */
/**
* Gets the resource collection API of Snapshots. It manages Snapshot.
*
* @return Resource collection API of Snapshots.
*/
public Snapshots snapshots() {
if (this.snapshots == null) {
this.snapshots = new SnapshotsImpl(clientObject.getSnapshots(), this);
}
return snapshots;
}

/** @return Resource collection API of SnapshotPolicies. */
/**
* Gets the resource collection API of SnapshotPolicies. It manages SnapshotPolicy.
*
* @return Resource collection API of SnapshotPolicies.
*/
public SnapshotPolicies snapshotPolicies() {
if (this.snapshotPolicies == null) {
this.snapshotPolicies = new SnapshotPoliciesImpl(clientObject.getSnapshotPolicies(), this);
}
return snapshotPolicies;
}

/** @return Resource collection API of Backups. */
/**
* Gets the resource collection API of Backups. It manages Backup.
*
* @return Resource collection API of Backups.
*/
public Backups backups() {
if (this.backups == null) {
this.backups = new BackupsImpl(clientObject.getBackups(), this);
}
return backups;
}

/** @return Resource collection API of AccountBackups. */
/**
* Gets the resource collection API of AccountBackups.
*
* @return Resource collection API of AccountBackups.
*/
public AccountBackups accountBackups() {
if (this.accountBackups == null) {
this.accountBackups = new AccountBackupsImpl(clientObject.getAccountBackups(), this);
}
return accountBackups;
}

/** @return Resource collection API of BackupPolicies. */
/**
* Gets the resource collection API of BackupPolicies. It manages BackupPolicy.
*
* @return Resource collection API of BackupPolicies.
*/
public BackupPolicies backupPolicies() {
if (this.backupPolicies == null) {
this.backupPolicies = new BackupPoliciesImpl(clientObject.getBackupPolicies(), this);
}
return backupPolicies;
}

/** @return Resource collection API of Vaults. */
/**
* Gets the resource collection API of VolumeQuotaRules. It manages VolumeQuotaRule.
*
* @return Resource collection API of VolumeQuotaRules.
*/
public VolumeQuotaRules volumeQuotaRules() {
if (this.volumeQuotaRules == null) {
this.volumeQuotaRules = new VolumeQuotaRulesImpl(clientObject.getVolumeQuotaRules(), this);
}
return volumeQuotaRules;
}

/**
* Gets the resource collection API of Vaults.
*
* @return Resource collection API of Vaults.
*/
public Vaults vaults() {
if (this.vaults == null) {
this.vaults = new VaultsImpl(clientObject.getVaults(), this);
}
return vaults;
}

/** @return Resource collection API of VolumeGroups. */
/**
* Gets the resource collection API of VolumeGroups. It manages VolumeGroupDetails.
*
* @return Resource collection API of VolumeGroups.
*/
public VolumeGroups volumeGroups() {
if (this.volumeGroups == null) {
this.volumeGroups = new VolumeGroupsImpl(clientObject.getVolumeGroups(), this);
}
return volumeGroups;
}

/** @return Resource collection API of Subvolumes. */
/**
* Gets the resource collection API of Subvolumes. It manages SubvolumeInfo.
*
* @return Resource collection API of Subvolumes.
*/
public Subvolumes subvolumes() {
if (this.subvolumes == null) {
this.subvolumes = new SubvolumesImpl(clientObject.getSubvolumes(), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ public interface NetAppManagementClient {
*/
BackupPoliciesClient getBackupPolicies();

/**
* Gets the VolumeQuotaRulesClient object to access its operations.
*
* @return the VolumeQuotaRulesClient object.
*/
VolumeQuotaRulesClient getVolumeQuotaRules();

/**
* Gets the VaultsClient object to access its operations.
*
Expand Down
Loading