Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
973 changes: 969 additions & 4 deletions sdk/providerhub/azure-resourcemanager-providerhub/CHANGELOG.md

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions sdk/providerhub/azure-resourcemanager-providerhub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager ProviderHub client library for Java.

This package contains Microsoft Azure SDK for ProviderHub Management SDK. Microsoft ProviderHub. Package tag package-2020-11-20. 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 ProviderHub Management SDK. Provider Hub. Package tag package-2024-09-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 @@ -52,15 +52,15 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD);
TokenCredential credential = new DefaultAzureCredentialBuilder()
.authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
.build();
ProviderHubManager manager = ProviderHubManager
.authenticate(credential, profile);
```

The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise.

See [Authentication][authenticate] for more options.

Expand Down Expand Up @@ -110,5 +110,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md
[coc]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/


1,843 changes: 1,361 additions & 482 deletions sdk/providerhub/azure-resourcemanager-providerhub/SAMPLE.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions sdk/providerhub/azure-resourcemanager-providerhub/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for ProviderHub Management</name>
<description>This package contains Microsoft Azure SDK for ProviderHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft ProviderHub. Package tag package-2020-11-20.</description>
<description>This package contains Microsoft Azure SDK for ProviderHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Provider Hub. Package tag package-2024-09-01.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand All @@ -45,7 +45,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<spotless.skip>false</spotless.skip>
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,45 @@
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.providerhub.fluent.ProviderHub;
import com.azure.resourcemanager.providerhub.implementation.AuthorizedApplicationsImpl;
import com.azure.resourcemanager.providerhub.implementation.CustomRolloutsImpl;
import com.azure.resourcemanager.providerhub.implementation.DefaultRolloutsImpl;
import com.azure.resourcemanager.providerhub.implementation.NewRegionFrontloadReleasesImpl;
import com.azure.resourcemanager.providerhub.implementation.NotificationRegistrationsImpl;
import com.azure.resourcemanager.providerhub.implementation.OperationsImpl;
import com.azure.resourcemanager.providerhub.implementation.ProviderHubBuilder;
import com.azure.resourcemanager.providerhub.implementation.ProviderMonitorSettingsImpl;
import com.azure.resourcemanager.providerhub.implementation.ProviderRegistrationsImpl;
import com.azure.resourcemanager.providerhub.implementation.ResourceActionsImpl;
import com.azure.resourcemanager.providerhub.implementation.ResourceProvidersImpl;
import com.azure.resourcemanager.providerhub.implementation.ResourceTypeRegistrationsImpl;
import com.azure.resourcemanager.providerhub.implementation.SkusImpl;
import com.azure.resourcemanager.providerhub.models.AuthorizedApplications;
import com.azure.resourcemanager.providerhub.models.CustomRollouts;
import com.azure.resourcemanager.providerhub.models.DefaultRollouts;
import com.azure.resourcemanager.providerhub.models.NewRegionFrontloadReleases;
import com.azure.resourcemanager.providerhub.models.NotificationRegistrations;
import com.azure.resourcemanager.providerhub.models.Operations;
import com.azure.resourcemanager.providerhub.models.ProviderMonitorSettings;
import com.azure.resourcemanager.providerhub.models.ProviderRegistrations;
import com.azure.resourcemanager.providerhub.models.ResourceActions;
import com.azure.resourcemanager.providerhub.models.ResourceProviders;
import com.azure.resourcemanager.providerhub.models.ResourceTypeRegistrations;
import com.azure.resourcemanager.providerhub.models.Skus;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;

/**
* Entry point to ProviderHubManager.
* Microsoft ProviderHub.
* Provider Hub.
*/
public final class ProviderHubManager {
private CustomRollouts customRollouts;
Expand All @@ -69,6 +79,14 @@ public final class ProviderHubManager {

private Skus skus;

private ResourceActions resourceActions;

private AuthorizedApplications authorizedApplications;

private ProviderMonitorSettings providerMonitorSettings;

private NewRegionFrontloadReleases newRegionFrontloadReleases;

private final ProviderHub clientObject;

private ProviderHubManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Expand Down Expand Up @@ -121,6 +139,9 @@ public static Configurable configure() {
*/
public static final class Configurable {
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
private static final String SDK_VERSION = "version";
private static final Map<String, String> PROPERTIES
= CoreUtils.getProperties("azure-resourcemanager-providerhub.properties");

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
Expand Down Expand Up @@ -228,12 +249,14 @@ public ProviderHubManager authenticate(TokenCredential credential, AzureProfile
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");

String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");

StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.providerhub")
.append("/")
.append("1.1.0");
.append(clientVersion);
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
Expand Down Expand Up @@ -377,6 +400,57 @@ public Skus skus() {
return skus;
}

/**
* Gets the resource collection API of ResourceActions.
*
* @return Resource collection API of ResourceActions.
*/
public ResourceActions resourceActions() {
if (this.resourceActions == null) {
this.resourceActions = new ResourceActionsImpl(clientObject.getResourceActions(), this);
}
return resourceActions;
}

/**
* Gets the resource collection API of AuthorizedApplications. It manages AuthorizedApplication.
*
* @return Resource collection API of AuthorizedApplications.
*/
public AuthorizedApplications authorizedApplications() {
if (this.authorizedApplications == null) {
this.authorizedApplications
= new AuthorizedApplicationsImpl(clientObject.getAuthorizedApplications(), this);
}
return authorizedApplications;
}

/**
* Gets the resource collection API of ProviderMonitorSettings. It manages ProviderMonitorSetting.
*
* @return Resource collection API of ProviderMonitorSettings.
*/
public ProviderMonitorSettings providerMonitorSettings() {
if (this.providerMonitorSettings == null) {
this.providerMonitorSettings
= new ProviderMonitorSettingsImpl(clientObject.getProviderMonitorSettings(), this);
}
return providerMonitorSettings;
}

/**
* Gets the resource collection API of NewRegionFrontloadReleases.
*
* @return Resource collection API of NewRegionFrontloadReleases.
*/
public NewRegionFrontloadReleases newRegionFrontloadReleases() {
if (this.newRegionFrontloadReleases == null) {
this.newRegionFrontloadReleases
= new NewRegionFrontloadReleasesImpl(clientObject.getNewRegionFrontloadReleases(), this);
}
return newRegionFrontloadReleases;
}

/**
* Gets wrapped service client ProviderHub providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.providerhub.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.providerhub.fluent.models.AuthorizedApplicationInner;
import java.util.UUID;

/**
* An instance of this class provides access to all the operations defined in AuthorizedApplicationsClient.
*/
public interface AuthorizedApplicationsClient {
/**
* Gets the authorized application details.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param applicationId The application ID.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the authorized application details along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AuthorizedApplicationInner> getWithResponse(String providerNamespace, UUID applicationId, Context context);

/**
* Gets the authorized application details.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param applicationId The application ID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the authorized application details.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
AuthorizedApplicationInner get(String providerNamespace, UUID applicationId);

/**
* Creates or updates the authorized application.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param applicationId The application ID.
* @param properties The authorized application properties supplied to the CreateOrUpdate operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<AuthorizedApplicationInner>, AuthorizedApplicationInner>
beginCreateOrUpdate(String providerNamespace, UUID applicationId, AuthorizedApplicationInner properties);

/**
* Creates or updates the authorized application.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param applicationId The application ID.
* @param properties The authorized application properties supplied to the CreateOrUpdate operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<AuthorizedApplicationInner>, AuthorizedApplicationInner> beginCreateOrUpdate(
String providerNamespace, UUID applicationId, AuthorizedApplicationInner properties, Context context);

/**
* Creates or updates the authorized application.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param applicationId The application ID.
* @param properties The authorized application properties supplied to the CreateOrUpdate operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
AuthorizedApplicationInner createOrUpdate(String providerNamespace, UUID applicationId,
AuthorizedApplicationInner properties);

/**
* Creates or updates the authorized application.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param applicationId The application ID.
* @param properties The authorized application properties supplied to the CreateOrUpdate operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
AuthorizedApplicationInner createOrUpdate(String providerNamespace, UUID applicationId,
AuthorizedApplicationInner properties, Context context);

/**
* Deletes an authorized application.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param applicationId The application ID.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(String providerNamespace, UUID applicationId, Context context);

/**
* Deletes an authorized application.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param applicationId The application ID.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
void delete(String providerNamespace, UUID applicationId);

/**
* Gets the list of the authorized applications in the provider namespace.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of the authorized applications in the provider namespace as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AuthorizedApplicationInner> list(String providerNamespace);

/**
* Gets the list of the authorized applications in the provider namespace.
*
* @param providerNamespace The name of the resource provider hosted within ProviderHub.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of the authorized applications in the provider namespace as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AuthorizedApplicationInner> list(String providerNamespace, Context context);
}
Loading