-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
254c4e4
commit 2cdc188
Showing
12 changed files
with
3,112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<!-- | ||
* 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. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-parent</artifactId> | ||
<version>1.2.2-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<artifactId>azure-mgmt-authorization</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Microsoft Azure SDK for Authorization Management</name> | ||
<description>This package contains Microsoft Authorization Management SDK.</description> | ||
<url>https://github.com/Azure/azure-sdk-for-java</url> | ||
<licenses> | ||
<license> | ||
<name>The MIT License (MIT)</name> | ||
<url>http://opensource.org/licenses/MIT</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
<scm> | ||
<url>scm:git:https://github.com/Azure/azure-sdk-for-java</url> | ||
<connection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</connection> | ||
<tag>HEAD</tag> | ||
</scm> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal> | ||
</properties> | ||
<developers> | ||
<developer> | ||
<id>microsoft</id> | ||
<name>Microsoft</name> | ||
</developer> | ||
</developers> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-client-runtime</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-mgmt-resources</artifactId> | ||
<version>1.2.2-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.microsoft.azure</groupId> | ||
<artifactId>azure-client-authentication</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addDefaultImplementationEntries>true</addDefaultImplementationEntries> | ||
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.1</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
<annotationProcessors> | ||
<annotationProcessor> | ||
com.microsoft.azure.management.apigeneration.LangDefinitionProcessor | ||
</annotationProcessor> | ||
</annotationProcessors> | ||
<debug>true</debug> | ||
<optimize>true</optimize> | ||
<compilerArguments> | ||
<AaddGeneratedAnnotation>true</AaddGeneratedAnnotation> | ||
<Adebug>true</Adebug> | ||
</compilerArguments> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.8</version> | ||
<configuration> | ||
<excludePackageNames>*.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search</excludePackageNames> | ||
<bottom> | ||
<![CDATA[<code> | ||
/** | ||
<br />* Copyright (c) Microsoft Corporation. All rights reserved. | ||
<br />* Licensed under the MIT License. See License.txt in the project root for | ||
<br />* license information. | ||
<br />*/ | ||
</code>]]> | ||
</bottom> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
44 changes: 44 additions & 0 deletions
44
azure-mgmt-locks/src/main/java/com/microsoft/azure/management/locks/LockLevel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* 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.locks; | ||
|
||
import java.util.Collection; | ||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.microsoft.rest.ExpandableStringEnum; | ||
|
||
/** | ||
* Defines values for LockLevel. | ||
*/ | ||
public final class LockLevel extends ExpandableStringEnum<LockLevel> { | ||
/** Static value NotSpecified for LockLevel. */ | ||
public static final LockLevel NOT_SPECIFIED = fromString("NotSpecified"); | ||
|
||
/** Static value CanNotDelete for LockLevel. */ | ||
public static final LockLevel CAN_NOT_DELETE = fromString("CanNotDelete"); | ||
|
||
/** Static value ReadOnly for LockLevel. */ | ||
public static final LockLevel READ_ONLY = fromString("ReadOnly"); | ||
|
||
/** | ||
* Creates or finds a LockLevel from its string representation. | ||
* @param name a name to look for | ||
* @return the corresponding LockLevel | ||
*/ | ||
@JsonCreator | ||
public static LockLevel fromString(String name) { | ||
return fromString(name, LockLevel.class); | ||
} | ||
|
||
/** | ||
* @return known LockLevel values | ||
*/ | ||
public static Collection<LockLevel> values() { | ||
return values(LockLevel.class); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
azure-mgmt-locks/src/main/java/com/microsoft/azure/management/locks/ManagementLockOwner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* 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.locks; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Lock owner properties. | ||
*/ | ||
public class ManagementLockOwner { | ||
/** | ||
* The application ID of the lock owner. | ||
*/ | ||
@JsonProperty(value = "applicationId") | ||
private String applicationId; | ||
|
||
/** | ||
* Get the applicationId value. | ||
* | ||
* @return the applicationId value | ||
*/ | ||
public String applicationId() { | ||
return this.applicationId; | ||
} | ||
|
||
/** | ||
* Set the applicationId value. | ||
* | ||
* @param applicationId the applicationId value to set | ||
* @return the ManagementLockOwner object itself. | ||
*/ | ||
public ManagementLockOwner withApplicationId(String applicationId) { | ||
this.applicationId = applicationId; | ||
return this; | ||
} | ||
|
||
} |
89 changes: 89 additions & 0 deletions
89
...c/main/java/com/microsoft/azure/management/locks/implementation/AuthorizationManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/** | ||
* 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.locks.implementation; | ||
|
||
import com.microsoft.azure.AzureEnvironment; | ||
import com.microsoft.azure.AzureResponseBuilder; | ||
import com.microsoft.azure.credentials.AzureTokenCredentials; | ||
import com.microsoft.azure.management.apigeneration.Beta; | ||
import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.AzureConfigurable; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.implementation.AzureConfigurableImpl; | ||
import com.microsoft.azure.management.resources.fluentcore.arm.implementation.Manager; | ||
import com.microsoft.azure.management.resources.fluentcore.utils.ProviderRegistrationInterceptor; | ||
import com.microsoft.azure.serializer.AzureJacksonAdapter; | ||
import com.microsoft.rest.RestClient; | ||
|
||
/** | ||
* Entry point to Azure Authorization resource management. | ||
*/ | ||
@Beta(SinceVersion.V1_3_0) | ||
public final class AuthorizationManager extends Manager<AuthorizationManager, ManagementLockClientImpl> { | ||
/** | ||
* Get a Configurable instance that can be used to create AuthorizationManager with optional configuration. | ||
* | ||
* @return the instance allowing configurations | ||
*/ | ||
public static Configurable configure() { | ||
return new AuthorizationManager.ConfigurableImpl(); | ||
} | ||
/** | ||
* Creates an instance of AuthorizationManager that exposes Authorization resource management API entry points. | ||
* | ||
* @param credentials the credentials to use | ||
* @param subscriptionId the subscription UUID | ||
* @return the AuthorizationManager | ||
*/ | ||
public static AuthorizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { | ||
return new AuthorizationManager(new RestClient.Builder() | ||
.withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) | ||
.withCredentials(credentials) | ||
.withSerializerAdapter(new AzureJacksonAdapter()) | ||
.withResponseBuilderFactory(new AzureResponseBuilder.Factory()) | ||
.withInterceptor(new ProviderRegistrationInterceptor(credentials)) | ||
.build(), subscriptionId); | ||
} | ||
/** | ||
* Creates an instance of AuthorizationManager that exposes Authorization resource management API entry points. | ||
* | ||
* @param restClient the RestClient to be used for API calls. | ||
* @param subscriptionId the subscription UUID | ||
* @return the AuthorizationManager | ||
*/ | ||
public static AuthorizationManager authenticate(RestClient restClient, String subscriptionId) { | ||
return new AuthorizationManager(restClient, subscriptionId); | ||
} | ||
/** | ||
* The interface allowing configurations to be set. | ||
*/ | ||
public interface Configurable extends AzureConfigurable<Configurable> { | ||
/** | ||
* Creates an instance of AuthorizationManager that exposes Authorization management API entry points. | ||
* | ||
* @param credentials the credentials to use | ||
* @param subscriptionId the subscription UUID | ||
* @return the interface exposing Authorization management API entry points that work across subscriptions | ||
*/ | ||
AuthorizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId); | ||
} | ||
/** | ||
* The implementation for Configurable interface. | ||
*/ | ||
private static final class ConfigurableImpl extends AzureConfigurableImpl<Configurable> implements Configurable { | ||
public AuthorizationManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { | ||
return AuthorizationManager.authenticate(buildRestClient(credentials), subscriptionId); | ||
} | ||
} | ||
private AuthorizationManager(RestClient restClient, String subscriptionId) { | ||
super( | ||
restClient, | ||
subscriptionId, | ||
new ManagementLockClientImpl(restClient).withSubscriptionId(subscriptionId)); | ||
} | ||
} |
Oops, something went wrong.