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 Agriculture Platform service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the Agriculture Platform service API instance.
+ */
+ public AgriculturePlatformManager 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.agricultureplatform")
+ .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 AgriculturePlatformManager(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 AgriServices. It manages AgriServiceResource.
+ *
+ * @return Resource collection API of AgriServices.
+ */
+ public AgriServices agriServices() {
+ if (this.agriServices == null) {
+ this.agriServices = new AgriServicesImpl(clientObject.getAgriServices(), this);
+ }
+ return agriServices;
+ }
+
+ /**
+ * Gets wrapped service client AgriculturePlatformMgmtClient providing direct access to the underlying
+ * auto-generated API implementation, based on Azure REST API.
+ *
+ * @return Wrapped service client AgriculturePlatformMgmtClient.
+ */
+ public AgriculturePlatformMgmtClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/AgriServicesClient.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/AgriServicesClient.java
new file mode 100644
index 000000000000..d69e25efdea2
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/AgriServicesClient.java
@@ -0,0 +1,306 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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.agricultureplatform.fluent.models.AgriServiceResourceInner;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AvailableAgriSolutionListResultInner;
+import com.azure.resourcemanager.agricultureplatform.models.AgriServiceResourceUpdate;
+
+/**
+ * An instance of this class provides access to all the operations defined in AgriServicesClient.
+ */
+public interface AgriServicesClient {
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(String resourceGroupName,
+ String agriServiceResourceName, Context context);
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AgriServiceResourceInner getByResourceGroup(String resourceGroupName, String agriServiceResourceName);
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AgriServiceResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceInner resource);
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AgriServiceResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceInner resource, Context context);
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AgriServiceResourceInner createOrUpdate(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceInner resource);
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AgriServiceResourceInner createOrUpdate(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceInner resource, Context context);
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 the {@link SyncPoller} for polling of schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AgriServiceResourceInner> beginUpdate(String resourceGroupName,
+ String agriServiceResourceName, AgriServiceResourceUpdate properties);
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 the {@link SyncPoller} for polling of schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, AgriServiceResourceInner> beginUpdate(String resourceGroupName,
+ String agriServiceResourceName, AgriServiceResourceUpdate properties, Context context);
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AgriServiceResourceInner update(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceUpdate properties);
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AgriServiceResourceInner update(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceUpdate properties, Context context);
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName);
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName,
+ Context context);
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName);
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName, Context context);
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listAvailableSolutionsWithResponse(String resourceGroupName,
+ String agriServiceResourceName, Context context);
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AvailableAgriSolutionListResultInner listAvailableSolutions(String resourceGroupName,
+ String agriServiceResourceName);
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/AgriculturePlatformMgmtClient.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/AgriculturePlatformMgmtClient.java
new file mode 100644
index 000000000000..2fcaa4202f73
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/AgriculturePlatformMgmtClient.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.agricultureplatform.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/**
+ * The interface for AgriculturePlatformMgmtClient class.
+ */
+public interface AgriculturePlatformMgmtClient {
+ /**
+ * 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 AgriServicesClient object to access its operations.
+ *
+ * @return the AgriServicesClient object.
+ */
+ AgriServicesClient getAgriServices();
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/OperationsClient.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/OperationsClient.java
new file mode 100644
index 000000000000..e5a31436dde9
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/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.agricultureplatform.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.agricultureplatform.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/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/AgriServiceResourceInner.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/AgriServiceResourceInner.java
new file mode 100644
index 000000000000..c808cdba61ba
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/AgriServiceResourceInner.java
@@ -0,0 +1,256 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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.agricultureplatform.models.AgriServiceResourceProperties;
+import com.azure.resourcemanager.agricultureplatform.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.agricultureplatform.models.Sku;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * Schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+@Fluent
+public final class AgriServiceResourceInner extends Resource {
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private AgriServiceResourceProperties properties;
+
+ /*
+ * The managed service identities assigned to this resource.
+ */
+ private ManagedServiceIdentity identity;
+
+ /*
+ * The SKU (Stock Keeping Unit) assigned to this resource.
+ */
+ private Sku sku;
+
+ /*
+ * 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 AgriServiceResourceInner class.
+ */
+ public AgriServiceResourceInner() {
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public AgriServiceResourceProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the AgriServiceResourceInner object itself.
+ */
+ public AgriServiceResourceInner withProperties(AgriServiceResourceProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the identity property: The managed service identities assigned to this resource.
+ *
+ * @return the identity value.
+ */
+ public ManagedServiceIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: The managed service identities assigned to this resource.
+ *
+ * @param identity the identity value to set.
+ * @return the AgriServiceResourceInner object itself.
+ */
+ public AgriServiceResourceInner withIdentity(ManagedServiceIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /**
+ * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource.
+ *
+ * @return the sku value.
+ */
+ public Sku sku() {
+ return this.sku;
+ }
+
+ /**
+ * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource.
+ *
+ * @param sku the sku value to set.
+ * @return the AgriServiceResourceInner object itself.
+ */
+ public AgriServiceResourceInner withSku(Sku sku) {
+ this.sku = sku;
+ 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 AgriServiceResourceInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AgriServiceResourceInner 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();
+ }
+ if (identity() != null) {
+ identity().validate();
+ }
+ if (sku() != null) {
+ sku().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);
+ jsonWriter.writeJsonField("identity", this.identity);
+ jsonWriter.writeJsonField("sku", this.sku);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AgriServiceResourceInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AgriServiceResourceInner 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 AgriServiceResourceInner.
+ */
+ public static AgriServiceResourceInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AgriServiceResourceInner deserializedAgriServiceResourceInner = new AgriServiceResourceInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("id".equals(fieldName)) {
+ deserializedAgriServiceResourceInner.id = reader.getString();
+ } else if ("name".equals(fieldName)) {
+ deserializedAgriServiceResourceInner.name = reader.getString();
+ } else if ("type".equals(fieldName)) {
+ deserializedAgriServiceResourceInner.type = reader.getString();
+ } else if ("location".equals(fieldName)) {
+ deserializedAgriServiceResourceInner.withLocation(reader.getString());
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedAgriServiceResourceInner.withTags(tags);
+ } else if ("properties".equals(fieldName)) {
+ deserializedAgriServiceResourceInner.properties = AgriServiceResourceProperties.fromJson(reader);
+ } else if ("identity".equals(fieldName)) {
+ deserializedAgriServiceResourceInner.identity = ManagedServiceIdentity.fromJson(reader);
+ } else if ("sku".equals(fieldName)) {
+ deserializedAgriServiceResourceInner.sku = Sku.fromJson(reader);
+ } else if ("systemData".equals(fieldName)) {
+ deserializedAgriServiceResourceInner.systemData = SystemData.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAgriServiceResourceInner;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/AvailableAgriSolutionListResultInner.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/AvailableAgriSolutionListResultInner.java
new file mode 100644
index 000000000000..4f0c70c2dd9d
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/AvailableAgriSolutionListResultInner.java
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.fluent.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.agricultureplatform.models.DataManagerForAgricultureSolution;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The list of available agri solutions.
+ */
+@Immutable
+public final class AvailableAgriSolutionListResultInner
+ implements JsonSerializable {
+ /*
+ * Agri solutions list.
+ */
+ private List solutions;
+
+ /**
+ * Creates an instance of AvailableAgriSolutionListResultInner class.
+ */
+ private AvailableAgriSolutionListResultInner() {
+ }
+
+ /**
+ * Get the solutions property: Agri solutions list.
+ *
+ * @return the solutions value.
+ */
+ public List solutions() {
+ return this.solutions;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (solutions() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property solutions in model AvailableAgriSolutionListResultInner"));
+ } else {
+ solutions().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(AvailableAgriSolutionListResultInner.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeArrayField("solutions", this.solutions, (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AvailableAgriSolutionListResultInner from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AvailableAgriSolutionListResultInner 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 AvailableAgriSolutionListResultInner.
+ */
+ public static AvailableAgriSolutionListResultInner fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AvailableAgriSolutionListResultInner deserializedAvailableAgriSolutionListResultInner
+ = new AvailableAgriSolutionListResultInner();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("solutions".equals(fieldName)) {
+ List solutions
+ = reader.readArray(reader1 -> DataManagerForAgricultureSolution.fromJson(reader1));
+ deserializedAvailableAgriSolutionListResultInner.solutions = solutions;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAvailableAgriSolutionListResultInner;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/OperationInner.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/OperationInner.java
new file mode 100644
index 000000000000..a3e1525e45bd
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/OperationInner.java
@@ -0,0 +1,159 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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.agricultureplatform.models.ActionType;
+import com.azure.resourcemanager.agricultureplatform.models.OperationDisplay;
+import com.azure.resourcemanager.agricultureplatform.models.Origin;
+import java.io.IOException;
+
+/**
+ * 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/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/package-info.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/package-info.java
new file mode 100644
index 000000000000..ca9514837536
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/models/package-info.java
@@ -0,0 +1,8 @@
+// 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 AgriculturePlatform.
+ */
+package com.azure.resourcemanager.agricultureplatform.fluent.models;
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/package-info.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/package-info.java
new file mode 100644
index 000000000000..907dba900fad
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/fluent/package-info.java
@@ -0,0 +1,8 @@
+// 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 AgriculturePlatform.
+ */
+package com.azure.resourcemanager.agricultureplatform.fluent;
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServiceResourceImpl.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServiceResourceImpl.java
new file mode 100644
index 000000000000..4b2e6177e41d
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServiceResourceImpl.java
@@ -0,0 +1,226 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AgriServiceResourceInner;
+import com.azure.resourcemanager.agricultureplatform.models.AgriServiceResource;
+import com.azure.resourcemanager.agricultureplatform.models.AgriServiceResourceProperties;
+import com.azure.resourcemanager.agricultureplatform.models.AgriServiceResourceUpdate;
+import com.azure.resourcemanager.agricultureplatform.models.AgriServiceResourceUpdateProperties;
+import com.azure.resourcemanager.agricultureplatform.models.AvailableAgriSolutionListResult;
+import com.azure.resourcemanager.agricultureplatform.models.ManagedServiceIdentity;
+import com.azure.resourcemanager.agricultureplatform.models.Sku;
+import java.util.Collections;
+import java.util.Map;
+
+public final class AgriServiceResourceImpl
+ implements AgriServiceResource, AgriServiceResource.Definition, AgriServiceResource.Update {
+ private AgriServiceResourceInner innerObject;
+
+ private final com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager 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 AgriServiceResourceProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public ManagedServiceIdentity identity() {
+ return this.innerModel().identity();
+ }
+
+ public Sku sku() {
+ return this.innerModel().sku();
+ }
+
+ 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 AgriServiceResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String agriServiceResourceName;
+
+ private AgriServiceResourceUpdate updateProperties;
+
+ public AgriServiceResourceImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public AgriServiceResource create() {
+ this.innerObject = serviceManager.serviceClient()
+ .getAgriServices()
+ .createOrUpdate(resourceGroupName, agriServiceResourceName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public AgriServiceResource create(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getAgriServices()
+ .createOrUpdate(resourceGroupName, agriServiceResourceName, this.innerModel(), context);
+ return this;
+ }
+
+ AgriServiceResourceImpl(String name,
+ com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager serviceManager) {
+ this.innerObject = new AgriServiceResourceInner();
+ this.serviceManager = serviceManager;
+ this.agriServiceResourceName = name;
+ }
+
+ public AgriServiceResourceImpl update() {
+ this.updateProperties = new AgriServiceResourceUpdate();
+ return this;
+ }
+
+ public AgriServiceResource apply() {
+ this.innerObject = serviceManager.serviceClient()
+ .getAgriServices()
+ .update(resourceGroupName, agriServiceResourceName, updateProperties, Context.NONE);
+ return this;
+ }
+
+ public AgriServiceResource apply(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getAgriServices()
+ .update(resourceGroupName, agriServiceResourceName, updateProperties, context);
+ return this;
+ }
+
+ AgriServiceResourceImpl(AgriServiceResourceInner innerObject,
+ com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.agriServiceResourceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "agriServices");
+ }
+
+ public AgriServiceResource refresh() {
+ this.innerObject = serviceManager.serviceClient()
+ .getAgriServices()
+ .getByResourceGroupWithResponse(resourceGroupName, agriServiceResourceName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public AgriServiceResource refresh(Context context) {
+ this.innerObject = serviceManager.serviceClient()
+ .getAgriServices()
+ .getByResourceGroupWithResponse(resourceGroupName, agriServiceResourceName, context)
+ .getValue();
+ return this;
+ }
+
+ public Response listAvailableSolutionsWithResponse(Context context) {
+ return serviceManager.agriServices()
+ .listAvailableSolutionsWithResponse(resourceGroupName, agriServiceResourceName, context);
+ }
+
+ public AvailableAgriSolutionListResult listAvailableSolutions() {
+ return serviceManager.agriServices().listAvailableSolutions(resourceGroupName, agriServiceResourceName);
+ }
+
+ public AgriServiceResourceImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public AgriServiceResourceImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public AgriServiceResourceImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateProperties.withTags(tags);
+ return this;
+ }
+ }
+
+ public AgriServiceResourceImpl withProperties(AgriServiceResourceProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+
+ public AgriServiceResourceImpl withIdentity(ManagedServiceIdentity identity) {
+ if (isInCreateMode()) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ } else {
+ this.updateProperties.withIdentity(identity);
+ return this;
+ }
+ }
+
+ public AgriServiceResourceImpl withSku(Sku sku) {
+ if (isInCreateMode()) {
+ this.innerModel().withSku(sku);
+ return this;
+ } else {
+ this.updateProperties.withSku(sku);
+ return this;
+ }
+ }
+
+ public AgriServiceResourceImpl withProperties(AgriServiceResourceUpdateProperties properties) {
+ this.updateProperties.withProperties(properties);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServicesClientImpl.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServicesClientImpl.java
new file mode 100644
index 000000000000..c3e8c848f2f1
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServicesClientImpl.java
@@ -0,0 +1,1456 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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.Post;
+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.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.agricultureplatform.fluent.AgriServicesClient;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AgriServiceResourceInner;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AvailableAgriSolutionListResultInner;
+import com.azure.resourcemanager.agricultureplatform.implementation.models.AgriServiceResourceListResult;
+import com.azure.resourcemanager.agricultureplatform.models.AgriServiceResourceUpdate;
+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 AgriServicesClient.
+ */
+public final class AgriServicesClientImpl implements AgriServicesClient {
+ /**
+ * The proxy service used to perform REST calls.
+ */
+ private final AgriServicesService service;
+
+ /**
+ * The service client containing this operation class.
+ */
+ private final AgriculturePlatformMgmtClientImpl client;
+
+ /**
+ * Initializes an instance of AgriServicesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ AgriServicesClientImpl(AgriculturePlatformMgmtClientImpl client) {
+ this.service
+ = RestProxy.create(AgriServicesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AgriculturePlatformMgmtClientAgriServices to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "AgriculturePlatformM")
+ public interface AgriServicesService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName}")
+ @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("agriServiceResourceName") String agriServiceResourceName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName}")
+ @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("agriServiceResourceName") String agriServiceResourceName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") AgriServiceResourceInner resource, Context context);
+
+ @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> update(@HostParam("endpoint") String endpoint,
+ @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("agriServiceResourceName") String agriServiceResourceName,
+ @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+ @BodyParam("application/json") AgriServiceResourceUpdate properties, Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName}")
+ @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("agriServiceResourceName") String agriServiceResourceName, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({ "Content-Type: application/json" })
+ @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices")
+ @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}/providers/Microsoft.AgriculturePlatform/agriServices")
+ @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" })
+ @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AgriculturePlatform/agriServices/{agriServiceResourceName}/listAvailableSolutions")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listAvailableSolutions(
+ @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("agriServiceResourceName") String agriServiceResourceName, @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)
+ Mono> listBySubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint,
+ @HeaderParam("Accept") String accept, Context context);
+ }
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String agriServiceResourceName) {
+ 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 (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName 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, agriServiceResourceName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
+ String agriServiceResourceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, agriServiceResourceName, accept, context);
+ }
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName,
+ String agriServiceResourceName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, agriServiceResourceName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(String resourceGroupName,
+ String agriServiceResourceName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, agriServiceResourceName, context).block();
+ }
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AgriServiceResourceInner getByResourceGroup(String resourceGroupName, String agriServiceResourceName) {
+ return getByResourceGroupWithResponse(resourceGroupName, agriServiceResourceName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String agriServiceResourceName, AgriServiceResourceInner 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 (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName 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, agriServiceResourceName, contentType, accept,
+ resource, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
+ String agriServiceResourceName, AgriServiceResourceInner resource, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName 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";
+ context = this.client.mergeContext(context);
+ return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, agriServiceResourceName, contentType, accept, resource,
+ context);
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, AgriServiceResourceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceInner resource) {
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, agriServiceResourceName, resource);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), AgriServiceResourceInner.class, AgriServiceResourceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 PollerFlux} for polling of schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, AgriServiceResourceInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceInner resource, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = createOrUpdateWithResponseAsync(resourceGroupName, agriServiceResourceName, resource, context);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), AgriServiceResourceInner.class, AgriServiceResourceInner.class, context);
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, AgriServiceResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceInner resource) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, agriServiceResourceName, resource).getSyncPoller();
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, AgriServiceResourceInner> beginCreateOrUpdate(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceInner resource, Context context) {
+ return this.beginCreateOrUpdateAsync(resourceGroupName, agriServiceResourceName, resource, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceInner resource) {
+ return beginCreateOrUpdateAsync(resourceGroupName, agriServiceResourceName, resource).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceInner resource, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, agriServiceResourceName, resource, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AgriServiceResourceInner createOrUpdate(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceInner resource) {
+ return createOrUpdateAsync(resourceGroupName, agriServiceResourceName, resource).block();
+ }
+
+ /**
+ * Create a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AgriServiceResourceInner createOrUpdate(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceInner resource, Context context) {
+ return createOrUpdateAsync(resourceGroupName, agriServiceResourceName, resource, context).block();
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName,
+ String agriServiceResourceName, AgriServiceResourceUpdate 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 (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName 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, agriServiceResourceName, contentType, accept,
+ properties, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> updateWithResponseAsync(String resourceGroupName,
+ String agriServiceResourceName, AgriServiceResourceUpdate properties, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName 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";
+ context = this.client.mergeContext(context);
+ return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, agriServiceResourceName, contentType, accept, properties, context);
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 the {@link PollerFlux} for polling of schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, AgriServiceResourceInner> beginUpdateAsync(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceUpdate properties) {
+ Mono>> mono
+ = updateWithResponseAsync(resourceGroupName, agriServiceResourceName, properties);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), AgriServiceResourceInner.class, AgriServiceResourceInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 the {@link PollerFlux} for polling of schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, AgriServiceResourceInner> beginUpdateAsync(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceUpdate properties,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = updateWithResponseAsync(resourceGroupName, agriServiceResourceName, properties, context);
+ return this.client.getLroResult(mono,
+ this.client.getHttpPipeline(), AgriServiceResourceInner.class, AgriServiceResourceInner.class, context);
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 the {@link SyncPoller} for polling of schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, AgriServiceResourceInner>
+ beginUpdate(String resourceGroupName, String agriServiceResourceName, AgriServiceResourceUpdate properties) {
+ return this.beginUpdateAsync(resourceGroupName, agriServiceResourceName, properties).getSyncPoller();
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 the {@link SyncPoller} for polling of schema of the AgriService resource from
+ * Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, AgriServiceResourceInner> beginUpdate(
+ String resourceGroupName, String agriServiceResourceName, AgriServiceResourceUpdate properties,
+ Context context) {
+ return this.beginUpdateAsync(resourceGroupName, agriServiceResourceName, properties, context).getSyncPoller();
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceUpdate properties) {
+ return beginUpdateAsync(resourceGroupName, agriServiceResourceName, properties).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceUpdate properties, Context context) {
+ return beginUpdateAsync(resourceGroupName, agriServiceResourceName, properties, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AgriServiceResourceInner update(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceUpdate properties) {
+ return updateAsync(resourceGroupName, agriServiceResourceName, properties).block();
+ }
+
+ /**
+ * Update a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 schema of the AgriService resource from Microsoft.AgriculturePlatform resource provider.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AgriServiceResourceInner update(String resourceGroupName, String agriServiceResourceName,
+ AgriServiceResourceUpdate properties, Context context) {
+ return updateAsync(resourceGroupName, agriServiceResourceName, properties, context).block();
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName) {
+ 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 (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName 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, agriServiceResourceName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(String resourceGroupName,
+ String agriServiceResourceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
+ resourceGroupName, agriServiceResourceName, accept, context);
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, agriServiceResourceName);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, Void> beginDeleteAsync(String resourceGroupName,
+ String agriServiceResourceName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono
+ = deleteWithResponseAsync(resourceGroupName, agriServiceResourceName, context);
+ return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
+ context);
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName) {
+ return this.beginDeleteAsync(resourceGroupName, agriServiceResourceName).getSyncPoller();
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName,
+ Context context) {
+ return this.beginDeleteAsync(resourceGroupName, agriServiceResourceName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName) {
+ return beginDeleteAsync(resourceGroupName, agriServiceResourceName).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return A {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String agriServiceResourceName, Context context) {
+ return beginDeleteAsync(resourceGroupName, agriServiceResourceName, context).last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName) {
+ deleteAsync(resourceGroupName, agriServiceResourceName).block();
+ }
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName, Context context) {
+ deleteAsync(resourceGroupName, agriServiceResourceName, context).block();
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource 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 AgriServiceResource 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 AgriServiceResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return 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));
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource 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 AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource 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 AgriServiceResource 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 AgriServiceResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ 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";
+ context = this.client.mergeContext(context);
+ return 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));
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>
+ listAvailableSolutionsWithResponseAsync(String resourceGroupName, String agriServiceResourceName) {
+ 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 (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listAvailableSolutions(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, agriServiceResourceName, accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listAvailableSolutionsWithResponseAsync(
+ String resourceGroupName, String agriServiceResourceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono.error(new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (agriServiceResourceName == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter agriServiceResourceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listAvailableSolutions(this.client.getEndpoint(), this.client.getApiVersion(),
+ this.client.getSubscriptionId(), resourceGroupName, agriServiceResourceName, accept, context);
+ }
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono listAvailableSolutionsAsync(String resourceGroupName,
+ String agriServiceResourceName) {
+ return listAvailableSolutionsWithResponseAsync(resourceGroupName, agriServiceResourceName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response listAvailableSolutionsWithResponse(String resourceGroupName,
+ String agriServiceResourceName, Context context) {
+ return listAvailableSolutionsWithResponseAsync(resourceGroupName, agriServiceResourceName, context).block();
+ }
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public AvailableAgriSolutionListResultInner listAvailableSolutions(String resourceGroupName,
+ String agriServiceResourceName) {
+ return listAvailableSolutionsWithResponse(resourceGroupName, agriServiceResourceName, Context.NONE).getValue();
+ }
+
+ /**
+ * 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 AgriServiceResource 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.
+ * @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 AgriServiceResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink,
+ Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> 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 AgriServiceResource 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.
+ * @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 AgriServiceResource list operation along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listBySubscriptionNextSinglePageAsync(String nextLink,
+ Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServicesImpl.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServicesImpl.java
new file mode 100644
index 000000000000..14b474069982
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriServicesImpl.java
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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.agricultureplatform.fluent.AgriServicesClient;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AgriServiceResourceInner;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AvailableAgriSolutionListResultInner;
+import com.azure.resourcemanager.agricultureplatform.models.AgriServiceResource;
+import com.azure.resourcemanager.agricultureplatform.models.AgriServices;
+import com.azure.resourcemanager.agricultureplatform.models.AvailableAgriSolutionListResult;
+
+public final class AgriServicesImpl implements AgriServices {
+ private static final ClientLogger LOGGER = new ClientLogger(AgriServicesImpl.class);
+
+ private final AgriServicesClient innerClient;
+
+ private final com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager serviceManager;
+
+ public AgriServicesImpl(AgriServicesClient innerClient,
+ com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getByResourceGroupWithResponse(String resourceGroupName,
+ String agriServiceResourceName, Context context) {
+ Response inner
+ = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, agriServiceResourceName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new AgriServiceResourceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public AgriServiceResource getByResourceGroup(String resourceGroupName, String agriServiceResourceName) {
+ AgriServiceResourceInner inner
+ = this.serviceClient().getByResourceGroup(resourceGroupName, agriServiceResourceName);
+ if (inner != null) {
+ return new AgriServiceResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String resourceGroupName, String agriServiceResourceName) {
+ this.serviceClient().delete(resourceGroupName, agriServiceResourceName);
+ }
+
+ public void delete(String resourceGroupName, String agriServiceResourceName, Context context) {
+ this.serviceClient().delete(resourceGroupName, agriServiceResourceName, context);
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new AgriServiceResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner
+ = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new AgriServiceResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new AgriServiceResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return ResourceManagerUtils.mapPage(inner, inner1 -> new AgriServiceResourceImpl(inner1, this.manager()));
+ }
+
+ public Response listAvailableSolutionsWithResponse(String resourceGroupName,
+ String agriServiceResourceName, Context context) {
+ Response inner = this.serviceClient()
+ .listAvailableSolutionsWithResponse(resourceGroupName, agriServiceResourceName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
+ new AvailableAgriSolutionListResultImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public AvailableAgriSolutionListResult listAvailableSolutions(String resourceGroupName,
+ String agriServiceResourceName) {
+ AvailableAgriSolutionListResultInner inner
+ = this.serviceClient().listAvailableSolutions(resourceGroupName, agriServiceResourceName);
+ if (inner != null) {
+ return new AvailableAgriSolutionListResultImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public AgriServiceResource 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 agriServiceResourceName = ResourceManagerUtils.getValueFromIdByName(id, "agriServices");
+ if (agriServiceResourceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'agriServices'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, agriServiceResourceName, 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 agriServiceResourceName = ResourceManagerUtils.getValueFromIdByName(id, "agriServices");
+ if (agriServiceResourceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'agriServices'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, agriServiceResourceName, 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 agriServiceResourceName = ResourceManagerUtils.getValueFromIdByName(id, "agriServices");
+ if (agriServiceResourceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'agriServices'.", id)));
+ }
+ this.delete(resourceGroupName, agriServiceResourceName, 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 agriServiceResourceName = ResourceManagerUtils.getValueFromIdByName(id, "agriServices");
+ if (agriServiceResourceName == null) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'agriServices'.", id)));
+ }
+ this.delete(resourceGroupName, agriServiceResourceName, context);
+ }
+
+ private AgriServicesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager manager() {
+ return this.serviceManager;
+ }
+
+ public AgriServiceResourceImpl define(String name) {
+ return new AgriServiceResourceImpl(name, this.manager());
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriculturePlatformMgmtClientBuilder.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriculturePlatformMgmtClientBuilder.java
new file mode 100644
index 000000000000..29dce8654ad8
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriculturePlatformMgmtClientBuilder.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.agricultureplatform.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 AgriculturePlatformMgmtClientImpl type.
+ */
+@ServiceClientBuilder(serviceClients = { AgriculturePlatformMgmtClientImpl.class })
+public final class AgriculturePlatformMgmtClientBuilder {
+ /*
+ * Service host
+ */
+ private String endpoint;
+
+ /**
+ * Sets Service host.
+ *
+ * @param endpoint the endpoint value.
+ * @return the AgriculturePlatformMgmtClientBuilder.
+ */
+ public AgriculturePlatformMgmtClientBuilder 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 AgriculturePlatformMgmtClientBuilder.
+ */
+ public AgriculturePlatformMgmtClientBuilder 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 AgriculturePlatformMgmtClientBuilder.
+ */
+ public AgriculturePlatformMgmtClientBuilder 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 AgriculturePlatformMgmtClientBuilder.
+ */
+ public AgriculturePlatformMgmtClientBuilder 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 AgriculturePlatformMgmtClientBuilder.
+ */
+ public AgriculturePlatformMgmtClientBuilder 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 AgriculturePlatformMgmtClientBuilder.
+ */
+ public AgriculturePlatformMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of AgriculturePlatformMgmtClientImpl with the provided parameters.
+ *
+ * @return an instance of AgriculturePlatformMgmtClientImpl.
+ */
+ public AgriculturePlatformMgmtClientImpl 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();
+ AgriculturePlatformMgmtClientImpl client = new AgriculturePlatformMgmtClientImpl(localPipeline,
+ localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId);
+ return client;
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriculturePlatformMgmtClientImpl.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriculturePlatformMgmtClientImpl.java
new file mode 100644
index 000000000000..8f01a229fcae
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AgriculturePlatformMgmtClientImpl.java
@@ -0,0 +1,304 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.http.HttpHeaderName;
+import com.azure.core.http.HttpHeaders;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.AzureEnvironment;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.management.polling.PollerFactory;
+import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.AsyncPollResponse;
+import com.azure.core.util.polling.LongRunningOperationStatus;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.serializer.SerializerAdapter;
+import com.azure.core.util.serializer.SerializerEncoding;
+import com.azure.resourcemanager.agricultureplatform.fluent.AgriServicesClient;
+import com.azure.resourcemanager.agricultureplatform.fluent.AgriculturePlatformMgmtClient;
+import com.azure.resourcemanager.agricultureplatform.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 AgriculturePlatformMgmtClientImpl type.
+ */
+@ServiceClient(builder = AgriculturePlatformMgmtClientBuilder.class)
+public final class AgriculturePlatformMgmtClientImpl implements AgriculturePlatformMgmtClient {
+ /**
+ * 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 AgriServicesClient object to access its operations.
+ */
+ private final AgriServicesClient agriServices;
+
+ /**
+ * Gets the AgriServicesClient object to access its operations.
+ *
+ * @return the AgriServicesClient object.
+ */
+ public AgriServicesClient getAgriServices() {
+ return this.agriServices;
+ }
+
+ /**
+ * Initializes an instance of AgriculturePlatformMgmtClient 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.
+ */
+ AgriculturePlatformMgmtClientImpl(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 = "2024-06-01-preview";
+ this.operations = new OperationsClientImpl(this);
+ this.agriServices = new AgriServicesClientImpl(this);
+ }
+
+ /**
+ * Gets default client context.
+ *
+ * @return the default client context.
+ */
+ public Context getContext() {
+ return Context.NONE;
+ }
+
+ /**
+ * Merges default client context with provided context.
+ *
+ * @param context the context to be merged with default client context.
+ * @return the merged context.
+ */
+ public Context mergeContext(Context context) {
+ return CoreUtils.mergeContexts(this.getContext(), context);
+ }
+
+ /**
+ * Gets long running operation result.
+ *
+ * @param activationResponse the response of activation operation.
+ * @param httpPipeline the http pipeline.
+ * @param pollResultType type of poll result.
+ * @param finalResultType type of final result.
+ * @param context the context shared by all requests.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return poller flux for poll result and final result.
+ */
+ public PollerFlux, U> getLroResult(Mono>> activationResponse,
+ HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) {
+ return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType,
+ defaultPollInterval, activationResponse, context);
+ }
+
+ /**
+ * Gets the final result, or an error, based on last async poll response.
+ *
+ * @param response the last async poll response.
+ * @param type of poll result.
+ * @param type of final result.
+ * @return the final result, or an error.
+ */
+ public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) {
+ if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) {
+ String errorMessage;
+ ManagementError managementError = null;
+ HttpResponse errorResponse = null;
+ PollResult.Error lroError = response.getValue().getError();
+ if (lroError != null) {
+ errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(),
+ lroError.getResponseBody());
+
+ errorMessage = response.getValue().getError().getMessage();
+ String errorBody = response.getValue().getError().getResponseBody();
+ if (errorBody != null) {
+ // try to deserialize error body to ManagementError
+ try {
+ managementError = this.getSerializerAdapter()
+ .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
+ if (managementError.getCode() == null || managementError.getMessage() == null) {
+ managementError = null;
+ }
+ } catch (IOException | RuntimeException ioe) {
+ LOGGER.logThrowableAsWarning(ioe);
+ }
+ }
+ } else {
+ // fallback to default error message
+ errorMessage = "Long running operation failed.";
+ }
+ if (managementError == null) {
+ // fallback to default ManagementError
+ managementError = new ManagementError(response.getStatus().toString(), errorMessage);
+ }
+ return Mono.error(new ManagementException(errorMessage, errorResponse, managementError));
+ } else {
+ return response.getFinalResult();
+ }
+ }
+
+ private static final class HttpResponseImpl extends HttpResponse {
+ private final int statusCode;
+
+ private final byte[] responseBody;
+
+ private final HttpHeaders httpHeaders;
+
+ HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) {
+ super(null);
+ this.statusCode = statusCode;
+ this.httpHeaders = httpHeaders;
+ this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public String getHeaderValue(String s) {
+ return httpHeaders.getValue(HttpHeaderName.fromString(s));
+ }
+
+ public HttpHeaders getHeaders() {
+ return httpHeaders;
+ }
+
+ public Flux getBody() {
+ return Flux.just(ByteBuffer.wrap(responseBody));
+ }
+
+ public Mono getBodyAsByteArray() {
+ return Mono.just(responseBody);
+ }
+
+ public Mono getBodyAsString() {
+ return Mono.just(new String(responseBody, StandardCharsets.UTF_8));
+ }
+
+ public Mono getBodyAsString(Charset charset) {
+ return Mono.just(new String(responseBody, charset));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(AgriculturePlatformMgmtClientImpl.class);
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AvailableAgriSolutionListResultImpl.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AvailableAgriSolutionListResultImpl.java
new file mode 100644
index 000000000000..d8e43c2a0871
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/AvailableAgriSolutionListResultImpl.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.agricultureplatform.implementation;
+
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AvailableAgriSolutionListResultInner;
+import com.azure.resourcemanager.agricultureplatform.models.AvailableAgriSolutionListResult;
+import com.azure.resourcemanager.agricultureplatform.models.DataManagerForAgricultureSolution;
+import java.util.Collections;
+import java.util.List;
+
+public final class AvailableAgriSolutionListResultImpl implements AvailableAgriSolutionListResult {
+ private AvailableAgriSolutionListResultInner innerObject;
+
+ private final com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager serviceManager;
+
+ AvailableAgriSolutionListResultImpl(AvailableAgriSolutionListResultInner innerObject,
+ com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public List solutions() {
+ List inner = this.innerModel().solutions();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public AvailableAgriSolutionListResultInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/OperationImpl.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/OperationImpl.java
new file mode 100644
index 000000000000..53ef6eb2100d
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/OperationImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.implementation;
+
+import com.azure.resourcemanager.agricultureplatform.fluent.models.OperationInner;
+import com.azure.resourcemanager.agricultureplatform.models.ActionType;
+import com.azure.resourcemanager.agricultureplatform.models.Operation;
+import com.azure.resourcemanager.agricultureplatform.models.OperationDisplay;
+import com.azure.resourcemanager.agricultureplatform.models.Origin;
+
+public final class OperationImpl implements Operation {
+ private OperationInner innerObject;
+
+ private final com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager serviceManager;
+
+ OperationImpl(OperationInner innerObject,
+ com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager 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.agricultureplatform.AgriculturePlatformManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/OperationsClientImpl.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/OperationsClientImpl.java
new file mode 100644
index 000000000000..f817b7a1a547
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/OperationsClientImpl.java
@@ -0,0 +1,235 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.agricultureplatform.fluent.OperationsClient;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.OperationInner;
+import com.azure.resourcemanager.agricultureplatform.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 AgriculturePlatformMgmtClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(AgriculturePlatformMgmtClientImpl client) {
+ this.service
+ = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for AgriculturePlatformMgmtClientOperations to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{endpoint}")
+ @ServiceInterface(name = "AgriculturePlatformM")
+ public interface OperationsService {
+ @Headers({ "Content-Type: application/json" })
+ @Get("/providers/Microsoft.AgriculturePlatform/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("{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);
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(() -> listSinglePageAsync(context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * List the operations for the provider.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
+ res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono.error(
+ new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+ res.getValue().value(), res.getValue().nextLink(), null));
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/OperationsImpl.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/OperationsImpl.java
new file mode 100644
index 000000000000..49e39180abb3
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/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.agricultureplatform.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.agricultureplatform.fluent.OperationsClient;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.OperationInner;
+import com.azure.resourcemanager.agricultureplatform.models.Operation;
+import com.azure.resourcemanager.agricultureplatform.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.agricultureplatform.AgriculturePlatformManager serviceManager;
+
+ public OperationsImpl(OperationsClient innerClient,
+ com.azure.resourcemanager.agricultureplatform.AgriculturePlatformManager 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.agricultureplatform.AgriculturePlatformManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/ResourceManagerUtils.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/ResourceManagerUtils.java
new file mode 100644
index 000000000000..237a3a41cf30
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/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.agricultureplatform.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/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/models/AgriServiceResourceListResult.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/models/AgriServiceResourceListResult.java
new file mode 100644
index 000000000000..dc94edbbe68d
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/models/AgriServiceResourceListResult.java
@@ -0,0 +1,115 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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.agricultureplatform.fluent.models.AgriServiceResourceInner;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The response of a AgriServiceResource list operation.
+ */
+@Immutable
+public final class AgriServiceResourceListResult implements JsonSerializable {
+ /*
+ * The AgriServiceResource items on this page
+ */
+ private List value;
+
+ /*
+ * The link to the next page of items
+ */
+ private String nextLink;
+
+ /**
+ * Creates an instance of AgriServiceResourceListResult class.
+ */
+ private AgriServiceResourceListResult() {
+ }
+
+ /**
+ * Get the value property: The AgriServiceResource 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 AgriServiceResourceListResult"));
+ } else {
+ value().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(AgriServiceResourceListResult.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 AgriServiceResourceListResult from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AgriServiceResourceListResult 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 AgriServiceResourceListResult.
+ */
+ public static AgriServiceResourceListResult fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AgriServiceResourceListResult deserializedAgriServiceResourceListResult
+ = new AgriServiceResourceListResult();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("value".equals(fieldName)) {
+ List value
+ = reader.readArray(reader1 -> AgriServiceResourceInner.fromJson(reader1));
+ deserializedAgriServiceResourceListResult.value = value;
+ } else if ("nextLink".equals(fieldName)) {
+ deserializedAgriServiceResourceListResult.nextLink = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAgriServiceResourceListResult;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/models/OperationListResult.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/models/OperationListResult.java
new file mode 100644
index 000000000000..caa76f64c517
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/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.agricultureplatform.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.agricultureplatform.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/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/package-info.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/package-info.java
new file mode 100644
index 000000000000..42bf05b7fdfe
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/implementation/package-info.java
@@ -0,0 +1,8 @@
+// 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 AgriculturePlatform.
+ */
+package com.azure.resourcemanager.agricultureplatform.implementation;
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/ActionType.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/ActionType.java
new file mode 100644
index 000000000000..c496d950d3fe
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/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.agricultureplatform.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/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceConfig.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceConfig.java
new file mode 100644
index 000000000000..99b6b8de18e1
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceConfig.java
@@ -0,0 +1,177 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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;
+
+/**
+ * Config of the AgriService resource instance.
+ */
+@Immutable
+public final class AgriServiceConfig implements JsonSerializable {
+ /*
+ * Instance URI of the AgriService instance.
+ */
+ private String instanceUri;
+
+ /*
+ * Version of AgriService instance.
+ */
+ private String version;
+
+ /*
+ * App service resource Id.
+ */
+ private String appServiceResourceId;
+
+ /*
+ * Cosmos Db resource Id.
+ */
+ private String cosmosDbResourceId;
+
+ /*
+ * Storage account resource Id.
+ */
+ private String storageAccountResourceId;
+
+ /*
+ * Key vault resource Id.
+ */
+ private String keyVaultResourceId;
+
+ /*
+ * Redis cache resource Id.
+ */
+ private String redisCacheResourceId;
+
+ /**
+ * Creates an instance of AgriServiceConfig class.
+ */
+ public AgriServiceConfig() {
+ }
+
+ /**
+ * Get the instanceUri property: Instance URI of the AgriService instance.
+ *
+ * @return the instanceUri value.
+ */
+ public String instanceUri() {
+ return this.instanceUri;
+ }
+
+ /**
+ * Get the version property: Version of AgriService instance.
+ *
+ * @return the version value.
+ */
+ public String version() {
+ return this.version;
+ }
+
+ /**
+ * Get the appServiceResourceId property: App service resource Id.
+ *
+ * @return the appServiceResourceId value.
+ */
+ public String appServiceResourceId() {
+ return this.appServiceResourceId;
+ }
+
+ /**
+ * Get the cosmosDbResourceId property: Cosmos Db resource Id.
+ *
+ * @return the cosmosDbResourceId value.
+ */
+ public String cosmosDbResourceId() {
+ return this.cosmosDbResourceId;
+ }
+
+ /**
+ * Get the storageAccountResourceId property: Storage account resource Id.
+ *
+ * @return the storageAccountResourceId value.
+ */
+ public String storageAccountResourceId() {
+ return this.storageAccountResourceId;
+ }
+
+ /**
+ * Get the keyVaultResourceId property: Key vault resource Id.
+ *
+ * @return the keyVaultResourceId value.
+ */
+ public String keyVaultResourceId() {
+ return this.keyVaultResourceId;
+ }
+
+ /**
+ * Get the redisCacheResourceId property: Redis cache resource Id.
+ *
+ * @return the redisCacheResourceId value.
+ */
+ public String redisCacheResourceId() {
+ return this.redisCacheResourceId;
+ }
+
+ /**
+ * 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 AgriServiceConfig from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AgriServiceConfig 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 AgriServiceConfig.
+ */
+ public static AgriServiceConfig fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AgriServiceConfig deserializedAgriServiceConfig = new AgriServiceConfig();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("instanceUri".equals(fieldName)) {
+ deserializedAgriServiceConfig.instanceUri = reader.getString();
+ } else if ("version".equals(fieldName)) {
+ deserializedAgriServiceConfig.version = reader.getString();
+ } else if ("appServiceResourceId".equals(fieldName)) {
+ deserializedAgriServiceConfig.appServiceResourceId = reader.getString();
+ } else if ("cosmosDbResourceId".equals(fieldName)) {
+ deserializedAgriServiceConfig.cosmosDbResourceId = reader.getString();
+ } else if ("storageAccountResourceId".equals(fieldName)) {
+ deserializedAgriServiceConfig.storageAccountResourceId = reader.getString();
+ } else if ("keyVaultResourceId".equals(fieldName)) {
+ deserializedAgriServiceConfig.keyVaultResourceId = reader.getString();
+ } else if ("redisCacheResourceId".equals(fieldName)) {
+ deserializedAgriServiceConfig.redisCacheResourceId = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAgriServiceConfig;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResource.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResource.java
new file mode 100644
index 000000000000..396f32d77c59
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResource.java
@@ -0,0 +1,354 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.models;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.Region;
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AgriServiceResourceInner;
+import java.util.Map;
+
+/**
+ * An immutable client-side representation of AgriServiceResource.
+ */
+public interface AgriServiceResource {
+ /**
+ * 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.
+ */
+ AgriServiceResourceProperties properties();
+
+ /**
+ * Gets the identity property: The managed service identities assigned to this resource.
+ *
+ * @return the identity value.
+ */
+ ManagedServiceIdentity identity();
+
+ /**
+ * Gets the sku property: The SKU (Stock Keeping Unit) assigned to this resource.
+ *
+ * @return the sku value.
+ */
+ Sku sku();
+
+ /**
+ * 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.agricultureplatform.fluent.models.AgriServiceResourceInner object.
+ *
+ * @return the inner object.
+ */
+ AgriServiceResourceInner innerModel();
+
+ /**
+ * The entirety of the AgriServiceResource definition.
+ */
+ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation,
+ DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate {
+ }
+
+ /**
+ * The AgriServiceResource definition stages.
+ */
+ interface DefinitionStages {
+ /**
+ * The first stage of the AgriServiceResource definition.
+ */
+ interface Blank extends WithLocation {
+ }
+
+ /**
+ * The stage of the AgriServiceResource 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 AgriServiceResource 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 AgriServiceResource 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,
+ DefinitionStages.WithIdentity, DefinitionStages.WithSku {
+ /**
+ * Executes the create request.
+ *
+ * @return the created resource.
+ */
+ AgriServiceResource create();
+
+ /**
+ * Executes the create request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the created resource.
+ */
+ AgriServiceResource create(Context context);
+ }
+
+ /**
+ * The stage of the AgriServiceResource 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 AgriServiceResource 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(AgriServiceResourceProperties properties);
+ }
+
+ /**
+ * The stage of the AgriServiceResource definition allowing to specify identity.
+ */
+ interface WithIdentity {
+ /**
+ * Specifies the identity property: The managed service identities assigned to this resource..
+ *
+ * @param identity The managed service identities assigned to this resource.
+ * @return the next definition stage.
+ */
+ WithCreate withIdentity(ManagedServiceIdentity identity);
+ }
+
+ /**
+ * The stage of the AgriServiceResource definition allowing to specify sku.
+ */
+ interface WithSku {
+ /**
+ * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource..
+ *
+ * @param sku The SKU (Stock Keeping Unit) assigned to this resource.
+ * @return the next definition stage.
+ */
+ WithCreate withSku(Sku sku);
+ }
+ }
+
+ /**
+ * Begins update for the AgriServiceResource resource.
+ *
+ * @return the stage of resource update.
+ */
+ AgriServiceResource.Update update();
+
+ /**
+ * The template for AgriServiceResource update.
+ */
+ interface Update
+ extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithSku, UpdateStages.WithProperties {
+ /**
+ * Executes the update request.
+ *
+ * @return the updated resource.
+ */
+ AgriServiceResource apply();
+
+ /**
+ * Executes the update request.
+ *
+ * @param context The context to associate with this operation.
+ * @return the updated resource.
+ */
+ AgriServiceResource apply(Context context);
+ }
+
+ /**
+ * The AgriServiceResource update stages.
+ */
+ interface UpdateStages {
+ /**
+ * The stage of the AgriServiceResource 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 AgriServiceResource update allowing to specify identity.
+ */
+ interface WithIdentity {
+ /**
+ * Specifies the identity property: The managed service identities assigned to this resource..
+ *
+ * @param identity The managed service identities assigned to this resource.
+ * @return the next definition stage.
+ */
+ Update withIdentity(ManagedServiceIdentity identity);
+ }
+
+ /**
+ * The stage of the AgriServiceResource update allowing to specify sku.
+ */
+ interface WithSku {
+ /**
+ * Specifies the sku property: The SKU (Stock Keeping Unit) assigned to this resource..
+ *
+ * @param sku The SKU (Stock Keeping Unit) assigned to this resource.
+ * @return the next definition stage.
+ */
+ Update withSku(Sku sku);
+ }
+
+ /**
+ * The stage of the AgriServiceResource 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(AgriServiceResourceUpdateProperties properties);
+ }
+ }
+
+ /**
+ * Refreshes the resource to sync with Azure.
+ *
+ * @return the refreshed resource.
+ */
+ AgriServiceResource refresh();
+
+ /**
+ * Refreshes the resource to sync with Azure.
+ *
+ * @param context The context to associate with this operation.
+ * @return the refreshed resource.
+ */
+ AgriServiceResource refresh(Context context);
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @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 list of available agri solutions along with {@link Response}.
+ */
+ Response listAvailableSolutionsWithResponse(Context context);
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @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 list of available agri solutions.
+ */
+ AvailableAgriSolutionListResult listAvailableSolutions();
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceProperties.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceProperties.java
new file mode 100644
index 000000000000..dcb5d3030a85
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceProperties.java
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Details of the Agriculture AgriDataManager.
+ */
+@Fluent
+public final class AgriServiceResourceProperties implements JsonSerializable {
+ /*
+ * The status of the last operation.
+ */
+ private ProvisioningState provisioningState;
+
+ /*
+ * Config of the AgriService instance.
+ */
+ private AgriServiceConfig config;
+
+ /*
+ * Managed On Behalf Of Configuration.
+ */
+ private ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration;
+
+ /*
+ * Data connector credentials of AgriService instance.
+ */
+ private List dataConnectorCredentials;
+
+ /*
+ * AgriService installed solutions.
+ */
+ private List installedSolutions;
+
+ /**
+ * Creates an instance of AgriServiceResourceProperties class.
+ */
+ public AgriServiceResourceProperties() {
+ }
+
+ /**
+ * Get the provisioningState property: The status of the last operation.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the config property: Config of the AgriService instance.
+ *
+ * @return the config value.
+ */
+ public AgriServiceConfig config() {
+ return this.config;
+ }
+
+ /**
+ * Set the config property: Config of the AgriService instance.
+ *
+ * @param config the config value to set.
+ * @return the AgriServiceResourceProperties object itself.
+ */
+ public AgriServiceResourceProperties withConfig(AgriServiceConfig config) {
+ this.config = config;
+ return this;
+ }
+
+ /**
+ * Get the managedOnBehalfOfConfiguration property: Managed On Behalf Of Configuration.
+ *
+ * @return the managedOnBehalfOfConfiguration value.
+ */
+ public ManagedOnBehalfOfConfiguration managedOnBehalfOfConfiguration() {
+ return this.managedOnBehalfOfConfiguration;
+ }
+
+ /**
+ * Get the dataConnectorCredentials property: Data connector credentials of AgriService instance.
+ *
+ * @return the dataConnectorCredentials value.
+ */
+ public List dataConnectorCredentials() {
+ return this.dataConnectorCredentials;
+ }
+
+ /**
+ * Set the dataConnectorCredentials property: Data connector credentials of AgriService instance.
+ *
+ * @param dataConnectorCredentials the dataConnectorCredentials value to set.
+ * @return the AgriServiceResourceProperties object itself.
+ */
+ public AgriServiceResourceProperties
+ withDataConnectorCredentials(List dataConnectorCredentials) {
+ this.dataConnectorCredentials = dataConnectorCredentials;
+ return this;
+ }
+
+ /**
+ * Get the installedSolutions property: AgriService installed solutions.
+ *
+ * @return the installedSolutions value.
+ */
+ public List installedSolutions() {
+ return this.installedSolutions;
+ }
+
+ /**
+ * Set the installedSolutions property: AgriService installed solutions.
+ *
+ * @param installedSolutions the installedSolutions value to set.
+ * @return the AgriServiceResourceProperties object itself.
+ */
+ public AgriServiceResourceProperties withInstalledSolutions(List installedSolutions) {
+ this.installedSolutions = installedSolutions;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (config() != null) {
+ config().validate();
+ }
+ if (managedOnBehalfOfConfiguration() != null) {
+ managedOnBehalfOfConfiguration().validate();
+ }
+ if (dataConnectorCredentials() != null) {
+ dataConnectorCredentials().forEach(e -> e.validate());
+ }
+ if (installedSolutions() != null) {
+ installedSolutions().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("config", this.config);
+ jsonWriter.writeArrayField("dataConnectorCredentials", this.dataConnectorCredentials,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("installedSolutions", this.installedSolutions,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AgriServiceResourceProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AgriServiceResourceProperties 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 AgriServiceResourceProperties.
+ */
+ public static AgriServiceResourceProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AgriServiceResourceProperties deserializedAgriServiceResourceProperties
+ = new AgriServiceResourceProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("provisioningState".equals(fieldName)) {
+ deserializedAgriServiceResourceProperties.provisioningState
+ = ProvisioningState.fromString(reader.getString());
+ } else if ("config".equals(fieldName)) {
+ deserializedAgriServiceResourceProperties.config = AgriServiceConfig.fromJson(reader);
+ } else if ("managedOnBehalfOfConfiguration".equals(fieldName)) {
+ deserializedAgriServiceResourceProperties.managedOnBehalfOfConfiguration
+ = ManagedOnBehalfOfConfiguration.fromJson(reader);
+ } else if ("dataConnectorCredentials".equals(fieldName)) {
+ List dataConnectorCredentials
+ = reader.readArray(reader1 -> DataConnectorCredentialMap.fromJson(reader1));
+ deserializedAgriServiceResourceProperties.dataConnectorCredentials = dataConnectorCredentials;
+ } else if ("installedSolutions".equals(fieldName)) {
+ List installedSolutions
+ = reader.readArray(reader1 -> InstalledSolutionMap.fromJson(reader1));
+ deserializedAgriServiceResourceProperties.installedSolutions = installedSolutions;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAgriServiceResourceProperties;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceUpdate.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceUpdate.java
new file mode 100644
index 000000000000..51edfea387c7
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceUpdate.java
@@ -0,0 +1,189 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.Map;
+
+/**
+ * The type used for update operations of the AgriServiceResource.
+ */
+@Fluent
+public final class AgriServiceResourceUpdate implements JsonSerializable {
+ /*
+ * The managed service identities assigned to this resource.
+ */
+ private ManagedServiceIdentity identity;
+
+ /*
+ * The SKU (Stock Keeping Unit) assigned to this resource.
+ */
+ private Sku sku;
+
+ /*
+ * Resource tags.
+ */
+ private Map tags;
+
+ /*
+ * The resource-specific properties for this resource.
+ */
+ private AgriServiceResourceUpdateProperties properties;
+
+ /**
+ * Creates an instance of AgriServiceResourceUpdate class.
+ */
+ public AgriServiceResourceUpdate() {
+ }
+
+ /**
+ * Get the identity property: The managed service identities assigned to this resource.
+ *
+ * @return the identity value.
+ */
+ public ManagedServiceIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: The managed service identities assigned to this resource.
+ *
+ * @param identity the identity value to set.
+ * @return the AgriServiceResourceUpdate object itself.
+ */
+ public AgriServiceResourceUpdate withIdentity(ManagedServiceIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /**
+ * Get the sku property: The SKU (Stock Keeping Unit) assigned to this resource.
+ *
+ * @return the sku value.
+ */
+ public Sku sku() {
+ return this.sku;
+ }
+
+ /**
+ * Set the sku property: The SKU (Stock Keeping Unit) assigned to this resource.
+ *
+ * @param sku the sku value to set.
+ * @return the AgriServiceResourceUpdate object itself.
+ */
+ public AgriServiceResourceUpdate withSku(Sku sku) {
+ this.sku = sku;
+ return this;
+ }
+
+ /**
+ * Get the tags property: Resource tags.
+ *
+ * @return the tags value.
+ */
+ public Map tags() {
+ return this.tags;
+ }
+
+ /**
+ * Set the tags property: Resource tags.
+ *
+ * @param tags the tags value to set.
+ * @return the AgriServiceResourceUpdate object itself.
+ */
+ public AgriServiceResourceUpdate withTags(Map tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ /**
+ * Get the properties property: The resource-specific properties for this resource.
+ *
+ * @return the properties value.
+ */
+ public AgriServiceResourceUpdateProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The resource-specific properties for this resource.
+ *
+ * @param properties the properties value to set.
+ * @return the AgriServiceResourceUpdate object itself.
+ */
+ public AgriServiceResourceUpdate withProperties(AgriServiceResourceUpdateProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (identity() != null) {
+ identity().validate();
+ }
+ if (sku() != null) {
+ sku().validate();
+ }
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("identity", this.identity);
+ jsonWriter.writeJsonField("sku", this.sku);
+ jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("properties", this.properties);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AgriServiceResourceUpdate from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AgriServiceResourceUpdate 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 AgriServiceResourceUpdate.
+ */
+ public static AgriServiceResourceUpdate fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AgriServiceResourceUpdate deserializedAgriServiceResourceUpdate = new AgriServiceResourceUpdate();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("identity".equals(fieldName)) {
+ deserializedAgriServiceResourceUpdate.identity = ManagedServiceIdentity.fromJson(reader);
+ } else if ("sku".equals(fieldName)) {
+ deserializedAgriServiceResourceUpdate.sku = Sku.fromJson(reader);
+ } else if ("tags".equals(fieldName)) {
+ Map tags = reader.readMap(reader1 -> reader1.getString());
+ deserializedAgriServiceResourceUpdate.tags = tags;
+ } else if ("properties".equals(fieldName)) {
+ deserializedAgriServiceResourceUpdate.properties
+ = AgriServiceResourceUpdateProperties.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAgriServiceResourceUpdate;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceUpdateProperties.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceUpdateProperties.java
new file mode 100644
index 000000000000..27de92274728
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServiceResourceUpdateProperties.java
@@ -0,0 +1,168 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * The updatable properties of the AgriServiceResource.
+ */
+@Fluent
+public final class AgriServiceResourceUpdateProperties
+ implements JsonSerializable {
+ /*
+ * Config of the AgriService instance.
+ */
+ private AgriServiceConfig config;
+
+ /*
+ * Data connector credentials of AgriService instance.
+ */
+ private List dataConnectorCredentials;
+
+ /*
+ * AgriService installed solutions.
+ */
+ private List installedSolutions;
+
+ /**
+ * Creates an instance of AgriServiceResourceUpdateProperties class.
+ */
+ public AgriServiceResourceUpdateProperties() {
+ }
+
+ /**
+ * Get the config property: Config of the AgriService instance.
+ *
+ * @return the config value.
+ */
+ public AgriServiceConfig config() {
+ return this.config;
+ }
+
+ /**
+ * Set the config property: Config of the AgriService instance.
+ *
+ * @param config the config value to set.
+ * @return the AgriServiceResourceUpdateProperties object itself.
+ */
+ public AgriServiceResourceUpdateProperties withConfig(AgriServiceConfig config) {
+ this.config = config;
+ return this;
+ }
+
+ /**
+ * Get the dataConnectorCredentials property: Data connector credentials of AgriService instance.
+ *
+ * @return the dataConnectorCredentials value.
+ */
+ public List dataConnectorCredentials() {
+ return this.dataConnectorCredentials;
+ }
+
+ /**
+ * Set the dataConnectorCredentials property: Data connector credentials of AgriService instance.
+ *
+ * @param dataConnectorCredentials the dataConnectorCredentials value to set.
+ * @return the AgriServiceResourceUpdateProperties object itself.
+ */
+ public AgriServiceResourceUpdateProperties
+ withDataConnectorCredentials(List dataConnectorCredentials) {
+ this.dataConnectorCredentials = dataConnectorCredentials;
+ return this;
+ }
+
+ /**
+ * Get the installedSolutions property: AgriService installed solutions.
+ *
+ * @return the installedSolutions value.
+ */
+ public List installedSolutions() {
+ return this.installedSolutions;
+ }
+
+ /**
+ * Set the installedSolutions property: AgriService installed solutions.
+ *
+ * @param installedSolutions the installedSolutions value to set.
+ * @return the AgriServiceResourceUpdateProperties object itself.
+ */
+ public AgriServiceResourceUpdateProperties withInstalledSolutions(List installedSolutions) {
+ this.installedSolutions = installedSolutions;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (config() != null) {
+ config().validate();
+ }
+ if (dataConnectorCredentials() != null) {
+ dataConnectorCredentials().forEach(e -> e.validate());
+ }
+ if (installedSolutions() != null) {
+ installedSolutions().forEach(e -> e.validate());
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeJsonField("config", this.config);
+ jsonWriter.writeArrayField("dataConnectorCredentials", this.dataConnectorCredentials,
+ (writer, element) -> writer.writeJson(element));
+ jsonWriter.writeArrayField("installedSolutions", this.installedSolutions,
+ (writer, element) -> writer.writeJson(element));
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of AgriServiceResourceUpdateProperties from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of AgriServiceResourceUpdateProperties 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 AgriServiceResourceUpdateProperties.
+ */
+ public static AgriServiceResourceUpdateProperties fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ AgriServiceResourceUpdateProperties deserializedAgriServiceResourceUpdateProperties
+ = new AgriServiceResourceUpdateProperties();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("config".equals(fieldName)) {
+ deserializedAgriServiceResourceUpdateProperties.config = AgriServiceConfig.fromJson(reader);
+ } else if ("dataConnectorCredentials".equals(fieldName)) {
+ List dataConnectorCredentials
+ = reader.readArray(reader1 -> DataConnectorCredentialMap.fromJson(reader1));
+ deserializedAgriServiceResourceUpdateProperties.dataConnectorCredentials = dataConnectorCredentials;
+ } else if ("installedSolutions".equals(fieldName)) {
+ List installedSolutions
+ = reader.readArray(reader1 -> InstalledSolutionMap.fromJson(reader1));
+ deserializedAgriServiceResourceUpdateProperties.installedSolutions = installedSolutions;
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedAgriServiceResourceUpdateProperties;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServices.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServices.java
new file mode 100644
index 000000000000..d683190dbd91
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AgriServices.java
@@ -0,0 +1,184 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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 AgriServices.
+ */
+public interface AgriServices {
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource along with {@link Response}.
+ */
+ Response getByResourceGroupWithResponse(String resourceGroupName,
+ String agriServiceResourceName, Context context);
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 AgriServiceResource.
+ */
+ AgriServiceResource getByResourceGroup(String resourceGroupName, String agriServiceResourceName);
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName);
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 agriServiceResourceName, Context context);
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable list();
+
+ /**
+ * List AgriServiceResource 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 AgriServiceResource list operation as paginated response with {@link PagedIterable}.
+ */
+ PagedIterable list(Context context);
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions along with {@link Response}.
+ */
+ Response listAvailableSolutionsWithResponse(String resourceGroupName,
+ String agriServiceResourceName, Context context);
+
+ /**
+ * Returns the list of available agri solutions.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param agriServiceResourceName The name of the AgriService resource.
+ * @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 list of available agri solutions.
+ */
+ AvailableAgriSolutionListResult listAvailableSolutions(String resourceGroupName, String agriServiceResourceName);
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @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 AgriServiceResource along with {@link Response}.
+ */
+ AgriServiceResource getById(String id);
+
+ /**
+ * Get a AgriServiceResource.
+ *
+ * @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 AgriServiceResource along with {@link Response}.
+ */
+ Response getByIdWithResponse(String id, Context context);
+
+ /**
+ * Delete a AgriServiceResource.
+ *
+ * @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 AgriServiceResource.
+ *
+ * @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 AgriServiceResource resource.
+ *
+ * @param name resource name.
+ * @return the first stage of the new AgriServiceResource definition.
+ */
+ AgriServiceResource.DefinitionStages.Blank define(String name);
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AuthCredentialsKind.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AuthCredentialsKind.java
new file mode 100644
index 000000000000..ff470df33971
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AuthCredentialsKind.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.models;
+
+import com.azure.core.util.ExpandableStringEnum;
+import java.util.Collection;
+
+/**
+ * Types of different kind of Data connector auth credentials supported.
+ */
+public final class AuthCredentialsKind extends ExpandableStringEnum {
+ /**
+ * OAuth Client Credential type.
+ */
+ public static final AuthCredentialsKind OAUTH_CLIENT_CREDENTIALS = fromString("OAuthClientCredentials");
+
+ /**
+ * API Key Auth Credential type.
+ */
+ public static final AuthCredentialsKind API_KEY_AUTH_CREDENTIALS = fromString("ApiKeyAuthCredentials");
+
+ /**
+ * Creates a new instance of AuthCredentialsKind value.
+ *
+ * @deprecated Use the {@link #fromString(String)} factory method.
+ */
+ @Deprecated
+ public AuthCredentialsKind() {
+ }
+
+ /**
+ * Creates or finds a AuthCredentialsKind from its string representation.
+ *
+ * @param name a name to look for.
+ * @return the corresponding AuthCredentialsKind.
+ */
+ public static AuthCredentialsKind fromString(String name) {
+ return fromString(name, AuthCredentialsKind.class);
+ }
+
+ /**
+ * Gets known AuthCredentialsKind values.
+ *
+ * @return known AuthCredentialsKind values.
+ */
+ public static Collection values() {
+ return values(AuthCredentialsKind.class);
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AvailableAgriSolutionListResult.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AvailableAgriSolutionListResult.java
new file mode 100644
index 000000000000..6850c74741f2
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/AvailableAgriSolutionListResult.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.agricultureplatform.models;
+
+import com.azure.resourcemanager.agricultureplatform.fluent.models.AvailableAgriSolutionListResultInner;
+import java.util.List;
+
+/**
+ * An immutable client-side representation of AvailableAgriSolutionListResult.
+ */
+public interface AvailableAgriSolutionListResult {
+ /**
+ * Gets the solutions property: Agri solutions list.
+ *
+ * @return the solutions value.
+ */
+ List solutions();
+
+ /**
+ * Gets the inner com.azure.resourcemanager.agricultureplatform.fluent.models.AvailableAgriSolutionListResultInner
+ * object.
+ *
+ * @return the inner object.
+ */
+ AvailableAgriSolutionListResultInner innerModel();
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataConnectorCredentialMap.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataConnectorCredentialMap.java
new file mode 100644
index 000000000000..e4c3f9829af3
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataConnectorCredentialMap.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.agricultureplatform.models;
+
+import com.azure.core.annotation.Fluent;
+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 java.io.IOException;
+
+/**
+ * Mapping of data connector credentials.
+ */
+@Fluent
+public final class DataConnectorCredentialMap implements JsonSerializable {
+ /*
+ * The key representing the credential.
+ */
+ private String key;
+
+ /*
+ * The data connector credential value.
+ */
+ private DataConnectorCredentials value;
+
+ /**
+ * Creates an instance of DataConnectorCredentialMap class.
+ */
+ public DataConnectorCredentialMap() {
+ }
+
+ /**
+ * Get the key property: The key representing the credential.
+ *
+ * @return the key value.
+ */
+ public String key() {
+ return this.key;
+ }
+
+ /**
+ * Set the key property: The key representing the credential.
+ *
+ * @param key the key value to set.
+ * @return the DataConnectorCredentialMap object itself.
+ */
+ public DataConnectorCredentialMap withKey(String key) {
+ this.key = key;
+ return this;
+ }
+
+ /**
+ * Get the value property: The data connector credential value.
+ *
+ * @return the value value.
+ */
+ public DataConnectorCredentials value() {
+ return this.value;
+ }
+
+ /**
+ * Set the value property: The data connector credential value.
+ *
+ * @param value the value value to set.
+ * @return the DataConnectorCredentialMap object itself.
+ */
+ public DataConnectorCredentialMap withValue(DataConnectorCredentials value) {
+ this.value = value;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (key() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException("Missing required property key in model DataConnectorCredentialMap"));
+ }
+ if (value() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property value in model DataConnectorCredentialMap"));
+ } else {
+ value().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DataConnectorCredentialMap.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("key", this.key);
+ jsonWriter.writeJsonField("value", this.value);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DataConnectorCredentialMap from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DataConnectorCredentialMap 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 DataConnectorCredentialMap.
+ */
+ public static DataConnectorCredentialMap fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DataConnectorCredentialMap deserializedDataConnectorCredentialMap = new DataConnectorCredentialMap();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("key".equals(fieldName)) {
+ deserializedDataConnectorCredentialMap.key = reader.getString();
+ } else if ("value".equals(fieldName)) {
+ deserializedDataConnectorCredentialMap.value = DataConnectorCredentials.fromJson(reader);
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDataConnectorCredentialMap;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataConnectorCredentials.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataConnectorCredentials.java
new file mode 100644
index 000000000000..c842e7375fed
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataConnectorCredentials.java
@@ -0,0 +1,207 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.json.JsonReader;
+import com.azure.json.JsonSerializable;
+import com.azure.json.JsonToken;
+import com.azure.json.JsonWriter;
+import java.io.IOException;
+
+/**
+ * The properties related to an AgriService data connector.
+ */
+@Fluent
+public final class DataConnectorCredentials implements JsonSerializable {
+ /*
+ * Type of credential.
+ */
+ private AuthCredentialsKind kind;
+
+ /*
+ * Client Id associated with the provider, if type of credentials is OAuthClientCredentials.
+ */
+ private String clientId;
+
+ /*
+ * Uri of the key vault
+ */
+ private String keyVaultUri;
+
+ /*
+ * Name of the key vault key.
+ */
+ private String keyName;
+
+ /*
+ * Version of the key vault key.
+ */
+ private String keyVersion;
+
+ /**
+ * Creates an instance of DataConnectorCredentials class.
+ */
+ public DataConnectorCredentials() {
+ }
+
+ /**
+ * Get the kind property: Type of credential.
+ *
+ * @return the kind value.
+ */
+ public AuthCredentialsKind kind() {
+ return this.kind;
+ }
+
+ /**
+ * Set the kind property: Type of credential.
+ *
+ * @param kind the kind value to set.
+ * @return the DataConnectorCredentials object itself.
+ */
+ public DataConnectorCredentials withKind(AuthCredentialsKind kind) {
+ this.kind = kind;
+ return this;
+ }
+
+ /**
+ * Get the clientId property: Client Id associated with the provider, if type of credentials is
+ * OAuthClientCredentials.
+ *
+ * @return the clientId value.
+ */
+ public String clientId() {
+ return this.clientId;
+ }
+
+ /**
+ * Set the clientId property: Client Id associated with the provider, if type of credentials is
+ * OAuthClientCredentials.
+ *
+ * @param clientId the clientId value to set.
+ * @return the DataConnectorCredentials object itself.
+ */
+ public DataConnectorCredentials withClientId(String clientId) {
+ this.clientId = clientId;
+ return this;
+ }
+
+ /**
+ * Get the keyVaultUri property: Uri of the key vault.
+ *
+ * @return the keyVaultUri value.
+ */
+ public String keyVaultUri() {
+ return this.keyVaultUri;
+ }
+
+ /**
+ * Set the keyVaultUri property: Uri of the key vault.
+ *
+ * @param keyVaultUri the keyVaultUri value to set.
+ * @return the DataConnectorCredentials object itself.
+ */
+ public DataConnectorCredentials withKeyVaultUri(String keyVaultUri) {
+ this.keyVaultUri = keyVaultUri;
+ return this;
+ }
+
+ /**
+ * Get the keyName property: Name of the key vault key.
+ *
+ * @return the keyName value.
+ */
+ public String keyName() {
+ return this.keyName;
+ }
+
+ /**
+ * Set the keyName property: Name of the key vault key.
+ *
+ * @param keyName the keyName value to set.
+ * @return the DataConnectorCredentials object itself.
+ */
+ public DataConnectorCredentials withKeyName(String keyName) {
+ this.keyName = keyName;
+ return this;
+ }
+
+ /**
+ * Get the keyVersion property: Version of the key vault key.
+ *
+ * @return the keyVersion value.
+ */
+ public String keyVersion() {
+ return this.keyVersion;
+ }
+
+ /**
+ * Set the keyVersion property: Version of the key vault key.
+ *
+ * @param keyVersion the keyVersion value to set.
+ * @return the DataConnectorCredentials object itself.
+ */
+ public DataConnectorCredentials withKeyVersion(String keyVersion) {
+ this.keyVersion = keyVersion;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
+ jsonWriter.writeStringField("clientId", this.clientId);
+ jsonWriter.writeStringField("keyVaultUri", this.keyVaultUri);
+ jsonWriter.writeStringField("keyName", this.keyName);
+ jsonWriter.writeStringField("keyVersion", this.keyVersion);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DataConnectorCredentials from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DataConnectorCredentials 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 DataConnectorCredentials.
+ */
+ public static DataConnectorCredentials fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DataConnectorCredentials deserializedDataConnectorCredentials = new DataConnectorCredentials();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("kind".equals(fieldName)) {
+ deserializedDataConnectorCredentials.kind = AuthCredentialsKind.fromString(reader.getString());
+ } else if ("clientId".equals(fieldName)) {
+ deserializedDataConnectorCredentials.clientId = reader.getString();
+ } else if ("keyVaultUri".equals(fieldName)) {
+ deserializedDataConnectorCredentials.keyVaultUri = reader.getString();
+ } else if ("keyName".equals(fieldName)) {
+ deserializedDataConnectorCredentials.keyName = reader.getString();
+ } else if ("keyVersion".equals(fieldName)) {
+ deserializedDataConnectorCredentials.keyVersion = reader.getString();
+ } else {
+ reader.skipChildren();
+ }
+ }
+
+ return deserializedDataConnectorCredentials;
+ });
+ }
+}
diff --git a/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataManagerForAgricultureSolution.java b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataManagerForAgricultureSolution.java
new file mode 100644
index 000000000000..139d270f73b7
--- /dev/null
+++ b/sdk/agricultureplatform/azure-resourcemanager-agricultureplatform/src/main/java/com/azure/resourcemanager/agricultureplatform/models/DataManagerForAgricultureSolution.java
@@ -0,0 +1,275 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package com.azure.resourcemanager.agricultureplatform.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 java.io.IOException;
+import java.util.List;
+
+/**
+ * Data Manager for Agriculture solution.
+ */
+@Immutable
+public final class DataManagerForAgricultureSolution implements JsonSerializable {
+ /*
+ * Partner Id.
+ */
+ private String partnerId;
+
+ /*
+ * Solution Id.
+ */
+ private String solutionId;
+
+ /*
+ * Partner tenant Id.
+ */
+ private String partnerTenantId;
+
+ /*
+ * Data access scopes.
+ */
+ private List dataAccessScopes;
+
+ /*
+ * Marketplace offer details.
+ */
+ private MarketPlaceOfferDetails marketPlaceOfferDetails;
+
+ /*
+ * Saas application Id.
+ */
+ private String saasApplicationId;
+
+ /*
+ * Entra application Id used to access azure data manager for agriculture instance.
+ */
+ private String accessAzureDataManagerForAgricultureApplicationId;
+
+ /*
+ * Entra application name used to access azure data manager for agriculture instance.
+ */
+ private String accessAzureDataManagerForAgricultureApplicationName;
+
+ /*
+ * Whether solution inference will validate input.
+ */
+ private boolean isValidateInput;
+
+ /**
+ * Creates an instance of DataManagerForAgricultureSolution class.
+ */
+ private DataManagerForAgricultureSolution() {
+ }
+
+ /**
+ * Get the partnerId property: Partner Id.
+ *
+ * @return the partnerId value.
+ */
+ public String partnerId() {
+ return this.partnerId;
+ }
+
+ /**
+ * Get the solutionId property: Solution Id.
+ *
+ * @return the solutionId value.
+ */
+ public String solutionId() {
+ return this.solutionId;
+ }
+
+ /**
+ * Get the partnerTenantId property: Partner tenant Id.
+ *
+ * @return the partnerTenantId value.
+ */
+ public String partnerTenantId() {
+ return this.partnerTenantId;
+ }
+
+ /**
+ * Get the dataAccessScopes property: Data access scopes.
+ *
+ * @return the dataAccessScopes value.
+ */
+ public List dataAccessScopes() {
+ return this.dataAccessScopes;
+ }
+
+ /**
+ * Get the marketPlaceOfferDetails property: Marketplace offer details.
+ *
+ * @return the marketPlaceOfferDetails value.
+ */
+ public MarketPlaceOfferDetails marketPlaceOfferDetails() {
+ return this.marketPlaceOfferDetails;
+ }
+
+ /**
+ * Get the saasApplicationId property: Saas application Id.
+ *
+ * @return the saasApplicationId value.
+ */
+ public String saasApplicationId() {
+ return this.saasApplicationId;
+ }
+
+ /**
+ * Get the accessAzureDataManagerForAgricultureApplicationId property: Entra application Id used to access azure
+ * data manager for agriculture instance.
+ *
+ * @return the accessAzureDataManagerForAgricultureApplicationId value.
+ */
+ public String accessAzureDataManagerForAgricultureApplicationId() {
+ return this.accessAzureDataManagerForAgricultureApplicationId;
+ }
+
+ /**
+ * Get the accessAzureDataManagerForAgricultureApplicationName property: Entra application name used to access azure
+ * data manager for agriculture instance.
+ *
+ * @return the accessAzureDataManagerForAgricultureApplicationName value.
+ */
+ public String accessAzureDataManagerForAgricultureApplicationName() {
+ return this.accessAzureDataManagerForAgricultureApplicationName;
+ }
+
+ /**
+ * Get the isValidateInput property: Whether solution inference will validate input.
+ *
+ * @return the isValidateInput value.
+ */
+ public boolean isValidateInput() {
+ return this.isValidateInput;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (partnerId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property partnerId in model DataManagerForAgricultureSolution"));
+ }
+ if (solutionId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property solutionId in model DataManagerForAgricultureSolution"));
+ }
+ if (partnerTenantId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property partnerTenantId in model DataManagerForAgricultureSolution"));
+ }
+ if (dataAccessScopes() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property dataAccessScopes in model DataManagerForAgricultureSolution"));
+ }
+ if (marketPlaceOfferDetails() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property marketPlaceOfferDetails in model DataManagerForAgricultureSolution"));
+ } else {
+ marketPlaceOfferDetails().validate();
+ }
+ if (saasApplicationId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property saasApplicationId in model DataManagerForAgricultureSolution"));
+ }
+ if (accessAzureDataManagerForAgricultureApplicationId() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property accessAzureDataManagerForAgricultureApplicationId in model DataManagerForAgricultureSolution"));
+ }
+ if (accessAzureDataManagerForAgricultureApplicationName() == null) {
+ throw LOGGER.atError()
+ .log(new IllegalArgumentException(
+ "Missing required property accessAzureDataManagerForAgricultureApplicationName in model DataManagerForAgricultureSolution"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(DataManagerForAgricultureSolution.class);
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.writeStartObject();
+ jsonWriter.writeStringField("partnerId", this.partnerId);
+ jsonWriter.writeStringField("solutionId", this.solutionId);
+ jsonWriter.writeStringField("partnerTenantId", this.partnerTenantId);
+ jsonWriter.writeArrayField("dataAccessScopes", this.dataAccessScopes,
+ (writer, element) -> writer.writeString(element));
+ jsonWriter.writeJsonField("marketPlaceOfferDetails", this.marketPlaceOfferDetails);
+ jsonWriter.writeStringField("saasApplicationId", this.saasApplicationId);
+ jsonWriter.writeStringField("accessAzureDataManagerForAgricultureApplicationId",
+ this.accessAzureDataManagerForAgricultureApplicationId);
+ jsonWriter.writeStringField("accessAzureDataManagerForAgricultureApplicationName",
+ this.accessAzureDataManagerForAgricultureApplicationName);
+ jsonWriter.writeBooleanField("isValidateInput", this.isValidateInput);
+ return jsonWriter.writeEndObject();
+ }
+
+ /**
+ * Reads an instance of DataManagerForAgricultureSolution from the JsonReader.
+ *
+ * @param jsonReader The JsonReader being read.
+ * @return An instance of DataManagerForAgricultureSolution 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 DataManagerForAgricultureSolution.
+ */
+ public static DataManagerForAgricultureSolution fromJson(JsonReader jsonReader) throws IOException {
+ return jsonReader.readObject(reader -> {
+ DataManagerForAgricultureSolution deserializedDataManagerForAgricultureSolution
+ = new DataManagerForAgricultureSolution();
+ while (reader.nextToken() != JsonToken.END_OBJECT) {
+ String fieldName = reader.getFieldName();
+ reader.nextToken();
+
+ if ("partnerId".equals(fieldName)) {
+ deserializedDataManagerForAgricultureSolution.partnerId = reader.getString();
+ } else if ("solutionId".equals(fieldName)) {
+ deserializedDataManagerForAgricultureSolution.solutionId = reader.getString();
+ } else if ("partnerTenantId".equals(fieldName)) {
+ deserializedDataManagerForAgricultureSolution.partnerTenantId = reader.getString();
+ } else if ("dataAccessScopes".equals(fieldName)) {
+ List