Skip to content

Commit

Permalink
mgmt restructure authorization (Azure#11817)
Browse files Browse the repository at this point in the history
* mgmt restructure authorization

* update namespace for spec

* regenerate code

* fix compile error

* fix checkstyle

* fix import
  • Loading branch information
xseeseesee authored Jun 8, 2020
1 parent edaa5f8 commit 4b18c35
Show file tree
Hide file tree
Showing 181 changed files with 4,266 additions and 1,759 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.appservice.implementation.AppServiceManager;
import com.azure.resourcemanager.appservice.models.SiteInner;
import com.azure.resourcemanager.authorization.BuiltInRole;
import com.azure.resourcemanager.authorization.models.BuiltInRole;
import com.azure.resourcemanager.msi.Identity;
import com.azure.resourcemanager.resources.fluentcore.arm.models.GroupableResource;
import com.azure.resourcemanager.resources.fluentcore.arm.models.HasName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import com.azure.resourcemanager.appservice.WebApps;
import com.azure.resourcemanager.appservice.models.WebSiteManagementClientBuilder;
import com.azure.resourcemanager.appservice.models.WebSiteManagementClientImpl;
import com.azure.resourcemanager.authorization.implementation.GraphRbacManager;
import com.azure.resourcemanager.authorization.GraphRbacManager;
import com.azure.resourcemanager.keyvault.implementation.KeyVaultManager;
import com.azure.resourcemanager.resources.fluentcore.arm.AzureConfigurable;
import com.azure.resourcemanager.resources.fluentcore.arm.implementation.AzureConfigurableImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import com.azure.resourcemanager.appservice.models.SiteSourceControlInner;
import com.azure.resourcemanager.appservice.models.SlotConfigNamesResourceInner;
import com.azure.resourcemanager.appservice.models.StringDictionaryInner;
import com.azure.resourcemanager.authorization.BuiltInRole;
import com.azure.resourcemanager.authorization.models.BuiltInRole;
import com.azure.resourcemanager.authorization.implementation.RoleAssignmentHelper;
import com.azure.resourcemanager.msi.Identity;
import com.azure.resourcemanager.resources.fluentcore.arm.models.implementation.GroupableResourceImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.azure.resourcemanager.appservice.ManagedServiceIdentityUserAssignedIdentities;
import com.azure.resourcemanager.appservice.models.SiteInner;
import com.azure.resourcemanager.appservice.models.SitePatchResourceInner;
import com.azure.resourcemanager.authorization.implementation.GraphRbacManager;
import com.azure.resourcemanager.authorization.GraphRbacManager;
import com.azure.resourcemanager.authorization.implementation.RoleAssignmentHelper;
import com.azure.resourcemanager.msi.Identity;
import com.azure.resourcemanager.resources.fluentcore.dag.TaskGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import com.azure.core.http.HttpPipeline;
import com.azure.core.http.rest.Response;
import com.azure.resourcemanager.authorization.BuiltInRole;
import com.azure.resourcemanager.authorization.models.BuiltInRole;
import com.azure.resourcemanager.msi.Identity;
import com.azure.resourcemanager.msi.implementation.MSIManager;
import com.azure.resourcemanager.resources.models.ResourceGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.authorization;

import com.azure.core.annotation.ServiceClient;
import com.azure.core.http.HttpPipeline;
import com.azure.core.management.AzureEnvironment;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.AzureServiceClient;
import com.azure.resourcemanager.authorization.fluent.ClassicAdministratorsClient;
import com.azure.resourcemanager.authorization.fluent.GlobalAdministratorsClient;
import com.azure.resourcemanager.authorization.fluent.PermissionsClient;
import com.azure.resourcemanager.authorization.fluent.ProviderOperationsMetadatasClient;
import com.azure.resourcemanager.authorization.fluent.RoleAssignmentsClient;
import com.azure.resourcemanager.authorization.fluent.RoleDefinitionsClient;

/** Initializes a new instance of the AuthorizationManagementClient type. */
@ServiceClient(builder = AuthorizationManagementClientBuilder.class)
public final class AuthorizationManagementClient extends AzureServiceClient {
private final ClientLogger logger = new ClientLogger(AuthorizationManagementClient.class);

/** The ID of the target subscription. */
private final String subscriptionId;

/**
* Gets The ID of the target subscription.
*
* @return the subscriptionId value.
*/
public String getSubscriptionId() {
return this.subscriptionId;
}

/** server parameter. */
private final String endpoint;

/**
* Gets server parameter.
*
* @return the endpoint value.
*/
public String getEndpoint() {
return this.endpoint;
}

/** The HTTP pipeline to send requests through. */
private final HttpPipeline httpPipeline;

/**
* Gets The HTTP pipeline to send requests through.
*
* @return the httpPipeline value.
*/
public HttpPipeline getHttpPipeline() {
return this.httpPipeline;
}

/** The ClassicAdministratorsClient object to access its operations. */
private final ClassicAdministratorsClient classicAdministrators;

/**
* Gets the ClassicAdministratorsClient object to access its operations.
*
* @return the ClassicAdministratorsClient object.
*/
public ClassicAdministratorsClient getClassicAdministrators() {
return this.classicAdministrators;
}

/** The GlobalAdministratorsClient object to access its operations. */
private final GlobalAdministratorsClient globalAdministrators;

/**
* Gets the GlobalAdministratorsClient object to access its operations.
*
* @return the GlobalAdministratorsClient object.
*/
public GlobalAdministratorsClient getGlobalAdministrators() {
return this.globalAdministrators;
}

/** The ProviderOperationsMetadatasClient object to access its operations. */
private final ProviderOperationsMetadatasClient providerOperationsMetadatas;

/**
* Gets the ProviderOperationsMetadatasClient object to access its operations.
*
* @return the ProviderOperationsMetadatasClient object.
*/
public ProviderOperationsMetadatasClient getProviderOperationsMetadatas() {
return this.providerOperationsMetadatas;
}

/** The RoleAssignmentsClient object to access its operations. */
private final RoleAssignmentsClient roleAssignments;

/**
* Gets the RoleAssignmentsClient object to access its operations.
*
* @return the RoleAssignmentsClient object.
*/
public RoleAssignmentsClient getRoleAssignments() {
return this.roleAssignments;
}

/** The PermissionsClient object to access its operations. */
private final PermissionsClient permissions;

/**
* Gets the PermissionsClient object to access its operations.
*
* @return the PermissionsClient object.
*/
public PermissionsClient getPermissions() {
return this.permissions;
}

/** The RoleDefinitionsClient object to access its operations. */
private final RoleDefinitionsClient roleDefinitions;

/**
* Gets the RoleDefinitionsClient object to access its operations.
*
* @return the RoleDefinitionsClient object.
*/
public RoleDefinitionsClient getRoleDefinitions() {
return this.roleDefinitions;
}

/**
* Initializes an instance of AuthorizationManagementClient client.
*
* @param httpPipeline The HTTP pipeline to send requests through.
* @param environment The Azure environment.
*/
AuthorizationManagementClient(
HttpPipeline httpPipeline, AzureEnvironment environment, String subscriptionId, String endpoint) {
super(httpPipeline, environment);
this.httpPipeline = httpPipeline;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
this.classicAdministrators = new ClassicAdministratorsClient(this);
this.globalAdministrators = new GlobalAdministratorsClient(this);
this.providerOperationsMetadatas = new ProviderOperationsMetadatasClient(this);
this.roleAssignments = new RoleAssignmentsClient(this);
this.permissions = new PermissionsClient(this);
this.roleDefinitions = new RoleDefinitionsClient(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.authorization.models;
package com.azure.resourcemanager.authorization;

import com.azure.core.annotation.ServiceClientBuilder;
import com.azure.core.http.HttpPipeline;
Expand All @@ -12,8 +12,8 @@
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.AzureEnvironment;

/** A builder for creating a new instance of the AuthorizationManagementClientImpl type. */
@ServiceClientBuilder(serviceClients = {AuthorizationManagementClientImpl.class})
/** A builder for creating a new instance of the AuthorizationManagementClient type. */
@ServiceClientBuilder(serviceClients = {AuthorizationManagementClient.class})
public final class AuthorizationManagementClientBuilder {
/*
* The ID of the target subscription.
Expand All @@ -34,16 +34,16 @@ public AuthorizationManagementClientBuilder subscriptionId(String subscriptionId
/*
* server parameter
*/
private String host;
private String endpoint;

/**
* Sets server parameter.
*
* @param host the host value.
* @param endpoint the endpoint value.
* @return the AuthorizationManagementClientBuilder.
*/
public AuthorizationManagementClientBuilder host(String host) {
this.host = host;
public AuthorizationManagementClientBuilder endpoint(String endpoint) {
this.endpoint = endpoint;
return this;
}

Expand Down Expand Up @@ -80,13 +80,13 @@ public AuthorizationManagementClientBuilder pipeline(HttpPipeline pipeline) {
}

/**
* Builds an instance of AuthorizationManagementClientImpl with the provided parameters.
* Builds an instance of AuthorizationManagementClient with the provided parameters.
*
* @return an instance of AuthorizationManagementClientImpl.
* @return an instance of AuthorizationManagementClient.
*/
public AuthorizationManagementClientImpl buildClient() {
if (host == null) {
this.host = "https://management.azure.com";
public AuthorizationManagementClient buildClient() {
if (endpoint == null) {
this.endpoint = "https://management.azure.com";
}
if (environment == null) {
this.environment = AzureEnvironment.AZURE;
Expand All @@ -97,9 +97,8 @@ public AuthorizationManagementClientImpl buildClient() {
.policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy())
.build();
}
AuthorizationManagementClientImpl client = new AuthorizationManagementClientImpl(pipeline, environment);
client.setSubscriptionId(this.subscriptionId);
client.setHost(this.host);
AuthorizationManagementClient client =
new AuthorizationManagementClient(pipeline, environment, subscriptionId, endpoint);
return client;
}
}
Loading

0 comments on commit 4b18c35

Please sign in to comment.