diff --git a/sdk/attestation/azure-resourcemanager-attestation/CHANGELOG.md b/sdk/attestation/azure-resourcemanager-attestation/CHANGELOG.md
index 18ee64fef580..fc7aa00049af 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 (2021-10-12)
+- 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 9207c54f0a92..3266f8aa9410 100644
--- a/sdk/attestation/azure-resourcemanager-attestation/pom.xml
+++ b/sdk/attestation/azure-resourcemanager-attestation/pom.xml
@@ -1,67 +1,86 @@
- 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
-
-
-
-
- com.azure
- azure-core
- 1.21.0
-
-
- com.azure
- azure-core-management
- 1.4.2
-
-
-
-
-
- org.jacoco
- jacoco-maven-plugin
- 0.8.7
-
- true
-
-
-
-
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+
+
+
+
+ com.azure
+ azure-core
+ 1.21.0
+
+
+ com.azure
+ azure-core-management
+ 1.4.2
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.8.7
+
+ true
+
+
+
+ org.revapi
+ revapi-maven-plugin
+ 0.11.2
+
+
+
+ -
+
java.method.addedToInterface
+
+ -
+ true
+
.*
+ com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)*
+
+
+
+
+
+
+
diff --git a/sdk/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..a92a9b8e8a53 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
@@ -9,7 +9,6 @@
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.policy.AddDatePolicy;
-import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
@@ -17,6 +16,7 @@
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
@@ -88,6 +88,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 +128,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,6 +195,9 @@ 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);
}
@@ -192,10 +207,7 @@ public AttestationManager authenticate(TokenCredential credential, AzureProfile
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
- policies
- .add(
- new BearerTokenAuthenticationPolicy(
- credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies);
HttpPolicyProviders.addAfterRetryPolicies(policies);
policies.add(new HttpLoggingPolicy(httpLogOptions));
diff --git a/sdk/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/PrivateEndpointConnectionsClientImpl.java b/sdk/attestation/azure-resourcemanager-attestation/src/main/java/com/azure/resourcemanager/attestation/implementation/PrivateEndpointConnectionsClientImpl.java
index 62477efb2d54..5d42862fc77b 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(
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/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);
+ }
+}