Skip to content

Commit 17ae933

Browse files
author
SDKAuto
committed
CodeGen from PR 18743 in Azure/azure-rest-api-specs
Merge 8827e4e3f3ce528c8c690761b01fc561e96600c7 into 6f0c7d58c0a923917c2b3467ee756f21dbd2f8e2
1 parent c84b21f commit 17ae933

File tree

182 files changed

+2766
-1430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+2766
-1430
lines changed

sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Release History
22

3-
## 1.2.0-beta.2 (Unreleased)
3+
## 1.0.0-beta.1 (2022-08-05)
4+
5+
- 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).
46

57
### Features Added
68

sdk/iothub/azure-resourcemanager-iothub/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Azure Resource Manager IotHub client library for Java.
44

5-
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).
5+
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).
66

77
## We'd love to hear your feedback
88

@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-iothub</artifactId>
35-
<version>1.2.0-beta.1</version>
35+
<version>1.2.0-beta.2</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/iothub/azure-resourcemanager-iothub/SAMPLE.md

Lines changed: 51 additions & 40 deletions
Large diffs are not rendered by default.

sdk/iothub/azure-resourcemanager-iothub/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<packaging>jar</packaging>
1414

1515
<name>Microsoft Azure SDK for IotHub Management</name>
16-
<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>
16+
<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>
1717
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

1919
<licenses>

sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import com.azure.core.http.HttpPipelineBuilder;
1111
import com.azure.core.http.HttpPipelinePosition;
1212
import com.azure.core.http.policy.AddDatePolicy;
13+
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
1314
import com.azure.core.http.policy.HttpLogOptions;
1415
import com.azure.core.http.policy.HttpLoggingPolicy;
1516
import com.azure.core.http.policy.HttpPipelinePolicy;
1617
import com.azure.core.http.policy.HttpPolicyProviders;
1718
import com.azure.core.http.policy.RequestIdPolicy;
19+
import com.azure.core.http.policy.RetryOptions;
1820
import com.azure.core.http.policy.RetryPolicy;
1921
import com.azure.core.http.policy.UserAgentPolicy;
2022
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
@@ -87,6 +89,19 @@ public static IotHubManager authenticate(TokenCredential credential, AzureProfil
8789
return configure().authenticate(credential, profile);
8890
}
8991

92+
/**
93+
* Creates an instance of IotHub service API entry point.
94+
*
95+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
96+
* @param profile the Azure profile for client.
97+
* @return the IotHub service API instance.
98+
*/
99+
public static IotHubManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
100+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
101+
Objects.requireNonNull(profile, "'profile' cannot be null.");
102+
return new IotHubManager(httpPipeline, profile, null);
103+
}
104+
90105
/**
91106
* Gets a Configurable instance that can be used to create IotHubManager with optional configuration.
92107
*
@@ -98,13 +113,14 @@ public static Configurable configure() {
98113

99114
/** The Configurable allowing configurations to be set. */
100115
public static final class Configurable {
101-
private final ClientLogger logger = new ClientLogger(Configurable.class);
116+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
102117

103118
private HttpClient httpClient;
104119
private HttpLogOptions httpLogOptions;
105120
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
106121
private final List<String> scopes = new ArrayList<>();
107122
private RetryPolicy retryPolicy;
123+
private RetryOptions retryOptions;
108124
private Duration defaultPollInterval;
109125

110126
private Configurable() {
@@ -165,16 +181,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
165181
return this;
166182
}
167183

184+
/**
185+
* Sets the retry options for the HTTP pipeline retry policy.
186+
*
187+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
188+
*
189+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
190+
* @return the configurable object itself.
191+
*/
192+
public Configurable withRetryOptions(RetryOptions retryOptions) {
193+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
194+
return this;
195+
}
196+
168197
/**
169198
* Sets the default poll interval, used when service does not provide "Retry-After" header.
170199
*
171200
* @param defaultPollInterval the default poll interval.
172201
* @return the configurable object itself.
173202
*/
174203
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
175-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
204+
this.defaultPollInterval =
205+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
176206
if (this.defaultPollInterval.isNegative()) {
177-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
207+
throw LOGGER
208+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
178209
}
179210
return this;
180211
}
@@ -196,7 +227,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi
196227
.append("-")
197228
.append("com.azure.resourcemanager.iothub")
198229
.append("/")
199-
.append("1.2.0-beta.1");
230+
.append("1.0.0-beta.1");
200231
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
201232
userAgentBuilder
202233
.append(" (")
@@ -214,10 +245,15 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi
214245
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
215246
}
216247
if (retryPolicy == null) {
217-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
248+
if (retryOptions != null) {
249+
retryPolicy = new RetryPolicy(retryOptions);
250+
} else {
251+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
252+
}
218253
}
219254
List<HttpPipelinePolicy> policies = new ArrayList<>();
220255
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
256+
policies.add(new AddHeadersFromContextPolicy());
221257
policies.add(new RequestIdPolicy());
222258
policies
223259
.addAll(
@@ -248,23 +284,35 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi
248284
}
249285
}
250286

