Skip to content

Commit

Permalink
fix checkstyle (Azure#12019)
Browse files Browse the repository at this point in the history
* fix checkstyle

* add ungrouped operation name

* regen app service

* fix compile error
  • Loading branch information
ChenTanyi authored Jun 10, 2020
1 parent 0636e82 commit 4e61822
Show file tree
Hide file tree
Showing 33 changed files with 3,160 additions and 2,934 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
/** Entry point to Azure storage resource management. */
public final class AppServiceManager extends Manager<AppServiceManager, WebSiteManagementClient> {
// Managers
private AuthorizationManager authorizationManager;
private KeyVaultManager keyVaultManager;
private StorageManager storageManager;
private final AuthorizationManager authorizationManager;
private final KeyVaultManager keyVaultManager;
private final StorageManager storageManager;
// Collections
private WebApps webApps;
private AppServicePlans appServicePlans;
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing;
import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.io.InputStream;
import java.io.SequenceInputStream;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.List;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in WebApps. */
public final class WebAppsClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ Mono<SlotConfigNamesResourceInner> listSlotConfigurations() {

@Override
Mono<SlotConfigNamesResourceInner> updateSlotConfigurations(SlotConfigNamesResourceInner inner) {
return this.manager().inner().getWebApps().updateSlotConfigurationNamesAsync(resourceGroupName(), name(), inner);
return this.manager().inner().getWebApps()
.updateSlotConfigurationNamesAsync(resourceGroupName(), name(), inner);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ Mono<StringDictionaryInner> updateAppSettings(StringDictionaryInner inner) {

@Override
Mono<ConnectionStringDictionaryInner> listConnectionStrings() {
return manager().inner().getWebApps().listConnectionStringsSlotAsync(resourceGroupName(), parent().name(), name());
return manager().inner().getWebApps()
.listConnectionStringsSlotAsync(resourceGroupName(), parent().name(), name());
}

@Override
Expand Down Expand Up @@ -434,7 +435,8 @@ public byte[] getContainerLogsZip() {
public Mono<byte[]> getContainerLogsZipAsync() {
return FluxUtil
.collectBytesInByteBufferStream(
manager().inner().getWebApps().getContainerLogsZipSlotAsync(resourceGroupName(), parent().name(), name()));
manager().inner().getWebApps()
.getContainerLogsZipSlotAsync(resourceGroupName(), parent().name(), name()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Mono<SourceControlInner> registerGithubAccessToken() {
return Mono.empty();
}
SourceControlInner sourceControlInner = new SourceControlInner().withToken(githubAccessToken);
return this.parent().manager().inner().updateSourceControlAsync("Github", sourceControlInner);
return this.parent().manager().inner().getResourceProviders()
.updateSourceControlAsync("Github", sourceControlInner);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ public class ActiveDirectoryApplicationsImpl
private ApplicationsClient innerCollection;
private AuthorizationManager manager;

public ActiveDirectoryApplicationsImpl(final ApplicationsClient client, final AuthorizationManager authorizationManager) {
public ActiveDirectoryApplicationsImpl(
final ApplicationsClient client, final AuthorizationManager authorizationManager) {
this.innerCollection = client;
this.manager = authorizationManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public interface IdProvider {
* @param taskGroup the pre-run task group after which role assignments create/remove tasks should run
* @param idProvider the provider that provides service principal id and resource id
*/
public RoleAssignmentHelper(final AuthorizationManager authorizationManager, TaskGroup taskGroup, IdProvider idProvider) {
public RoleAssignmentHelper(
final AuthorizationManager authorizationManager, TaskGroup taskGroup, IdProvider idProvider) {
this.authorizationManager = Objects.requireNonNull(authorizationManager);
this.idProvider = Objects.requireNonNull(idProvider);
this.preRunTaskGroup = Objects.requireNonNull(taskGroup);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public class ServicePrincipalsImpl
private ServicePrincipalsClient innerCollection;
private AuthorizationManager manager;

public ServicePrincipalsImpl(final ServicePrincipalsClient client, final AuthorizationManager authorizationManager) {
public ServicePrincipalsImpl(
final ServicePrincipalsClient client, final AuthorizationManager authorizationManager) {
this.innerCollection = client;
this.manager = authorizationManager;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

/** An immutable client-side representation of an Azure AD role definition. */
@Fluent
public interface RoleDefinition extends HasInner<RoleDefinitionInner>, HasId, HasName, HasManager<AuthorizationManager> {
public interface RoleDefinition
extends HasInner<RoleDefinitionInner>, HasId, HasName, HasManager<AuthorizationManager> {
/** @return the role name */
String roleName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public final class ContainerRegistryManager
extends Manager<ContainerRegistryManager, ContainerRegistryManagementClient> {
// The service managers
private RegistriesImpl registries;
private StorageManager storageManager;
private final StorageManager storageManager;
private RegistryTasksImpl tasks;
private RegistryTaskRunsImpl registryTaskRuns;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ interface SourceControlType {
* @param sourceControl the source control the user wishes to use.
* @return the next stage of the container registry source trigger definition.
*/
Update withSourceControl(com.azure.resourcemanager.containerregistry.models.SourceControlType sourceControl);
Update withSourceControl(
com.azure.resourcemanager.containerregistry.models.SourceControlType sourceControl);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ public Mono<NotebookWorkspaceInner> createOrUpdateAsync(
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName Cosmos DB database account name.
* @param notebookCreateUpdateParameters The notebook workspace to create for the current database account.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
import reactor.core.publisher.Mono;

/** Implementation of DnsZones. */
public class DnsZonesImpl extends TopLevelModifiableResourcesImpl<DnsZone, DnsZoneImpl, ZoneInner, ZonesClient, DnsZoneManager>
public class DnsZonesImpl
extends TopLevelModifiableResourcesImpl<DnsZone, DnsZoneImpl, ZoneInner, ZonesClient, DnsZoneManager>
implements DnsZones {

public DnsZonesImpl(final DnsZoneManager dnsZoneManager) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/** Entry point to Azure KeyVault resource management. */
public final class KeyVaultManager extends Manager<KeyVaultManager, KeyVaultManagementClient> {
// Service managers
private AuthorizationManager authorizationManager;
private final AuthorizationManager authorizationManager;
// Collections
private Vaults vaults;
// Variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ private Mono<List<AccessPolicy>> populateAccessPolicies() {
String
.format(
"User principal name %s is not found in tenant %s",
accessPolicy.userPrincipalName(), authorizationManager.tenantId()),
accessPolicy.userPrincipalName(),
authorizationManager.tenantId()),
null))));
} else if (accessPolicy.servicePrincipalName() != null) {
observables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public class VaultsImpl extends GroupableResourcesImpl<Vault, VaultImpl, VaultIn
private final AuthorizationManager authorizationManager;
private final String tenantId;

public VaultsImpl(final KeyVaultManager keyVaultManager, final AuthorizationManager authorizationManager, final String tenantId) {
public VaultsImpl(
final KeyVaultManager keyVaultManager, final AuthorizationManager authorizationManager, final String tenantId) {
super(keyVaultManager.inner().getVaults(), keyVaultManager);
this.authorizationManager = authorizationManager;
this.tenantId = tenantId;
Expand Down
2 changes: 1 addition & 1 deletion sdk/management/api-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dir": "../appservice/mgmt",
"source": "specification/web/resource-manager/readme.md",
"package": "com.azure.resourcemanager.appservice",
"args": "--payload-flattening-threshold=1 --tag=package-2019-08 --add-inner=AppServiceCertificate"
"args": "--payload-flattening-threshold=1 --tag=package-2019-08 --add-inner=AppServiceCertificate --name-for-ungrouped-operations=ResourceProvider"
},
"authorization": {
"dir": "../authorization/mgmt",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ public static NetworkManager authenticate(HttpPipeline httpPipeline, AzureProfil
return authenticate(httpPipeline, profile, new SdkContext());
}

/**
* Creates an instance of NetworkManager that exposes network resource management API entry points.
*
* @param httpPipeline the HttpPipeline to be used for API calls.
* @param profile the profile to use
* @param sdkContext the sdk context
* @return the NetworkManager
*/
public static NetworkManager authenticate(HttpPipeline httpPipeline, AzureProfile profile, SdkContext sdkContext) {
return new NetworkManager(httpPipeline, profile, sdkContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public Mono<NetworkWatcher> createResourceAsync() {

@Override
protected Mono<NetworkWatcherInner> getInnerAsync() {
return this.manager().inner().getNetworkWatchers().getByResourceGroupAsync(this.resourceGroupName(), this.name());
return this.manager().inner().getNetworkWatchers()
.getByResourceGroupAsync(this.resourceGroupName(), this.name());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ public PagedIterable<VirtualNetworkGatewayConnection> listConnections() {
@Override
public PagedFlux<VirtualNetworkGatewayConnection> listConnectionsAsync() {
PagedFlux<VirtualNetworkGatewayConnectionListEntityInner> connectionInners =
this.manager().inner().getVirtualNetworkGateways().listConnectionsAsync(this.resourceGroupName(), this.name());
this.manager().inner().getVirtualNetworkGateways()
.listConnectionsAsync(this.resourceGroupName(), this.name());
return PagedConverter
.flatMapPage(connectionInners, connectionInner -> connections().getByIdAsync(connectionInner.id()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

package com.azure.resourcemanager.network.models;

import com.azure.resourcemanager.network.models.AppliableWithTags;

import java.util.Map;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SqlServerManager extends Manager<SqlServerManager, SqlManagementCli
private SqlServers sqlServers;
private final String tenantId;

private StorageManager storageManager;
private final StorageManager storageManager;

protected SqlServerManager(HttpPipeline httpPipeline, AzureProfile profile, SdkContext sdkContext) {
super(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
* Package containing the inner classes for SqlManagementClient. The Azure SQL Database management API provides a
* RESTful set of web services that interact with Azure SQL Database services to manage your databases. The API enables
* you to create, retrieve, update, and delete databases.
*/
package com.azure.resourcemanager.sql.fluent.inner;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

/**
* Package containing the client classes for SqlManagementClient. The Azure SQL Database management API provides a
* RESTful set of web services that interact with Azure SQL Database services to manage your databases. The API enables
* you to create, retrieve, update, and delete databases.
*/
package com.azure.resourcemanager.sql.fluent;
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ public List<SqlElasticPool> listBySqlServer(SqlServer sqlServer) {
List<SqlElasticPool> elasticPoolSet = new ArrayList<>();
if (sqlServer != null) {
for (ElasticPoolInner inner
: this.manager.inner().getElasticPools().listByServer(sqlServer.resourceGroupName(), sqlServer.name())) {
: this.manager.inner().getElasticPools()
.listByServer(sqlServer.resourceGroupName(), sqlServer.name())) {
elasticPoolSet.add(new SqlElasticPoolImpl(inner.name(), (SqlServerImpl) sqlServer, inner, manager));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ public List<String> databases() {

@Override
public void delete() {
this.sqlServerManager.inner().getFailoverGroups().delete(this.resourceGroupName, this.sqlServerName, this.name());
this.sqlServerManager.inner().getFailoverGroups()
.delete(this.resourceGroupName, this.sqlServerName, this.name());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public PagedFlux<SqlFailoverGroup> listBySqlServerAsync(
@Override
public List<SqlFailoverGroup> listBySqlServer(final SqlServer sqlServer) {
List<SqlFailoverGroup> failoverGroups = new ArrayList<>();
PagedIterable<FailoverGroupInner> failoverGroupInners =
sqlServer.manager().inner().getFailoverGroups().listByServer(sqlServer.resourceGroupName(), sqlServer.name());
PagedIterable<FailoverGroupInner> failoverGroupInners = sqlServer.manager().inner().getFailoverGroups()
.listByServer(sqlServer.resourceGroupName(), sqlServer.name());
for (FailoverGroupInner inner : failoverGroupInners) {
failoverGroups
.add(
Expand Down Expand Up @@ -211,8 +211,8 @@ public Mono<SqlFailoverGroup> forceFailoverAllowDataLossAsync(String failoverGro

@Override
public SqlFailoverGroup failover(String resourceGroupName, String serverName, String failoverGroupName) {
FailoverGroupInner failoverGroupInner =
this.sqlServerManager.inner().getFailoverGroups().failover(resourceGroupName, serverName, failoverGroupName);
FailoverGroupInner failoverGroupInner = this.sqlServerManager.inner().getFailoverGroups()
.failover(resourceGroupName, serverName, failoverGroupName);
return failoverGroupInner != null
? new SqlFailoverGroupImpl(failoverGroupInner.name(), failoverGroupInner, this.sqlServerManager)
: null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public Mono<SqlServerDnsAlias> getBySqlServerAsync(
@Override
public SqlServerDnsAlias getBySqlServer(SqlServer sqlServer, String name) {
Objects.requireNonNull(sqlServer);
ServerDnsAliasInner serverDnsAliasInner =
sqlServer.manager().inner().getServerDnsAliases().get(sqlServer.resourceGroupName(), sqlServer.name(), name);
ServerDnsAliasInner serverDnsAliasInner = sqlServer.manager().inner().getServerDnsAliases()
.get(sqlServer.resourceGroupName(), sqlServer.name(), name);
return serverDnsAliasInner != null
? new SqlServerDnsAliasImpl(name, (SqlServerImpl) sqlServer, serverDnsAliasInner, sqlServer.manager())
: null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ public List<ServiceObjective> listServiceObjectives() {

@Override
public ServiceObjective getServiceObjective(String serviceObjectiveName) {
ServiceObjectiveInner inner =
this.manager().inner().getServiceObjectives().get(this.resourceGroupName(), this.name(), serviceObjectiveName);
ServiceObjectiveInner inner = this.manager().inner().getServiceObjectives()
.get(this.resourceGroupName(), this.name(), serviceObjectiveName);
return (inner != null) ? new ServiceObjectiveImpl(inner, this) : null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public void deleteBySqlServer(String resourceGroupName, String sqlServerName, St

@Override
public Mono<Void> deleteBySqlServerAsync(String resourceGroupName, String sqlServerName, String name) {
return this.sqlServerManager.inner().getVirtualNetworkRules().deleteAsync(resourceGroupName, sqlServerName, name);
return this.sqlServerManager.inner().getVirtualNetworkRules()
.deleteAsync(resourceGroupName, sqlServerName, name);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

/** This package contains the base classes for sql management sdk. */
/**
* Package containing the data models for SqlManagementClient. The Azure SQL Database management API provides a RESTful
* set of web services that interact with Azure SQL Database services to manage your databases. The API enables you to
* create, retrieve, update, and delete databases.
*/
package com.azure.resourcemanager.sql.models;

0 comments on commit 4e61822

Please sign in to comment.