Skip to content

Commit 5efc75f

Browse files
author
SDKAuto
committed
CodeGen from PR 14090 in Azure/azure-rest-api-specs
Merge 97abfdacd1f7d4d1622cd0e0721a6f042e6620b8 into 88d9023117ea3bfae404a44b755ca7f0bf81b806
1 parent 2899394 commit 5efc75f

22 files changed

+447
-271
lines changed

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

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

3-
## 1.0.0-beta.2 (Unreleased)
3+
## 1.0.0-beta.1 (2021-04-28)
44

5+
- Azure Resource Manager Confluent client library for Java. This package contains Microsoft Azure SDK for Confluent Management SDK. Package tag package-2020-03-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
56

67
## 1.0.0-beta.1 (2021-01-14)
78

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ Azure Resource Manager Confluent client library for Java.
44

55
This package contains Microsoft Azure SDK for Confluent Management SDK. Package tag package-2020-03-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
66

7+
## We'd love to hear your feedback
8+
9+
We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
10+
11+
If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
12+
13+
Thank you in advance for your collaboration. We really appreciate your time!
14+
15+
## Documentation
16+
17+
Various documentation is available to help you get started
18+
19+
- [API reference documentation][docs]
20+
721
## Getting started
822

923
### Prerequisites
@@ -18,7 +32,7 @@ This package contains Microsoft Azure SDK for Confluent Management SDK. Package
1832
<dependency>
1933
<groupId>com.azure.resourcemanager</groupId>
2034
<artifactId>azure-resourcemanager-confluent</artifactId>
21-
<version>1.0.0-beta.1</version>
35+
<version>1.0.0-beta.2</version>
2236
</dependency>
2337
```
2438
[//]: # ({x-version-update-end})
@@ -75,6 +89,8 @@ For details on contributing to this repository, see the [contributing guide](htt
7589
1. Create new Pull Request
7690

7791
<!-- LINKS -->
92+
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
93+
[docs]: https://azure.github.io/azure-sdk-for-java/
7894
[jdk]: https://docs.microsoft.com/java/azure/jdk/
7995
[azure_subscription]: https://azure.microsoft.com/free/
8096
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity

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

Lines changed: 6 additions & 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 Confluent Management</name>
16-
<description>This package contains Microsoft Azure SDK for Confluent Management SDK. Package tag package-2020-03-01. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt</description>
16+
<description>This package contains Microsoft Azure SDK for Confluent Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2020-03-01.</description>
1717
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

1919
<licenses>
@@ -41,6 +41,11 @@
4141
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
4242
</properties>
4343
<dependencies>
44+
<dependency>
45+
<groupId>com.azure</groupId>
46+
<artifactId>azure-core</artifactId>
47+
<version>1.15.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
48+
</dependency>
4449
<dependency>
4550
<groupId>com.azure</groupId>
4651
<artifactId>azure-core-management</artifactId>

sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,31 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr
160160
Objects.requireNonNull(credential, "'credential' cannot be null.");
161161
Objects.requireNonNull(profile, "'profile' cannot be null.");
162162

163+
StringBuilder userAgentBuilder = new StringBuilder();
164+
userAgentBuilder
165+
.append("azsdk-java")
166+
.append("-")
167+
.append("com.azure.resourcemanager.confluent")
168+
.append("/")
169+
.append("1.0.0-beta.1");
170+
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
171+
userAgentBuilder
172+
.append(" (")
173+
.append(Configuration.getGlobalConfiguration().get("java.version"))
174+
.append("; ")
175+
.append(Configuration.getGlobalConfiguration().get("os.name"))
176+
.append("; ")
177+
.append(Configuration.getGlobalConfiguration().get("os.version"))
178+
.append("; auto-generated)");
179+
} else {
180+
userAgentBuilder.append(" (auto-generated)");
181+
}
182+
163183
if (retryPolicy == null) {
164184
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
165185
}
166186
List<HttpPipelinePolicy> policies = new ArrayList<>();
167-
policies
168-
.add(
169-
new UserAgentPolicy(
170-
null,
171-
"com.azure.resourcemanager.confluent",
172-
"1.0.0-beta.1",
173-
Configuration.getGlobalConfiguration()));
187+
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
174188
policies.add(new RequestIdPolicy());
175189
HttpPolicyProviders.addBeforeRetryPolicies(policies);
176190
policies.add(retryPolicy);
@@ -179,6 +193,7 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr
179193
.add(
180194
new BearerTokenAuthenticationPolicy(
181195
credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
196+
policies.addAll(this.policies);
182197
HttpPolicyProviders.addAfterRetryPolicies(policies);
183198
policies.add(new HttpLoggingPolicy(httpLogOptions));
184199
HttpPipeline httpPipeline =

sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import com.azure.core.annotation.JsonFlatten;
99
import com.azure.core.management.Resource;
1010
import com.azure.core.util.logging.ClientLogger;
11-
import com.azure.resourcemanager.confluent.models.OfferDetail;
11+
import com.azure.resourcemanager.confluent.models.OrganizationResourcePropertiesOfferDetail;
12+
import com.azure.resourcemanager.confluent.models.OrganizationResourcePropertiesUserDetail;
1213
import com.azure.resourcemanager.confluent.models.ProvisionState;
13-
import com.azure.resourcemanager.confluent.models.UserDetail;
1414
import com.fasterxml.jackson.annotation.JsonIgnore;
1515
import com.fasterxml.jackson.annotation.JsonProperty;
1616
import java.time.OffsetDateTime;
@@ -31,7 +31,7 @@ public class OrganizationResourceInner extends Resource {
3131
/*
3232
* Provision states for confluent RP
3333
*/
34-
@JsonProperty(value = "properties.provisioningState")
34+
@JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
3535
private ProvisionState provisioningState;
3636

3737
/*
@@ -50,13 +50,13 @@ public class OrganizationResourceInner extends Resource {
5050
* Confluent offer detail
5151
*/
5252
@JsonProperty(value = "properties.offerDetail")
53-
private OfferDetail offerDetail;
53+
private OrganizationResourcePropertiesOfferDetail offerDetail;
5454

5555
/*
5656
* Subscriber detail
5757
*/
5858
@JsonProperty(value = "properties.userDetail")
59-
private UserDetail userDetail;
59+
private OrganizationResourcePropertiesUserDetail userDetail;
6060

6161
/**
6262
* Get the createdTime property: The creation time of the resource.
@@ -76,17 +76,6 @@ public ProvisionState provisioningState() {
7676
return this.provisioningState;
7777
}
7878

79-
/**
80-
* Set the provisioningState property: Provision states for confluent RP.
81-
*
82-
* @param provisioningState the provisioningState value to set.
83-
* @return the OrganizationResourceInner object itself.
84-
*/
85-
public OrganizationResourceInner withProvisioningState(ProvisionState provisioningState) {
86-
this.provisioningState = provisioningState;
87-
return this;
88-
}
89-
9079
/**
9180
* Get the organizationId property: Id of the Confluent organization.
9281
*
@@ -110,7 +99,7 @@ public String ssoUrl() {
11099
*
111100
* @return the offerDetail value.
112101
*/
113-
public OfferDetail offerDetail() {
102+
public OrganizationResourcePropertiesOfferDetail offerDetail() {
114103
return this.offerDetail;
115104
}
116105

@@ -120,7 +109,7 @@ public OfferDetail offerDetail() {
120109
* @param offerDetail the offerDetail value to set.
121110
* @return the OrganizationResourceInner object itself.
122111
*/
123-
public OrganizationResourceInner withOfferDetail(OfferDetail offerDetail) {
112+
public OrganizationResourceInner withOfferDetail(OrganizationResourcePropertiesOfferDetail offerDetail) {
124113
this.offerDetail = offerDetail;
125114
return this;
126115
}
@@ -130,7 +119,7 @@ public OrganizationResourceInner withOfferDetail(OfferDetail offerDetail) {
130119
*
131120
* @return the userDetail value.
132121
*/
133-
public UserDetail userDetail() {
122+
public OrganizationResourcePropertiesUserDetail userDetail() {
134123
return this.userDetail;
135124
}
136125

@@ -140,7 +129,7 @@ public UserDetail userDetail() {
140129
* @param userDetail the userDetail value to set.
141130
* @return the OrganizationResourceInner object itself.
142131
*/
143-
public OrganizationResourceInner withUserDetail(UserDetail userDetail) {
132+
public OrganizationResourceInner withUserDetail(OrganizationResourcePropertiesUserDetail userDetail) {
144133
this.userDetail = userDetail;
145134
return this;
146135
}

sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentAgreementResourceImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44

55
package com.azure.resourcemanager.confluent.implementation;
66

7-
import com.azure.resourcemanager.confluent.ConfluentManager;
87
import com.azure.resourcemanager.confluent.fluent.models.ConfluentAgreementResourceInner;
98
import com.azure.resourcemanager.confluent.models.ConfluentAgreementResource;
109
import java.time.OffsetDateTime;
1110

1211
public final class ConfluentAgreementResourceImpl implements ConfluentAgreementResource {
1312
private ConfluentAgreementResourceInner innerObject;
1413

15-
private final ConfluentManager serviceManager;
14+
private final com.azure.resourcemanager.confluent.ConfluentManager serviceManager;
1615

17-
ConfluentAgreementResourceImpl(ConfluentAgreementResourceInner innerObject, ConfluentManager serviceManager) {
16+
ConfluentAgreementResourceImpl(
17+
ConfluentAgreementResourceInner innerObject,
18+
com.azure.resourcemanager.confluent.ConfluentManager serviceManager) {
1819
this.innerObject = innerObject;
1920
this.serviceManager = serviceManager;
2021
}
@@ -67,7 +68,7 @@ public ConfluentAgreementResourceInner innerModel() {
6768
return this.innerObject;
6869
}
6970

70-
private ConfluentManager manager() {
71+
private com.azure.resourcemanager.confluent.ConfluentManager manager() {
7172
return this.serviceManager;
7273
}
7374
}

sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public <T, U> Mono<U> getLroFinalResultOrError(AsyncPollResponse<PollResult<T>,
258258
if (managementError.getCode() == null || managementError.getMessage() == null) {
259259
managementError = null;
260260
}
261-
} catch (IOException ioe) {
261+
} catch (IOException | RuntimeException ioe) {
262262
logger.logThrowableAsWarning(ioe);
263263
}
264264
}
@@ -287,7 +287,7 @@ private static final class HttpResponseImpl extends HttpResponse {
287287
super(null);
288288
this.statusCode = statusCode;
289289
this.httpHeaders = httpHeaders;
290-
this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8);
290+
this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
291291
}
292292

293293
public int getStatusCode() {

sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/MarketplaceAgreementsClientImpl.java

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.azure.core.annotation.HostParam;
1414
import com.azure.core.annotation.PathParam;
1515
import com.azure.core.annotation.Put;
16+
import com.azure.core.annotation.QueryParam;
1617
import com.azure.core.annotation.ReturnType;
1718
import com.azure.core.annotation.ServiceInterface;
1819
import com.azure.core.annotation.ServiceMethod;
@@ -67,6 +68,7 @@ private interface MarketplaceAgreementsService {
6768
@UnexpectedResponseExceptionType(ManagementException.class)
6869
Mono<Response<ConfluentAgreementResourceListResponse>> list(
6970
@HostParam("$host") String endpoint,
71+
@QueryParam("api-version") String apiVersion,
7072
@PathParam("subscriptionId") String subscriptionId,
7173
@HeaderParam("Accept") String accept,
7274
Context context);
@@ -77,6 +79,7 @@ Mono<Response<ConfluentAgreementResourceListResponse>> list(
7779
@UnexpectedResponseExceptionType(ManagementException.class)
7880
Mono<Response<ConfluentAgreementResourceInner>> create(
7981
@HostParam("$host") String endpoint,
82+
@QueryParam("api-version") String apiVersion,
8083
@PathParam("subscriptionId") String subscriptionId,
8184
@BodyParam("application/json") ConfluentAgreementResourceInner body,
8285
@HeaderParam("Accept") String accept,
@@ -117,7 +120,14 @@ private Mono<PagedResponse<ConfluentAgreementResourceInner>> listSinglePageAsync
117120
final String accept = "application/json";
118121
return FluxUtil
119122
.withContext(
120-
context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), accept, context))
123+
context ->
124+
service
125+
.list(
126+
this.client.getEndpoint(),
127+
this.client.getApiVersion(),
128+
this.client.getSubscriptionId(),
129+
accept,
130+
context))
121131
.<PagedResponse<ConfluentAgreementResourceInner>>map(
122132
res ->
123133
new PagedResponseBase<>(
@@ -127,7 +137,7 @@ private Mono<PagedResponse<ConfluentAgreementResourceInner>> listSinglePageAsync
127137
res.getValue().value(),
128138
res.getValue().nextLink(),
129139
null))
130-
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
140+
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
131141
}
132142

133143
/**
@@ -156,7 +166,12 @@ private Mono<PagedResponse<ConfluentAgreementResourceInner>> listSinglePageAsync
156166
final String accept = "application/json";
157167
context = this.client.mergeContext(context);
158168
return service
159-
.list(this.client.getEndpoint(), this.client.getSubscriptionId(), accept, context)
169+
.list(
170+
this.client.getEndpoint(),
171+
this.client.getApiVersion(),
172+
this.client.getSubscriptionId(),
173+
accept,
174+
context)
160175
.map(
161176
res ->
162177
new PagedResponseBase<>(
@@ -252,8 +267,15 @@ private Mono<Response<ConfluentAgreementResourceInner>> createWithResponseAsync(
252267
return FluxUtil
253268
.withContext(
254269
context ->
255-
service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), body, accept, context))
256-
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
270+
service
271+
.create(
272+
this.client.getEndpoint(),
273+
this.client.getApiVersion(),
274+
this.client.getSubscriptionId(),
275+
body,
276+
accept,
277+
context))
278+
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
257279
}
258280

259281
/**
@@ -286,7 +308,14 @@ private Mono<Response<ConfluentAgreementResourceInner>> createWithResponseAsync(
286308
}
287309
final String accept = "application/json";
288310
context = this.client.mergeContext(context);
289-
return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), body, accept, context);
311+
return service
312+
.create(
313+
this.client.getEndpoint(),
314+
this.client.getApiVersion(),
315+
this.client.getSubscriptionId(),
316+
body,
317+
accept,
318+
context);
290319
}
291320

292321
/**
@@ -393,7 +422,7 @@ private Mono<PagedResponse<ConfluentAgreementResourceInner>> listNextSinglePageA
393422
res.getValue().value(),
394423
res.getValue().nextLink(),
395424
null))
396-
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
425+
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
397426
}
398427

399428
/**

0 commit comments

Comments
 (0)