scopes = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private RetryOptions retryOptions;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ 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.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the retry options for the HTTP pipeline retry policy.
+ *
+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
+ *
+ * @param retryOptions the retry options for the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryOptions(RetryOptions retryOptions) {
+ this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval
+ = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw LOGGER
+ .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of AzureTerraform service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the AzureTerraform service API instance.
+ */
+ public AzureTerraformManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder.append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.terraform")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder.append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
+ 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.addAll(this.policies.stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new AzureTerraformManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of Operations.
+ *
+ * @return Resource collection API of Operations.
+ */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /**
+ * Gets the resource collection API of Terraforms.
+ *
+ * @return Resource collection API of Terraforms.
+ */
+ public Terraforms terraforms() {
+ if (this.terraforms == null) {
+ this.terraforms = new TerraformsImpl(clientObject.getTerraforms(), this);
+ }
+ return terraforms;
+ }
+
+ /**
+ * Gets wrapped service client AzureTerraformManagementClient providing direct access to the underlying
+ * auto-generated API implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client AzureTerraformManagementClient.
+ */
+ public AzureTerraformManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/AzureTerraformManagementClient.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/AzureTerraformManagementClient.java
new file mode 100644
index 000000000000..a90b5f233a42
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/AzureTerraformManagementClient.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for AzureTerraformManagementClient class.
+ */
+public interface AzureTerraformManagementClient {
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the TerraformsClient object to access its operations.
+ *
+ * @return the TerraformsClient object.
+ */
+ TerraformsClient getTerraforms();
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/OperationsClient.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/OperationsClient.java
new file mode 100644
index 000000000000..856ee475d007
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/OperationsClient.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.terraform.fluent.models.OperationInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public interface OperationsClient {
+ /**
+ * List the operations for the provider.
+ *
+ * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/TerraformsClient.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/TerraformsClient.java
new file mode 100644
index 000000000000..131f567b4cc2
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/TerraformsClient.java
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.terraform.models.BaseExportModel;
+
+/**
+ * An instance of this class provides access to all the operations defined in TerraformsClient.
+ */
+public interface TerraformsClient {
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginExportTerraform(BaseExportModel body);
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginExportTerraform(BaseExportModel body, Context context);
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void exportTerraform(BaseExportModel body);
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void exportTerraform(BaseExportModel body, Context context);
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/models/OperationInner.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/models/OperationInner.java
new file mode 100644
index 000000000000..4cab8acb0ab9
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/models/OperationInner.java
@@ -0,0 +1,172 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.terraform.models.ActionType;
+import com.azure.resourcemanager.terraform.models.OperationDisplay;
+import com.azure.resourcemanager.terraform.models.Origin;
+import java.io.IOException;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Fluent
+public final class OperationInner implements JsonSerializable {
+ /*
+ * The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
+ */
+ private String name;
+
+ /*
+ * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for
+ * ARM/control-plane operations.
+ */
+ private Boolean isDataAction;
+
+ /*
+ * Localized display information for this particular operation.
+ */
+ private OperationDisplay display;
+
+ /*
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
+ * value is "user,system"
+ */
+ private Origin origin;
+
+ /*
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ private ActionType actionType;
+
+ /**
+ * Creates an instance of OperationInner class.
+ */
+ public OperationInner() {
+ }
+
+ /**
+ * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for ARM/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Get the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Localized display information for this particular operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ public Origin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
+ * only APIs.
+ *
+ * @return the actionType value.
+ */
+ public ActionType actionType() {
+ return this.actionType;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("display", this.display);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationInner.
+ */
+ public static OperationInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationInner deserializedOperationInner = new OperationInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("name".equals(fieldName)) {
+ deserializedOperationInner.name = reader.getString();
+ } else if ("isDataAction".equals(fieldName)) {
+ deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
+ } else if ("display".equals(fieldName)) {
+ deserializedOperationInner.display = OperationDisplay.fromJson(reader);
+ } else if ("origin".equals(fieldName)) {
+ deserializedOperationInner.origin = Origin.fromString(reader.getString());
+ } else if ("actionType".equals(fieldName)) {
+ deserializedOperationInner.actionType = ActionType.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationInner;
+ });
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/models/package-info.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/models/package-info.java
new file mode 100644
index 000000000000..51f0eb89f869
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/models/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the inner data models for AzureTerraformManagementClient.
+ * AzureTerraform Client.
+ */
+package com.azure.resourcemanager.terraform.fluent.models;
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/package-info.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/package-info.java
new file mode 100644
index 000000000000..65302ccd0c87
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/fluent/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the service clients for AzureTerraformManagementClient.
+ * AzureTerraform Client.
+ */
+package com.azure.resourcemanager.terraform.fluent;
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/AzureTerraformManagementClientBuilder.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/AzureTerraformManagementClientBuilder.java
new file mode 100644
index 000000000000..1f623452d9ff
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/AzureTerraformManagementClientBuilder.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.implementation;
+
+import com.azure.core.annotation.ServiceClientBuilder;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.serializer.SerializerFactory;
+import com.azure.core.util.serializer.SerializerAdapter;
+import java.time.Duration;
+
+/**
+ * A builder for creating a new instance of the AzureTerraformManagementClientImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { AzureTerraformManagementClientImpl.class })
+public final class AzureTerraformManagementClientBuilder {
+ /*
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets The ID of the target subscription. The value must be an UUID.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the AzureTerraformManagementClientBuilder.
+ */
+ public AzureTerraformManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the AzureTerraformManagementClientBuilder.
+ */
+ public AzureTerraformManagementClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the AzureTerraformManagementClientBuilder.
+ */
+ public AzureTerraformManagementClientBuilder environment(AzureEnvironment environment) {
+ this.environment = environment;
+ return this;
+ }
+
+ /*
+ * The HTTP pipeline to send requests through
+ */
+ private HttpPipeline pipeline;
+
+ /**
+ * Sets The HTTP pipeline to send requests through.
+ *
+ * @param pipeline the pipeline value.
+ * @return the AzureTerraformManagementClientBuilder.
+ */
+ public AzureTerraformManagementClientBuilder pipeline(HttpPipeline pipeline) {
+ this.pipeline = pipeline;
+ return this;
+ }
+
+ /*
+ * The default poll interval for long-running operation
+ */
+ private Duration defaultPollInterval;
+
+ /**
+ * Sets The default poll interval for long-running operation.
+ *
+ * @param defaultPollInterval the defaultPollInterval value.
+ * @return the AzureTerraformManagementClientBuilder.
+ */
+ public AzureTerraformManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = defaultPollInterval;
+ return this;
+ }
+
+ /*
+ * The serializer to serialize an object into a string
+ */
+ private SerializerAdapter serializerAdapter;
+
+ /**
+ * Sets The serializer to serialize an object into a string.
+ *
+ * @param serializerAdapter the serializerAdapter value.
+ * @return the AzureTerraformManagementClientBuilder.
+ */
+ public AzureTerraformManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of AzureTerraformManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of AzureTerraformManagementClientImpl.
+ */
+ public AzureTerraformManagementClientImpl buildClient() {
+ String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
+ AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
+ HttpPipeline localPipeline = (pipeline != null)
+ ? pipeline
+ : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ Duration localDefaultPollInterval
+ = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
+ SerializerAdapter localSerializerAdapter = (serializerAdapter != null)
+ ? serializerAdapter
+ : SerializerFactory.createDefaultManagementSerializerAdapter();
+ AzureTerraformManagementClientImpl client = new AzureTerraformManagementClientImpl(localPipeline,
+ localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/AzureTerraformManagementClientImpl.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/AzureTerraformManagementClientImpl.java
new file mode 100644
index 000000000000..c22d214410b3
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/AzureTerraformManagementClientImpl.java
@@ -0,0 +1,304 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.terraform.fluent.AzureTerraformManagementClient;
+import com.azure.resourcemanager.terraform.fluent.OperationsClient;
+import com.azure.resourcemanager.terraform.fluent.TerraformsClient;
+import java.io.IOException;
+import java.lang.reflect.Type;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
+import java.time.Duration;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * Initializes a new instance of the AzureTerraformManagementClientImpl type.
+ */
+@ServiceClient(builder = AzureTerraformManagementClientBuilder.class)
+public final class AzureTerraformManagementClientImpl implements AzureTerraformManagementClient {
+ /**
+ * The ID of the target subscription. The value must be an UUID.
+ */
+ private final String subscriptionId;
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /**
+ * server parameter.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Api Version.
+ */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /**
+ * The HTTP pipeline to send requests through.
+ */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /**
+ * The serializer to serialize an object into a string.
+ */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /**
+ * The default poll interval for long-running operation.
+ */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /**
+ * The OperationsClient object to access its operations.
+ */
+ private final OperationsClient operations;
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ public OperationsClient getOperations() {
+ return this.operations;
+ }
+
+ /**
+ * The TerraformsClient object to access its operations.
+ */
+ private final TerraformsClient terraforms;
+
+ /**
+ * Gets the TerraformsClient object to access its operations.
+ *
+ * @return the TerraformsClient object.
+ */
+ public TerraformsClient getTerraforms() {
+ return this.terraforms;
+ }
+
+ /**
+ * Initializes an instance of AzureTerraformManagementClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
+ * @param endpoint server parameter.
+ */
+ AzureTerraformManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2023-07-01-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.terraforms = new TerraformsClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ return CoreUtils.mergeContexts(this.getContext(), context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param httpPipeline the http pipeline.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return poller flux for poll result and final result.
+ */
+ public PollerFlux, U> getLroResult(Mono>> activationResponse,
+ HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) {
+ return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType,
+ defaultPollInterval, activationResponse, context);
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @param response the last async poll response.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result, or an error.
+ */
+ public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) {
+ if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ PollResult.Error lroError = response.getValue().getError();
+ if (lroError != null) {
+ errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(),
+ lroError.getResponseBody());
+
+ errorMessage = response.getValue().getError().getMessage();
+ String errorBody = response.getValue().getError().getResponseBody();
+ if (errorBody != null) {
+ // try to deserialize error body to ManagementError
+ try {
+ managementError = this.getSerializerAdapter()
+ .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ if (managementError.getCode() == null || managementError.getMessage() == null) {
+ managementError = null;
+ }
+ } catch (IOException | RuntimeException ioe) {
+ LOGGER.logThrowableAsWarning(ioe);
+ }
+ }
+ } else {
+ // fallback to default error message
+ errorMessage = "Long running operation failed.";
+ }
+ if (managementError == null) {
+ // fallback to default ManagementError
+ managementError = new ManagementError(response.getStatus().toString(), errorMessage);
+ }
+ return Mono.error(new ManagementException(errorMessage, errorResponse, managementError));
+ } else {
+ return response.getFinalResult();
+ }
+ }
+
+ private static final class HttpResponseImpl extends HttpResponse {
+ private final int statusCode;
+
+ private final byte[] responseBody;
+
+ private final HttpHeaders httpHeaders;
+
+ HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) {
+ super(null);
+ this.statusCode = statusCode;
+ this.httpHeaders = httpHeaders;
+ this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(HttpHeaderName.fromString(s));
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(AzureTerraformManagementClientImpl.class);
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationImpl.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationImpl.java
new file mode 100644
index 000000000000..3a938e90ab45
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.implementation;
+
+import com.azure.resourcemanager.terraform.fluent.models.OperationInner;
+import com.azure.resourcemanager.terraform.models.ActionType;
+import com.azure.resourcemanager.terraform.models.Operation;
+import com.azure.resourcemanager.terraform.models.OperationDisplay;
+import com.azure.resourcemanager.terraform.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.terraform.AzureTerraformManager serviceManager;
+
+ OperationImpl(OperationInner innerObject,
+ com.azure.resourcemanager.terraform.AzureTerraformManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public Boolean isDataAction() {
+ return this.innerModel().isDataAction();
+ }
+
+ public OperationDisplay display() {
+ return this.innerModel().display();
+ }
+
+ public Origin origin() {
+ return this.innerModel().origin();
+ }
+
+ public ActionType actionType() {
+ return this.innerModel().actionType();
+ }
+
+ public OperationInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.terraform.AzureTerraformManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationsClientImpl.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationsClientImpl.java
new file mode 100644
index 000000000000..346cb3689cbd
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationsClientImpl.java
@@ -0,0 +1,235 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.terraform.fluent.OperationsClient;
+import com.azure.resourcemanager.terraform.fluent.models.OperationInner;
+import com.azure.resourcemanager.terraform.models.OperationListResult;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in OperationsClient.
+ */
+public final class OperationsClientImpl implements OperationsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final OperationsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final AzureTerraformManagementClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(AzureTerraformManagementClientImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureTerraformManagementClientOperations to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureTerraformManage")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.AzureTerraform/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationsImpl.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationsImpl.java
new file mode 100644
index 000000000000..bd73cc9ba6a2
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/OperationsImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.terraform.fluent.OperationsClient;
+import com.azure.resourcemanager.terraform.fluent.models.OperationInner;
+import com.azure.resourcemanager.terraform.models.Operation;
+import com.azure.resourcemanager.terraform.models.Operations;
+
+public final class OperationsImpl implements Operations {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class);
+
+ private final OperationsClient innerClient;
+
+ private final com.azure.resourcemanager.terraform.AzureTerraformManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient,
+ com.azure.resourcemanager.terraform.AzureTerraformManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager()));
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.terraform.AzureTerraformManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/ResourceManagerUtils.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/ResourceManagerUtils.java
new file mode 100644
index 000000000000..62cc0e32cd48
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/ResourceManagerUtils.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.implementation;
+
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.util.CoreUtils;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import reactor.core.publisher.Flux;
+
+final class ResourceManagerUtils {
+ private ResourceManagerUtils() {
+ }
+
+ static String getValueFromIdByName(String id, String name) {
+ if (id == null) {
+ return null;
+ }
+ Iterator itr = Arrays.stream(id.split("/")).iterator();
+ while (itr.hasNext()) {
+ String part = itr.next();
+ if (part != null && !part.trim().isEmpty()) {
+ if (part.equalsIgnoreCase(name)) {
+ if (itr.hasNext()) {
+ return itr.next();
+ } else {
+ return null;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
+ if (id == null || pathTemplate == null) {
+ return null;
+ }
+ String parameterNameParentheses = "{" + parameterName + "}";
+ List idSegmentsReverted = Arrays.asList(id.split("/"));
+ List pathSegments = Arrays.asList(pathTemplate.split("/"));
+ Collections.reverse(idSegmentsReverted);
+ Iterator idItrReverted = idSegmentsReverted.iterator();
+ int pathIndex = pathSegments.size();
+ while (idItrReverted.hasNext() && pathIndex > 0) {
+ String idSegment = idItrReverted.next();
+ String pathSegment = pathSegments.get(--pathIndex);
+ if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) {
+ if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) {
+ if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) {
+ List segments = new ArrayList<>();
+ segments.add(idSegment);
+ idItrReverted.forEachRemaining(segments::add);
+ Collections.reverse(segments);
+ if (!segments.isEmpty() && segments.get(0).isEmpty()) {
+ segments.remove(0);
+ }
+ return String.join("/", segments);
+ } else {
+ return idSegment;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl<>(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse> pageMapper;
+
+ private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) {
+ super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux
+ .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper)))));
+ this.pagedIterable = pagedIterable;
+ this.mapper = mapper;
+ this.pageMapper = getPageMapper(mapper);
+ }
+
+ private static Function, PagedResponse> getPageMapper(Function mapper) {
+ return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(),
+ page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(),
+ null);
+ }
+
+ @Override
+ public Stream stream() {
+ return pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl<>(iterable.iterator(), mapper);
+ }
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/TerraformsClientImpl.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/TerraformsClientImpl.java
new file mode 100644
index 000000000000..f2448b7d83e3
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/TerraformsClientImpl.java
@@ -0,0 +1,255 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.terraform.fluent.TerraformsClient;
+import com.azure.resourcemanager.terraform.models.BaseExportModel;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in TerraformsClient.
+ */
+public final class TerraformsClientImpl implements TerraformsClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final TerraformsService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final AzureTerraformManagementClientImpl client;
+
+ /**
+ * Initializes an instance of TerraformsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ TerraformsClientImpl(AzureTerraformManagementClientImpl client) {
+ this.service
+ = RestProxy.create(TerraformsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AzureTerraformManagementClientTerraforms to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "AzureTerraformManage")
+ public interface TerraformsService {
+ @Headers({ "Content-Type: application/json" })
+ @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AzureTerraform/exportTerraform")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> exportTerraform(@HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") BaseExportModel body, @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @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 {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> exportTerraformWithResponseAsync(BaseExportModel body) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.exportTerraform(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), body, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @param context The context to associate with this operation.
+ * @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 {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> exportTerraformWithResponseAsync(BaseExportModel body, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (body == null) {
+ return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
+ } else {
+ body.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.exportTerraform(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), body, accept, context);
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @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 {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginExportTerraformAsync(BaseExportModel body) {
+ Mono>> mono = exportTerraformWithResponseAsync(body);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @param context The context to associate with this operation.
+ * @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 {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginExportTerraformAsync(BaseExportModel body, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = exportTerraformWithResponseAsync(body, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginExportTerraform(BaseExportModel body) {
+ return this.beginExportTerraformAsync(body).getSyncPoller();
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @param context The context to associate with this operation.
+ * @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 {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, Void> beginExportTerraform(BaseExportModel body, Context context) {
+ return this.beginExportTerraformAsync(body, context).getSyncPoller();
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono exportTerraformAsync(BaseExportModel body) {
+ return beginExportTerraformAsync(body).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @param context The context to associate with this operation.
+ * @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 A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono exportTerraformAsync(BaseExportModel body, Context context) {
+ return beginExportTerraformAsync(body, context).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void exportTerraform(BaseExportModel body) {
+ exportTerraformAsync(body).block();
+ }
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @param context The context to associate with this operation.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void exportTerraform(BaseExportModel body, Context context) {
+ exportTerraformAsync(body, context).block();
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/TerraformsImpl.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/TerraformsImpl.java
new file mode 100644
index 000000000000..2da563cefb2c
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/TerraformsImpl.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.terraform.implementation;
+
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.terraform.fluent.TerraformsClient;
+import com.azure.resourcemanager.terraform.models.BaseExportModel;
+import com.azure.resourcemanager.terraform.models.Terraforms;
+
+public final class TerraformsImpl implements Terraforms {
+ private static final ClientLogger LOGGER = new ClientLogger(TerraformsImpl.class);
+
+ private final TerraformsClient innerClient;
+
+ private final com.azure.resourcemanager.terraform.AzureTerraformManager serviceManager;
+
+ public TerraformsImpl(TerraformsClient innerClient,
+ com.azure.resourcemanager.terraform.AzureTerraformManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public void exportTerraform(BaseExportModel body) {
+ this.serviceClient().exportTerraform(body);
+ }
+
+ public void exportTerraform(BaseExportModel body, Context context) {
+ this.serviceClient().exportTerraform(body, context);
+ }
+
+ private TerraformsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.terraform.AzureTerraformManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/package-info.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/package-info.java
new file mode 100644
index 000000000000..080047e393bd
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/implementation/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the implementations for AzureTerraformManagementClient.
+ * AzureTerraform Client.
+ */
+package com.azure.resourcemanager.terraform.implementation;
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ActionType.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ActionType.java
new file mode 100644
index 000000000000..76bee14c7edd
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ActionType.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+public final class ActionType extends ExpandableStringEnum {
+ /**
+ * Static value Internal for ActionType.
+ */
+ public static final ActionType INTERNAL = fromString("Internal");
+
+ /**
+ * Creates a new instance of ActionType value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ActionType() {
+ }
+
+ /**
+ * Creates or finds a ActionType from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ActionType.
+ */
+ public static ActionType fromString(String name) {
+ return fromString(name, ActionType.class);
+ }
+
+ /**
+ * Gets known ActionType values.
+ *
+ * @return known ActionType values.
+ */
+ public static Collection values() {
+ return values(ActionType.class);
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/BaseExportModel.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/BaseExportModel.java
new file mode 100644
index 000000000000..694d5fe7ac36
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/BaseExportModel.java
@@ -0,0 +1,199 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * The base export parameter.
+ */
+@Fluent
+public class BaseExportModel implements JsonSerializable {
+ /*
+ * The parameter type
+ */
+ private Type type = Type.fromString("BaseExportModel");
+
+ /*
+ * The target Azure Terraform Provider
+ */
+ private TargetProvider targetProvider;
+
+ /*
+ * Whether to output all non-computed properties in the generated Terraform configuration? This probably needs
+ * manual modifications to make it valid
+ */
+ private Boolean fullProperties;
+
+ /*
+ * Mask sensitive attributes in the Terraform configuration
+ */
+ private Boolean maskSensitive;
+
+ /**
+ * Creates an instance of BaseExportModel class.
+ */
+ public BaseExportModel() {
+ }
+
+ /**
+ * Get the type property: The parameter type.
+ *
+ * @return the type value.
+ */
+ public Type type() {
+ return this.type;
+ }
+
+ /**
+ * Get the targetProvider property: The target Azure Terraform Provider.
+ *
+ * @return the targetProvider value.
+ */
+ public TargetProvider targetProvider() {
+ return this.targetProvider;
+ }
+
+ /**
+ * Set the targetProvider property: The target Azure Terraform Provider.
+ *
+ * @param targetProvider the targetProvider value to set.
+ * @return the BaseExportModel object itself.
+ */
+ public BaseExportModel withTargetProvider(TargetProvider targetProvider) {
+ this.targetProvider = targetProvider;
+ return this;
+ }
+
+ /**
+ * Get the fullProperties property: Whether to output all non-computed properties in the generated Terraform
+ * configuration? This probably needs manual modifications to make it valid.
+ *
+ * @return the fullProperties value.
+ */
+ public Boolean fullProperties() {
+ return this.fullProperties;
+ }
+
+ /**
+ * Set the fullProperties property: Whether to output all non-computed properties in the generated Terraform
+ * configuration? This probably needs manual modifications to make it valid.
+ *
+ * @param fullProperties the fullProperties value to set.
+ * @return the BaseExportModel object itself.
+ */
+ public BaseExportModel withFullProperties(Boolean fullProperties) {
+ this.fullProperties = fullProperties;
+ return this;
+ }
+
+ /**
+ * Get the maskSensitive property: Mask sensitive attributes in the Terraform configuration.
+ *
+ * @return the maskSensitive value.
+ */
+ public Boolean maskSensitive() {
+ return this.maskSensitive;
+ }
+
+ /**
+ * Set the maskSensitive property: Mask sensitive attributes in the Terraform configuration.
+ *
+ * @param maskSensitive the maskSensitive value to set.
+ * @return the BaseExportModel object itself.
+ */
+ public BaseExportModel withMaskSensitive(Boolean maskSensitive) {
+ this.maskSensitive = maskSensitive;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
+ jsonWriter.writeStringField("targetProvider",
+ this.targetProvider == null ? null : this.targetProvider.toString());
+ jsonWriter.writeBooleanField("fullProperties", this.fullProperties);
+ jsonWriter.writeBooleanField("maskSensitive", this.maskSensitive);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of BaseExportModel from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of BaseExportModel if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the BaseExportModel.
+ */
+ public static BaseExportModel fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ String discriminatorValue = null;
+ try (JsonReader readerToUse = reader.bufferObject()) {
+ readerToUse.nextToken(); // Prepare for reading
+ while (readerToUse.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = readerToUse.getFieldName();
+ readerToUse.nextToken();
+ if ("type".equals(fieldName)) {
+ discriminatorValue = readerToUse.getString();
+ break;
+ } else {
+ readerToUse.skipChildren();
+ }
+ }
+ // Use the discriminator value to determine which subtype should be deserialized.
+ if ("ExportQuery".equals(discriminatorValue)) {
+ return ExportQuery.fromJson(readerToUse.reset());
+ } else if ("ExportResource".equals(discriminatorValue)) {
+ return ExportResource.fromJson(readerToUse.reset());
+ } else if ("ExportResourceGroup".equals(discriminatorValue)) {
+ return ExportResourceGroup.fromJson(readerToUse.reset());
+ } else {
+ return fromJsonKnownDiscriminator(readerToUse.reset());
+ }
+ }
+ });
+ }
+
+ static BaseExportModel fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ BaseExportModel deserializedBaseExportModel = new BaseExportModel();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("type".equals(fieldName)) {
+ deserializedBaseExportModel.type = Type.fromString(reader.getString());
+ } else if ("targetProvider".equals(fieldName)) {
+ deserializedBaseExportModel.targetProvider = TargetProvider.fromString(reader.getString());
+ } else if ("fullProperties".equals(fieldName)) {
+ deserializedBaseExportModel.fullProperties = reader.getNullable(JsonReader::getBoolean);
+ } else if ("maskSensitive".equals(fieldName)) {
+ deserializedBaseExportModel.maskSensitive = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedBaseExportModel;
+ });
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportQuery.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportQuery.java
new file mode 100644
index 000000000000..1e11596fe8ce
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportQuery.java
@@ -0,0 +1,214 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Export parameter for resources queried by ARG (Azure Resource Graph).
+ */
+@Fluent
+public final class ExportQuery extends BaseExportModel {
+ /*
+ * The parameter type
+ */
+ private Type type = Type.EXPORT_QUERY;
+
+ /*
+ * The ARG where predicate. Note that you can combine multiple conditions in one `where` predicate, e.g.
+ * `resourceGroup =~ "my-rg" and type =~ "microsoft.network/virtualnetworks"`
+ */
+ private String query;
+
+ /*
+ * The name pattern of the Terraform resources
+ */
+ private String namePattern;
+
+ /*
+ * Whether to recursively list child resources of the query result
+ */
+ private Boolean recursive;
+
+ /**
+ * Creates an instance of ExportQuery class.
+ */
+ public ExportQuery() {
+ }
+
+ /**
+ * Get the type property: The parameter type.
+ *
+ * @return the type value.
+ */
+ @Override
+ public Type type() {
+ return this.type;
+ }
+
+ /**
+ * Get the query property: The ARG where predicate. Note that you can combine multiple conditions in one `where`
+ * predicate, e.g. `resourceGroup =~ "my-rg" and type =~ "microsoft.network/virtualnetworks"`.
+ *
+ * @return the query value.
+ */
+ public String query() {
+ return this.query;
+ }
+
+ /**
+ * Set the query property: The ARG where predicate. Note that you can combine multiple conditions in one `where`
+ * predicate, e.g. `resourceGroup =~ "my-rg" and type =~ "microsoft.network/virtualnetworks"`.
+ *
+ * @param query the query value to set.
+ * @return the ExportQuery object itself.
+ */
+ public ExportQuery withQuery(String query) {
+ this.query = query;
+ return this;
+ }
+
+ /**
+ * Get the namePattern property: The name pattern of the Terraform resources.
+ *
+ * @return the namePattern value.
+ */
+ public String namePattern() {
+ return this.namePattern;
+ }
+
+ /**
+ * Set the namePattern property: The name pattern of the Terraform resources.
+ *
+ * @param namePattern the namePattern value to set.
+ * @return the ExportQuery object itself.
+ */
+ public ExportQuery withNamePattern(String namePattern) {
+ this.namePattern = namePattern;
+ return this;
+ }
+
+ /**
+ * Get the recursive property: Whether to recursively list child resources of the query result.
+ *
+ * @return the recursive value.
+ */
+ public Boolean recursive() {
+ return this.recursive;
+ }
+
+ /**
+ * Set the recursive property: Whether to recursively list child resources of the query result.
+ *
+ * @param recursive the recursive value to set.
+ * @return the ExportQuery object itself.
+ */
+ public ExportQuery withRecursive(Boolean recursive) {
+ this.recursive = recursive;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportQuery withTargetProvider(TargetProvider targetProvider) {
+ super.withTargetProvider(targetProvider);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportQuery withFullProperties(Boolean fullProperties) {
+ super.withFullProperties(fullProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportQuery withMaskSensitive(Boolean maskSensitive) {
+ super.withMaskSensitive(maskSensitive);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (query() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property query in model ExportQuery"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ExportQuery.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("targetProvider", targetProvider() == null ? null : targetProvider().toString());
+ jsonWriter.writeBooleanField("fullProperties", fullProperties());
+ jsonWriter.writeBooleanField("maskSensitive", maskSensitive());
+ jsonWriter.writeStringField("query", this.query);
+ jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
+ jsonWriter.writeStringField("namePattern", this.namePattern);
+ jsonWriter.writeBooleanField("recursive", this.recursive);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ExportQuery from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ExportQuery if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ExportQuery.
+ */
+ public static ExportQuery fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ExportQuery deserializedExportQuery = new ExportQuery();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("targetProvider".equals(fieldName)) {
+ deserializedExportQuery.withTargetProvider(TargetProvider.fromString(reader.getString()));
+ } else if ("fullProperties".equals(fieldName)) {
+ deserializedExportQuery.withFullProperties(reader.getNullable(JsonReader::getBoolean));
+ } else if ("maskSensitive".equals(fieldName)) {
+ deserializedExportQuery.withMaskSensitive(reader.getNullable(JsonReader::getBoolean));
+ } else if ("query".equals(fieldName)) {
+ deserializedExportQuery.query = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedExportQuery.type = Type.fromString(reader.getString());
+ } else if ("namePattern".equals(fieldName)) {
+ deserializedExportQuery.namePattern = reader.getString();
+ } else if ("recursive".equals(fieldName)) {
+ deserializedExportQuery.recursive = reader.getNullable(JsonReader::getBoolean);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedExportQuery;
+ });
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportResource.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportResource.java
new file mode 100644
index 000000000000..d726ac793098
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportResource.java
@@ -0,0 +1,241 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Export parameter for individual resources.
+ */
+@Fluent
+public final class ExportResource extends BaseExportModel {
+ /*
+ * The parameter type
+ */
+ private Type type = Type.EXPORT_RESOURCE;
+
+ /*
+ * The id of the resource to be exported
+ */
+ private List resourceIds;
+
+ /*
+ * The Terraform resource name. Only works when `resourceIds` contains only one item.
+ */
+ private String resourceName;
+
+ /*
+ * The Terraform resource type. Only works when `resourceIds` contains only one item.
+ */
+ private String resourceType;
+
+ /*
+ * The name pattern of the Terraform resources
+ */
+ private String namePattern;
+
+ /**
+ * Creates an instance of ExportResource class.
+ */
+ public ExportResource() {
+ }
+
+ /**
+ * Get the type property: The parameter type.
+ *
+ * @return the type value.
+ */
+ @Override
+ public Type type() {
+ return this.type;
+ }
+
+ /**
+ * Get the resourceIds property: The id of the resource to be exported.
+ *
+ * @return the resourceIds value.
+ */
+ public List resourceIds() {
+ return this.resourceIds;
+ }
+
+ /**
+ * Set the resourceIds property: The id of the resource to be exported.
+ *
+ * @param resourceIds the resourceIds value to set.
+ * @return the ExportResource object itself.
+ */
+ public ExportResource withResourceIds(List resourceIds) {
+ this.resourceIds = resourceIds;
+ return this;
+ }
+
+ /**
+ * Get the resourceName property: The Terraform resource name. Only works when `resourceIds` contains only one item.
+ *
+ * @return the resourceName value.
+ */
+ public String resourceName() {
+ return this.resourceName;
+ }
+
+ /**
+ * Set the resourceName property: The Terraform resource name. Only works when `resourceIds` contains only one item.
+ *
+ * @param resourceName the resourceName value to set.
+ * @return the ExportResource object itself.
+ */
+ public ExportResource withResourceName(String resourceName) {
+ this.resourceName = resourceName;
+ return this;
+ }
+
+ /**
+ * Get the resourceType property: The Terraform resource type. Only works when `resourceIds` contains only one item.
+ *
+ * @return the resourceType value.
+ */
+ public String resourceType() {
+ return this.resourceType;
+ }
+
+ /**
+ * Set the resourceType property: The Terraform resource type. Only works when `resourceIds` contains only one item.
+ *
+ * @param resourceType the resourceType value to set.
+ * @return the ExportResource object itself.
+ */
+ public ExportResource withResourceType(String resourceType) {
+ this.resourceType = resourceType;
+ return this;
+ }
+
+ /**
+ * Get the namePattern property: The name pattern of the Terraform resources.
+ *
+ * @return the namePattern value.
+ */
+ public String namePattern() {
+ return this.namePattern;
+ }
+
+ /**
+ * Set the namePattern property: The name pattern of the Terraform resources.
+ *
+ * @param namePattern the namePattern value to set.
+ * @return the ExportResource object itself.
+ */
+ public ExportResource withNamePattern(String namePattern) {
+ this.namePattern = namePattern;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportResource withTargetProvider(TargetProvider targetProvider) {
+ super.withTargetProvider(targetProvider);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportResource withFullProperties(Boolean fullProperties) {
+ super.withFullProperties(fullProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportResource withMaskSensitive(Boolean maskSensitive) {
+ super.withMaskSensitive(maskSensitive);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (resourceIds() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property resourceIds in model ExportResource"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ExportResource.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("targetProvider", targetProvider() == null ? null : targetProvider().toString());
+ jsonWriter.writeBooleanField("fullProperties", fullProperties());
+ jsonWriter.writeBooleanField("maskSensitive", maskSensitive());
+ jsonWriter.writeArrayField("resourceIds", this.resourceIds, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
+ jsonWriter.writeStringField("resourceName", this.resourceName);
+ jsonWriter.writeStringField("resourceType", this.resourceType);
+ jsonWriter.writeStringField("namePattern", this.namePattern);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ExportResource from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ExportResource if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ExportResource.
+ */
+ public static ExportResource fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ExportResource deserializedExportResource = new ExportResource();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("targetProvider".equals(fieldName)) {
+ deserializedExportResource.withTargetProvider(TargetProvider.fromString(reader.getString()));
+ } else if ("fullProperties".equals(fieldName)) {
+ deserializedExportResource.withFullProperties(reader.getNullable(JsonReader::getBoolean));
+ } else if ("maskSensitive".equals(fieldName)) {
+ deserializedExportResource.withMaskSensitive(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceIds".equals(fieldName)) {
+ List resourceIds = reader.readArray(reader1 -> reader1.getString());
+ deserializedExportResource.resourceIds = resourceIds;
+ } else if ("type".equals(fieldName)) {
+ deserializedExportResource.type = Type.fromString(reader.getString());
+ } else if ("resourceName".equals(fieldName)) {
+ deserializedExportResource.resourceName = reader.getString();
+ } else if ("resourceType".equals(fieldName)) {
+ deserializedExportResource.resourceType = reader.getString();
+ } else if ("namePattern".equals(fieldName)) {
+ deserializedExportResource.namePattern = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedExportResource;
+ });
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportResourceGroup.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportResourceGroup.java
new file mode 100644
index 000000000000..33feaf9e3caf
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/ExportResourceGroup.java
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Export parameter for a resource group.
+ */
+@Fluent
+public final class ExportResourceGroup extends BaseExportModel {
+ /*
+ * The parameter type
+ */
+ private Type type = Type.EXPORT_RESOURCE_GROUP;
+
+ /*
+ * The name of the resource group to be exported
+ */
+ private String resourceGroupName;
+
+ /*
+ * The name pattern of the Terraform resources
+ */
+ private String namePattern;
+
+ /**
+ * Creates an instance of ExportResourceGroup class.
+ */
+ public ExportResourceGroup() {
+ }
+
+ /**
+ * Get the type property: The parameter type.
+ *
+ * @return the type value.
+ */
+ @Override
+ public Type type() {
+ return this.type;
+ }
+
+ /**
+ * Get the resourceGroupName property: The name of the resource group to be exported.
+ *
+ * @return the resourceGroupName value.
+ */
+ public String resourceGroupName() {
+ return this.resourceGroupName;
+ }
+
+ /**
+ * Set the resourceGroupName property: The name of the resource group to be exported.
+ *
+ * @param resourceGroupName the resourceGroupName value to set.
+ * @return the ExportResourceGroup object itself.
+ */
+ public ExportResourceGroup withResourceGroupName(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ /**
+ * Get the namePattern property: The name pattern of the Terraform resources.
+ *
+ * @return the namePattern value.
+ */
+ public String namePattern() {
+ return this.namePattern;
+ }
+
+ /**
+ * Set the namePattern property: The name pattern of the Terraform resources.
+ *
+ * @param namePattern the namePattern value to set.
+ * @return the ExportResourceGroup object itself.
+ */
+ public ExportResourceGroup withNamePattern(String namePattern) {
+ this.namePattern = namePattern;
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportResourceGroup withTargetProvider(TargetProvider targetProvider) {
+ super.withTargetProvider(targetProvider);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportResourceGroup withFullProperties(Boolean fullProperties) {
+ super.withFullProperties(fullProperties);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public ExportResourceGroup withMaskSensitive(Boolean maskSensitive) {
+ super.withMaskSensitive(maskSensitive);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ if (resourceGroupName() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property resourceGroupName in model ExportResourceGroup"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ExportResourceGroup.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("targetProvider", targetProvider() == null ? null : targetProvider().toString());
+ jsonWriter.writeBooleanField("fullProperties", fullProperties());
+ jsonWriter.writeBooleanField("maskSensitive", maskSensitive());
+ jsonWriter.writeStringField("resourceGroupName", this.resourceGroupName);
+ jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString());
+ jsonWriter.writeStringField("namePattern", this.namePattern);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of ExportResourceGroup from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of ExportResourceGroup if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @throws IOException If an error occurs while reading the ExportResourceGroup.
+ */
+ public static ExportResourceGroup fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ ExportResourceGroup deserializedExportResourceGroup = new ExportResourceGroup();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("targetProvider".equals(fieldName)) {
+ deserializedExportResourceGroup.withTargetProvider(TargetProvider.fromString(reader.getString()));
+ } else if ("fullProperties".equals(fieldName)) {
+ deserializedExportResourceGroup.withFullProperties(reader.getNullable(JsonReader::getBoolean));
+ } else if ("maskSensitive".equals(fieldName)) {
+ deserializedExportResourceGroup.withMaskSensitive(reader.getNullable(JsonReader::getBoolean));
+ } else if ("resourceGroupName".equals(fieldName)) {
+ deserializedExportResourceGroup.resourceGroupName = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedExportResourceGroup.type = Type.fromString(reader.getString());
+ } else if ("namePattern".equals(fieldName)) {
+ deserializedExportResourceGroup.namePattern = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedExportResourceGroup;
+ });
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Operation.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Operation.java
new file mode 100644
index 000000000000..e5fd3caf173c
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Operation.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.resourcemanager.terraform.fluent.models.OperationInner;
+
+/**
+ * An immutable client-side representation of Operation.
+ */
+public interface Operation {
+ /**
+ * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
+ * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
+ *
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane
+ * operations and "false" for ARM/control-plane operations.
+ *
+ * @return the isDataAction value.
+ */
+ Boolean isDataAction();
+
+ /**
+ * Gets the display property: Localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ OperationDisplay display();
+
+ /**
+ * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and
+ * audit logs UX. Default value is "user,system".
+ *
+ * @return the origin value.
+ */
+ Origin origin();
+
+ /**
+ * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal
+ * only APIs.
+ *
+ * @return the actionType value.
+ */
+ ActionType actionType();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.terraform.fluent.models.OperationInner object.
+ *
+ * @return the inner object.
+ */
+ OperationInner innerModel();
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/OperationDisplay.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/OperationDisplay.java
new file mode 100644
index 000000000000..a6a5161c653c
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/OperationDisplay.java
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * Localized display information for this particular operation.
+ */
+@Immutable
+public final class OperationDisplay implements JsonSerializable {
+ /*
+ * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or
+ * "Microsoft Compute".
+ */
+ private String provider;
+
+ /*
+ * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or
+ * "Job Schedule Collections".
+ */
+ private String resource;
+
+ /*
+ * The concise, localized friendly name for the operation; suitable for dropdowns. E.g.
+ * "Create or Update Virtual Machine", "Restart Virtual Machine".
+ */
+ private String operation;
+
+ /*
+ * The short, localized friendly description of the operation; suitable for tool tips and detailed views.
+ */
+ private String description;
+
+ /**
+ * Creates an instance of OperationDisplay class.
+ */
+ public OperationDisplay() {
+ }
+
+ /**
+ * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring
+ * Insights" or "Microsoft Compute".
+ *
+ * @return the provider value.
+ */
+ public String provider() {
+ return this.provider;
+ }
+
+ /**
+ * Get the resource property: The localized friendly name of the resource type related to this operation. E.g.
+ * "Virtual Machines" or "Job Schedule Collections".
+ *
+ * @return the resource value.
+ */
+ public String resource() {
+ return this.resource;
+ }
+
+ /**
+ * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g.
+ * "Create or Update Virtual Machine", "Restart Virtual Machine".
+ *
+ * @return the operation value.
+ */
+ public String operation() {
+ return this.operation;
+ }
+
+ /**
+ * Get the description property: The short, localized friendly description of the operation; suitable for tool tips
+ * and detailed views.
+ *
+ * @return the description value.
+ */
+ public String description() {
+ return this.description;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationDisplay from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationDisplay.
+ */
+ public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationDisplay deserializedOperationDisplay = new OperationDisplay();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("provider".equals(fieldName)) {
+ deserializedOperationDisplay.provider = reader.getString();
+ } else if ("resource".equals(fieldName)) {
+ deserializedOperationDisplay.resource = reader.getString();
+ } else if ("operation".equals(fieldName)) {
+ deserializedOperationDisplay.operation = reader.getString();
+ } else if ("description".equals(fieldName)) {
+ deserializedOperationDisplay.description = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationDisplay;
+ });
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/OperationListResult.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/OperationListResult.java
new file mode 100644
index 000000000000..22bfbc8f9186
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/OperationListResult.java
@@ -0,0 +1,104 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.terraform.fluent.models.OperationInner;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of
+ * results.
+ */
+@Immutable
+public final class OperationListResult implements JsonSerializable {
+ /*
+ * List of operations supported by the resource provider
+ */
+ private List value;
+
+ /*
+ * URL to get the next set of operation list results (if there are any).
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of OperationListResult class.
+ */
+ public OperationListResult() {
+ }
+
+ /**
+ * Get the value property: List of operations supported by the resource provider.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Get the nextLink property: URL to get the next set of operation list results (if there are any).
+ *
+ * @return the nextLink value.
+ */
+ public String nextLink() {
+ return this.nextLink;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() != null) {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of OperationListResult from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was
+ * pointing to JSON null.
+ * @throws IOException If an error occurs while reading the OperationListResult.
+ */
+ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ OperationListResult deserializedOperationListResult = new OperationListResult();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1));
+ deserializedOperationListResult.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedOperationListResult.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedOperationListResult;
+ });
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Operations.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Operations.java
new file mode 100644
index 000000000000..f4763428997f
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Operations.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+
+/**
+ * Resource collection API of Operations.
+ */
+public interface Operations {
+ /**
+ * List the operations for the provider.
+ *
+ * @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 a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ PagedIterable list();
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ PagedIterable list(Context context);
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Origin.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Origin.java
new file mode 100644
index 000000000000..14988acf9352
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Origin.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value
+ * is "user,system".
+ */
+public final class Origin extends ExpandableStringEnum {
+ /**
+ * Static value user for Origin.
+ */
+ public static final Origin USER = fromString("user");
+
+ /**
+ * Static value system for Origin.
+ */
+ public static final Origin SYSTEM = fromString("system");
+
+ /**
+ * Static value user,system for Origin.
+ */
+ public static final Origin USER_SYSTEM = fromString("user,system");
+
+ /**
+ * Creates a new instance of Origin value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public Origin() {
+ }
+
+ /**
+ * Creates or finds a Origin from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding Origin.
+ */
+ public static Origin fromString(String name) {
+ return fromString(name, Origin.class);
+ }
+
+ /**
+ * Gets known Origin values.
+ *
+ * @return known Origin values.
+ */
+ public static Collection values() {
+ return values(Origin.class);
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/TargetProvider.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/TargetProvider.java
new file mode 100644
index 000000000000..168558590999
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/TargetProvider.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * The target Azure Terraform Provider.
+ */
+public final class TargetProvider extends ExpandableStringEnum {
+ /**
+ * Static value azurerm for TargetProvider.
+ */
+ public static final TargetProvider AZURERM = fromString("azurerm");
+
+ /**
+ * Static value azapi for TargetProvider.
+ */
+ public static final TargetProvider AZAPI = fromString("azapi");
+
+ /**
+ * Creates a new instance of TargetProvider value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public TargetProvider() {
+ }
+
+ /**
+ * Creates or finds a TargetProvider from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding TargetProvider.
+ */
+ public static TargetProvider fromString(String name) {
+ return fromString(name, TargetProvider.class);
+ }
+
+ /**
+ * Gets known TargetProvider values.
+ *
+ * @return known TargetProvider values.
+ */
+ public static Collection values() {
+ return values(TargetProvider.class);
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Terraforms.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Terraforms.java
new file mode 100644
index 000000000000..19c10ac580dc
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Terraforms.java
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.util.Context;
+
+/**
+ * Resource collection API of Terraforms.
+ */
+public interface Terraforms {
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @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.
+ */
+ void exportTerraform(BaseExportModel body);
+
+ /**
+ * Exports the Terraform configuration of the specified resource(s).
+ *
+ * @param body The request body.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ void exportTerraform(BaseExportModel body, Context context);
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Type.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Type.java
new file mode 100644
index 000000000000..00c5e0893e2e
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/Type.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * The parameter type.
+ */
+public final class Type extends ExpandableStringEnum {
+ /**
+ * Static value ExportResource for Type.
+ */
+ public static final Type EXPORT_RESOURCE = fromString("ExportResource");
+
+ /**
+ * Static value ExportResourceGroup for Type.
+ */
+ public static final Type EXPORT_RESOURCE_GROUP = fromString("ExportResourceGroup");
+
+ /**
+ * Static value ExportQuery for Type.
+ */
+ public static final Type EXPORT_QUERY = fromString("ExportQuery");
+
+ /**
+ * Creates a new instance of Type value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public Type() {
+ }
+
+ /**
+ * Creates or finds a Type from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding Type.
+ */
+ public static Type fromString(String name) {
+ return fromString(name, Type.class);
+ }
+
+ /**
+ * Gets known Type values.
+ *
+ * @return known Type values.
+ */
+ public static Collection values() {
+ return values(Type.class);
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/package-info.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/package-info.java
new file mode 100644
index 000000000000..3c41ba14d92e
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/models/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the data models for AzureTerraformManagementClient.
+ * AzureTerraform Client.
+ */
+package com.azure.resourcemanager.terraform.models;
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/package-info.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/package-info.java
new file mode 100644
index 000000000000..f69b31c596db
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/com/azure/resourcemanager/terraform/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the classes for AzureTerraformManagementClient.
+ * AzureTerraform Client.
+ */
+package com.azure.resourcemanager.terraform;
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/java/module-info.java b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/module-info.java
new file mode 100644
index 000000000000..1d3d8ef8d271
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/java/module-info.java
@@ -0,0 +1,15 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+module com.azure.resourcemanager.terraform {
+ requires transitive com.azure.core.management;
+
+ exports com.azure.resourcemanager.terraform;
+ exports com.azure.resourcemanager.terraform.fluent;
+ exports com.azure.resourcemanager.terraform.fluent.models;
+ exports com.azure.resourcemanager.terraform.models;
+
+ opens com.azure.resourcemanager.terraform.fluent.models to com.azure.core;
+ opens com.azure.resourcemanager.terraform.models to com.azure.core;
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-terraform/proxy-config.json b/sdk/terraform/azure-resourcemanager-terraform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-terraform/proxy-config.json
new file mode 100644
index 000000000000..0790a839ed52
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-terraform/proxy-config.json
@@ -0,0 +1 @@
+[["com.azure.resourcemanager.terraform.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.terraform.implementation.TerraformsClientImpl$TerraformsService"]]
\ No newline at end of file
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-terraform/reflect-config.json b/sdk/terraform/azure-resourcemanager-terraform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-terraform/reflect-config.json
new file mode 100644
index 000000000000..0637a088a01e
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-terraform/reflect-config.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/samples/java/com/azure/resourcemanager/terraform/generated/OperationsListSamples.java b/sdk/terraform/azure-resourcemanager-terraform/src/samples/java/com/azure/resourcemanager/terraform/generated/OperationsListSamples.java
new file mode 100644
index 000000000000..caf715fd6395
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/samples/java/com/azure/resourcemanager/terraform/generated/OperationsListSamples.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.terraform.generated;
+
+/**
+ * Samples for Operations List.
+ */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file:
+ * specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/
+ * ListOperations.json
+ */
+ /**
+ * Sample code: Get a list of operations for a resource provider.
+ *
+ * @param manager Entry point to AzureTerraformManager.
+ */
+ public static void
+ getAListOfOperationsForAResourceProvider(com.azure.resourcemanager.terraform.AzureTerraformManager manager) {
+ manager.operations().list(com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/terraform/azure-resourcemanager-terraform/src/samples/java/com/azure/resourcemanager/terraform/generated/TerraformExportTerraformSamples.java b/sdk/terraform/azure-resourcemanager-terraform/src/samples/java/com/azure/resourcemanager/terraform/generated/TerraformExportTerraformSamples.java
new file mode 100644
index 000000000000..29109feedbb6
--- /dev/null
+++ b/sdk/terraform/azure-resourcemanager-terraform/src/samples/java/com/azure/resourcemanager/terraform/generated/TerraformExportTerraformSamples.java
@@ -0,0 +1,27 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.terraform.generated;
+
+import com.azure.resourcemanager.terraform.models.ExportResourceGroup;
+
+/**
+ * Samples for Terraform ExportTerraform.
+ */
+public final class TerraformExportTerraformSamples {
+ /*
+ * x-ms-original-file:
+ * specification/terraform/resource-manager/Microsoft.AzureTerraform/preview/2023-07-01-preview/examples/
+ * ExportTerraform.json
+ */
+ /**
+ * Sample code: ExportTerraform.
+ *
+ * @param manager Entry point to AzureTerraformManager.
+ */
+ public static void exportTerraform(com.azure.resourcemanager.terraform.AzureTerraformManager manager) {
+ manager.terraforms()
+ .exportTerraform(new ExportResourceGroup().withResourceGroupName("rg1"), com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/terraform/ci.yml b/sdk/terraform/ci.yml
new file mode 100644
index 000000000000..fcb7855a2dc8
--- /dev/null
+++ b/sdk/terraform/ci.yml
@@ -0,0 +1,46 @@
+# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
+
+trigger:
+ branches:
+ include:
+ - main
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/terraform/ci.yml
+ - sdk/terraform/azure-resourcemanager-terraform/
+ exclude:
+ - sdk/terraform/pom.xml
+ - sdk/terraform/azure-resourcemanager-terraform/pom.xml
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/terraform/ci.yml
+ - sdk/terraform/azure-resourcemanager-terraform/
+ exclude:
+ - sdk/terraform/pom.xml
+ - sdk/terraform/azure-resourcemanager-terraform/pom.xml
+
+parameters:
+ - name: release_azureresourcemanagerterraform
+ displayName: azure-resourcemanager-terraform
+ type: boolean
+ default: false
+
+extends:
+ template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
+ parameters:
+ ServiceDirectory: terraform
+ Artifacts:
+ - name: azure-resourcemanager-terraform
+ groupId: com.azure.resourcemanager
+ safeName: azureresourcemanagerterraform
+ releaseInBatch: ${{ parameters.release_azureresourcemanagerterraform }}
diff --git a/sdk/terraform/pom.xml b/sdk/terraform/pom.xml
new file mode 100644
index 000000000000..87c4380d39f7
--- /dev/null
+++ b/sdk/terraform/pom.xml
@@ -0,0 +1,15 @@
+
+
+ 4.0.0
+ com.azure
+ azure-terraform-service
+ pom
+ 1.0.0
+
+
+ azure-resourcemanager-terraform
+
+