diff --git a/sdk/attestation/azure-resourcemanager-attestation/CHANGELOG.md b/sdk/attestation/azure-resourcemanager-attestation/CHANGELOG.md index 18ee64fef580..919cc87cb525 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/CHANGELOG.md +++ b/sdk/attestation/azure-resourcemanager-attestation/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2022-01-24) +- Azure Resource Manager Attestation client library for Java. This package contains Microsoft Azure SDK for Attestation Management SDK. Various APIs for managing resources in attestation service. This primarily encompasses per-provider management. Package tag package-2020-10-01. 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-04-12) diff --git a/sdk/attestation/azure-resourcemanager-attestation/README.md b/sdk/attestation/azure-resourcemanager-attestation/README.md index 4e4cd3add358..c0cd84a5d9cf 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/README.md +++ b/sdk/attestation/azure-resourcemanager-attestation/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-attestation - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({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/attestation/azure-resourcemanager-attestation/SAMPLE.md) + + ## Troubleshooting ## Next steps diff --git a/sdk/attestation/azure-resourcemanager-attestation/SAMPLE.md b/sdk/attestation/azure-resourcemanager-attestation/SAMPLE.md new file mode 100644 index 000000000000..e13223d78dad --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/SAMPLE.md @@ -0,0 +1,346 @@ +# Code snippets and samples + + +## AttestationProviders + +- [Create](#attestationproviders_create) +- [Delete](#attestationproviders_delete) +- [GetByResourceGroup](#attestationproviders_getbyresourcegroup) +- [GetDefaultByLocation](#attestationproviders_getdefaultbylocation) +- [List](#attestationproviders_list) +- [ListByResourceGroup](#attestationproviders_listbyresourcegroup) +- [ListDefault](#attestationproviders_listdefault) +- [Update](#attestationproviders_update) + +## Operations + +- [List](#operations_list) + +## PrivateEndpointConnections + +- [Create](#privateendpointconnections_create) +- [Delete](#privateendpointconnections_delete) +- [Get](#privateendpointconnections_get) +- [List](#privateendpointconnections_list) +### AttestationProviders_Create + +```java +import com.azure.resourcemanager.attestation.models.AttestationServiceCreationSpecificParams; + +/** Samples for AttestationProviders Create. */ +public final class AttestationProvidersCreateSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Create_AttestationProvider.json + */ + /** + * Sample code: AttestationProviders_Create. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersCreate(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .attestationProviders() + .define("myattestationprovider") + .withRegion((String) null) + .withExistingResourceGroup("MyResourceGroup") + .withProperties((AttestationServiceCreationSpecificParams) null) + .create(); + } +} +``` + +### AttestationProviders_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for AttestationProviders Delete. */ +public final class AttestationProvidersDeleteSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Delete_AttestationProvider.json + */ + /** + * Sample code: AttestationProviders_Delete. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersDelete(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .attestationProviders() + .deleteWithResponse("sample-resource-group", "myattestationprovider", Context.NONE); + } +} +``` + +### AttestationProviders_GetByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for AttestationProviders GetByResourceGroup. */ +public final class AttestationProvidersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvider.json + */ + /** + * Sample code: AttestationProviders_Get. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersGet(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .attestationProviders() + .getByResourceGroupWithResponse("MyResourceGroup", "myattestationprovider", Context.NONE); + } +} +``` + +### AttestationProviders_GetDefaultByLocation + +```java +import com.azure.core.util.Context; + +/** Samples for AttestationProviders GetDefaultByLocation. */ +public final class AttestationProvidersGetDefaultByLocationSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_DefaultProviderByLocation.json + */ + /** + * Sample code: AttestationProviders_GetDefaultWithLocation. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersGetDefaultWithLocation( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.attestationProviders().getDefaultByLocationWithResponse("Central US", Context.NONE); + } +} +``` + +### AttestationProviders_List + +```java +import com.azure.core.util.Context; + +/** Samples for AttestationProviders List. */ +public final class AttestationProvidersListSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvidersList.json + */ + /** + * Sample code: AttestationProviders_List. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersList(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.attestationProviders().listWithResponse(Context.NONE); + } +} +``` + +### AttestationProviders_ListByResourceGroup + +```java +import com.azure.core.util.Context; + +/** Samples for AttestationProviders ListByResourceGroup. */ +public final class AttestationProvidersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvidersListByResourceGroup.json + */ + /** + * Sample code: AttestationProviders_ListByResourceGroup. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersListByResourceGroup( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.attestationProviders().listByResourceGroupWithResponse("testrg1", Context.NONE); + } +} +``` + +### AttestationProviders_ListDefault + +```java +import com.azure.core.util.Context; + +/** Samples for AttestationProviders ListDefault. */ +public final class AttestationProvidersListDefaultSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_DefaultProviders.json + */ + /** + * Sample code: AttestationProviders_GetDefault. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersGetDefault( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.attestationProviders().listDefaultWithResponse(Context.NONE); + } +} +``` + +### AttestationProviders_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.attestation.models.AttestationProvider; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AttestationProviders Update. */ +public final class AttestationProvidersUpdateSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Update_AttestationProvider.json + */ + /** + * Sample code: AttestationProviders_Update. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersUpdate(com.azure.resourcemanager.attestation.AttestationManager manager) { + AttestationProvider resource = + manager + .attestationProviders() + .getByResourceGroupWithResponse("MyResourceGroup", "myattestationprovider", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Property1", "Value1", "Property2", "Value2", "Property3", "Value3")).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; + } +} +``` + +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AttestationManager. + */ + public static void operationsList(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.operations().listWithResponse(Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Create + +```java +import com.azure.resourcemanager.attestation.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.attestation.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Create. */ +public final class PrivateEndpointConnectionsCreateSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderPutPrivateEndpointConnection.json + */ + /** + * Sample code: AttestationProviderPutPrivateEndpointConnection. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProviderPutPrivateEndpointConnection( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingAttestationProvider("res7687", "sto9699") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} +``` + +### PrivateEndpointConnections_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderDeletePrivateEndpointConnection.json + */ + /** + * Sample code: AttestationProviderDeletePrivateEndpointConnection. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProviderDeletePrivateEndpointConnection( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .privateEndpointConnections() + .deleteWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderGetPrivateEndpointConnection.json + */ + /** + * Sample code: AttestationProviderGetPrivateEndpointConnection. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProviderGetPrivateEndpointConnection( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", Context.NONE); + } +} +``` + +### PrivateEndpointConnections_List + +```java +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderListPrivateEndpointConnections.json + */ + /** + * Sample code: AttestationProviderListPrivateEndpointConnections. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProviderListPrivateEndpointConnections( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.privateEndpointConnections().list("res6977", "sto2527", Context.NONE); + } +} +``` + diff --git a/sdk/attestation/azure-resourcemanager-attestation/pom.xml b/sdk/attestation/azure-resourcemanager-attestation/pom.xml index a8f65e82793d..31ee8fcb09ac 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/pom.xml +++ b/sdk/attestation/azure-resourcemanager-attestation/pom.xml @@ -1,55 +1,55 @@ - 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-attestation - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-attestation + 1.0.0-beta.2 + jar - Microsoft Azure SDK for Attestation Management - This package contains Microsoft Azure SDK for Attestation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Various APIs for managing resources in attestation service. This primarily encompasses per-provider management. Package tag package-2020-10-01. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for Attestation Management + This package contains Microsoft Azure SDK for Attestation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Various APIs for managing resources in attestation service. This primarily encompasses per-provider management. Package tag package-2020-10-01. + 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 - true - - - - com.azure - azure-core - 1.24.1 - - - com.azure - azure-core-management - 1.5.1 - - + + 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 + true + + + + com.azure + azure-core + 1.24.1 + + + com.azure + azure-core-management + 1.5.1 + + diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/AttestationManager.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/AttestationManager.java index e137d35ffc2f..c79b1e2bfc71 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/AttestationManager.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/AttestationManager.java @@ -8,8 +8,8 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; 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 +17,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; @@ -33,6 +34,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * Entry point to AttestationManager. Various APIs for managing resources in attestation service. This primarily @@ -88,6 +90,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; @@ -127,6 +130,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. * @@ -183,20 +197,33 @@ public AttestationManager authenticate(TokenCredential credential, AzureProfile userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); - policies.addAll(this.policies); + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/AttestationProvidersClient.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/AttestationProvidersClient.java index d2591bfca7c5..547768e0682b 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/AttestationProvidersClient.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/AttestationProvidersClient.java @@ -37,7 +37,7 @@ public interface AttestationProvidersClient { * @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 the status of Attestation Provider. + * @return the status of Attestation Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByResourceGroupWithResponse( @@ -68,7 +68,7 @@ AttestationProviderInner create( * @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 attestation service response message. + * @return attestation service response message along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createWithResponse( @@ -102,7 +102,7 @@ AttestationProviderInner update( * @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 attestation service response message. + * @return attestation service response message along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response updateWithResponse( @@ -129,7 +129,7 @@ Response updateWithResponse( * @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 the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String resourceGroupName, String providerName, Context context); @@ -151,7 +151,7 @@ Response updateWithResponse( * @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 attestation Providers List. + * @return attestation Providers List along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse(Context context); @@ -176,7 +176,7 @@ Response updateWithResponse( * @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 attestation Providers List. + * @return attestation Providers List along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listByResourceGroupWithResponse( @@ -199,7 +199,7 @@ Response listByResourceGroupWithResponse( * @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 the default provider. + * @return the default provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listDefaultWithResponse(Context context); @@ -224,7 +224,7 @@ Response listByResourceGroupWithResponse( * @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 the default provider by location. + * @return the default provider by location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDefaultByLocationWithResponse(String location, Context context); diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/OperationsClient.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/OperationsClient.java index 709f15ffb2f0..1e6aaa80445e 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/OperationsClient.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/OperationsClient.java @@ -29,7 +29,7 @@ public interface OperationsClient { * @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 list of supported operations. + * @return list of supported operations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse(Context context); diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/PrivateEndpointConnectionsClient.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/PrivateEndpointConnectionsClient.java index 2bc3b18a7b99..8fbe5a56e080 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/PrivateEndpointConnectionsClient.java @@ -67,7 +67,8 @@ PrivateEndpointConnectionInner get( * @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 the specified private endpoint connection associated with the attestation provider. + * @return the specified private endpoint connection associated with the attestation provider along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( @@ -105,7 +106,7 @@ PrivateEndpointConnectionInner create( * @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 the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createWithResponse( @@ -140,7 +141,7 @@ Response createWithResponse( * @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 the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse( diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/AttestationProviderInner.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/AttestationProviderInner.java index eb87b8c43293..6f469ef71be7 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/AttestationProviderInner.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/AttestationProviderInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.attestation.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; @@ -16,9 +15,8 @@ import java.util.Map; /** Attestation service response message. */ -@JsonFlatten @Fluent -public class AttestationProviderInner extends Resource { +public final class AttestationProviderInner extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(AttestationProviderInner.class); /* @@ -28,29 +26,10 @@ public class AttestationProviderInner extends Resource { private SystemData systemData; /* - * Trust model for the attestation provider. + * Describes Attestation service status. */ - @JsonProperty(value = "properties.trustModel") - private String trustModel; - - /* - * Status of attestation service. - */ - @JsonProperty(value = "properties.status") - private AttestationServiceStatus status; - - /* - * Gets the uri of attestation service - */ - @JsonProperty(value = "properties.attestUri") - private String attestUri; - - /* - * List of private endpoint connections associated with the attestation - * provider. - */ - @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) - private List privateEndpointConnections; + @JsonProperty(value = "properties") + private StatusResult innerProperties; /** * Get the systemData property: The system metadata relating to this resource. @@ -61,13 +40,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the innerProperties property: Describes Attestation service status. + * + * @return the innerProperties value. + */ + private StatusResult innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public AttestationProviderInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public AttestationProviderInner withTags(Map tags) { + super.withTags(tags); + return this; + } + /** * Get the trustModel property: Trust model for the attestation provider. * * @return the trustModel value. */ public String trustModel() { - return this.trustModel; + return this.innerProperties() == null ? null : this.innerProperties().trustModel(); } /** @@ -77,7 +79,10 @@ public String trustModel() { * @return the AttestationProviderInner object itself. */ public AttestationProviderInner withTrustModel(String trustModel) { - this.trustModel = trustModel; + if (this.innerProperties() == null) { + this.innerProperties = new StatusResult(); + } + this.innerProperties().withTrustModel(trustModel); return this; } @@ -87,7 +92,7 @@ public AttestationProviderInner withTrustModel(String trustModel) { * @return the status value. */ public AttestationServiceStatus status() { - return this.status; + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** @@ -97,7 +102,10 @@ public AttestationServiceStatus status() { * @return the AttestationProviderInner object itself. */ public AttestationProviderInner withStatus(AttestationServiceStatus status) { - this.status = status; + if (this.innerProperties() == null) { + this.innerProperties = new StatusResult(); + } + this.innerProperties().withStatus(status); return this; } @@ -107,7 +115,7 @@ public AttestationProviderInner withStatus(AttestationServiceStatus status) { * @return the attestUri value. */ public String attestUri() { - return this.attestUri; + return this.innerProperties() == null ? null : this.innerProperties().attestUri(); } /** @@ -117,7 +125,10 @@ public String attestUri() { * @return the AttestationProviderInner object itself. */ public AttestationProviderInner withAttestUri(String attestUri) { - this.attestUri = attestUri; + if (this.innerProperties() == null) { + this.innerProperties = new StatusResult(); + } + this.innerProperties().withAttestUri(attestUri); return this; } @@ -128,21 +139,7 @@ public AttestationProviderInner withAttestUri(String attestUri) { * @return the privateEndpointConnections value. */ public List privateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** {@inheritDoc} */ - @Override - public AttestationProviderInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AttestationProviderInner withTags(Map tags) { - super.withTags(tags); - return this; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpointConnections(); } /** @@ -151,8 +148,8 @@ public AttestationProviderInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (privateEndpointConnections() != null) { - privateEndpointConnections().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/PrivateEndpointConnectionInner.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/PrivateEndpointConnectionInner.java index ce8d7a32dda0..e9ee40434d6d 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/PrivateEndpointConnectionInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.attestation.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.attestation.models.PrivateEndpoint; @@ -15,29 +14,24 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** The Private Endpoint Connection resource. */ -@JsonFlatten @Fluent -public class PrivateEndpointConnectionInner extends ProxyResource { +public final class PrivateEndpointConnectionInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionInner.class); /* - * The resource of private end point. + * Resource properties. */ - @JsonProperty(value = "properties.privateEndpoint") - private PrivateEndpoint privateEndpoint; + @JsonProperty(value = "properties") + private PrivateEndpointConnectionProperties innerProperties; - /* - * A collection of information about the state of the connection between - * service consumer and provider. - */ - @JsonProperty(value = "properties.privateLinkServiceConnectionState") - private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; - - /* - * The provisioning state of the private endpoint connection resource. + /** + * Get the innerProperties property: Resource properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private PrivateEndpointConnectionProvisioningState provisioningState; + private PrivateEndpointConnectionProperties innerProperties() { + return this.innerProperties; + } /** * Get the privateEndpoint property: The resource of private end point. @@ -45,7 +39,7 @@ public class PrivateEndpointConnectionInner extends ProxyResource { * @return the privateEndpoint value. */ public PrivateEndpoint privateEndpoint() { - return this.privateEndpoint; + return this.innerProperties() == null ? null : this.innerProperties().privateEndpoint(); } /** @@ -55,7 +49,10 @@ public PrivateEndpoint privateEndpoint() { * @return the PrivateEndpointConnectionInner object itself. */ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { - this.privateEndpoint = privateEndpoint; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateEndpoint(privateEndpoint); return this; } @@ -66,7 +63,7 @@ public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privat * @return the privateLinkServiceConnectionState value. */ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { - return this.privateLinkServiceConnectionState; + return this.innerProperties() == null ? null : this.innerProperties().privateLinkServiceConnectionState(); } /** @@ -78,7 +75,10 @@ public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { */ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { - this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + if (this.innerProperties() == null) { + this.innerProperties = new PrivateEndpointConnectionProperties(); + } + this.innerProperties().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); return this; } @@ -88,7 +88,7 @@ public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState( * @return the provisioningState value. */ public PrivateEndpointConnectionProvisioningState provisioningState() { - return this.provisioningState; + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } /** @@ -97,11 +97,8 @@ public PrivateEndpointConnectionProvisioningState provisioningState() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (privateEndpoint() != null) { - privateEndpoint().validate(); - } - if (privateLinkServiceConnectionState() != null) { - privateLinkServiceConnectionState().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/PrivateEndpointConnectionProperties.java new file mode 100644 index 000000000000..45c76e67ca39 --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/PrivateEndpointConnectionProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.attestation.models.PrivateEndpoint; +import com.azure.resourcemanager.attestation.models.PrivateEndpointConnectionProvisioningState; +import com.azure.resourcemanager.attestation.models.PrivateLinkServiceConnectionState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of the PrivateEndpointConnectProperties. */ +@Fluent +public final class PrivateEndpointConnectionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PrivateEndpointConnectionProperties.class); + + /* + * The resource of private end point. + */ + @JsonProperty(value = "privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /* + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "privateLinkServiceConnectionState", required = true) + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /* + * The provisioning state of the private endpoint connection resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private PrivateEndpointConnectionProvisioningState provisioningState; + + /** + * Get the privateEndpoint property: The resource of private end point. + * + * @return the privateEndpoint value. + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the privateEndpoint property: The resource of private end point. + * + * @param privateEndpoint the privateEndpoint value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value. + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set the privateLinkServiceConnectionState property: A collection of information about the state of the connection + * between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set. + * @return the PrivateEndpointConnectionProperties object itself. + */ + public PrivateEndpointConnectionProperties withPrivateLinkServiceConnectionState( + PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the private endpoint connection resource. + * + * @return the provisioningState value. + */ + public PrivateEndpointConnectionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpoint() != null) { + privateEndpoint().validate(); + } + if (privateLinkServiceConnectionState() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property privateLinkServiceConnectionState in model" + + " PrivateEndpointConnectionProperties")); + } else { + privateLinkServiceConnectionState().validate(); + } + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/StatusResult.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/StatusResult.java new file mode 100644 index 000000000000..48e72ac271bc --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/fluent/models/StatusResult.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.attestation.models.AttestationServiceStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Status of attestation service. */ +@Fluent +public final class StatusResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(StatusResult.class); + + /* + * Trust model for the attestation provider. + */ + @JsonProperty(value = "trustModel") + private String trustModel; + + /* + * Status of attestation service. + */ + @JsonProperty(value = "status") + private AttestationServiceStatus status; + + /* + * Gets the uri of attestation service + */ + @JsonProperty(value = "attestUri") + private String attestUri; + + /* + * List of private endpoint connections associated with the attestation + * provider. + */ + @JsonProperty(value = "privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the trustModel property: Trust model for the attestation provider. + * + * @return the trustModel value. + */ + public String trustModel() { + return this.trustModel; + } + + /** + * Set the trustModel property: Trust model for the attestation provider. + * + * @param trustModel the trustModel value to set. + * @return the StatusResult object itself. + */ + public StatusResult withTrustModel(String trustModel) { + this.trustModel = trustModel; + return this; + } + + /** + * Get the status property: Status of attestation service. + * + * @return the status value. + */ + public AttestationServiceStatus status() { + return this.status; + } + + /** + * Set the status property: Status of attestation service. + * + * @param status the status value to set. + * @return the StatusResult object itself. + */ + public StatusResult withStatus(AttestationServiceStatus status) { + this.status = status; + return this; + } + + /** + * Get the attestUri property: Gets the uri of attestation service. + * + * @return the attestUri value. + */ + public String attestUri() { + return this.attestUri; + } + + /** + * Set the attestUri property: Gets the uri of attestation service. + * + * @param attestUri the attestUri value to set. + * @return the StatusResult object itself. + */ + public StatusResult withAttestUri(String attestUri) { + this.attestUri = attestUri; + return this; + } + + /** + * Get the privateEndpointConnections property: List of private endpoint connections associated with the attestation + * provider. + * + * @return the privateEndpointConnections value. + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (privateEndpointConnections() != null) { + privateEndpointConnections().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/AttestationProvidersClientImpl.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/AttestationProvidersClientImpl.java index a16367806af0..4d83434c7f91 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/AttestationProvidersClientImpl.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/AttestationProvidersClientImpl.java @@ -181,7 +181,7 @@ Mono> getDefaultByLocation( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of Attestation Provider. + * @return the status of Attestation Provider along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -230,7 +230,7 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of Attestation Provider. + * @return the status of Attestation Provider along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( @@ -275,7 +275,7 @@ private Mono> getByResourceGroupWithResponseA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of Attestation Provider. + * @return the status of Attestation Provider on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String providerName) { @@ -314,7 +314,7 @@ public AttestationProviderInner getByResourceGroup(String resourceGroupName, Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the status of Attestation Provider. + * @return the status of Attestation Provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( @@ -331,7 +331,8 @@ public Response getByResourceGroupWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation service response message. + * @return attestation service response message along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -387,7 +388,8 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation service response message. + * @return attestation service response message along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -442,7 +444,7 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation service response message. + * @return attestation service response message on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -485,7 +487,7 @@ public AttestationProviderInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation service response message. + * @return attestation service response message along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse( @@ -505,7 +507,8 @@ public Response createWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation service response message. + * @return attestation service response message along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -561,7 +564,8 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation service response message. + * @return attestation service response message along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> updateWithResponseAsync( @@ -613,7 +617,7 @@ private Mono> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation service response message. + * @return attestation service response message on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -656,7 +660,7 @@ public AttestationProviderInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation service response message. + * @return attestation service response message along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse( @@ -672,7 +676,7 @@ public Response updateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String resourceGroupName, String providerName) { @@ -720,7 +724,7 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -765,7 +769,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String providerName) { @@ -795,7 +799,7 @@ public void delete(String resourceGroupName, String providerName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String providerName, Context context) { @@ -807,7 +811,7 @@ public Response deleteWithResponse(String resourceGroupName, String provid * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation Providers List. + * @return attestation Providers List along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync() { @@ -844,7 +848,7 @@ private Mono> listWithResponseAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation Providers List. + * @return attestation Providers List along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(Context context) { @@ -876,7 +880,7 @@ private Mono> listWithResponseAsync * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation Providers List. + * @return attestation Providers List on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync() { @@ -910,7 +914,7 @@ public AttestationProviderListResultInner list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation Providers List. + * @return attestation Providers List along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(Context context) { @@ -924,7 +928,7 @@ public Response listWithResponse(Context con * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation Providers List. + * @return attestation Providers List along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupWithResponseAsync( @@ -968,7 +972,7 @@ private Mono> listByResourceGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation Providers List. + * @return attestation Providers List along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupWithResponseAsync( @@ -1008,7 +1012,7 @@ private Mono> listByResourceGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation Providers List. + * @return attestation Providers List on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listByResourceGroupAsync(String resourceGroupName) { @@ -1045,7 +1049,7 @@ public AttestationProviderListResultInner listByResourceGroup(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return attestation Providers List. + * @return attestation Providers List along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listByResourceGroupWithResponse( @@ -1058,7 +1062,7 @@ public Response listByResourceGroupWithRespo * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the default provider. + * @return the default provider along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDefaultWithResponseAsync() { @@ -1095,7 +1099,7 @@ private Mono> listDefaultWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the default provider. + * @return the default provider along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listDefaultWithResponseAsync(Context context) { @@ -1127,7 +1131,7 @@ private Mono> listDefaultWithRespon * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the default provider. + * @return the default provider on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listDefaultAsync() { @@ -1161,7 +1165,7 @@ public AttestationProviderListResultInner listDefault() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the default provider. + * @return the default provider along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listDefaultWithResponse(Context context) { @@ -1175,7 +1179,7 @@ public Response listDefaultWithResponse(Cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the default provider by location. + * @return the default provider by location along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultByLocationWithResponseAsync(String location) { @@ -1217,7 +1221,7 @@ private Mono> getDefaultByLocationWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the default provider by location. + * @return the default provider by location along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getDefaultByLocationWithResponseAsync( @@ -1256,7 +1260,7 @@ private Mono> getDefaultByLocationWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the default provider by location. + * @return the default provider by location on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getDefaultByLocationAsync(String location) { @@ -1293,7 +1297,7 @@ public AttestationProviderInner getDefaultByLocation(String location) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the default provider by location. + * @return the default provider by location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDefaultByLocationWithResponse(String location, Context context) { diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/AttestationProvidersImpl.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/AttestationProvidersImpl.java index 296a6081e270..6cd662d4fa49 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/AttestationProvidersImpl.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/AttestationProvidersImpl.java @@ -216,7 +216,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'attestationProviders'.", id))); } - this.deleteWithResponse(resourceGroupName, providerName, Context.NONE).getValue(); + this.deleteWithResponse(resourceGroupName, providerName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/OperationsClientImpl.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/OperationsClientImpl.java index 4072b351da1b..9589f6c66ded 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/OperationsClientImpl.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/OperationsClientImpl.java @@ -69,7 +69,7 @@ Mono> list( * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of supported operations. + * @return list of supported operations along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync() { @@ -93,7 +93,7 @@ private Mono> listWithResponseAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of supported operations. + * @return list of supported operations along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync(Context context) { @@ -113,7 +113,7 @@ private Mono> listWithResponseAsync(Context context * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of supported operations. + * @return list of supported operations on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync() { @@ -147,7 +147,7 @@ public OperationListInner list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of supported operations. + * @return list of supported operations along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse(Context context) { diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsClientImpl.java index 62477efb2d54..ee1f9bd08583 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsClientImpl.java @@ -67,7 +67,7 @@ private interface PrivateEndpointConnectionsService { @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Attestation" - + "/attestationProvider/{providerName}/privateEndpointConnections") + + "/attestationProviders/{providerName}/privateEndpointConnections") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @@ -137,7 +137,8 @@ Mono> delete( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -190,7 +191,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of private endpoint connection associated with the specified storage account. + * @return list of private endpoint connection associated with the specified storage account along with {@link + * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -305,7 +307,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the attestation provider. + * @return the specified private endpoint connection associated with the attestation provider along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -363,7 +366,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the attestation provider. + * @return the specified private endpoint connection associated with the attestation provider along with {@link + * Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -417,7 +421,8 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the attestation provider. + * @return the specified private endpoint connection associated with the attestation provider on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( @@ -462,7 +467,8 @@ public PrivateEndpointConnectionInner get( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the specified private endpoint connection associated with the attestation provider. + * @return the specified private endpoint connection associated with the attestation provider along with {@link + * Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -481,7 +487,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -549,7 +556,8 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createWithResponseAsync( @@ -614,7 +622,7 @@ private Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( @@ -667,7 +675,7 @@ public PrivateEndpointConnectionInner create( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Private Endpoint Connection resource. + * @return the Private Endpoint Connection resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createWithResponse( @@ -691,7 +699,7 @@ public Response createWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -749,7 +757,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync( @@ -803,7 +811,7 @@ private Mono> deleteWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync( @@ -839,7 +847,7 @@ public void delete(String resourceGroupName, String providerName, String private * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse( diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsImpl.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsImpl.java index 0748b7ce8c29..59f4c559c130 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsImpl.java @@ -176,9 +176,7 @@ public void deleteById(String id) { "The resource ID '%s' is not valid. Missing path segment 'privateEndpointConnections'.", id))); } - this - .deleteWithResponse(resourceGroupName, providerName, privateEndpointConnectionName, Context.NONE) - .getValue(); + this.deleteWithResponse(resourceGroupName, providerName, privateEndpointConnectionName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationProviders.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationProviders.java index 75fabb8eeb84..6be1549d3307 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationProviders.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationProviders.java @@ -30,7 +30,7 @@ public interface AttestationProviders { * @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 the status of Attestation Provider. + * @return the status of Attestation Provider along with {@link Response}. */ Response getByResourceGroupWithResponse( String resourceGroupName, String providerName, Context context); @@ -55,7 +55,7 @@ Response getByResourceGroupWithResponse( * @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 the response. + * @return the {@link Response}. */ Response deleteWithResponse(String resourceGroupName, String providerName, Context context); @@ -75,7 +75,7 @@ Response getByResourceGroupWithResponse( * @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 attestation Providers List. + * @return attestation Providers List along with {@link Response}. */ Response listWithResponse(Context context); @@ -98,7 +98,7 @@ Response getByResourceGroupWithResponse( * @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 attestation Providers List. + * @return attestation Providers List along with {@link Response}. */ Response listByResourceGroupWithResponse(String resourceGroupName, Context context); @@ -118,7 +118,7 @@ Response getByResourceGroupWithResponse( * @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 the default provider. + * @return the default provider along with {@link Response}. */ Response listDefaultWithResponse(Context context); @@ -141,7 +141,7 @@ Response getByResourceGroupWithResponse( * @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 the default provider by location. + * @return the default provider by location along with {@link Response}. */ Response getDefaultByLocationWithResponse(String location, Context context); @@ -152,7 +152,7 @@ Response getByResourceGroupWithResponse( * @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 the status of Attestation Provider. + * @return the status of Attestation Provider along with {@link Response}. */ AttestationProvider getById(String id); @@ -164,7 +164,7 @@ Response getByResourceGroupWithResponse( * @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 the status of Attestation Provider. + * @return the status of Attestation Provider along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -186,7 +186,7 @@ Response getByResourceGroupWithResponse( * @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 the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationServiceCreationParams.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationServiceCreationParams.java index fd91e599f046..3d844ad548b7 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationServiceCreationParams.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationServiceCreationParams.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; @@ -26,6 +27,7 @@ public final class AttestationServiceCreationParams { * The tags that will be assigned to the attestation provider. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationServicePatchParams.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationServicePatchParams.java index 795855e5dc6b..85c3484ec1eb 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationServicePatchParams.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/AttestationServicePatchParams.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 AttestationServicePatchParams { * The tags that will be assigned to the attestation provider. */ @JsonProperty(value = "tags") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/Operations.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/Operations.java index 9d0f32b868ae..adf056a2b911 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/Operations.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/Operations.java @@ -25,7 +25,7 @@ public interface Operations { * @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 list of supported operations. + * @return list of supported operations along with {@link Response}. */ Response listWithResponse(Context context); } diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/PrivateEndpointConnections.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/PrivateEndpointConnections.java index f195e71ee0e4..e1051e526108 100644 --- a/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/PrivateEndpointConnections.java +++ b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/models/PrivateEndpointConnections.java @@ -60,7 +60,8 @@ public interface PrivateEndpointConnections { * @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 the specified private endpoint connection associated with the attestation provider. + * @return the specified private endpoint connection associated with the attestation provider along with {@link + * Response}. */ Response getWithResponse( String resourceGroupName, String providerName, String privateEndpointConnectionName, Context context); @@ -89,7 +90,7 @@ Response getWithResponse( * @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 the response. + * @return the {@link Response}. */ Response deleteWithResponse( String resourceGroupName, String providerName, String privateEndpointConnectionName, Context context); @@ -101,7 +102,8 @@ Response deleteWithResponse( * @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 the specified private endpoint connection associated with the attestation provider. + * @return the specified private endpoint connection associated with the attestation provider along with {@link + * Response}. */ PrivateEndpointConnection getById(String id); @@ -113,7 +115,8 @@ Response deleteWithResponse( * @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 the specified private endpoint connection associated with the attestation provider. + * @return the specified private endpoint connection associated with the attestation provider along with {@link + * Response}. */ Response getByIdWithResponse(String id, Context context); @@ -135,7 +138,7 @@ Response deleteWithResponse( * @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 the response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersCreateSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersCreateSamples.java new file mode 100644 index 000000000000..063288ace20b --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersCreateSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.resourcemanager.attestation.models.AttestationServiceCreationSpecificParams; + +/** Samples for AttestationProviders Create. */ +public final class AttestationProvidersCreateSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Create_AttestationProvider.json + */ + /** + * Sample code: AttestationProviders_Create. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersCreate(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .attestationProviders() + .define("myattestationprovider") + .withRegion((String) null) + .withExistingResourceGroup("MyResourceGroup") + .withProperties((AttestationServiceCreationSpecificParams) null) + .create(); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersDeleteSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersDeleteSamples.java new file mode 100644 index 000000000000..89731dbb5e3a --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersDeleteSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for AttestationProviders Delete. */ +public final class AttestationProvidersDeleteSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Delete_AttestationProvider.json + */ + /** + * Sample code: AttestationProviders_Delete. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersDelete(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .attestationProviders() + .deleteWithResponse("sample-resource-group", "myattestationprovider", Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersGetByResourceGroupSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersGetByResourceGroupSamples.java new file mode 100644 index 000000000000..5738aaea97f3 --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersGetByResourceGroupSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for AttestationProviders GetByResourceGroup. */ +public final class AttestationProvidersGetByResourceGroupSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvider.json + */ + /** + * Sample code: AttestationProviders_Get. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersGet(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .attestationProviders() + .getByResourceGroupWithResponse("MyResourceGroup", "myattestationprovider", Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersGetDefaultByLocationSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersGetDefaultByLocationSamples.java new file mode 100644 index 000000000000..cf04aea65950 --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersGetDefaultByLocationSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for AttestationProviders GetDefaultByLocation. */ +public final class AttestationProvidersGetDefaultByLocationSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_DefaultProviderByLocation.json + */ + /** + * Sample code: AttestationProviders_GetDefaultWithLocation. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersGetDefaultWithLocation( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.attestationProviders().getDefaultByLocationWithResponse("Central US", Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListByResourceGroupSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListByResourceGroupSamples.java new file mode 100644 index 000000000000..6a0202961347 --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListByResourceGroupSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for AttestationProviders ListByResourceGroup. */ +public final class AttestationProvidersListByResourceGroupSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvidersListByResourceGroup.json + */ + /** + * Sample code: AttestationProviders_ListByResourceGroup. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersListByResourceGroup( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.attestationProviders().listByResourceGroupWithResponse("testrg1", Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListDefaultSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListDefaultSamples.java new file mode 100644 index 000000000000..6bf5bc058721 --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListDefaultSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for AttestationProviders ListDefault. */ +public final class AttestationProvidersListDefaultSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_DefaultProviders.json + */ + /** + * Sample code: AttestationProviders_GetDefault. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersGetDefault( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.attestationProviders().listDefaultWithResponse(Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListSamples.java new file mode 100644 index 000000000000..2c50e2b5175b --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersListSamples.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.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for AttestationProviders List. */ +public final class AttestationProvidersListSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Get_AttestationProvidersList.json + */ + /** + * Sample code: AttestationProviders_List. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersList(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.attestationProviders().listWithResponse(Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersUpdateSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersUpdateSamples.java new file mode 100644 index 000000000000..802ec8f5effb --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/AttestationProvidersUpdateSamples.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.attestation.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.attestation.models.AttestationProvider; +import java.util.HashMap; +import java.util.Map; + +/** Samples for AttestationProviders Update. */ +public final class AttestationProvidersUpdateSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Update_AttestationProvider.json + */ + /** + * Sample code: AttestationProviders_Update. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProvidersUpdate(com.azure.resourcemanager.attestation.AttestationManager manager) { + AttestationProvider resource = + manager + .attestationProviders() + .getByResourceGroupWithResponse("MyResourceGroup", "myattestationprovider", Context.NONE) + .getValue(); + resource.update().withTags(mapOf("Property1", "Value1", "Property2", "Value2", "Property3", "Value3")).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/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/OperationsListSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/OperationsListSamples.java new file mode 100644 index 000000000000..0c6ed98886f7 --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/OperationsListSamples.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.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/Operations_List.json + */ + /** + * Sample code: Operations_List. + * + * @param manager Entry point to AttestationManager. + */ + public static void operationsList(com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.operations().listWithResponse(Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsCreateSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsCreateSamples.java new file mode 100644 index 000000000000..5fdf557d3eca --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsCreateSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.resourcemanager.attestation.models.PrivateEndpointServiceConnectionStatus; +import com.azure.resourcemanager.attestation.models.PrivateLinkServiceConnectionState; + +/** Samples for PrivateEndpointConnections Create. */ +public final class PrivateEndpointConnectionsCreateSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderPutPrivateEndpointConnection.json + */ + /** + * Sample code: AttestationProviderPutPrivateEndpointConnection. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProviderPutPrivateEndpointConnection( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .privateEndpointConnections() + .define("{privateEndpointConnectionName}") + .withExistingAttestationProvider("res7687", "sto9699") + .withPrivateLinkServiceConnectionState( + new PrivateLinkServiceConnectionState() + .withStatus(PrivateEndpointServiceConnectionStatus.APPROVED) + .withDescription("Auto-Approved")) + .create(); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsDeleteSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsDeleteSamples.java new file mode 100644 index 000000000000..c713ab7df2e4 --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Delete. */ +public final class PrivateEndpointConnectionsDeleteSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderDeletePrivateEndpointConnection.json + */ + /** + * Sample code: AttestationProviderDeletePrivateEndpointConnection. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProviderDeletePrivateEndpointConnection( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .privateEndpointConnections() + .deleteWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsGetSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsGetSamples.java new file mode 100644 index 000000000000..03f65bf09d6d --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections Get. */ +public final class PrivateEndpointConnectionsGetSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderGetPrivateEndpointConnection.json + */ + /** + * Sample code: AttestationProviderGetPrivateEndpointConnection. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProviderGetPrivateEndpointConnection( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager + .privateEndpointConnections() + .getWithResponse("res6977", "sto2527", "{privateEndpointConnectionName}", Context.NONE); + } +} diff --git a/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsListSamples.java b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsListSamples.java new file mode 100644 index 000000000000..009afdfbb70e --- /dev/null +++ b/sdk/attestation/azure-resourcemanager-attestation/src/samples/java/com/azure/resourcemanager/attestation/generated/PrivateEndpointConnectionsListSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.attestation.generated; + +import com.azure.core.util.Context; + +/** Samples for PrivateEndpointConnections List. */ +public final class PrivateEndpointConnectionsListSamples { + /* + * x-ms-original-file: specification/attestation/resource-manager/Microsoft.Attestation/stable/2020-10-01/examples/AttestationProviderListPrivateEndpointConnections.json + */ + /** + * Sample code: AttestationProviderListPrivateEndpointConnections. + * + * @param manager Entry point to AttestationManager. + */ + public static void attestationProviderListPrivateEndpointConnections( + com.azure.resourcemanager.attestation.AttestationManager manager) { + manager.privateEndpointConnections().list("res6977", "sto2527", Context.NONE); + } +}