Skip to content

Commit

Permalink
CodeGen from PR 18743 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 8a10eaacb25276587d26cc52a30b40ec5fb0c7ba into 8c2258114e565bb041dcb25a761acb965a4870e7
  • Loading branch information
SDKAuto committed Jul 26, 2022
1 parent a6e5f77 commit 5b27f19
Show file tree
Hide file tree
Showing 176 changed files with 1,859 additions and 1,596 deletions.
4 changes: 3 additions & 1 deletion sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.2.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2022-07-26)

- Azure Resource Manager IotHub client library for Java. This package contains Microsoft Azure SDK for IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2022-04-30. 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/iothub/azure-resourcemanager-iothub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager IotHub client library for Java.

This package contains Microsoft Azure SDK for IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2021-07-02. 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 IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2022-04-30. 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-iothub</artifactId>
<version>1.2.0-beta.1</version>
<version>1.2.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
91 changes: 51 additions & 40 deletions sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/iothub/azure-resourcemanager-iothub/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 IotHub Management</name>
<description>This package contains Microsoft Azure SDK for IotHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2021-07-02.</description>
<description>This package contains Microsoft Azure SDK for IotHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-preview-2022-04-30.</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 Down Expand Up @@ -87,6 +89,19 @@ public static IotHubManager authenticate(TokenCredential credential, AzureProfil
return configure().authenticate(credential, profile);
}

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

/**
* Gets a Configurable instance that can be used to create IotHubManager with optional configuration.
*
Expand All @@ -98,13 +113,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 @@ -165,16 +181,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 @@ -196,7 +227,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi
.append("-")
.append("com.azure.resourcemanager.iothub")
.append("/")
.append("1.2.0-beta.1");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand All @@ -214,10 +245,15 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi
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 @@ -248,23 +284,35 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi
}
}

/** @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 IotHubResources. */
/**
* Gets the resource collection API of IotHubResources. It manages IotHubDescription, EventHubConsumerGroupInfo.
*
* @return Resource collection API of IotHubResources.
*/
public IotHubResources iotHubResources() {
if (this.iotHubResources == null) {
this.iotHubResources = new IotHubResourcesImpl(clientObject.getIotHubResources(), this);
}
return iotHubResources;
}

/** @return Resource collection API of ResourceProviderCommons. */
/**
* Gets the resource collection API of ResourceProviderCommons.
*
* @return Resource collection API of ResourceProviderCommons.
*/
public ResourceProviderCommons resourceProviderCommons() {
if (this.resourceProviderCommons == null) {
this.resourceProviderCommons =
Expand All @@ -273,23 +321,35 @@ public ResourceProviderCommons resourceProviderCommons() {
return resourceProviderCommons;
}

/** @return Resource collection API of Certificates. */
/**
* Gets the resource collection API of Certificates. It manages CertificateDescription.
*
* @return Resource collection API of Certificates.
*/
public Certificates certificates() {
if (this.certificates == null) {
this.certificates = new CertificatesImpl(clientObject.getCertificates(), this);
}
return certificates;
}

/** @return Resource collection API of IotHubs. */
/**
* Gets the resource collection API of IotHubs.
*
* @return Resource collection API of IotHubs.
*/
public IotHubs iotHubs() {
if (this.iotHubs == null) {
this.iotHubs = new IotHubsImpl(clientObject.getIotHubs(), this);
}
return iotHubs;
}

/** @return Resource collection API of PrivateLinkResourcesOperations. */
/**
* Gets the resource collection API of PrivateLinkResourcesOperations.
*
* @return Resource collection API of PrivateLinkResourcesOperations.
*/
public PrivateLinkResourcesOperations privateLinkResourcesOperations() {
if (this.privateLinkResourcesOperations == null) {
this.privateLinkResourcesOperations =
Expand All @@ -298,7 +358,11 @@ public PrivateLinkResourcesOperations privateLinkResourcesOperations() {
return privateLinkResourcesOperations;
}

/** @return Resource collection API of PrivateEndpointConnections. */
/**
* Gets the resource collection API of PrivateEndpointConnections.
*
* @return Resource collection API of PrivateEndpointConnections.
*/
public PrivateEndpointConnections privateEndpointConnections() {
if (this.privateEndpointConnections == null) {
this.privateEndpointConnections =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public interface CertificatesClient {
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 JSON-serialized array of Certificate objects.
*/
Expand All @@ -36,8 +35,7 @@ public interface CertificatesClient {
* @param resourceName The name of the IoT hub.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 JSON-serialized array of Certificate objects along with {@link Response}.
*/
Expand All @@ -52,8 +50,7 @@ Response<CertificateListDescriptionInner> listByIotHubWithResponse(
* @param resourceName The name of the IoT hub.
* @param certificateName The name of the certificate.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 X509 Certificate.
*/
Expand All @@ -68,8 +65,7 @@ Response<CertificateListDescriptionInner> listByIotHubWithResponse(
* @param certificateName The name of the certificate.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 X509 Certificate along with {@link Response}.
*/
Expand All @@ -85,8 +81,7 @@ Response<CertificateDescriptionInner> getWithResponse(
* @param certificateName The name of the certificate.
* @param certificateDescription The certificate body.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 X509 Certificate.
*/
Expand All @@ -108,8 +103,7 @@ CertificateDescriptionInner createOrUpdate(
* an existing certificate.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 X509 Certificate along with {@link Response}.
*/
Expand All @@ -130,8 +124,7 @@ Response<CertificateDescriptionInner> createOrUpdateWithResponse(
* @param certificateName The name of the certificate.
* @param ifMatch ETag of the Certificate.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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)
Expand All @@ -146,8 +139,7 @@ Response<CertificateDescriptionInner> createOrUpdateWithResponse(
* @param ifMatch ETag of the Certificate.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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}.
*/
Expand All @@ -164,8 +156,7 @@ Response<Void> deleteWithResponse(
* @param certificateName The name of the certificate.
* @param ifMatch ETag of the Certificate.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 X509 Certificate.
*/
Expand All @@ -183,8 +174,7 @@ CertificateWithNonceDescriptionInner generateVerificationCode(
* @param ifMatch ETag of the Certificate.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 X509 Certificate along with {@link Response}.
*/
Expand All @@ -202,8 +192,7 @@ Response<CertificateWithNonceDescriptionInner> generateVerificationCodeWithRespo
* @param ifMatch ETag of the Certificate.
* @param certificateVerificationBody The name of the certificate.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 X509 Certificate.
*/
Expand All @@ -226,8 +215,7 @@ CertificateDescriptionInner verify(
* @param certificateVerificationBody The name of the certificate.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.resourcemanager.iothub.models.ErrorDetailsException thrown if the request is rejected by
* server.
* @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 X509 Certificate along with {@link Response}.
*/
Expand Down
Loading

0 comments on commit 5b27f19

Please sign in to comment.