From 00897c62d664d6980c7a23353ab30c0597525acc Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 29 Oct 2021 08:36:12 +0000 Subject: [PATCH] CodeGen from PR 16048 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.Confluent to add version preview/2021-09-01-preview (#16048) * Adds base for updating Microsoft.Confluent from version preview/2021-03-01-preview to version 2021-09-01-preview * Updates readme * Updates API version in new specs and examples * Fixing spellcheck (#16551) --- .../CHANGELOG.md | 3 +- .../azure-resourcemanager-confluent/README.md | 7 +- .../azure-resourcemanager-confluent/SAMPLE.md | 321 ++++++++++++++++++ .../azure-resourcemanager-confluent/pom.xml | 177 +++++----- .../confluent/ConfluentManager.java | 24 +- .../confluent/fluent/OrganizationsClient.java | 8 +- .../models/ConfluentAgreementProperties.java | 236 +++++++++++++ .../ConfluentAgreementResourceInner.java | 121 +++---- .../models/OrganizationResourceInner.java | 115 +++---- .../OrganizationResourceProperties.java | 156 +++++++++ .../ConfluentManagementClientImpl.java | 2 +- .../OrganizationsClientImpl.java | 16 +- .../confluent/models/OfferDetail.java | 6 +- .../models/OrganizationResource.java | 2 +- .../models/OrganizationResourceUpdate.java | 2 + .../MarketplaceAgreementsCreateSamples.java | 22 ++ .../MarketplaceAgreementsListSamples.java | 22 ++ .../generated/OrganizationCreateSamples.java | 54 +++ .../generated/OrganizationDeleteSamples.java | 22 ++ ...OrganizationGetByResourceGroupSamples.java | 22 ++ ...rganizationListByResourceGroupSamples.java | 22 ++ .../generated/OrganizationListSamples.java | 22 ++ .../OrganizationOperationsListSamples.java | 22 ++ .../generated/OrganizationUpdateSamples.java | 41 +++ ...alidationsValidateOrganizationSamples.java | 58 ++++ 25 files changed, 1263 insertions(+), 240 deletions(-) create mode 100644 sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementProperties.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceProperties.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsCreateSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsListSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationDeleteSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetByResourceGroupSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListByResourceGroupSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationOperationsListSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationUpdateSamples.java create mode 100644 sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationSamples.java diff --git a/sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md b/sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md index 0d9c5f1dcab0..3022a62228bd 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md +++ b/sdk/confluent/azure-resourcemanager-confluent/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2021-10-29) +- Azure Resource Manager Confluent client library for Java. This package contains Microsoft Azure SDK for Confluent Management SDK. Package tag package-preview-2021-09. 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.2 (2021-05-13) diff --git a/sdk/confluent/azure-resourcemanager-confluent/README.md b/sdk/confluent/azure-resourcemanager-confluent/README.md index 1d88d636610a..8a5f23182195 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/README.md +++ b/sdk/confluent/azure-resourcemanager-confluent/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Confluent client library for Java. -This package contains Microsoft Azure SDK for Confluent Management SDK. Package tag package-2021-03-01-preview. 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-preview-2021-09. 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 @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-confluent - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,9 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md b/sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md new file mode 100644 index 000000000000..6cb696b1a518 --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/SAMPLE.md @@ -0,0 +1,321 @@ +# Code snippets and samples + + +## MarketplaceAgreements + +- [Create](#marketplaceagreements_create) +- [List](#marketplaceagreements_list) + +## Organization + +- [Create](#organization_create) +- [Delete](#organization_delete) +- [GetByResourceGroup](#organization_getbyresourcegroup) +- [List](#organization_list) +- [ListByResourceGroup](#organization_listbyresourcegroup) +- [Update](#organization_update) + +## OrganizationOperations + +- [List](#organizationoperations_list) + +## Validations + +- [ValidateOrganization](#validations_validateorganization) +### MarketplaceAgreements_Create + +```java +import com.azure.core.util.Context; + +/** Samples for MarketplaceAgreements Create. */ +public final class MarketplaceAgreementsCreateSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/MarketplaceAgreements_Create.json + */ + /** + * Sample code: MarketplaceAgreements_Create. + * + * @param manager Entry point to ConfluentManager. + */ + public static void marketplaceAgreementsCreate(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.marketplaceAgreements().createWithResponse(null, Context.NONE); + } +} +``` + +### MarketplaceAgreements_List + +```java +import com.azure.core.util.Context; + +/** Samples for MarketplaceAgreements List. */ +public final class MarketplaceAgreementsListSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/MarketplaceAgreements_List.json + */ + /** + * Sample code: MarketplaceAgreements_List. + * + * @param manager Entry point to ConfluentManager. + */ + public static void marketplaceAgreementsList(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.marketplaceAgreements().list(Context.NONE); + } +} +``` + +### Organization_Create + +```java +import com.azure.resourcemanager.confluent.models.OfferDetail; +import com.azure.resourcemanager.confluent.models.UserDetail; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Organization Create. */ +public final class OrganizationCreateSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_Create.json + */ + /** + * Sample code: Organization_Create. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationCreate(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager + .organizations() + .define("myOrganization") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOfferDetail( + new OfferDetail() + .withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string")) + .withUserDetail( + new UserDetail() + .withFirstName("string") + .withLastName("string") + .withEmailAddress("contoso@microsoft.com")) + .withTags(mapOf("Environment", "Dev")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### Organization_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Organization Delete. */ +public final class OrganizationDeleteSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_Delete.json + */ + /** + * Sample code: Confluent_Delete. + * + * @param manager Entry point to ConfluentManager. + */ + public static void confluentDelete(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizations().delete("myResourceGroup", "myOrganization", Context.NONE); + } +} +``` + +### Organization_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Organization GetByResourceGroup. */ +public final class OrganizationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_Get.json + */ + /** + * Sample code: Organization_Get. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationGet(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizations().getByResourceGroupWithResponse("myResourceGroup", "myOrganization", Context.NONE); + } +} +``` + +### Organization_List + +```java +import com.azure.core.util.Context; + +/** Samples for Organization List. */ +public final class OrganizationListSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_ListBySubscription.json + */ + /** + * Sample code: Organization_ListBySubscription. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationListBySubscription(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizations().list(Context.NONE); + } +} +``` + +### Organization_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for Organization ListByResourceGroup. */ +public final class OrganizationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_ListByResourceGroup.json + */ + /** + * Sample code: Organization_ListByResourceGroup. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationListByResourceGroup(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizations().listByResourceGroup("myResourceGroup", Context.NONE); + } +} +``` + +### Organization_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.confluent.models.OrganizationResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Organization Update. */ +public final class OrganizationUpdateSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_Update.json + */ + /** + * Sample code: Confluent_Update. + * + * @param manager Entry point to ConfluentManager. + */ + public static void confluentUpdate(com.azure.resourcemanager.confluent.ConfluentManager manager) { + OrganizationResource resource = + manager + .organizations() + .getByResourceGroupWithResponse("myResourceGroup", "myOrganization", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("client", "dev-client", "env", "dev")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### OrganizationOperations_List + +```java +import com.azure.core.util.Context; + +/** Samples for OrganizationOperations List. */ +public final class OrganizationOperationsListSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/OrganizationOperations_List.json + */ + /** + * Sample code: OrganizationOperations_List. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationOperationsList(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizationOperations().list(Context.NONE); + } +} +``` + +### Validations_ValidateOrganization + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.confluent.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.confluent.models.OfferDetail; +import com.azure.resourcemanager.confluent.models.UserDetail; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Validations ValidateOrganization. */ +public final class ValidationsValidateOrganizationSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Validations_ValidateOrganizations.json + */ + /** + * Sample code: Validations_ValidateOrganizations. + * + * @param manager Entry point to ConfluentManager. + */ + public static void validationsValidateOrganizations(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager + .validations() + .validateOrganizationWithResponse( + "myResourceGroup", + "myOrganization", + new OrganizationResourceInner() + .withLocation("West US") + .withTags(mapOf("Environment", "Dev")) + .withOfferDetail( + new OfferDetail() + .withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string")) + .withUserDetail( + new UserDetail() + .withFirstName("string") + .withLastName("string") + .withEmailAddress("abc@microsoft.com")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + diff --git a/sdk/confluent/azure-resourcemanager-confluent/pom.xml b/sdk/confluent/azure-resourcemanager-confluent/pom.xml index ca24b61a19c6..e64c664fffd4 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/pom.xml +++ b/sdk/confluent/azure-resourcemanager-confluent/pom.xml @@ -1,85 +1,104 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-confluent - 1.0.0-beta.3 - jar + com.azure.resourcemanager + azure-resourcemanager-confluent + 1.0.0-beta.3 + jar - Microsoft Azure SDK for Confluent Management - 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-2021-03-01-preview. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for Confluent Management + 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-preview-2021-09. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.21.0 - - - com.azure - azure-core-management - 1.4.2 - - - com.azure - azure-identity - 1.4.0 - test - - - com.azure - azure-core-test - 1.7.3 - test - - - com.azure.resourcemanager - azure-resourcemanager-resources - 2.9.0 - test - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.7 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.21.0 + + + com.azure + azure-core-management + 1.4.2 + + + com.azure + azure-identity + 1.4.0 + test + + + com.azure + azure-core-test + 1.7.3 + test + + + com.azure.resourcemanager + azure-resourcemanager-resources + 2.9.0 + test + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.7 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java index a76176df96ae..fb4e23b4bba8 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/ConfluentManager.java @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +16,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -89,6 +89,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -128,6 +129,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { return this; } + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + /** * Sets the retry policy to the HTTP pipeline. * @@ -170,7 +182,7 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr .append("-") .append("com.azure.resourcemanager.confluent") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -184,6 +196,9 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -193,10 +208,7 @@ public ConfluentManager authenticate(TokenCredential credential, AzureProfile pr HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/OrganizationsClient.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/OrganizationsClient.java index 9d48ef8e938a..c2843314b347 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/OrganizationsClient.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/OrganizationsClient.java @@ -102,7 +102,7 @@ Response getByResourceGroupWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return organization resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OrganizationResourceInner> beginCreate( String resourceGroupName, String organizationName, OrganizationResourceInner body); @@ -118,7 +118,7 @@ SyncPoller, OrganizationResourceInner> beg * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return organization resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, OrganizationResourceInner> beginCreate( String resourceGroupName, String organizationName, OrganizationResourceInner body, Context context); @@ -204,7 +204,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName); /** @@ -218,7 +218,7 @@ Response updateWithResponse( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName, Context context); /** diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementProperties.java new file mode 100644 index 000000000000..eed0203d860c --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementProperties.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Terms properties for Marketplace and Confluent. */ +@Fluent +public final class ConfluentAgreementProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfluentAgreementProperties.class); + + /* + * Publisher identifier string. + */ + @JsonProperty(value = "publisher") + private String publisher; + + /* + * Product identifier string. + */ + @JsonProperty(value = "product") + private String product; + + /* + * Plan identifier string. + */ + @JsonProperty(value = "plan") + private String plan; + + /* + * Link to HTML with Microsoft and Publisher terms. + */ + @JsonProperty(value = "licenseTextLink") + private String licenseTextLink; + + /* + * Link to the privacy policy of the publisher. + */ + @JsonProperty(value = "privacyPolicyLink") + private String privacyPolicyLink; + + /* + * Date and time in UTC of when the terms were accepted. This is empty if + * Accepted is false. + */ + @JsonProperty(value = "retrieveDatetime") + private OffsetDateTime retrieveDatetime; + + /* + * Terms signature. + */ + @JsonProperty(value = "signature") + private String signature; + + /* + * If any version of the terms have been accepted, otherwise false. + */ + @JsonProperty(value = "accepted") + private Boolean accepted; + + /** + * Get the publisher property: Publisher identifier string. + * + * @return the publisher value. + */ + public String publisher() { + return this.publisher; + } + + /** + * Set the publisher property: Publisher identifier string. + * + * @param publisher the publisher value to set. + * @return the ConfluentAgreementProperties object itself. + */ + public ConfluentAgreementProperties withPublisher(String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get the product property: Product identifier string. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Set the product property: Product identifier string. + * + * @param product the product value to set. + * @return the ConfluentAgreementProperties object itself. + */ + public ConfluentAgreementProperties withProduct(String product) { + this.product = product; + return this; + } + + /** + * Get the plan property: Plan identifier string. + * + * @return the plan value. + */ + public String plan() { + return this.plan; + } + + /** + * Set the plan property: Plan identifier string. + * + * @param plan the plan value to set. + * @return the ConfluentAgreementProperties object itself. + */ + public ConfluentAgreementProperties withPlan(String plan) { + this.plan = plan; + return this; + } + + /** + * Get the licenseTextLink property: Link to HTML with Microsoft and Publisher terms. + * + * @return the licenseTextLink value. + */ + public String licenseTextLink() { + return this.licenseTextLink; + } + + /** + * Set the licenseTextLink property: Link to HTML with Microsoft and Publisher terms. + * + * @param licenseTextLink the licenseTextLink value to set. + * @return the ConfluentAgreementProperties object itself. + */ + public ConfluentAgreementProperties withLicenseTextLink(String licenseTextLink) { + this.licenseTextLink = licenseTextLink; + return this; + } + + /** + * Get the privacyPolicyLink property: Link to the privacy policy of the publisher. + * + * @return the privacyPolicyLink value. + */ + public String privacyPolicyLink() { + return this.privacyPolicyLink; + } + + /** + * Set the privacyPolicyLink property: Link to the privacy policy of the publisher. + * + * @param privacyPolicyLink the privacyPolicyLink value to set. + * @return the ConfluentAgreementProperties object itself. + */ + public ConfluentAgreementProperties withPrivacyPolicyLink(String privacyPolicyLink) { + this.privacyPolicyLink = privacyPolicyLink; + return this; + } + + /** + * Get the retrieveDatetime property: Date and time in UTC of when the terms were accepted. This is empty if + * Accepted is false. + * + * @return the retrieveDatetime value. + */ + public OffsetDateTime retrieveDatetime() { + return this.retrieveDatetime; + } + + /** + * Set the retrieveDatetime property: Date and time in UTC of when the terms were accepted. This is empty if + * Accepted is false. + * + * @param retrieveDatetime the retrieveDatetime value to set. + * @return the ConfluentAgreementProperties object itself. + */ + public ConfluentAgreementProperties withRetrieveDatetime(OffsetDateTime retrieveDatetime) { + this.retrieveDatetime = retrieveDatetime; + return this; + } + + /** + * Get the signature property: Terms signature. + * + * @return the signature value. + */ + public String signature() { + return this.signature; + } + + /** + * Set the signature property: Terms signature. + * + * @param signature the signature value to set. + * @return the ConfluentAgreementProperties object itself. + */ + public ConfluentAgreementProperties withSignature(String signature) { + this.signature = signature; + return this; + } + + /** + * Get the accepted property: If any version of the terms have been accepted, otherwise false. + * + * @return the accepted value. + */ + public Boolean accepted() { + return this.accepted; + } + + /** + * Set the accepted property: If any version of the terms have been accepted, otherwise false. + * + * @param accepted the accepted value to set. + * @return the ConfluentAgreementProperties object itself. + */ + public ConfluentAgreementProperties withAccepted(Boolean accepted) { + this.accepted = accepted; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementResourceInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementResourceInner.java index 08e91741fe1c..637b1e9457ea 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementResourceInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/ConfluentAgreementResourceInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; @@ -14,9 +13,8 @@ import java.time.OffsetDateTime; /** Agreement Terms definition. */ -@JsonFlatten @Fluent -public class ConfluentAgreementResourceInner extends ProxyResource { +public final class ConfluentAgreementResourceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfluentAgreementResourceInner.class); /* @@ -26,53 +24,10 @@ public class ConfluentAgreementResourceInner extends ProxyResource { private SystemData systemData; /* - * Publisher identifier string. + * Represents the properties of the resource. */ - @JsonProperty(value = "properties.publisher") - private String publisher; - - /* - * Product identifier string. - */ - @JsonProperty(value = "properties.product") - private String product; - - /* - * Plan identifier string. - */ - @JsonProperty(value = "properties.plan") - private String plan; - - /* - * Link to HTML with Microsoft and Publisher terms. - */ - @JsonProperty(value = "properties.licenseTextLink") - private String licenseTextLink; - - /* - * Link to the privacy policy of the publisher. - */ - @JsonProperty(value = "properties.privacyPolicyLink") - private String privacyPolicyLink; - - /* - * Date and time in UTC of when the terms were accepted. This is empty if - * Accepted is false. - */ - @JsonProperty(value = "properties.retrieveDatetime") - private OffsetDateTime retrieveDatetime; - - /* - * Terms signature. - */ - @JsonProperty(value = "properties.signature") - private String signature; - - /* - * If any version of the terms have been accepted, otherwise false. - */ - @JsonProperty(value = "properties.accepted") - private Boolean accepted; + @JsonProperty(value = "properties") + private ConfluentAgreementProperties innerProperties; /** * Get the systemData property: Metadata pertaining to creation and last modification of the resource. @@ -83,13 +38,22 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the innerProperties property: Represents the properties of the resource. + * + * @return the innerProperties value. + */ + private ConfluentAgreementProperties innerProperties() { + return this.innerProperties; + } + /** * Get the publisher property: Publisher identifier string. * * @return the publisher value. */ public String publisher() { - return this.publisher; + return this.innerProperties() == null ? null : this.innerProperties().publisher(); } /** @@ -99,7 +63,10 @@ public String publisher() { * @return the ConfluentAgreementResourceInner object itself. */ public ConfluentAgreementResourceInner withPublisher(String publisher) { - this.publisher = publisher; + if (this.innerProperties() == null) { + this.innerProperties = new ConfluentAgreementProperties(); + } + this.innerProperties().withPublisher(publisher); return this; } @@ -109,7 +76,7 @@ public ConfluentAgreementResourceInner withPublisher(String publisher) { * @return the product value. */ public String product() { - return this.product; + return this.innerProperties() == null ? null : this.innerProperties().product(); } /** @@ -119,7 +86,10 @@ public String product() { * @return the ConfluentAgreementResourceInner object itself. */ public ConfluentAgreementResourceInner withProduct(String product) { - this.product = product; + if (this.innerProperties() == null) { + this.innerProperties = new ConfluentAgreementProperties(); + } + this.innerProperties().withProduct(product); return this; } @@ -129,7 +99,7 @@ public ConfluentAgreementResourceInner withProduct(String product) { * @return the plan value. */ public String plan() { - return this.plan; + return this.innerProperties() == null ? null : this.innerProperties().plan(); } /** @@ -139,7 +109,10 @@ public String plan() { * @return the ConfluentAgreementResourceInner object itself. */ public ConfluentAgreementResourceInner withPlan(String plan) { - this.plan = plan; + if (this.innerProperties() == null) { + this.innerProperties = new ConfluentAgreementProperties(); + } + this.innerProperties().withPlan(plan); return this; } @@ -149,7 +122,7 @@ public ConfluentAgreementResourceInner withPlan(String plan) { * @return the licenseTextLink value. */ public String licenseTextLink() { - return this.licenseTextLink; + return this.innerProperties() == null ? null : this.innerProperties().licenseTextLink(); } /** @@ -159,7 +132,10 @@ public String licenseTextLink() { * @return the ConfluentAgreementResourceInner object itself. */ public ConfluentAgreementResourceInner withLicenseTextLink(String licenseTextLink) { - this.licenseTextLink = licenseTextLink; + if (this.innerProperties() == null) { + this.innerProperties = new ConfluentAgreementProperties(); + } + this.innerProperties().withLicenseTextLink(licenseTextLink); return this; } @@ -169,7 +145,7 @@ public ConfluentAgreementResourceInner withLicenseTextLink(String licenseTextLin * @return the privacyPolicyLink value. */ public String privacyPolicyLink() { - return this.privacyPolicyLink; + return this.innerProperties() == null ? null : this.innerProperties().privacyPolicyLink(); } /** @@ -179,7 +155,10 @@ public String privacyPolicyLink() { * @return the ConfluentAgreementResourceInner object itself. */ public ConfluentAgreementResourceInner withPrivacyPolicyLink(String privacyPolicyLink) { - this.privacyPolicyLink = privacyPolicyLink; + if (this.innerProperties() == null) { + this.innerProperties = new ConfluentAgreementProperties(); + } + this.innerProperties().withPrivacyPolicyLink(privacyPolicyLink); return this; } @@ -190,7 +169,7 @@ public ConfluentAgreementResourceInner withPrivacyPolicyLink(String privacyPolic * @return the retrieveDatetime value. */ public OffsetDateTime retrieveDatetime() { - return this.retrieveDatetime; + return this.innerProperties() == null ? null : this.innerProperties().retrieveDatetime(); } /** @@ -201,7 +180,10 @@ public OffsetDateTime retrieveDatetime() { * @return the ConfluentAgreementResourceInner object itself. */ public ConfluentAgreementResourceInner withRetrieveDatetime(OffsetDateTime retrieveDatetime) { - this.retrieveDatetime = retrieveDatetime; + if (this.innerProperties() == null) { + this.innerProperties = new ConfluentAgreementProperties(); + } + this.innerProperties().withRetrieveDatetime(retrieveDatetime); return this; } @@ -211,7 +193,7 @@ public ConfluentAgreementResourceInner withRetrieveDatetime(OffsetDateTime retri * @return the signature value. */ public String signature() { - return this.signature; + return this.innerProperties() == null ? null : this.innerProperties().signature(); } /** @@ -221,7 +203,10 @@ public String signature() { * @return the ConfluentAgreementResourceInner object itself. */ public ConfluentAgreementResourceInner withSignature(String signature) { - this.signature = signature; + if (this.innerProperties() == null) { + this.innerProperties = new ConfluentAgreementProperties(); + } + this.innerProperties().withSignature(signature); return this; } @@ -231,7 +216,7 @@ public ConfluentAgreementResourceInner withSignature(String signature) { * @return the accepted value. */ public Boolean accepted() { - return this.accepted; + return this.innerProperties() == null ? null : this.innerProperties().accepted(); } /** @@ -241,7 +226,10 @@ public Boolean accepted() { * @return the ConfluentAgreementResourceInner object itself. */ public ConfluentAgreementResourceInner withAccepted(Boolean accepted) { - this.accepted = accepted; + if (this.innerProperties() == null) { + this.innerProperties = new ConfluentAgreementProperties(); + } + this.innerProperties().withAccepted(accepted); return this; } @@ -251,5 +239,8 @@ public ConfluentAgreementResourceInner withAccepted(Boolean accepted) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java index 49f1caef6ec4..707eb43f9020 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.confluent.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; @@ -18,9 +17,8 @@ import java.util.Map; /** Organization resource. */ -@JsonFlatten @Fluent -public class OrganizationResourceInner extends Resource { +public final class OrganizationResourceInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(OrganizationResourceInner.class); /* @@ -30,40 +28,10 @@ public class OrganizationResourceInner extends Resource { private SystemData systemData; /* - * The creation time of the resource. + * Organization resource properties */ - @JsonProperty(value = "properties.createdTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdTime; - - /* - * Provision states for confluent RP - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ProvisionState provisioningState; - - /* - * Id of the Confluent organization. - */ - @JsonProperty(value = "properties.organizationId", access = JsonProperty.Access.WRITE_ONLY) - private String organizationId; - - /* - * SSO url for the Confluent organization. - */ - @JsonProperty(value = "properties.ssoUrl", access = JsonProperty.Access.WRITE_ONLY) - private String ssoUrl; - - /* - * Confluent offer detail - */ - @JsonProperty(value = "properties.offerDetail", required = true) - private OfferDetail offerDetail; - - /* - * Subscriber detail - */ - @JsonProperty(value = "properties.userDetail", required = true) - private UserDetail userDetail; + @JsonProperty(value = "properties", required = true) + private OrganizationResourceProperties innerProperties = new OrganizationResourceProperties(); /** * Get the systemData property: Metadata pertaining to creation and last modification of the resource. @@ -74,22 +42,45 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the innerProperties property: Organization resource properties. + * + * @return the innerProperties value. + */ + private OrganizationResourceProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public OrganizationResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public OrganizationResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the createdTime property: The creation time of the resource. * * @return the createdTime value. */ public OffsetDateTime createdTime() { - return this.createdTime; + return this.innerProperties() == null ? null : this.innerProperties().createdTime(); } /** - * Get the provisioningState property: Provision states for confluent RP. + * Get the provisioningState property: ProvisioningState Provision states for confluent RP. * * @return the provisioningState value. */ public ProvisionState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -98,7 +89,7 @@ public ProvisionState provisioningState() { * @return the organizationId value. */ public String organizationId() { - return this.organizationId; + return this.innerProperties() == null ? null : this.innerProperties().organizationId(); } /** @@ -107,7 +98,7 @@ public String organizationId() { * @return the ssoUrl value. */ public String ssoUrl() { - return this.ssoUrl; + return this.innerProperties() == null ? null : this.innerProperties().ssoUrl(); } /** @@ -116,7 +107,7 @@ public String ssoUrl() { * @return the offerDetail value. */ public OfferDetail offerDetail() { - return this.offerDetail; + return this.innerProperties() == null ? null : this.innerProperties().offerDetail(); } /** @@ -126,7 +117,10 @@ public OfferDetail offerDetail() { * @return the OrganizationResourceInner object itself. */ public OrganizationResourceInner withOfferDetail(OfferDetail offerDetail) { - this.offerDetail = offerDetail; + if (this.innerProperties() == null) { + this.innerProperties = new OrganizationResourceProperties(); + } + this.innerProperties().withOfferDetail(offerDetail); return this; } @@ -136,7 +130,7 @@ public OrganizationResourceInner withOfferDetail(OfferDetail offerDetail) { * @return the userDetail value. */ public UserDetail userDetail() { - return this.userDetail; + return this.innerProperties() == null ? null : this.innerProperties().userDetail(); } /** @@ -146,21 +140,10 @@ public UserDetail userDetail() { * @return the OrganizationResourceInner object itself. */ public OrganizationResourceInner withUserDetail(UserDetail userDetail) { - this.userDetail = userDetail; - return this; - } - - /** {@inheritDoc} */ - @Override - public OrganizationResourceInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public OrganizationResourceInner withTags(Map tags) { - super.withTags(tags); + if (this.innerProperties() == null) { + this.innerProperties = new OrganizationResourceProperties(); + } + this.innerProperties().withUserDetail(userDetail); return this; } @@ -170,21 +153,13 @@ public OrganizationResourceInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (offerDetail() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property offerDetail in model OrganizationResourceInner")); - } else { - offerDetail().validate(); - } - if (userDetail() == null) { + if (innerProperties() == null) { throw logger .logExceptionAsError( new IllegalArgumentException( - "Missing required property userDetail in model OrganizationResourceInner")); + "Missing required property innerProperties in model OrganizationResourceInner")); } else { - userDetail().validate(); + innerProperties().validate(); } } } diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceProperties.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceProperties.java new file mode 100644 index 000000000000..5cb2e5ee2ad0 --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/fluent/models/OrganizationResourceProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.confluent.models.OfferDetail; +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; + +/** Organization resource property. */ +@Fluent +public final class OrganizationResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrganizationResourceProperties.class); + + /* + * The creation time of the resource. + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * ProvisioningState Provision states for confluent RP + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisionState provisioningState; + + /* + * Id of the Confluent organization. + */ + @JsonProperty(value = "organizationId", access = JsonProperty.Access.WRITE_ONLY) + private String organizationId; + + /* + * SSO url for the Confluent organization. + */ + @JsonProperty(value = "ssoUrl", access = JsonProperty.Access.WRITE_ONLY) + private String ssoUrl; + + /* + * Confluent offer detail + */ + @JsonProperty(value = "offerDetail", required = true) + private OfferDetail offerDetail; + + /* + * Subscriber detail + */ + @JsonProperty(value = "userDetail", required = true) + private UserDetail userDetail; + + /** + * Get the createdTime property: The creation time of the resource. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the provisioningState property: ProvisioningState Provision states for confluent RP. + * + * @return the provisioningState value. + */ + public ProvisionState provisioningState() { + return this.provisioningState; + } + + /** + * Get the organizationId property: Id of the Confluent organization. + * + * @return the organizationId value. + */ + public String organizationId() { + return this.organizationId; + } + + /** + * Get the ssoUrl property: SSO url for the Confluent organization. + * + * @return the ssoUrl value. + */ + public String ssoUrl() { + return this.ssoUrl; + } + + /** + * Get the offerDetail property: Confluent offer detail. + * + * @return the offerDetail value. + */ + public OfferDetail offerDetail() { + return this.offerDetail; + } + + /** + * Set the offerDetail property: Confluent offer detail. + * + * @param offerDetail the offerDetail value to set. + * @return the OrganizationResourceProperties object itself. + */ + public OrganizationResourceProperties withOfferDetail(OfferDetail offerDetail) { + this.offerDetail = offerDetail; + return this; + } + + /** + * Get the userDetail property: Subscriber detail. + * + * @return the userDetail value. + */ + public UserDetail userDetail() { + return this.userDetail; + } + + /** + * Set the userDetail property: Subscriber detail. + * + * @param userDetail the userDetail value to set. + * @return the OrganizationResourceProperties object itself. + */ + public OrganizationResourceProperties withUserDetail(UserDetail userDetail) { + this.userDetail = userDetail; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (offerDetail() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property offerDetail in model OrganizationResourceProperties")); + } else { + offerDetail().validate(); + } + if (userDetail() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property userDetail in model OrganizationResourceProperties")); + } else { + userDetail().validate(); + } + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java index 88da4ab265d1..af2f2e09e076 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/ConfluentManagementClientImpl.java @@ -183,7 +183,7 @@ public ValidationsClient getValidations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01-preview"; + this.apiVersion = "2021-09-01-preview"; this.marketplaceAgreements = new MarketplaceAgreementsClientImpl(this); this.organizationOperations = new OrganizationOperationsClientImpl(this); this.organizations = new OrganizationsClientImpl(this); diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationsClientImpl.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationsClientImpl.java index ddfde7f8dd3e..79cc6413fd8d 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationsClientImpl.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/implementation/OrganizationsClientImpl.java @@ -750,7 +750,7 @@ private Mono>> createWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return organization resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OrganizationResourceInner> beginCreateAsync( String resourceGroupName, String organizationName, OrganizationResourceInner body) { Mono>> mono = createWithResponseAsync(resourceGroupName, organizationName, body); @@ -776,7 +776,7 @@ private PollerFlux, OrganizationResourceIn * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return organization resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, OrganizationResourceInner> beginCreateAsync( String resourceGroupName, String organizationName, OrganizationResourceInner body, Context context) { context = this.client.mergeContext(context); @@ -803,7 +803,7 @@ private PollerFlux, OrganizationResourceIn * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return organization resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OrganizationResourceInner> beginCreate( String resourceGroupName, String organizationName, OrganizationResourceInner body) { return beginCreateAsync(resourceGroupName, organizationName, body).getSyncPoller(); @@ -821,7 +821,7 @@ public SyncPoller, OrganizationResourceInn * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return organization resource. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, OrganizationResourceInner> beginCreate( String resourceGroupName, String organizationName, OrganizationResourceInner body, Context context) { return beginCreateAsync(resourceGroupName, organizationName, body, context).getSyncPoller(); @@ -1230,7 +1230,7 @@ private Mono>> deleteWithResponseAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String organizationName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, organizationName); return this @@ -1249,7 +1249,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync( String resourceGroupName, String organizationName, Context context) { context = this.client.mergeContext(context); @@ -1269,7 +1269,7 @@ private PollerFlux, Void> beginDeleteAsync( * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String organizationName) { return beginDeleteAsync(resourceGroupName, organizationName).getSyncPoller(); } @@ -1285,7 +1285,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ - @ServiceMethod(returns = ReturnType.SINGLE) + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete( String resourceGroupName, String organizationName, Context context) { return beginDeleteAsync(resourceGroupName, organizationName, context).getSyncPoller(); diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OfferDetail.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OfferDetail.java index 9f75324f9438..bf40b5969bc7 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OfferDetail.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OfferDetail.java @@ -45,7 +45,7 @@ public final class OfferDetail { private String termUnit; /* - * SaaS Offer Status + * SaaSOfferStatus SaaS Offer Status */ @JsonProperty(value = "status") private SaaSOfferStatus status; @@ -151,7 +151,7 @@ public OfferDetail withTermUnit(String termUnit) { } /** - * Get the status property: SaaS Offer Status. + * Get the status property: SaaSOfferStatus SaaS Offer Status. * * @return the status value. */ @@ -160,7 +160,7 @@ public SaaSOfferStatus status() { } /** - * Set the status property: SaaS Offer Status. + * Set the status property: SaaSOfferStatus SaaS Offer Status. * * @param status the status value to set. * @return the OfferDetail object itself. diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java index 004e28c12646..af89df1f24d0 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResource.java @@ -63,7 +63,7 @@ public interface OrganizationResource { OffsetDateTime createdTime(); /** - * Gets the provisioningState property: Provision states for confluent RP. + * Gets the provisioningState property: ProvisioningState Provision states for confluent RP. * * @return the provisioningState value. */ diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceUpdate.java b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceUpdate.java index 2ad71354abcb..26fc1617c71e 100644 --- a/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceUpdate.java +++ b/sdk/confluent/azure-resourcemanager-confluent/src/main/java/com/azure/resourcemanager/confluent/models/OrganizationResourceUpdate.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -19,6 +20,7 @@ public final class OrganizationResourceUpdate { * ARM resource tags */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsCreateSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsCreateSamples.java new file mode 100644 index 000000000000..59836e98f238 --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsCreateSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; + +/** Samples for MarketplaceAgreements Create. */ +public final class MarketplaceAgreementsCreateSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/MarketplaceAgreements_Create.json + */ + /** + * Sample code: MarketplaceAgreements_Create. + * + * @param manager Entry point to ConfluentManager. + */ + public static void marketplaceAgreementsCreate(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.marketplaceAgreements().createWithResponse(null, Context.NONE); + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsListSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsListSamples.java new file mode 100644 index 000000000000..73b90c1a2c91 --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/MarketplaceAgreementsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; + +/** Samples for MarketplaceAgreements List. */ +public final class MarketplaceAgreementsListSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/MarketplaceAgreements_List.json + */ + /** + * Sample code: MarketplaceAgreements_List. + * + * @param manager Entry point to ConfluentManager. + */ + public static void marketplaceAgreementsList(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.marketplaceAgreements().list(Context.NONE); + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateSamples.java new file mode 100644 index 000000000000..9669d1126876 --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationCreateSamples.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.resourcemanager.confluent.models.OfferDetail; +import com.azure.resourcemanager.confluent.models.UserDetail; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Organization Create. */ +public final class OrganizationCreateSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_Create.json + */ + /** + * Sample code: Organization_Create. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationCreate(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager + .organizations() + .define("myOrganization") + .withRegion("West US") + .withExistingResourceGroup("myResourceGroup") + .withOfferDetail( + new OfferDetail() + .withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string")) + .withUserDetail( + new UserDetail() + .withFirstName("string") + .withLastName("string") + .withEmailAddress("contoso@microsoft.com")) + .withTags(mapOf("Environment", "Dev")) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationDeleteSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationDeleteSamples.java new file mode 100644 index 000000000000..6221642581a8 --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; + +/** Samples for Organization Delete. */ +public final class OrganizationDeleteSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_Delete.json + */ + /** + * Sample code: Confluent_Delete. + * + * @param manager Entry point to ConfluentManager. + */ + public static void confluentDelete(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizations().delete("myResourceGroup", "myOrganization", Context.NONE); + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetByResourceGroupSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetByResourceGroupSamples.java new file mode 100644 index 000000000000..3a14fffdabf3 --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; + +/** Samples for Organization GetByResourceGroup. */ +public final class OrganizationGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_Get.json + */ + /** + * Sample code: Organization_Get. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationGet(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizations().getByResourceGroupWithResponse("myResourceGroup", "myOrganization", Context.NONE); + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListByResourceGroupSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListByResourceGroupSamples.java new file mode 100644 index 000000000000..50c610e5c57c --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; + +/** Samples for Organization ListByResourceGroup. */ +public final class OrganizationListByResourceGroupSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_ListByResourceGroup.json + */ + /** + * Sample code: Organization_ListByResourceGroup. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationListByResourceGroup(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizations().listByResourceGroup("myResourceGroup", Context.NONE); + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListSamples.java new file mode 100644 index 000000000000..de3ea8493f1a --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; + +/** Samples for Organization List. */ +public final class OrganizationListSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_ListBySubscription.json + */ + /** + * Sample code: Organization_ListBySubscription. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationListBySubscription(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizations().list(Context.NONE); + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationOperationsListSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationOperationsListSamples.java new file mode 100644 index 000000000000..7a7bc10b14f8 --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationOperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; + +/** Samples for OrganizationOperations List. */ +public final class OrganizationOperationsListSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/OrganizationOperations_List.json + */ + /** + * Sample code: OrganizationOperations_List. + * + * @param manager Entry point to ConfluentManager. + */ + public static void organizationOperationsList(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager.organizationOperations().list(Context.NONE); + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationUpdateSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationUpdateSamples.java new file mode 100644 index 000000000000..c0b5a5c4361d --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/OrganizationUpdateSamples.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.confluent.models.OrganizationResource; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Organization Update. */ +public final class OrganizationUpdateSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Organization_Update.json + */ + /** + * Sample code: Confluent_Update. + * + * @param manager Entry point to ConfluentManager. + */ + public static void confluentUpdate(com.azure.resourcemanager.confluent.ConfluentManager manager) { + OrganizationResource resource = + manager + .organizations() + .getByResourceGroupWithResponse("myResourceGroup", "myOrganization", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("client", "dev-client", "env", "dev")).apply(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationSamples.java b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationSamples.java new file mode 100644 index 000000000000..e1cf38a4d21f --- /dev/null +++ b/sdk/confluent/azure-resourcemanager-confluent/src/samples/java/com/azure/resourcemanager/confluent/generated/ValidationsValidateOrganizationSamples.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.confluent.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.confluent.fluent.models.OrganizationResourceInner; +import com.azure.resourcemanager.confluent.models.OfferDetail; +import com.azure.resourcemanager.confluent.models.UserDetail; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Validations ValidateOrganization. */ +public final class ValidationsValidateOrganizationSamples { + /* + * x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/preview/2021-09-01-preview/examples/Validations_ValidateOrganizations.json + */ + /** + * Sample code: Validations_ValidateOrganizations. + * + * @param manager Entry point to ConfluentManager. + */ + public static void validationsValidateOrganizations(com.azure.resourcemanager.confluent.ConfluentManager manager) { + manager + .validations() + .validateOrganizationWithResponse( + "myResourceGroup", + "myOrganization", + new OrganizationResourceInner() + .withLocation("West US") + .withTags(mapOf("Environment", "Dev")) + .withOfferDetail( + new OfferDetail() + .withPublisherId("string") + .withId("string") + .withPlanId("string") + .withPlanName("string") + .withTermUnit("string")) + .withUserDetail( + new UserDetail() + .withFirstName("string") + .withLastName("string") + .withEmailAddress("abc@microsoft.com")), + Context.NONE); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +}