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 Contoso service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Contoso service API instance.
+ */
+ public ContosoManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder.append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.contoso")
+ .append("/")
+ .append(clientVersion);
+ 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 BearerTokenAuthenticationPolicy(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 ContosoManager(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 Employees. It manages Employee.
+ *
+ * @return Resource collection API of Employees.
+ */
+ public Employees employees() {
+ if (this.employees == null) {
+ this.employees = new EmployeesImpl(clientObject.getEmployees(), this);
+ }
+ return employees;
+ }
+
+ /**
+ * Gets wrapped service client ContosoManagementClient providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client ContosoManagementClient.
+ */
+ public ContosoManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/ContosoManagementClient.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/ContosoManagementClient.java
new file mode 100644
index 000000000000..1b0a19a9b5fe
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/ContosoManagementClient.java
@@ -0,0 +1,62 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for ContosoManagementClient class.
+ */
+public interface ContosoManagementClient {
+ /**
+ * Gets Service host.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The ID of the target subscription. The value must be an UUID.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * 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 EmployeesClient object to access its operations.
+ *
+ * @return the EmployeesClient object.
+ */
+ EmployeesClient getEmployees();
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/EmployeesClient.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/EmployeesClient.java
new file mode 100644
index 000000000000..6527092af91f
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/EmployeesClient.java
@@ -0,0 +1,237 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.contoso.fluent.models.EmployeeInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in EmployeesClient.
+ */
+public interface EmployeesClient {
+ /**
+ * Get a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 Employee along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName, String employeeName,
+ Context context);
+
+ /**
+ * Get a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 Employee.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ EmployeeInner getByResourceGroup(String resourceGroupName, String employeeName);
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, EmployeeInner> beginCreateOrUpdate(String resourceGroupName,
+ String employeeName, EmployeeInner resource);
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, EmployeeInner> beginCreateOrUpdate(String resourceGroupName,
+ String employeeName, EmployeeInner resource, Context context);
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ EmployeeInner createOrUpdate(String resourceGroupName, String employeeName, EmployeeInner resource);
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ EmployeeInner createOrUpdate(String resourceGroupName, String employeeName, EmployeeInner resource,
+ Context context);
+
+ /**
+ * Update a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param properties The resource properties to be updated.
+ * @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 employee resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(String resourceGroupName, String employeeName, EmployeeInner properties,
+ Context context);
+
+ /**
+ * Update a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param properties The resource properties to be updated.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ EmployeeInner update(String resourceGroupName, String employeeName, EmployeeInner properties);
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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> beginDelete(String resourceGroupName, String employeeName);
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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> beginDelete(String resourceGroupName, String employeeName, Context context);
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 delete(String resourceGroupName, String employeeName);
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 delete(String resourceGroupName, String employeeName, Context context);
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @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 response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/OperationsClient.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/OperationsClient.java
new file mode 100644
index 000000000000..a24a6850bf8c
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/OperationsClient.java
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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.contoso.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/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/models/EmployeeInner.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/models/EmployeeInner.java
new file mode 100644
index 000000000000..0c094e4050a4
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/models/EmployeeInner.java
@@ -0,0 +1,192 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.management.SystemData;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.contoso.models.EmployeeProperties;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Employee resource.
+ */
+@Fluent
+public final class EmployeeInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private EmployeeProperties properties;
+
+ /*
+ * Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ */
+ private SystemData systemData;
+
+ /*
+ * The type of the resource.
+ */
+ private String type;
+
+ /*
+ * The name of the resource.
+ */
+ private String name;
+
+ /*
+ * Fully qualified resource Id for the resource.
+ */
+ private String id;
+
+ /**
+ * Creates an instance of EmployeeInner class.
+ */
+ public EmployeeInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public EmployeeProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the EmployeeInner object itself.
+ */
+ public EmployeeInner withProperties(EmployeeProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Get the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ @Override
+ public String type() {
+ return this.type;
+ }
+
+ /**
+ * Get the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ @Override
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Get the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ @Override
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EmployeeInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public EmployeeInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("location", location());
+ jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of EmployeeInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of EmployeeInner 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 EmployeeInner.
+ */
+ public static EmployeeInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ EmployeeInner deserializedEmployeeInner = new EmployeeInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedEmployeeInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedEmployeeInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedEmployeeInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedEmployeeInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedEmployeeInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedEmployeeInner.properties = EmployeeProperties.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedEmployeeInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedEmployeeInner;
+ });
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/models/OperationInner.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/models/OperationInner.java
new file mode 100644
index 000000000000..7216d9fa62ba
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/models/OperationInner.java
@@ -0,0 +1,161 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.fluent.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.contoso.models.ActionType;
+import com.azure.resourcemanager.contoso.models.OperationDisplay;
+import com.azure.resourcemanager.contoso.models.Origin;
+import java.io.IOException;
+
+/**
+ * REST API Operation
+ *
+ * Details of a REST API operation, returned from the Resource Provider Operations API.
+ */
+@Immutable
+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 Azure
+ * Resource Manager/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;
+
+ /*
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+ private ActionType actionType;
+
+ /**
+ * Creates an instance of OperationInner class.
+ */
+ private 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 Azure Resource Manager/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;
+ }
+
+ /**
+ * 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: Extensible 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/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/models/package-info.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/models/package-info.java
new file mode 100644
index 000000000000..407d157571eb
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the inner data models for Contoso.
+ * Microsoft.Contoso Resource Provider management API.
+ */
+package com.azure.resourcemanager.contoso.fluent.models;
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/package-info.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/fluent/package-info.java
new file mode 100644
index 000000000000..5fd98a299528
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the service clients for Contoso.
+ * Microsoft.Contoso Resource Provider management API.
+ */
+package com.azure.resourcemanager.contoso.fluent;
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ContosoManagementClientBuilder.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ContosoManagementClientBuilder.java
new file mode 100644
index 000000000000..e3759da8de19
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ContosoManagementClientBuilder.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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 ContosoManagementClientImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { ContosoManagementClientImpl.class })
+public final class ContosoManagementClientBuilder {
+ /*
+ * Service host
+ */
+ private String endpoint;
+
+ /**
+ * Sets Service host.
+ *
+ * @param endpoint the endpoint value.
+ * @return the ContosoManagementClientBuilder.
+ */
+ public ContosoManagementClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * 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 ContosoManagementClientBuilder.
+ */
+ public ContosoManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the ContosoManagementClientBuilder.
+ */
+ public ContosoManagementClientBuilder 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 ContosoManagementClientBuilder.
+ */
+ public ContosoManagementClientBuilder 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 ContosoManagementClientBuilder.
+ */
+ public ContosoManagementClientBuilder 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 ContosoManagementClientBuilder.
+ */
+ public ContosoManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of ContosoManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of ContosoManagementClientImpl.
+ */
+ public ContosoManagementClientImpl 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();
+ ContosoManagementClientImpl client = new ContosoManagementClientImpl(localPipeline, localSerializerAdapter,
+ localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId);
+ return client;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ContosoManagementClientImpl.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ContosoManagementClientImpl.java
new file mode 100644
index 000000000000..8e795faaf641
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ContosoManagementClientImpl.java
@@ -0,0 +1,324 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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.management.polling.SyncPollerFactory;
+import com.azure.core.util.BinaryData;
+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.polling.SyncPoller;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.contoso.fluent.ContosoManagementClient;
+import com.azure.resourcemanager.contoso.fluent.EmployeesClient;
+import com.azure.resourcemanager.contoso.fluent.OperationsClient;
+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 ContosoManagementClientImpl type.
+ */
+@ServiceClient(builder = ContosoManagementClientBuilder.class)
+public final class ContosoManagementClientImpl implements ContosoManagementClient {
+ /**
+ * Service host.
+ */
+ private final String endpoint;
+
+ /**
+ * Gets Service host.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /**
+ * Version parameter.
+ */
+ private final String apiVersion;
+
+ /**
+ * Gets Version parameter.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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 EmployeesClient object to access its operations.
+ */
+ private final EmployeesClient employees;
+
+ /**
+ * Gets the EmployeesClient object to access its operations.
+ *
+ * @return the EmployeesClient object.
+ */
+ public EmployeesClient getEmployees() {
+ return this.employees;
+ }
+
+ /**
+ * Initializes an instance of ContosoManagementClient 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 endpoint Service host.
+ * @param subscriptionId The ID of the target subscription. The value must be an UUID.
+ */
+ ContosoManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.endpoint = endpoint;
+ this.subscriptionId = subscriptionId;
+ this.apiVersion = "2021-11-01";
+ this.operations = new OperationsClientImpl(this);
+ this.employees = new EmployeesClientImpl(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 long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @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 SyncPoller for poll result and final result.
+ */
+ public SyncPoller, U> getLroResult(Response activationResponse,
+ Type pollResultType, Type finalResultType, Context context) {
+ return SyncPollerFactory.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(ContosoManagementClientImpl.class);
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeeImpl.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeeImpl.java
new file mode 100644
index 000000000000..3ab5ad2d03b4
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeeImpl.java
@@ -0,0 +1,165 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.contoso.fluent.models.EmployeeInner;
+import com.azure.resourcemanager.contoso.models.Employee;
+import com.azure.resourcemanager.contoso.models.EmployeeProperties;
+import java.util.Collections;
+import java.util.Map;
+
+public final class EmployeeImpl implements Employee, Employee.Definition, Employee.Update {
+ private EmployeeInner innerObject;
+
+ private final com.azure.resourcemanager.contoso.ContosoManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public EmployeeProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public EmployeeInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.contoso.ContosoManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String employeeName;
+
+ public EmployeeImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public Employee create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getEmployees()
+ .createOrUpdate(resourceGroupName, employeeName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public Employee create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getEmployees()
+ .createOrUpdate(resourceGroupName, employeeName, this.innerModel(), context);
+ return this;
+ }
+
+ EmployeeImpl(String name, com.azure.resourcemanager.contoso.ContosoManager serviceManager) {
+ this.innerObject = new EmployeeInner();
+ this.serviceManager = serviceManager;
+ this.employeeName = name;
+ }
+
+ public EmployeeImpl update() {
+ return this;
+ }
+
+ public Employee apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getEmployees()
+ .updateWithResponse(resourceGroupName, employeeName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public Employee apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getEmployees()
+ .updateWithResponse(resourceGroupName, employeeName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ EmployeeImpl(EmployeeInner innerObject, com.azure.resourcemanager.contoso.ContosoManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.employeeName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "employees");
+ }
+
+ public Employee refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getEmployees()
+ .getByResourceGroupWithResponse(resourceGroupName, employeeName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public Employee refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getEmployees()
+ .getByResourceGroupWithResponse(resourceGroupName, employeeName, context)
+ .getValue();
+ return this;
+ }
+
+ public EmployeeImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public EmployeeImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public EmployeeImpl withTags(Map tags) {
+ this.innerModel().withTags(tags);
+ return this;
+ }
+
+ public EmployeeImpl withProperties(EmployeeProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeesClientImpl.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeesClientImpl.java
new file mode 100644
index 000000000000..4a3e2eec04ad
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeesClientImpl.java
@@ -0,0 +1,1313 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+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.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+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.management.polling.PollResult;
+import com.azure.core.util.BinaryData;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.contoso.fluent.EmployeesClient;
+import com.azure.resourcemanager.contoso.fluent.models.EmployeeInner;
+import com.azure.resourcemanager.contoso.implementation.models.EmployeeListResult;
+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 EmployeesClient.
+ */
+public final class EmployeesClientImpl implements EmployeesClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final EmployeesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final ContosoManagementClientImpl client;
+
+ /**
+ * Initializes an instance of EmployeesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ EmployeesClientImpl(ContosoManagementClientImpl client) {
+ this.service
+ = RestProxy.create(EmployeesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ContosoManagementClientEmployees to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "ContosoManagementClientEmployees")
+ public interface EmployeesService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("employeeName") String employeeName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response getByResourceGroupSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("employeeName") String employeeName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("employeeName") String employeeName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") EmployeeInner resource, Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}")
+ @ExpectedResponses({ 200, 201 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response createOrUpdateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("employeeName") String employeeName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") EmployeeInner resource, Context context);
+
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("employeeName") String employeeName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") EmployeeInner properties, Context context);
+
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response updateSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("employeeName") String employeeName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") EmployeeInner properties, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("employeeName") String employeeName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees/{employeeName}")
+ @ExpectedResponses({ 202, 204 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response deleteSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @PathParam("employeeName") String employeeName,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Contoso/employees")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByResourceGroupSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/employees")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Contoso/employees")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listByResourceGroupNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listBySubscriptionNextSync(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Get a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 Employee along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String employeeName) {
+ 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 (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 Employee on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String employeeName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, employeeName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 Employee along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String employeeName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, accept, context);
+ }
+
+ /**
+ * Get a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 Employee.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EmployeeInner getByResourceGroup(String resourceGroupName, String employeeName) {
+ return getByResourceGroupWithResponse(resourceGroupName, employeeName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String employeeName, EmployeeInner resource) {
+ 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 (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, contentType, accept, resource,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response createOrUpdateWithResponse(String resourceGroupName, String employeeName,
+ EmployeeInner resource) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ if (resource == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, contentType, accept, resource,
+ Context.NONE);
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response createOrUpdateWithResponse(String resourceGroupName, String employeeName,
+ EmployeeInner resource, Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ if (resource == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ } else {
+ resource.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, contentType, accept, resource, context);
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, EmployeeInner> beginCreateOrUpdateAsync(String resourceGroupName,
+ String employeeName, EmployeeInner resource) {
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, employeeName, resource);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(),
+ EmployeeInner.class, EmployeeInner.class, this.client.getContext());
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, EmployeeInner> beginCreateOrUpdate(String resourceGroupName,
+ String employeeName, EmployeeInner resource) {
+ Response response = createOrUpdateWithResponse(resourceGroupName, employeeName, resource);
+ return this.client.getLroResult(response, EmployeeInner.class,
+ EmployeeInner.class, Context.NONE);
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, EmployeeInner> beginCreateOrUpdate(String resourceGroupName,
+ String employeeName, EmployeeInner resource, Context context) {
+ Response response = createOrUpdateWithResponse(resourceGroupName, employeeName, resource, context);
+ return this.client.getLroResult(response, EmployeeInner.class,
+ EmployeeInner.class, context);
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String employeeName,
+ EmployeeInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, employeeName, resource).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EmployeeInner createOrUpdate(String resourceGroupName, String employeeName, EmployeeInner resource) {
+ return beginCreateOrUpdate(resourceGroupName, employeeName, resource).getFinalResult();
+ }
+
+ /**
+ * Create a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param resource Resource create parameters.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EmployeeInner createOrUpdate(String resourceGroupName, String employeeName, EmployeeInner resource,
+ Context context) {
+ return beginCreateOrUpdate(resourceGroupName, employeeName, resource, context).getFinalResult();
+ }
+
+ /**
+ * Update a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param properties The resource properties to be updated.
+ * @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 employee resource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(String resourceGroupName, String employeeName,
+ EmployeeInner properties) {
+ 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 (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ if (properties == null) {
+ return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, contentType, accept, properties, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param properties The resource properties to be updated.
+ * @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 employee resource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String employeeName, EmployeeInner properties) {
+ return updateWithResponseAsync(resourceGroupName, employeeName, properties)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Update a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param properties The resource properties to be updated.
+ * @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 employee resource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(String resourceGroupName, String employeeName,
+ EmployeeInner properties, Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ if (properties == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter properties is required and cannot be null."));
+ } else {
+ properties.validate();
+ }
+ final String contentType = "application/json";
+ final String accept = "application/json";
+ return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, contentType, accept, properties, context);
+ }
+
+ /**
+ * Update a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @param properties The resource properties to be updated.
+ * @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 employee resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public EmployeeInner update(String resourceGroupName, String employeeName, EmployeeInner properties) {
+ return updateWithResponse(resourceGroupName, employeeName, properties, Context.NONE).getValue();
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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>> deleteWithResponseAsync(String resourceGroupName, String employeeName) {
+ 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 (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response deleteWithResponse(String resourceGroupName, String employeeName) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, accept, Context.NONE);
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 response body along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Response deleteWithResponse(String resourceGroupName, String employeeName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (employeeName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter employeeName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, employeeName, accept, context);
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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> beginDeleteAsync(String resourceGroupName, String employeeName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, employeeName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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> beginDelete(String resourceGroupName, String employeeName) {
+ Response response = deleteWithResponse(resourceGroupName, employeeName);
+ return this.client.getLroResult(response, Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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> beginDelete(String resourceGroupName, String employeeName,
+ Context context) {
+ Response response = deleteWithResponse(resourceGroupName, employeeName, context);
+ return this.client.getLroResult(response, Void.class, Void.class, context);
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 deleteAsync(String resourceGroupName, String employeeName) {
+ return beginDeleteAsync(resourceGroupName, employeeName).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 delete(String resourceGroupName, String employeeName) {
+ beginDelete(resourceGroupName, employeeName).getFinalResult();
+ }
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 delete(String resourceGroupName, String employeeName, Context context) {
+ beginDelete(resourceGroupName, employeeName, context).getFinalResult();
+ }
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ 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 (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, 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 Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listByResourceGroupSync(this.client.getEndpoint(),
+ this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 response of a Employee list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listByResourceGroupSync(this.client.getEndpoint(),
+ this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePage(nextLink));
+ }
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePage(nextLink, context));
+ }
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation 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."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), 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 Employee resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage() {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @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 response of a Employee list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(() -> listSinglePage(), nextLink -> listBySubscriptionNextSinglePage(nextLink));
+ }
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @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 response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(() -> listSinglePage(context),
+ nextLink -> listBySubscriptionNextSinglePage(nextLink, 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 the response of a Employee list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * 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 the response of a Employee list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * 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 the response of a Employee list operation along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listBySubscriptionNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * 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 the response of a Employee list operation along with {@link PagedResponse}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(EmployeesClientImpl.class);
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeesImpl.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeesImpl.java
new file mode 100644
index 000000000000..66f6991ddfb4
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/EmployeesImpl.java
@@ -0,0 +1,145 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.SimpleResponse;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.contoso.fluent.EmployeesClient;
+import com.azure.resourcemanager.contoso.fluent.models.EmployeeInner;
+import com.azure.resourcemanager.contoso.models.Employee;
+import com.azure.resourcemanager.contoso.models.Employees;
+
+public final class EmployeesImpl implements Employees {
+ private static final ClientLogger LOGGER = new ClientLogger(EmployeesImpl.class);
+
+ private final EmployeesClient innerClient;
+
+ private final com.azure.resourcemanager.contoso.ContosoManager serviceManager;
+
+ public EmployeesImpl(EmployeesClient innerClient, com.azure.resourcemanager.contoso.ContosoManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getByResourceGroupWithResponse(String resourceGroupName, String employeeName,
+ Context context) {
+ Response inner
+ = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, employeeName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new EmployeeImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Employee getByResourceGroup(String resourceGroupName, String employeeName) {
+ EmployeeInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, employeeName);
+ if (inner != null) {
+ return new EmployeeImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String employeeName) {
+ this.serviceClient().delete(resourceGroupName, employeeName);
+ }
+
+ public void delete(String resourceGroupName, String employeeName, Context context) {
+ this.serviceClient().delete(resourceGroupName, employeeName, context);
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new EmployeeImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new EmployeeImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new EmployeeImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new EmployeeImpl(inner1, this.manager()));
+ }
+
+ public Employee getById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String employeeName = ResourceManagerUtils.getValueFromIdByName(id, "employees");
+ if (employeeName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'employees'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, employeeName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String employeeName = ResourceManagerUtils.getValueFromIdByName(id, "employees");
+ if (employeeName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'employees'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, employeeName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String employeeName = ResourceManagerUtils.getValueFromIdByName(id, "employees");
+ if (employeeName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'employees'.", id)));
+ }
+ this.delete(resourceGroupName, employeeName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String employeeName = ResourceManagerUtils.getValueFromIdByName(id, "employees");
+ if (employeeName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'employees'.", id)));
+ }
+ this.delete(resourceGroupName, employeeName, context);
+ }
+
+ private EmployeesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.contoso.ContosoManager manager() {
+ return this.serviceManager;
+ }
+
+ public EmployeeImpl define(String name) {
+ return new EmployeeImpl(name, this.manager());
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationImpl.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationImpl.java
new file mode 100644
index 000000000000..3d6991b7373d
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.implementation;
+
+import com.azure.resourcemanager.contoso.fluent.models.OperationInner;
+import com.azure.resourcemanager.contoso.models.ActionType;
+import com.azure.resourcemanager.contoso.models.Operation;
+import com.azure.resourcemanager.contoso.models.OperationDisplay;
+import com.azure.resourcemanager.contoso.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.contoso.ContosoManager serviceManager;
+
+ OperationImpl(OperationInner innerObject, com.azure.resourcemanager.contoso.ContosoManager 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.contoso.ContosoManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationsClientImpl.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationsClientImpl.java
new file mode 100644
index 000000000000..a4dfba70c5cc
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationsClientImpl.java
@@ -0,0 +1,284 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.contoso.fluent.OperationsClient;
+import com.azure.resourcemanager.contoso.fluent.models.OperationInner;
+import com.azure.resourcemanager.contoso.implementation.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 ContosoManagementClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(ContosoManagementClientImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ContosoManagementClientOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "ContosoManagementClientOperations")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.Contoso/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.Contoso/operations")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listSync(@HostParam("endpoint") 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("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("{nextLink}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("endpoint") 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.
+ *
+ * @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.
+ *
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage() {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listSinglePage(Context context) {
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
+ return 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 PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(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 PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, 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.
+ * @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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res
+ = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ /**
+ * 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PagedResponse listNextSinglePage(String nextLink, Context context) {
+ if (nextLink == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context);
+ return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(),
+ res.getValue().nextLink(), null);
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class);
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationsImpl.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationsImpl.java
new file mode 100644
index 000000000000..e42b30f4ffad
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/OperationsImpl.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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.contoso.fluent.OperationsClient;
+import com.azure.resourcemanager.contoso.fluent.models.OperationInner;
+import com.azure.resourcemanager.contoso.models.Operation;
+import com.azure.resourcemanager.contoso.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.contoso.ContosoManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient,
+ com.azure.resourcemanager.contoso.ContosoManager 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.contoso.ContosoManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ResourceManagerUtils.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ResourceManagerUtils.java
new file mode 100644
index 000000000000..cf0d8b505d86
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/ResourceManagerUtils.java
@@ -0,0 +1,195 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/models/EmployeeListResult.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/models/EmployeeListResult.java
new file mode 100644
index 000000000000..6ccdb5f7b4ac
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/models/EmployeeListResult.java
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.implementation.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.contoso.fluent.models.EmployeeInner;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The response of a Employee list operation.
+ */
+@Immutable
+public final class EmployeeListResult implements JsonSerializable {
+ /*
+ * The Employee items on this page
+ */
+ private List value;
+
+ /*
+ * The link to the next page of items
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of EmployeeListResult class.
+ */
+ private EmployeeListResult() {
+ }
+
+ /**
+ * Get the value property: The Employee items on this page.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Get the nextLink property: The link to the next page of items.
+ *
+ * @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) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property value in model EmployeeListResult"));
+ } else {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(EmployeeListResult.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("nextLink", this.nextLink);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of EmployeeListResult from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of EmployeeListResult 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 EmployeeListResult.
+ */
+ public static EmployeeListResult fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ EmployeeListResult deserializedEmployeeListResult = new EmployeeListResult();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value = reader.readArray(reader1 -> EmployeeInner.fromJson(reader1));
+ deserializedEmployeeListResult.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedEmployeeListResult.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedEmployeeListResult;
+ });
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/models/OperationListResult.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/models/OperationListResult.java
new file mode 100644
index 000000000000..9abf95fa18e2
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/models/OperationListResult.java
@@ -0,0 +1,113 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.implementation.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import com.azure.resourcemanager.contoso.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 {
+ /*
+ * The Operation items on this page
+ */
+ private List value;
+
+ /*
+ * The link to the next page of items
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of OperationListResult class.
+ */
+ private OperationListResult() {
+ }
+
+ /**
+ * Get the value property: The Operation items on this page.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Get the nextLink property: The link to the next page of items.
+ *
+ * @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) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property value in model OperationListResult"));
+ } else {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeStringField("nextLink", this.nextLink);
+ 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 IllegalStateException If the deserialized JSON object was missing any required properties.
+ * @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/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/package-info.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/implementation/package-info.java
new file mode 100644
index 000000000000..30291625ebfe
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the implementations for Contoso.
+ * Microsoft.Contoso Resource Provider management API.
+ */
+package com.azure.resourcemanager.contoso.implementation;
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/ActionType.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/ActionType.java
new file mode 100644
index 000000000000..e530f4e3e499
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/ActionType.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
+ */
+public final class ActionType extends ExpandableStringEnum {
+ /**
+ * Actions are for internal-only APIs.
+ */
+ 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/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Employee.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Employee.java
new file mode 100644
index 000000000000..d318c31e7516
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Employee.java
@@ -0,0 +1,265 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.models;
+
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.contoso.fluent.models.EmployeeInner;
+import java.util.Map;
+
+/**
+ * An immutable client-side representation of Employee.
+ */
+public interface Employee {
+ /**
+ * Gets the id property: Fully qualified resource Id for the resource.
+ *
+ * @return the id value.
+ */
+ String id();
+
+ /**
+ * Gets the name property: The name of the resource.
+ *
+ * @return the name value.
+ */
+ String name();
+
+ /**
+ * Gets the type property: The type of the resource.
+ *
+ * @return the type value.
+ */
+ String type();
+
+ /**
+ * Gets the location property: The geo-location where the resource lives.
+ *
+ * @return the location value.
+ */
+ String location();
+
+ /**
+ * Gets the tags property: Resource tags.
+ *
+ * @return the tags value.
+ */
+ Map tags();
+
+ /**
+ * Gets the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ EmployeeProperties properties();
+
+ /**
+ * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
+ *
+ * @return the systemData value.
+ */
+ SystemData systemData();
+
+ /**
+ * Gets the region of the resource.
+ *
+ * @return the region of the resource.
+ */
+ Region region();
+
+ /**
+ * Gets the name of the resource region.
+ *
+ * @return the name of the resource region.
+ */
+ String regionName();
+
+ /**
+ * Gets the name of the resource group.
+ *
+ * @return the name of the resource group.
+ */
+ String resourceGroupName();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.contoso.fluent.models.EmployeeInner object.
+ *
+ * @return the inner object.
+ */
+ EmployeeInner innerModel();
+
+ /**
+ * The entirety of the Employee definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation,
+ DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * The Employee definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of the Employee definition.
+ */
+ interface Blank extends WithLocation {
+ }
+
+ /**
+ * The stage of the Employee definition allowing to specify location.
+ */
+ interface WithLocation {
+ /**
+ * Specifies the region for the resource.
+ *
+ * @param location The geo-location where the resource lives.
+ * @return the next definition stage.
+ */
+ WithResourceGroup withRegion(Region location);
+
+ /**
+ * Specifies the region for the resource.
+ *
+ * @param location The geo-location where the resource lives.
+ * @return the next definition stage.
+ */
+ WithResourceGroup withRegion(String location);
+ }
+
+ /**
+ * The stage of the Employee definition allowing to specify parent resource.
+ */
+ interface WithResourceGroup {
+ /**
+ * Specifies resourceGroupName.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @return the next definition stage.
+ */
+ WithCreate withExistingResourceGroup(String resourceGroupName);
+ }
+
+ /**
+ * The stage of the Employee definition which contains all the minimum required properties for the resource to
+ * be created, but also allows for any other optional properties to be specified.
+ */
+ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties {
+ /**
+ * Executes the create request.
+ *
+ * @return the created resource.
+ */
+ Employee create();
+
+ /**
+ * Executes the create request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the created resource.
+ */
+ Employee create(Context context);
+ }
+
+ /**
+ * The stage of the Employee definition allowing to specify tags.
+ */
+ interface WithTags {
+ /**
+ * Specifies the tags property: Resource tags..
+ *
+ * @param tags Resource tags.
+ * @return the next definition stage.
+ */
+ WithCreate withTags(Map tags);
+ }
+
+ /**
+ * The stage of the Employee definition allowing to specify properties.
+ */
+ interface WithProperties {
+ /**
+ * Specifies the properties property: The resource-specific properties for this resource..
+ *
+ * @param properties The resource-specific properties for this resource.
+ * @return the next definition stage.
+ */
+ WithCreate withProperties(EmployeeProperties properties);
+ }
+ }
+
+ /**
+ * Begins update for the Employee resource.
+ *
+ * @return the stage of resource update.
+ */
+ Employee.Update update();
+
+ /**
+ * The template for Employee update.
+ */
+ interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties {
+ /**
+ * Executes the update request.
+ *
+ * @return the updated resource.
+ */
+ Employee apply();
+
+ /**
+ * Executes the update request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the updated resource.
+ */
+ Employee apply(Context context);
+ }
+
+ /**
+ * The Employee update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the Employee update allowing to specify tags.
+ */
+ interface WithTags {
+ /**
+ * Specifies the tags property: Resource tags..
+ *
+ * @param tags Resource tags.
+ * @return the next definition stage.
+ */
+ Update withTags(Map tags);
+ }
+
+ /**
+ * The stage of the Employee update allowing to specify properties.
+ */
+ interface WithProperties {
+ /**
+ * Specifies the properties property: The resource-specific properties for this resource..
+ *
+ * @param properties The resource-specific properties for this resource.
+ * @return the next definition stage.
+ */
+ Update withProperties(EmployeeProperties properties);
+ }
+ }
+
+ /**
+ * Refreshes the resource to sync with Azure.
+ *
+ * @return the refreshed resource.
+ */
+ Employee refresh();
+
+ /**
+ * Refreshes the resource to sync with Azure.
+ *
+ * @param context The context to associate with this operation.
+ * @return the refreshed resource.
+ */
+ Employee refresh(Context context);
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/EmployeeProperties.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/EmployeeProperties.java
new file mode 100644
index 000000000000..0f97946865ad
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/EmployeeProperties.java
@@ -0,0 +1,178 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.Base64Url;
+import com.azure.core.util.CoreUtils;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.Objects;
+
+/**
+ * Employee properties.
+ */
+@Fluent
+public final class EmployeeProperties implements JsonSerializable {
+ private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
+
+ /*
+ * Age of employee
+ */
+ private Integer age;
+
+ /*
+ * City of employee
+ */
+ private String city;
+
+ /*
+ * Profile of employee
+ */
+ private Base64Url profile;
+
+ /*
+ * The status of the last operation.
+ */
+ private ProvisioningState provisioningState;
+
+ /**
+ * Creates an instance of EmployeeProperties class.
+ */
+ public EmployeeProperties() {
+ }
+
+ /**
+ * Get the age property: Age of employee.
+ *
+ * @return the age value.
+ */
+ public Integer age() {
+ return this.age;
+ }
+
+ /**
+ * Set the age property: Age of employee.
+ *
+ * @param age the age value to set.
+ * @return the EmployeeProperties object itself.
+ */
+ public EmployeeProperties withAge(Integer age) {
+ this.age = age;
+ return this;
+ }
+
+ /**
+ * Get the city property: City of employee.
+ *
+ * @return the city value.
+ */
+ public String city() {
+ return this.city;
+ }
+
+ /**
+ * Set the city property: City of employee.
+ *
+ * @param city the city value to set.
+ * @return the EmployeeProperties object itself.
+ */
+ public EmployeeProperties withCity(String city) {
+ this.city = city;
+ return this;
+ }
+
+ /**
+ * Get the profile property: Profile of employee.
+ *
+ * @return the profile value.
+ */
+ public byte[] profile() {
+ if (this.profile == null) {
+ return EMPTY_BYTE_ARRAY;
+ }
+ return this.profile.decodedBytes();
+ }
+
+ /**
+ * Set the profile property: Profile of employee.
+ *
+ * @param profile the profile value to set.
+ * @return the EmployeeProperties object itself.
+ */
+ public EmployeeProperties withProfile(byte[] profile) {
+ if (profile == null) {
+ this.profile = null;
+ } else {
+ this.profile = Base64Url.encode(CoreUtils.clone(profile));
+ }
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The status of the last operation.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * 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.writeNumberField("age", this.age);
+ jsonWriter.writeStringField("city", this.city);
+ jsonWriter.writeStringField("profile", Objects.toString(this.profile, null));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of EmployeeProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of EmployeeProperties 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 EmployeeProperties.
+ */
+ public static EmployeeProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ EmployeeProperties deserializedEmployeeProperties = new EmployeeProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("age".equals(fieldName)) {
+ deserializedEmployeeProperties.age = reader.getNullable(JsonReader::getInt);
+ } else if ("city".equals(fieldName)) {
+ deserializedEmployeeProperties.city = reader.getString();
+ } else if ("profile".equals(fieldName)) {
+ deserializedEmployeeProperties.profile
+ = reader.getNullable(nonNullReader -> new Base64Url(nonNullReader.getString()));
+ } else if ("provisioningState".equals(fieldName)) {
+ deserializedEmployeeProperties.provisioningState = ProvisioningState.fromString(reader.getString());
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedEmployeeProperties;
+ });
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Employees.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Employees.java
new file mode 100644
index 000000000000..1c4bb94aa861
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Employees.java
@@ -0,0 +1,157 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.models;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+
+/**
+ * Resource collection API of Employees.
+ */
+public interface Employees {
+ /**
+ * Get a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 Employee along with {@link Response}.
+ */
+ Response getByResourceGroupWithResponse(String resourceGroupName, String employeeName, Context context);
+
+ /**
+ * Get a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 Employee.
+ */
+ Employee getByResourceGroup(String resourceGroupName, String employeeName);
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 deleteByResourceGroup(String resourceGroupName, String employeeName);
+
+ /**
+ * Delete a Employee.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param employeeName The name of the Employee.
+ * @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 delete(String resourceGroupName, String employeeName, Context context);
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List Employee resources by resource group.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @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 response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable list();
+
+ /**
+ * List Employee resources by subscription ID.
+ *
+ * @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 response of a Employee list operation as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable list(Context context);
+
+ /**
+ * Get a Employee.
+ *
+ * @param id the resource ID.
+ * @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 Employee along with {@link Response}.
+ */
+ Employee getById(String id);
+
+ /**
+ * Get a Employee.
+ *
+ * @param id the resource ID.
+ * @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 Employee along with {@link Response}.
+ */
+ Response getByIdWithResponse(String id, Context context);
+
+ /**
+ * Delete a Employee.
+ *
+ * @param id the resource ID.
+ * @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 deleteById(String id);
+
+ /**
+ * Delete a Employee.
+ *
+ * @param id the resource ID.
+ * @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 deleteByIdWithResponse(String id, Context context);
+
+ /**
+ * Begins definition for a new Employee resource.
+ *
+ * @param name resource name.
+ * @return the first stage of the new Employee definition.
+ */
+ Employee.DefinitionStages.Blank define(String name);
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Operation.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Operation.java
new file mode 100644
index 000000000000..1feeb6644812
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Operation.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.models;
+
+import com.azure.resourcemanager.contoso.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 Azure Resource Manager/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: Extensible 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.contoso.fluent.models.OperationInner object.
+ *
+ * @return the inner object.
+ */
+ OperationInner innerModel();
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/OperationDisplay.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/OperationDisplay.java
new file mode 100644
index 000000000000..e9a903626966
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/OperationDisplay.java
@@ -0,0 +1,136 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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 and 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.
+ */
+ private 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/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Operations.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Operations.java
new file mode 100644
index 000000000000..6c8810ae2d2a
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Operations.java
@@ -0,0 +1,35 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Origin.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Origin.java
new file mode 100644
index 000000000000..1fb5dcd14f20
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/Origin.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.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 {
+ /**
+ * Indicates the operation is initiated by a user.
+ */
+ public static final Origin USER = fromString("user");
+
+ /**
+ * Indicates the operation is initiated by a system.
+ */
+ public static final Origin SYSTEM = fromString("system");
+
+ /**
+ * Indicates the operation is initiated by a user or system.
+ */
+ 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/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/ProvisioningState.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/ProvisioningState.java
new file mode 100644
index 000000000000..085331e46189
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/ProvisioningState.java
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * The resource provisioning state.
+ */
+public final class ProvisioningState extends ExpandableStringEnum {
+ /**
+ * Resource has been created.
+ */
+ public static final ProvisioningState SUCCEEDED = fromString("Succeeded");
+
+ /**
+ * Failed to provision the resource.
+ */
+ public static final ProvisioningState FAILED = fromString("Failed");
+
+ /**
+ * Resource creation was canceled.
+ */
+ public static final ProvisioningState CANCELED = fromString("Canceled");
+
+ /**
+ * The resource is being provisioned.
+ */
+ public static final ProvisioningState PROVISIONING = fromString("Provisioning");
+
+ /**
+ * The resource is updating.
+ */
+ public static final ProvisioningState UPDATING = fromString("Updating");
+
+ /**
+ * The resource is being deleted.
+ */
+ public static final ProvisioningState DELETING = fromString("Deleting");
+
+ /**
+ * The resource create request has been accepted.
+ */
+ public static final ProvisioningState ACCEPTED = fromString("Accepted");
+
+ /**
+ * Creates a new instance of ProvisioningState value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public ProvisioningState() {
+ }
+
+ /**
+ * Creates or finds a ProvisioningState from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding ProvisioningState.
+ */
+ public static ProvisioningState fromString(String name) {
+ return fromString(name, ProvisioningState.class);
+ }
+
+ /**
+ * Gets known ProvisioningState values.
+ *
+ * @return known ProvisioningState values.
+ */
+ public static Collection values() {
+ return values(ProvisioningState.class);
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/package-info.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/models/package-info.java
new file mode 100644
index 000000000000..25f209c96c74
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/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) TypeSpec Code Generator.
+
+/**
+ * Package containing the data models for Contoso.
+ * Microsoft.Contoso Resource Provider management API.
+ */
+package com.azure.resourcemanager.contoso.models;
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/package-info.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/package-info.java
new file mode 100644
index 000000000000..cfcdcc12fb15
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/com/azure/resourcemanager/contoso/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+/**
+ * Package containing the classes for Contoso.
+ * Microsoft.Contoso Resource Provider management API.
+ */
+package com.azure.resourcemanager.contoso;
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/java/module-info.java b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/module-info.java
new file mode 100644
index 000000000000..35ea3ffa7c78
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/java/module-info.java
@@ -0,0 +1,16 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+module com.azure.resourcemanager.contoso {
+ requires transitive com.azure.core.management;
+
+ exports com.azure.resourcemanager.contoso;
+ exports com.azure.resourcemanager.contoso.fluent;
+ exports com.azure.resourcemanager.contoso.fluent.models;
+ exports com.azure.resourcemanager.contoso.models;
+
+ opens com.azure.resourcemanager.contoso.fluent.models to com.azure.core;
+ opens com.azure.resourcemanager.contoso.models to com.azure.core;
+ opens com.azure.resourcemanager.contoso.implementation.models to com.azure.core;
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/azure-resourcemanager-contoso_apiview_properties.json b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/azure-resourcemanager-contoso_apiview_properties.json
new file mode 100644
index 000000000000..979569b4ac5f
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/azure-resourcemanager-contoso_apiview_properties.json
@@ -0,0 +1,29 @@
+{
+ "flavor": "azure",
+ "CrossLanguageDefinitionId": {
+ "com.azure.resourcemanager.contoso.fluent.ContosoManagementClient": "Microsoft.Contoso",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient": "Microsoft.Contoso.Employees",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.beginCreateOrUpdate": "Microsoft.Contoso.Employees.createOrUpdate",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.beginDelete": "Microsoft.Contoso.Employees.delete",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.createOrUpdate": "Microsoft.Contoso.Employees.createOrUpdate",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.delete": "Microsoft.Contoso.Employees.delete",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.getByResourceGroup": "Microsoft.Contoso.Employees.get",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.getByResourceGroupWithResponse": "Microsoft.Contoso.Employees.get",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.list": "Microsoft.Contoso.Employees.listBySubscription",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.listByResourceGroup": "Microsoft.Contoso.Employees.listByResourceGroup",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.update": "Microsoft.Contoso.Employees.update",
+ "com.azure.resourcemanager.contoso.fluent.EmployeesClient.updateWithResponse": "Microsoft.Contoso.Employees.update",
+ "com.azure.resourcemanager.contoso.fluent.OperationsClient": "Microsoft.Contoso.Operations",
+ "com.azure.resourcemanager.contoso.fluent.OperationsClient.list": "Azure.ResourceManager.Operations.list",
+ "com.azure.resourcemanager.contoso.fluent.models.EmployeeInner": "Microsoft.Contoso.Employee",
+ "com.azure.resourcemanager.contoso.fluent.models.OperationInner": "Azure.ResourceManager.CommonTypes.Operation",
+ "com.azure.resourcemanager.contoso.implementation.ContosoManagementClientBuilder": "Microsoft.Contoso",
+ "com.azure.resourcemanager.contoso.implementation.models.EmployeeListResult": "Azure.ResourceManager.ResourceListResult",
+ "com.azure.resourcemanager.contoso.implementation.models.OperationListResult": "Azure.ResourceManager.CommonTypes.OperationListResult",
+ "com.azure.resourcemanager.contoso.models.ActionType": "Azure.ResourceManager.CommonTypes.ActionType",
+ "com.azure.resourcemanager.contoso.models.EmployeeProperties": "Microsoft.Contoso.EmployeeProperties",
+ "com.azure.resourcemanager.contoso.models.OperationDisplay": "Azure.ResourceManager.CommonTypes.OperationDisplay",
+ "com.azure.resourcemanager.contoso.models.Origin": "Azure.ResourceManager.CommonTypes.Origin",
+ "com.azure.resourcemanager.contoso.models.ProvisioningState": "Microsoft.Contoso.ProvisioningState"
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/azure-resourcemanager-contoso_metadata.json b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/azure-resourcemanager-contoso_metadata.json
new file mode 100644
index 000000000000..d1de9b552e2b
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/azure-resourcemanager-contoso_metadata.json
@@ -0,0 +1 @@
+{"flavor":"azure","apiVersion":"2021-11-01","crossLanguageDefinitions":{"com.azure.resourcemanager.contoso.fluent.ContosoManagementClient":"Microsoft.Contoso","com.azure.resourcemanager.contoso.fluent.EmployeesClient":"Microsoft.Contoso.Employees","com.azure.resourcemanager.contoso.fluent.EmployeesClient.beginCreateOrUpdate":"Microsoft.Contoso.Employees.createOrUpdate","com.azure.resourcemanager.contoso.fluent.EmployeesClient.beginDelete":"Microsoft.Contoso.Employees.delete","com.azure.resourcemanager.contoso.fluent.EmployeesClient.createOrUpdate":"Microsoft.Contoso.Employees.createOrUpdate","com.azure.resourcemanager.contoso.fluent.EmployeesClient.delete":"Microsoft.Contoso.Employees.delete","com.azure.resourcemanager.contoso.fluent.EmployeesClient.getByResourceGroup":"Microsoft.Contoso.Employees.get","com.azure.resourcemanager.contoso.fluent.EmployeesClient.getByResourceGroupWithResponse":"Microsoft.Contoso.Employees.get","com.azure.resourcemanager.contoso.fluent.EmployeesClient.list":"Microsoft.Contoso.Employees.listBySubscription","com.azure.resourcemanager.contoso.fluent.EmployeesClient.listByResourceGroup":"Microsoft.Contoso.Employees.listByResourceGroup","com.azure.resourcemanager.contoso.fluent.EmployeesClient.update":"Microsoft.Contoso.Employees.update","com.azure.resourcemanager.contoso.fluent.EmployeesClient.updateWithResponse":"Microsoft.Contoso.Employees.update","com.azure.resourcemanager.contoso.fluent.OperationsClient":"Microsoft.Contoso.Operations","com.azure.resourcemanager.contoso.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.contoso.fluent.models.EmployeeInner":"Microsoft.Contoso.Employee","com.azure.resourcemanager.contoso.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.contoso.implementation.ContosoManagementClientBuilder":"Microsoft.Contoso","com.azure.resourcemanager.contoso.implementation.models.EmployeeListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.contoso.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.contoso.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.contoso.models.EmployeeProperties":"Microsoft.Contoso.EmployeeProperties","com.azure.resourcemanager.contoso.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.contoso.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.contoso.models.ProvisioningState":"Microsoft.Contoso.ProvisioningState"}}
\ No newline at end of file
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-contoso/proxy-config.json b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-contoso/proxy-config.json
new file mode 100644
index 000000000000..a410d025dc8e
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-contoso/proxy-config.json
@@ -0,0 +1 @@
+[["com.azure.resourcemanager.contoso.implementation.EmployeesClientImpl$EmployeesService"],["com.azure.resourcemanager.contoso.implementation.OperationsClientImpl$OperationsService"]]
\ No newline at end of file
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-contoso/reflect-config.json b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-contoso/reflect-config.json
new file mode 100644
index 000000000000..0637a088a01e
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-contoso/reflect-config.json
@@ -0,0 +1 @@
+[]
\ No newline at end of file
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/azure-resourcemanager-contoso.properties b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/azure-resourcemanager-contoso.properties
new file mode 100644
index 000000000000..defbd48204e4
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/main/resources/azure-resourcemanager-contoso.properties
@@ -0,0 +1 @@
+version=${project.version}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesCreateOrUpdateSamples.java b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesCreateOrUpdateSamples.java
new file mode 100644
index 000000000000..8fba1881f732
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesCreateOrUpdateSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.resourcemanager.contoso.models.EmployeeProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Samples for Employees CreateOrUpdate.
+ */
+public final class EmployeesCreateOrUpdateSamples {
+ /*
+ * x-ms-original-file: 2021-11-01/Employees_CreateOrUpdate.json
+ */
+ /**
+ * Sample code: Employees_CreateOrUpdate.
+ *
+ * @param manager Entry point to ContosoManager.
+ */
+ public static void employeesCreateOrUpdate(com.azure.resourcemanager.contoso.ContosoManager manager) {
+ manager.employees()
+ .define("9KF-f-8b")
+ .withRegion("itajgxyqozseoygnl")
+ .withExistingResourceGroup("rgopenapi")
+ .withTags(mapOf("key2913", "fakeTokenPlaceholder"))
+ .withProperties(new EmployeeProperties().withAge(30)
+ .withCity("gydhnntudughbmxlkyzrskcdkotrxn")
+ .withProfile("ms".getBytes()))
+ .create();
+ }
+
+ // Use "Map.of" if available
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesDeleteSamples.java b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesDeleteSamples.java
new file mode 100644
index 000000000000..24554452b13d
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesDeleteSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+/**
+ * Samples for Employees Delete.
+ */
+public final class EmployeesDeleteSamples {
+ /*
+ * x-ms-original-file: 2021-11-01/Employees_Delete.json
+ */
+ /**
+ * Sample code: Employees_Delete.
+ *
+ * @param manager Entry point to ContosoManager.
+ */
+ public static void employeesDelete(com.azure.resourcemanager.contoso.ContosoManager manager) {
+ manager.employees().delete("rgopenapi", "5vX--BxSu3ux48rI4O9OQ569", com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesGetByResourceGroupSamples.java b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesGetByResourceGroupSamples.java
new file mode 100644
index 000000000000..ba525bb5650a
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesGetByResourceGroupSamples.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+/**
+ * Samples for Employees GetByResourceGroup.
+ */
+public final class EmployeesGetByResourceGroupSamples {
+ /*
+ * x-ms-original-file: 2021-11-01/Employees_Get.json
+ */
+ /**
+ * Sample code: Employees_Get.
+ *
+ * @param manager Entry point to ContosoManager.
+ */
+ public static void employeesGet(com.azure.resourcemanager.contoso.ContosoManager manager) {
+ manager.employees()
+ .getByResourceGroupWithResponse("rgopenapi", "le-8MU--J3W6q8D386p3-iT3", com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesListByResourceGroupSamples.java b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesListByResourceGroupSamples.java
new file mode 100644
index 000000000000..b7df8d932b39
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesListByResourceGroupSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+/**
+ * Samples for Employees ListByResourceGroup.
+ */
+public final class EmployeesListByResourceGroupSamples {
+ /*
+ * x-ms-original-file: 2021-11-01/Employees_ListByResourceGroup.json
+ */
+ /**
+ * Sample code: Employees_ListByResourceGroup.
+ *
+ * @param manager Entry point to ContosoManager.
+ */
+ public static void employeesListByResourceGroup(com.azure.resourcemanager.contoso.ContosoManager manager) {
+ manager.employees().listByResourceGroup("rgopenapi", com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesListSamples.java b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesListSamples.java
new file mode 100644
index 000000000000..d6977978e6b1
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+/**
+ * Samples for Employees List.
+ */
+public final class EmployeesListSamples {
+ /*
+ * x-ms-original-file: 2021-11-01/Employees_ListBySubscription.json
+ */
+ /**
+ * Sample code: Employees_ListBySubscription.
+ *
+ * @param manager Entry point to ContosoManager.
+ */
+ public static void employeesListBySubscription(com.azure.resourcemanager.contoso.ContosoManager manager) {
+ manager.employees().list(com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesUpdateSamples.java b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesUpdateSamples.java
new file mode 100644
index 000000000000..014ceade25f0
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/EmployeesUpdateSamples.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.resourcemanager.contoso.models.Employee;
+import com.azure.resourcemanager.contoso.models.EmployeeProperties;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Samples for Employees Update.
+ */
+public final class EmployeesUpdateSamples {
+ /*
+ * x-ms-original-file: 2021-11-01/Employees_Update.json
+ */
+ /**
+ * Sample code: Employees_Update.
+ *
+ * @param manager Entry point to ContosoManager.
+ */
+ public static void employeesUpdate(com.azure.resourcemanager.contoso.ContosoManager manager) {
+ Employee resource = manager.employees()
+ .getByResourceGroupWithResponse("rgopenapi", "-XhyNJ--", com.azure.core.util.Context.NONE)
+ .getValue();
+ resource.update()
+ .withTags(mapOf("key7952", "fakeTokenPlaceholder"))
+ .withProperties(
+ new EmployeeProperties().withAge(24).withCity("uyfg").withProfile("oapgijcswfkruiuuzbwco".getBytes()))
+ .apply();
+ }
+
+ // Use "Map.of" if available
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/OperationsListSamples.java b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/OperationsListSamples.java
new file mode 100644
index 000000000000..c8b9843c2411
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/samples/java/com/azure/resourcemanager/contoso/generated/OperationsListSamples.java
@@ -0,0 +1,22 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+/**
+ * Samples for Operations List.
+ */
+public final class OperationsListSamples {
+ /*
+ * x-ms-original-file: 2021-11-01/Operations_List.json
+ */
+ /**
+ * Sample code: Operations_List.
+ *
+ * @param manager Entry point to ContosoManager.
+ */
+ public static void operationsList(com.azure.resourcemanager.contoso.ContosoManager manager) {
+ manager.operations().list(com.azure.core.util.Context.NONE);
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeeInnerTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeeInnerTests.java
new file mode 100644
index 000000000000..95f9cacc4c07
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeeInnerTests.java
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.contoso.fluent.models.EmployeeInner;
+import com.azure.resourcemanager.contoso.models.EmployeeProperties;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.jupiter.api.Assertions;
+
+public final class EmployeeInnerTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ EmployeeInner model = BinaryData.fromString(
+ "{\"properties\":{\"age\":1273684509,\"city\":\"pzvgnwzsymglzufc\",\"provisioningState\":\"Succeeded\"},\"location\":\"dbihanufhfcbj\",\"tags\":{\"xqhabi\":\"git\"},\"id\":\"pikxwczbyscnpqxu\",\"name\":\"ivyqniwbybrkxvd\",\"type\":\"mjgr\"}")
+ .toObject(EmployeeInner.class);
+ Assertions.assertEquals("dbihanufhfcbj", model.location());
+ Assertions.assertEquals("git", model.tags().get("xqhabi"));
+ Assertions.assertEquals(1273684509, model.properties().age());
+ Assertions.assertEquals("pzvgnwzsymglzufc", model.properties().city());
+ }
+
+ @org.junit.jupiter.api.Test
+ public void testSerialize() throws Exception {
+ EmployeeInner model = new EmployeeInner().withLocation("dbihanufhfcbj")
+ .withTags(mapOf("xqhabi", "git"))
+ .withProperties(new EmployeeProperties().withAge(1273684509).withCity("pzvgnwzsymglzufc"));
+ model = BinaryData.fromObject(model).toObject(EmployeeInner.class);
+ Assertions.assertEquals("dbihanufhfcbj", model.location());
+ Assertions.assertEquals("git", model.tags().get("xqhabi"));
+ Assertions.assertEquals(1273684509, model.properties().age());
+ Assertions.assertEquals("pzvgnwzsymglzufc", model.properties().city());
+ }
+
+ // Use "Map.of" if available
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeeListResultTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeeListResultTests.java
new file mode 100644
index 000000000000..b343ace4f525
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeeListResultTests.java
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.contoso.implementation.models.EmployeeListResult;
+import org.junit.jupiter.api.Assertions;
+
+public final class EmployeeListResultTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ EmployeeListResult model = BinaryData.fromString(
+ "{\"value\":[{\"properties\":{\"age\":2045600331,\"city\":\"yejhk\",\"provisioningState\":\"Failed\"},\"location\":\"apcz\",\"tags\":{\"ni\":\"kjyemkk\",\"ilzyd\":\"joxzjnchgejspodm\"},\"id\":\"h\",\"name\":\"jwyahuxinpmqnja\",\"type\":\"wixjsprozvcp\"}],\"nextLink\":\"eg\"}")
+ .toObject(EmployeeListResult.class);
+ Assertions.assertEquals("apcz", model.value().get(0).location());
+ Assertions.assertEquals("kjyemkk", model.value().get(0).tags().get("ni"));
+ Assertions.assertEquals(2045600331, model.value().get(0).properties().age());
+ Assertions.assertEquals("yejhk", model.value().get(0).properties().city());
+ Assertions.assertEquals("eg", model.nextLink());
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeePropertiesTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeePropertiesTests.java
new file mode 100644
index 000000000000..3b0057cbd219
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeePropertiesTests.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.contoso.models.EmployeeProperties;
+import org.junit.jupiter.api.Assertions;
+
+public final class EmployeePropertiesTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ EmployeeProperties model
+ = BinaryData.fromString("{\"age\":1126091678,\"city\":\"ukxgaud\",\"provisioningState\":\"Updating\"}")
+ .toObject(EmployeeProperties.class);
+ Assertions.assertEquals(1126091678, model.age());
+ Assertions.assertEquals("ukxgaud", model.city());
+ }
+
+ @org.junit.jupiter.api.Test
+ public void testSerialize() throws Exception {
+ EmployeeProperties model = new EmployeeProperties().withAge(1126091678).withCity("ukxgaud");
+ model = BinaryData.fromObject(model).toObject(EmployeeProperties.class);
+ Assertions.assertEquals(1126091678, model.age());
+ Assertions.assertEquals("ukxgaud", model.city());
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesCreateOrUpdateMockTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesCreateOrUpdateMockTests.java
new file mode 100644
index 000000000000..d2287d3052f1
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesCreateOrUpdateMockTests.java
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.models.AzureCloud;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.contoso.ContosoManager;
+import com.azure.resourcemanager.contoso.models.Employee;
+import com.azure.resourcemanager.contoso.models.EmployeeProperties;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class EmployeesCreateOrUpdateMockTests {
+ @Test
+ public void testCreateOrUpdate() throws Exception {
+ String responseStr
+ = "{\"properties\":{\"age\":1677515825,\"city\":\"ytb\",\"provisioningState\":\"Succeeded\"},\"location\":\"uflmm\",\"tags\":{\"b\":\"smodmgloug\"},\"id\":\"wtmutduq\",\"name\":\"ta\",\"type\":\"spwgcuertumkdosv\"}";
+
+ HttpClient httpClient
+ = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+ ContosoManager manager = ContosoManager.configure()
+ .withHttpClient(httpClient)
+ .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+ new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
+
+ Employee response = manager.employees()
+ .define("zdatqxhocdg")
+ .withRegion("kao")
+ .withExistingResourceGroup("nhutjeltmrldhugj")
+ .withTags(mapOf("tyhxhurokft", "i", "iawxklry", "xolniwpwcukjfk", "cbacphejkotynqg", "lwckbasyypnddhs"))
+ .withProperties(new EmployeeProperties().withAge(1293628182).withCity("phut"))
+ .create();
+
+ Assertions.assertEquals("uflmm", response.location());
+ Assertions.assertEquals("smodmgloug", response.tags().get("b"));
+ Assertions.assertEquals(1677515825, response.properties().age());
+ Assertions.assertEquals("ytb", response.properties().city());
+ }
+
+ // Use "Map.of" if available
+ @SuppressWarnings("unchecked")
+ private static Map mapOf(Object... inputs) {
+ Map map = new HashMap<>();
+ for (int i = 0; i < inputs.length; i += 2) {
+ String key = (String) inputs[i];
+ T value = (T) inputs[i + 1];
+ map.put(key, value);
+ }
+ return map;
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesGetByResourceGroupWithResponseMockTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesGetByResourceGroupWithResponseMockTests.java
new file mode 100644
index 000000000000..789083f2e302
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesGetByResourceGroupWithResponseMockTests.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.models.AzureCloud;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.contoso.ContosoManager;
+import com.azure.resourcemanager.contoso.models.Employee;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class EmployeesGetByResourceGroupWithResponseMockTests {
+ @Test
+ public void testGetByResourceGroupWithResponse() throws Exception {
+ String responseStr
+ = "{\"properties\":{\"age\":413609639,\"city\":\"dphlxaolt\",\"provisioningState\":\"Canceled\"},\"location\":\"qjbpfzfsin\",\"tags\":{\"jrwzox\":\"f\"},\"id\":\"j\",\"name\":\"felluwfzitonpe\",\"type\":\"fpjkjlxofp\"}";
+
+ HttpClient httpClient
+ = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+ ContosoManager manager = ContosoManager.configure()
+ .withHttpClient(httpClient)
+ .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+ new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
+
+ Employee response = manager.employees()
+ .getByResourceGroupWithResponse("ffdfdosygexpa", "jakhmsbzjh", com.azure.core.util.Context.NONE)
+ .getValue();
+
+ Assertions.assertEquals("qjbpfzfsin", response.location());
+ Assertions.assertEquals("f", response.tags().get("jrwzox"));
+ Assertions.assertEquals(413609639, response.properties().age());
+ Assertions.assertEquals("dphlxaolt", response.properties().city());
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesListByResourceGroupMockTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesListByResourceGroupMockTests.java
new file mode 100644
index 000000000000..c8ca6fcb8116
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesListByResourceGroupMockTests.java
@@ -0,0 +1,42 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.models.AzureCloud;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.contoso.ContosoManager;
+import com.azure.resourcemanager.contoso.models.Employee;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class EmployeesListByResourceGroupMockTests {
+ @Test
+ public void testListByResourceGroup() throws Exception {
+ String responseStr
+ = "{\"value\":[{\"properties\":{\"age\":2045160621,\"city\":\"kpode\",\"provisioningState\":\"Accepted\"},\"location\":\"nuvamiheogna\",\"tags\":{\"o\":\"xth\",\"cciqihnhungbwjz\":\"usivye\",\"kufubljo\":\"nfygxgispemvtz\",\"v\":\"xqeofjaeqjhqjba\"},\"id\":\"smjqulngsntnbyb\",\"name\":\"zgcwrw\",\"type\":\"lxxwrljdouskc\"}]}";
+
+ HttpClient httpClient
+ = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+ ContosoManager manager = ContosoManager.configure()
+ .withHttpClient(httpClient)
+ .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+ new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
+
+ PagedIterable response
+ = manager.employees().listByResourceGroup("vhpfxxypininmay", com.azure.core.util.Context.NONE);
+
+ Assertions.assertEquals("nuvamiheogna", response.iterator().next().location());
+ Assertions.assertEquals("xth", response.iterator().next().tags().get("o"));
+ Assertions.assertEquals(2045160621, response.iterator().next().properties().age());
+ Assertions.assertEquals("kpode", response.iterator().next().properties().city());
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesListMockTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesListMockTests.java
new file mode 100644
index 000000000000..1e3f1af418ef
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/EmployeesListMockTests.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.models.AzureCloud;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.contoso.ContosoManager;
+import com.azure.resourcemanager.contoso.models.Employee;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class EmployeesListMockTests {
+ @Test
+ public void testList() throws Exception {
+ String responseStr
+ = "{\"value\":[{\"properties\":{\"age\":1685957957,\"city\":\"rcjd\",\"provisioningState\":\"Accepted\"},\"location\":\"xbnjbiksq\",\"tags\":{\"fmppe\":\"ssainqpjwnzll\",\"c\":\"bvmgxsabkyqduuji\"},\"id\":\"czdzev\",\"name\":\"dhkrwpdappdsbdk\",\"type\":\"wrwjfeu\"}]}";
+
+ HttpClient httpClient
+ = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+ ContosoManager manager = ContosoManager.configure()
+ .withHttpClient(httpClient)
+ .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+ new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
+
+ PagedIterable response = manager.employees().list(com.azure.core.util.Context.NONE);
+
+ Assertions.assertEquals("xbnjbiksq", response.iterator().next().location());
+ Assertions.assertEquals("ssainqpjwnzll", response.iterator().next().tags().get("fmppe"));
+ Assertions.assertEquals(1685957957, response.iterator().next().properties().age());
+ Assertions.assertEquals("rcjd", response.iterator().next().properties().city());
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationDisplayTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationDisplayTests.java
new file mode 100644
index 000000000000..2081c64f15c6
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationDisplayTests.java
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.contoso.models.OperationDisplay;
+
+public final class OperationDisplayTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ OperationDisplay model = BinaryData.fromString(
+ "{\"provider\":\"cdm\",\"resource\":\"rcryuanzwuxzdxta\",\"operation\":\"lhmwhfpmrqobm\",\"description\":\"kknryrtihf\"}")
+ .toObject(OperationDisplay.class);
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationInnerTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationInnerTests.java
new file mode 100644
index 000000000000..d637b4aec300
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationInnerTests.java
@@ -0,0 +1,17 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.contoso.fluent.models.OperationInner;
+
+public final class OperationInnerTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ OperationInner model = BinaryData.fromString(
+ "{\"name\":\"nygj\",\"isDataAction\":true,\"display\":{\"provider\":\"eqsrdeupewnwreit\",\"resource\":\"yflusarhmofc\",\"operation\":\"smy\",\"description\":\"kdtmlxhekuk\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}")
+ .toObject(OperationInner.class);
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationListResultTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationListResultTests.java
new file mode 100644
index 000000000000..8d46e49375e0
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationListResultTests.java
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.util.BinaryData;
+import com.azure.resourcemanager.contoso.implementation.models.OperationListResult;
+import org.junit.jupiter.api.Assertions;
+
+public final class OperationListResultTests {
+ @org.junit.jupiter.api.Test
+ public void testDeserialize() throws Exception {
+ OperationListResult model = BinaryData.fromString(
+ "{\"value\":[{\"name\":\"hq\",\"isDataAction\":true,\"display\":{\"provider\":\"pybczmehmtzopb\",\"resource\":\"h\",\"operation\":\"pidgsybbejhphoyc\",\"description\":\"xaobhdxbmtqioqjz\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"fpownoizhwlr\",\"isDataAction\":false,\"display\":{\"provider\":\"oqijgkdmbpaz\",\"resource\":\"bc\",\"operation\":\"pdznrbtcqqjnqgl\",\"description\":\"gnufoooj\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"esaagdfm\",\"isDataAction\":true,\"display\":{\"provider\":\"j\",\"resource\":\"ifkwmrvktsizntoc\",\"operation\":\"a\",\"description\":\"ajpsquc\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"kfo\"}")
+ .toObject(OperationListResult.class);
+ Assertions.assertEquals("kfo", model.nextLink());
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationsListMockTests.java b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationsListMockTests.java
new file mode 100644
index 000000000000..727433313467
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/src/test/java/com/azure/resourcemanager/contoso/generated/OperationsListMockTests.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.contoso.generated;
+
+import com.azure.core.credential.AccessToken;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.models.AzureCloud;
+import com.azure.core.test.http.MockHttpResponse;
+import com.azure.resourcemanager.contoso.ContosoManager;
+import com.azure.resourcemanager.contoso.models.Operation;
+import java.nio.charset.StandardCharsets;
+import java.time.OffsetDateTime;
+import org.junit.jupiter.api.Test;
+import reactor.core.publisher.Mono;
+
+public final class OperationsListMockTests {
+ @Test
+ public void testList() throws Exception {
+ String responseStr
+ = "{\"value\":[{\"name\":\"wmfdatscmdvpjhul\",\"isDataAction\":false,\"display\":{\"provider\":\"kjozkrwfnd\",\"resource\":\"djpslw\",\"operation\":\"dpvwryoqpsoaccta\",\"description\":\"kljla\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}";
+
+ HttpClient httpClient
+ = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8)));
+ ContosoManager manager = ContosoManager.configure()
+ .withHttpClient(httpClient)
+ .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)),
+ new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD));
+
+ PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE);
+
+ }
+}
diff --git a/sdk/contoso/azure-resourcemanager-contoso/tsp-location.yaml b/sdk/contoso/azure-resourcemanager-contoso/tsp-location.yaml
new file mode 100644
index 000000000000..cd26ec71b476
--- /dev/null
+++ b/sdk/contoso/azure-resourcemanager-contoso/tsp-location.yaml
@@ -0,0 +1,4 @@
+directory: specification/contosowidgetmanager/Contoso.Management
+commit: e7fce5a11370ee551f5cadf36b3e92b5919831e8
+repo: Azure/azure-rest-api-specs
+additionalDirectories:
diff --git a/sdk/contoso/ci.yml b/sdk/contoso/ci.yml
new file mode 100644
index 000000000000..73561dc32b79
--- /dev/null
+++ b/sdk/contoso/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/contoso/ci.yml
+ - sdk/contoso/azure-resourcemanager-contoso/
+ exclude:
+ - sdk/contoso/pom.xml
+ - sdk/contoso/azure-resourcemanager-contoso/pom.xml
+
+pr:
+ branches:
+ include:
+ - main
+ - feature/*
+ - hotfix/*
+ - release/*
+ paths:
+ include:
+ - sdk/contoso/ci.yml
+ - sdk/contoso/azure-resourcemanager-contoso/
+ exclude:
+ - sdk/contoso/pom.xml
+ - sdk/contoso/azure-resourcemanager-contoso/pom.xml
+
+parameters:
+ - name: release_azureresourcemanagercontoso
+ displayName: azure-resourcemanager-contoso
+ type: boolean
+ default: false
+
+extends:
+ template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
+ parameters:
+ ServiceDirectory: contoso
+ Artifacts:
+ - name: azure-resourcemanager-contoso
+ groupId: com.azure.resourcemanager
+ safeName: azureresourcemanagercontoso
+ releaseInBatch: ${{ parameters.release_azureresourcemanagercontoso }}
diff --git a/sdk/contoso/pom.xml b/sdk/contoso/pom.xml
new file mode 100644
index 000000000000..4dd511abe080
--- /dev/null
+++ b/sdk/contoso/pom.xml
@@ -0,0 +1,15 @@
+
+
+ 4.0.0
+ com.azure
+ azure-contoso-service
+ pom
+ 1.0.0
+
+
+ azure-resourcemanager-contoso
+
+