Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-resourcemanager-confluent] confluent t2 config #8526

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2021-05-10)

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

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

Expand Down
20 changes: 18 additions & 2 deletions sdk/confluent/azure-resourcemanager-confluent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,21 @@

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).
This package contains Microsoft Azure SDK for Confluent Management SDK. Package tag package-2020-03-01-preview. 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

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.

If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.

Thank you in advance for your collaboration. We really appreciate your time!

## Documentation

Various documentation is available to help you get started

- [API reference documentation][docs]

## Getting started

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

<!-- LINKS -->
[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
[docs]: https://azure.github.io/azure-sdk-for-java/
[jdk]: https://docs.microsoft.com/java/azure/jdk/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity
Expand Down
7 changes: 6 additions & 1 deletion sdk/confluent/azure-resourcemanager-confluent/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 Confluent Management</name>
<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>
<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-preview.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down Expand Up @@ -41,6 +41,11 @@
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
</properties>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.16.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-management</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,31 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");

StringBuilder userAgentBuilder = new StringBuilder();
userAgentBuilder
.append("azsdk-java")
.append("-")
.append("com.azure.resourcemanager.confluent")
.append("/")
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
.append("; ")
.append(Configuration.getGlobalConfiguration().get("os.name"))
.append("; ")
.append(Configuration.getGlobalConfiguration().get("os.version"))
.append("; auto-generated)");
} else {
userAgentBuilder.append(" (auto-generated)");
}

