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 8827e4e3f3ce528c8c690761b01fc561e96600c7 into 6f0c7d58c0a923917c2b3467ee756f21dbd2f8e2
  • Loading branch information
SDKAuto committed Aug 5, 2022
1 parent c84b21f commit 17ae933
Show file tree
Hide file tree
Showing 182 changed files with 2,766 additions and 1,430 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-08-05)

- 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 @@ -16,7 +16,9 @@
/** An instance of this class provides access to all the operations defined in CertificatesClient. */
public interface CertificatesClient {
/**
* Returns the list of certificates.
* Get the certificate list.
*
* <p>Returns the list of certificates.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -30,7 +32,9 @@ public interface CertificatesClient {
CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName);

/**
* Returns the list of certificates.
* Get the certificate list.
*
* <p>Returns the list of certificates.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -46,7 +50,9 @@ Response<CertificateListDescriptionInner> listByIotHubWithResponse(
String resourceGroupName, String resourceName, Context context);

/**
* Returns the certificate.
* Get the certificate.
*
* <p>Returns the certificate.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -61,7 +67,9 @@ Response<CertificateListDescriptionInner> listByIotHubWithResponse(
CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName);

/**
* Returns the certificate.
* Get the certificate.
*
* <p>Returns the certificate.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -78,7 +86,9 @@ Response<CertificateDescriptionInner> getWithResponse(
String resourceGroupName, String resourceName, String certificateName, Context context);

/**
* Adds new or replaces existing certificate.
* Upload the certificate to the IoT hub.
*
* <p>Adds new or replaces existing certificate.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -98,7 +108,9 @@ CertificateDescriptionInner createOrUpdate(
CertificateDescriptionInner certificateDescription);

/**
* Adds new or replaces existing certificate.
* Upload the certificate to the IoT hub.
*
* <p>Adds new or replaces existing certificate.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -123,7 +135,9 @@ Response<CertificateDescriptionInner> createOrUpdateWithResponse(
Context context);

/**
* Deletes an existing X509 certificate or does nothing if it does not exist.
* Delete an X509 certificate.
*
* <p>Deletes an existing X509 certificate or does nothing if it does not exist.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -138,7 +152,9 @@ Response<CertificateDescriptionInner> createOrUpdateWithResponse(
void delete(String resourceGroupName, String resourceName, String certificateName, String ifMatch);

/**
* Deletes an existing X509 certificate or does nothing if it does not exist.
* Delete an X509 certificate.
*
* <p>Deletes an existing X509 certificate or does nothing if it does not exist.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -156,8 +172,10 @@ Response<Void> deleteWithResponse(
String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context);

/**
* Generates verification code for proof of possession flow. The verification code will be used to generate a leaf
* certificate.
* Generate verification code for proof of possession flow.
*
* <p>Generates verification code for proof of possession flow. The verification code will be used to generate a
* leaf certificate.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -174,8 +192,10 @@ CertificateWithNonceDescriptionInner generateVerificationCode(
String resourceGroupName, String resourceName, String certificateName, String ifMatch);

/**
* Generates verification code for proof of possession flow. The verification code will be used to generate a leaf
* certificate.
* Generate verification code for proof of possession flow.
*
* <p>Generates verification code for proof of possession flow. The verification code will be used to generate a
* leaf certificate.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -193,8 +213,10 @@ Response<CertificateWithNonceDescriptionInner> generateVerificationCodeWithRespo
String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context);

/**
* Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded
* certificate.
* Verify certificate's private key possession.
*
* <p>Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre
* uploaded certificate.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand All @@ -216,8 +238,10 @@ CertificateDescriptionInner verify(
CertificateVerificationDescription certificateVerificationBody);

/**
* Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded
* certificate.
* Verify certificate's private key possession.
*
* <p>Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre
* uploaded certificate.
*
* @param resourceGroupName The name of the resource group that contains the IoT hub.
* @param resourceName The name of the IoT hub.
Expand Down
Loading

0 comments on commit 17ae933

Please sign in to comment.