Skip to content

Commit 39a9b48

Browse files
author
SDKAuto
committed
CodeGen from PR 13166 in Azure/azure-rest-api-specs
Merge b353336f78b47a9a9d83765d68a6b9b87ea76f95 into 89f00c23e9b247304c490504f182aebd0dff4f4e
1 parent 6e7e9fb commit 39a9b48

File tree

14 files changed

+220
-66
lines changed

14 files changed

+220
-66
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-02-26)
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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.13.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: 21 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);

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
/*
@@ -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
*

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: 33 additions & 4 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<>(
@@ -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,7 +267,14 @@ private Mono<Response<ConfluentAgreementResourceInner>> createWithResponseAsync(
252267
return FluxUtil
253268
.withContext(
254269
context ->
255-
service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), body, accept, context))
270+
service
271+
.create(
272+
this.client.getEndpoint(),
273+
this.client.getApiVersion(),
274+
this.client.getSubscriptionId(),
275+
body,
276+
accept,
277+
context))
256278
.subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
257279
}
258280

@@ -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
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public MarketplaceAgreementsImpl(MarketplaceAgreementsClient innerClient, Conflu
3030

3131
public PagedIterable<ConfluentAgreementResource> list() {
3232
PagedIterable<ConfluentAgreementResourceInner> inner = this.serviceClient().list();
33-
return inner.mapPage(inner1 -> new ConfluentAgreementResourceImpl(inner1, this.manager()));
33+
return Utils.mapPage(inner, inner1 -> new ConfluentAgreementResourceImpl(inner1, this.manager()));
3434
}
3535

3636
public PagedIterable<ConfluentAgreementResource> list(Context context) {
3737
PagedIterable<ConfluentAgreementResourceInner> inner = this.serviceClient().list(context);
38-
return inner.mapPage(inner1 -> new ConfluentAgreementResourceImpl(inner1, this.manager()));
38+
return Utils.mapPage(inner, inner1 -> new ConfluentAgreementResourceImpl(inner1, this.manager()));
3939
}
4040

4141
public ConfluentAgreementResource create() {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ public OrganizationOperationsImpl(OrganizationOperationsClient innerClient, Conf
2828

2929
public PagedIterable<OperationResult> list() {
3030
PagedIterable<OperationResultInner> inner = this.serviceClient().list();
31-
return inner.mapPage(inner1 -> new OperationResultImpl(inner1, this.manager()));
31+
return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager()));
3232
}
3333

3434
public PagedIterable<OperationResult> list(Context context) {
3535
PagedIterable<OperationResultInner> inner = this.serviceClient().list(context);
36-
return inner.mapPage(inner1 -> new OperationResultImpl(inner1, this.manager()));
36+
return Utils.mapPage(inner, inner1 -> new OperationResultImpl(inner1, this.manager()));
3737
}
3838

3939
private OrganizationOperationsClient serviceClient() {

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ public OrganizationResourceImpl withTags(Map<String, String> tags) {
195195
}
196196
}
197197

198-
public OrganizationResourceImpl withProvisioningState(ProvisionState provisioningState) {
199-
this.innerModel().withProvisioningState(provisioningState);
200-
return this;
201-
}
202-
203198
public OrganizationResourceImpl withOfferDetail(OfferDetail offerDetail) {
204199
this.innerModel().withOfferDetail(offerDetail);
205200
return this;

0 commit comments

Comments
 (0)