251-
/** @return Resource collection API of Operations. */
287+
/**
288+
* Gets the resource collection API of Operations.
289+
*
290+
* @return Resource collection API of Operations.
291+
*/
252292
public Operations operations() {
253293
if (this.operations == null) {
254294
this.operations = new OperationsImpl(clientObject.getOperations(), this);
255295
}
256296
return operations;
257297
}
258298

259-
/** @return Resource collection API of IotHubResources. */
299+
/**
300+
* Gets the resource collection API of IotHubResources. It manages IotHubDescription, EventHubConsumerGroupInfo.
301+
*
302+
* @return Resource collection API of IotHubResources.
303+
*/
260304
public IotHubResources iotHubResources() {
261305
if (this.iotHubResources == null) {
262306
this.iotHubResources = new IotHubResourcesImpl(clientObject.getIotHubResources(), this);
263307
}
264308
return iotHubResources;
265309
}
266310

267-
/** @return Resource collection API of ResourceProviderCommons. */
311+
/**
312+
* Gets the resource collection API of ResourceProviderCommons.
313+
*
314+
* @return Resource collection API of ResourceProviderCommons.
315+
*/
268316
public ResourceProviderCommons resourceProviderCommons() {
269317
if (this.resourceProviderCommons == null) {
270318
this.resourceProviderCommons =
@@ -273,23 +321,35 @@ public ResourceProviderCommons resourceProviderCommons() {
273321
return resourceProviderCommons;
274322
}
275323

276-
/** @return Resource collection API of Certificates. */
324+
/**
325+
* Gets the resource collection API of Certificates. It manages CertificateDescription.
326+
*
327+
* @return Resource collection API of Certificates.
328+
*/
277329
public Certificates certificates() {
278330
if (this.certificates == null) {
279331
this.certificates = new CertificatesImpl(clientObject.getCertificates(), this);
280332
}
281333
return certificates;
282334
}
283335

284-
/** @return Resource collection API of IotHubs. */
336+
/**
337+
* Gets the resource collection API of IotHubs.
338+
*
339+
* @return Resource collection API of IotHubs.
340+
*/
285341
public IotHubs iotHubs() {
286342
if (this.iotHubs == null) {
287343
this.iotHubs = new IotHubsImpl(clientObject.getIotHubs(), this);
288344
}
289345
return iotHubs;
290346
}
291347

292-
/** @return Resource collection API of PrivateLinkResourcesOperations. */
348+
/**
349+
* Gets the resource collection API of PrivateLinkResourcesOperations.
350+
*
351+
* @return Resource collection API of PrivateLinkResourcesOperations.
352+
*/
293353
public PrivateLinkResourcesOperations privateLinkResourcesOperations() {
294354
if (this.privateLinkResourcesOperations == null) {
295355
this.privateLinkResourcesOperations =
@@ -298,7 +358,11 @@ public PrivateLinkResourcesOperations privateLinkResourcesOperations() {
298358
return privateLinkResourcesOperations;
299359
}
300360

301-
/** @return Resource collection API of PrivateEndpointConnections. */
361+
/**
362+
* Gets the resource collection API of PrivateEndpointConnections.
363+
*
364+
* @return Resource collection API of PrivateEndpointConnections.
365+
*/
302366
public PrivateEndpointConnections privateEndpointConnections() {
303367
if (this.privateEndpointConnections == null) {
304368
this.privateEndpointConnections =

sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/CertificatesClient.java

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
/** An instance of this class provides access to all the operations defined in CertificatesClient. */
1717
public interface CertificatesClient {
1818
/**
19-
* Returns the list of certificates.
19+
* Get the certificate list.
20+
*
21+
* <p>Returns the list of certificates.
2022
*
2123
* @param resourceGroupName The name of the resource group that contains the IoT hub.
2224
* @param resourceName The name of the IoT hub.
@@ -30,7 +32,9 @@ public interface CertificatesClient {
3032
CertificateListDescriptionInner listByIotHub(String resourceGroupName, String resourceName);
3133

3234
/**
33-
* Returns the list of certificates.
35+
* Get the certificate list.
36+
*
37+
* <p>Returns the list of certificates.
3438
*
3539
* @param resourceGroupName The name of the resource group that contains the IoT hub.
3640
* @param resourceName The name of the IoT hub.
@@ -46,7 +50,9 @@ Response<CertificateListDescriptionInner> listByIotHubWithResponse(
4650
String resourceGroupName, String resourceName, Context context);
4751

4852
/**
49-
* Returns the certificate.
53+
* Get the certificate.
54+
*
55+
* <p>Returns the certificate.
5056
*
5157
* @param resourceGroupName The name of the resource group that contains the IoT hub.
5258
* @param resourceName The name of the IoT hub.
@@ -61,7 +67,9 @@ Response<CertificateListDescriptionInner> listByIotHubWithResponse(
6167
CertificateDescriptionInner get(String resourceGroupName, String resourceName, String certificateName);
6268

6369
/**
64-
* Returns the certificate.
70+
* Get the certificate.
71+
*
72+
* <p>Returns the certificate.
6573
*
6674
* @param resourceGroupName The name of the resource group that contains the IoT hub.
6775
* @param resourceName The name of the IoT hub.
@@ -78,7 +86,9 @@ Response<CertificateDescriptionInner> getWithResponse(
7886
String resourceGroupName, String resourceName, String certificateName, Context context);
7987

8088
/**
81-
* Adds new or replaces existing certificate.
89+
* Upload the certificate to the IoT hub.
90+
*
91+
* <p>Adds new or replaces existing certificate.
8292
*
8393
* @param resourceGroupName The name of the resource group that contains the IoT hub.
8494
* @param resourceName The name of the IoT hub.
@@ -98,7 +108,9 @@ CertificateDescriptionInner createOrUpdate(
98108
CertificateDescriptionInner certificateDescription);
99109

100110
/**
101-
* Adds new or replaces existing certificate.
111+
* Upload the certificate to the IoT hub.
112+
*
113+
* <p>Adds new or replaces existing certificate.
102114
*
103115
* @param resourceGroupName The name of the resource group that contains the IoT hub.
104116
* @param resourceName The name of the IoT hub.
@@ -123,7 +135,9 @@ Response<CertificateDescriptionInner> createOrUpdateWithResponse(
123135
Context context);
124136

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

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

158174
/**
159-
* Generates verification code for proof of possession flow. The verification code will be used to generate a leaf
160-
* certificate.
175+
* Generate verification code for proof of possession flow.
176+
*
177+
* <p>Generates verification code for proof of possession flow. The verification code will be used to generate a
178+
* leaf certificate.
161179
*
162180
* @param resourceGroupName The name of the resource group that contains the IoT hub.
163181
* @param resourceName The name of the IoT hub.
@@ -174,8 +192,10 @@ CertificateWithNonceDescriptionInner generateVerificationCode(
174192
String resourceGroupName, String resourceName, String certificateName, String ifMatch);
175193

176194
/**
177-
* Generates verification code for proof of possession flow. The verification code will be used to generate a leaf
178-
* certificate.
195+
* Generate verification code for proof of possession flow.
196+
*
197+
* <p>Generates verification code for proof of possession flow. The verification code will be used to generate a
198+
* leaf certificate.
179199
*
180200
* @param resourceGroupName The name of the resource group that contains the IoT hub.
181201
* @param resourceName The name of the IoT hub.
@@ -193,8 +213,10 @@ Response<CertificateWithNonceDescriptionInner> generateVerificationCodeWithRespo
193213
String resourceGroupName, String resourceName, String certificateName, String ifMatch, Context context);
194214

195215
/**
196-
* Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded
197-
* certificate.
216+
* Verify certificate's private key possession.
217+
*
218+
* <p>Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre
219+
* uploaded certificate.
198220
*
199221
* @param resourceGroupName The name of the resource group that contains the IoT hub.
200222
* @param resourceName The name of the IoT hub.
@@ -216,8 +238,10 @@ CertificateDescriptionInner verify(
216238
CertificateVerificationDescription certificateVerificationBody);
217239

218240
/**
219-
* Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre uploaded
220-
* certificate.
241+
* Verify certificate's private key possession.
242+
*
243+
* <p>Verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre
244+
* uploaded certificate.
221245
*
222246
* @param resourceGroupName The name of the resource group that contains the IoT hub.
223247
* @param resourceName The name of the IoT hub.

0 commit comments

Comments
 (0)