if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies
.add(
new UserAgentPolicy(
null,
"com.azure.resourcemanager.confluent",
"1.0.0-beta.1",
Configuration.getGlobalConfiguration()));
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
Expand All @@ -179,6 +193,7 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr
.add(
new BearerTokenAuthenticationPolicy(
credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
policies.addAll(this.policies);
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
HttpPipeline httpPipeline =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ public interface MarketplaceAgreementsClient {
PagedIterable<ConfluentAgreementResourceInner> list(Context context);

/**
* Accept marketplace terms.
* Create Confluent Marketplace agreement in the subscription.
*
* @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 confluent Agreements Resource.
* @return agreement Terms definition.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
ConfluentAgreementResourceInner create();

/**
* Accept marketplace terms.
* Create Confluent Marketplace agreement in the subscription.
*
* @param body Confluent Agreement resource.
* @param body Confluent Marketplace Agreement resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @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 confluent Agreements Resource.
* @return agreement Terms definition.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ConfluentAgreementResourceInner> createWithResponse(ConfluentAgreementResourceInner body, Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Confluent Agreements Resource. */
/** Agreement Terms definition. */
@JsonFlatten
@Fluent
public class ConfluentAgreementResourceInner extends ProxyResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.confluent.models.OfferDetail;
import com.azure.resourcemanager.confluent.models.OrganizationResourcePropertiesOfferDetail;
import com.azure.resourcemanager.confluent.models.OrganizationResourcePropertiesUserDetail;
import com.azure.resourcemanager.confluent.models.ProvisionState;
import com.azure.resourcemanager.confluent.models.UserDetail;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
Expand All @@ -31,7 +31,7 @@ public class OrganizationResourceInner extends Resource {
/*
* Provision states for confluent RP
*/
@JsonProperty(value = "properties.provisioningState")
@JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
private ProvisionState provisioningState;

/*
Expand All @@ -50,13 +50,13 @@ public class OrganizationResourceInner extends Resource {
* Confluent offer detail
*/
@JsonProperty(value = "properties.offerDetail")
private OfferDetail offerDetail;
private OrganizationResourcePropertiesOfferDetail offerDetail;

/*
* Subscriber detail
*/
@JsonProperty(value = "properties.userDetail")
private UserDetail userDetail;
private OrganizationResourcePropertiesUserDetail userDetail;

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

/**
* Set the provisioningState property: Provision states for confluent RP.
*
* @param provisioningState the provisioningState value to set.
* @return the OrganizationResourceInner object itself.
*/
public OrganizationResourceInner withProvisioningState(ProvisionState provisioningState) {
this.provisioningState = provisioningState;
return this;
}

/**
* Get the organizationId property: Id of the Confluent organization.
*
Expand All @@ -110,7 +99,7 @@ public String ssoUrl() {
*
* @return the offerDetail value.
*/
public OfferDetail offerDetail() {
public OrganizationResourcePropertiesOfferDetail offerDetail() {
return this.offerDetail;
}

Expand All @@ -120,7 +109,7 @@ public OfferDetail offerDetail() {
* @param offerDetail the offerDetail value to set.
* @return the OrganizationResourceInner object itself.
*/
public OrganizationResourceInner withOfferDetail(OfferDetail offerDetail) {
public OrganizationResourceInner withOfferDetail(OrganizationResourcePropertiesOfferDetail offerDetail) {
this.offerDetail = offerDetail;
return this;
}
Expand All @@ -130,7 +119,7 @@ public OrganizationResourceInner withOfferDetail(OfferDetail offerDetail) {
*
* @return the userDetail value.
*/
public UserDetail userDetail() {
public OrganizationResourcePropertiesUserDetail userDetail() {
return this.userDetail;
}

Expand All @@ -140,7 +129,7 @@ public UserDetail userDetail() {
* @param userDetail the userDetail value to set.
* @return the OrganizationResourceInner object itself.
*/
public OrganizationResourceInner withUserDetail(UserDetail userDetail) {
public OrganizationResourceInner withUserDetail(OrganizationResourcePropertiesUserDetail userDetail) {
this.userDetail = userDetail;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@

package com.azure.resourcemanager.confluent.implementation;

import com.azure.resourcemanager.confluent.ConfluentManager;
import com.azure.resourcemanager.confluent.fluent.models.ConfluentAgreementResourceInner;
import com.azure.resourcemanager.confluent.models.ConfluentAgreementResource;
import java.time.OffsetDateTime;

public final class ConfluentAgreementResourceImpl implements ConfluentAgreementResource {
private ConfluentAgreementResourceInner innerObject;

private final ConfluentManager serviceManager;
private final com.azure.resourcemanager.confluent.ConfluentManager serviceManager;

ConfluentAgreementResourceImpl(ConfluentAgreementResourceInner innerObject, ConfluentManager serviceManager) {
ConfluentAgreementResourceImpl(
ConfluentAgreementResourceInner innerObject,
com.azure.resourcemanager.confluent.ConfluentManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
Expand Down Expand Up @@ -67,7 +68,7 @@ public ConfluentAgreementResourceInner innerModel() {
return this.innerObject;
}

private ConfluentManager manager() {
private com.azure.resourcemanager.confluent.ConfluentManager manager() {
return this.serviceManager;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public OrganizationsClient getOrganizations() {
this.defaultPollInterval = defaultPollInterval;
this.subscriptionId = subscriptionId;
this.endpoint = endpoint;
this.apiVersion = "2020-03-01";
this.apiVersion = "2020-03-01-preview";
this.marketplaceAgreements = new MarketplaceAgreementsClientImpl(this);
this.organizationOperations = new OrganizationOperationsClientImpl(this);
this.organizations = new OrganizationsClientImpl(this);
Expand Down Expand Up @@ -258,7 +258,7 @@ public <T, U> Mono<U> getLroFinalResultOrError(AsyncPollResponse<PollResult<T>,
if (managementError.getCode() == null || managementError.getMessage() == null) {
managementError = null;
}
} catch (IOException ioe) {
} catch (IOException | RuntimeException ioe) {
logger.logThrowableAsWarning(ioe);
}
}
Expand Down Expand Up @@ -287,7 +287,7 @@ private static final class HttpResponseImpl extends HttpResponse {
super(null);
this.statusCode = statusCode;
this.httpHeaders = httpHeaders;
this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8);
this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
}

public int getStatusCode() {
Expand Down
Loading