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 ManagedServices service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the ManagedServices service API instance.
+ */
+ public ManagedServicesManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.managedservices")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (scopes.isEmpty()) {
+ scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
+ }
+ if (retryPolicy == null) {
+ if (retryOptions != null) {
+ retryPolicy = new RetryPolicy(retryOptions);
+ } else {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new AddHeadersFromContextPolicy());
+ policies.add(new RequestIdPolicy());
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
+ policies
+ .addAll(
+ this
+ .policies
+ .stream()
+ .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
+ .collect(Collectors.toList()));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new ManagedServicesManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of RegistrationDefinitions. It manages RegistrationDefinition.
+ *
+ * @return Resource collection API of RegistrationDefinitions.
+ */
+ public RegistrationDefinitions registrationDefinitions() {
+ if (this.registrationDefinitions == null) {
+ this.registrationDefinitions =
+ new RegistrationDefinitionsImpl(clientObject.getRegistrationDefinitions(), this);
+ }
+ return registrationDefinitions;
+ }
+
+ /**
+ * Gets the resource collection API of RegistrationAssignments. It manages RegistrationAssignment.
+ *
+ * @return Resource collection API of RegistrationAssignments.
+ */
+ public RegistrationAssignments registrationAssignments() {
+ if (this.registrationAssignments == null) {
+ this.registrationAssignments =
+ new RegistrationAssignmentsImpl(clientObject.getRegistrationAssignments(), this);
+ }
+ return registrationAssignments;
+ }
+
+ /**
+ * Gets the resource collection API of MarketplaceRegistrationDefinitions.
+ *
+ * @return Resource collection API of MarketplaceRegistrationDefinitions.
+ */
+ public MarketplaceRegistrationDefinitions marketplaceRegistrationDefinitions() {
+ if (this.marketplaceRegistrationDefinitions == null) {
+ this.marketplaceRegistrationDefinitions =
+ new MarketplaceRegistrationDefinitionsImpl(clientObject.getMarketplaceRegistrationDefinitions(), this);
+ }
+ return marketplaceRegistrationDefinitions;
+ }
+
+ /**
+ * Gets the resource collection API of MarketplaceRegistrationDefinitionsWithoutScopes.
+ *
+ * @return Resource collection API of MarketplaceRegistrationDefinitionsWithoutScopes.
+ */
+ public MarketplaceRegistrationDefinitionsWithoutScopes marketplaceRegistrationDefinitionsWithoutScopes() {
+ if (this.marketplaceRegistrationDefinitionsWithoutScopes == null) {
+ this.marketplaceRegistrationDefinitionsWithoutScopes =
+ new MarketplaceRegistrationDefinitionsWithoutScopesImpl(
+ clientObject.getMarketplaceRegistrationDefinitionsWithoutScopes(), this);
+ }
+ return marketplaceRegistrationDefinitionsWithoutScopes;
+ }
+
+ /**
+ * 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 OperationsWithScopes.
+ *
+ * @return Resource collection API of OperationsWithScopes.
+ */
+ public OperationsWithScopes operationsWithScopes() {
+ if (this.operationsWithScopes == null) {
+ this.operationsWithScopes = new OperationsWithScopesImpl(clientObject.getOperationsWithScopes(), this);
+ }
+ return operationsWithScopes;
+ }
+
+ /**
+ * @return Wrapped service client ManagedServicesClient providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ */
+ public ManagedServicesClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/ManagedServicesClient.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/ManagedServicesClient.java
new file mode 100644
index 000000000000..0fde0e809f0a
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/ManagedServicesClient.java
@@ -0,0 +1,81 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for ManagedServicesClient class. */
+public interface ManagedServicesClient {
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the RegistrationDefinitionsClient object to access its operations.
+ *
+ * @return the RegistrationDefinitionsClient object.
+ */
+ RegistrationDefinitionsClient getRegistrationDefinitions();
+
+ /**
+ * Gets the RegistrationAssignmentsClient object to access its operations.
+ *
+ * @return the RegistrationAssignmentsClient object.
+ */
+ RegistrationAssignmentsClient getRegistrationAssignments();
+
+ /**
+ * Gets the MarketplaceRegistrationDefinitionsClient object to access its operations.
+ *
+ * @return the MarketplaceRegistrationDefinitionsClient object.
+ */
+ MarketplaceRegistrationDefinitionsClient getMarketplaceRegistrationDefinitions();
+
+ /**
+ * Gets the MarketplaceRegistrationDefinitionsWithoutScopesClient object to access its operations.
+ *
+ * @return the MarketplaceRegistrationDefinitionsWithoutScopesClient object.
+ */
+ MarketplaceRegistrationDefinitionsWithoutScopesClient getMarketplaceRegistrationDefinitionsWithoutScopes();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the OperationsWithScopesClient object to access its operations.
+ *
+ * @return the OperationsWithScopesClient object.
+ */
+ OperationsWithScopesClient getOperationsWithScopes();
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/MarketplaceRegistrationDefinitionsClient.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/MarketplaceRegistrationDefinitionsClient.java
new file mode 100644
index 000000000000..83068330d7ac
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/MarketplaceRegistrationDefinitionsClient.java
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.util.Context;
+import com.azure.resourcemanager.managedservices.fluent.models.MarketplaceRegistrationDefinitionInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in MarketplaceRegistrationDefinitionsClient.
+ */
+public interface MarketplaceRegistrationDefinitionsClient {
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the 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 list of the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String scope);
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String scope, String filter, Context context);
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String scope, String marketplaceIdentifier, Context context);
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MarketplaceRegistrationDefinitionInner get(String scope, String marketplaceIdentifier);
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/MarketplaceRegistrationDefinitionsWithoutScopesClient.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/MarketplaceRegistrationDefinitionsWithoutScopesClient.java
new file mode 100644
index 000000000000..90b3fdb97a05
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/MarketplaceRegistrationDefinitionsWithoutScopesClient.java
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.util.Context;
+import com.azure.resourcemanager.managedservices.fluent.models.MarketplaceRegistrationDefinitionInner;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * MarketplaceRegistrationDefinitionsWithoutScopesClient.
+ */
+public interface MarketplaceRegistrationDefinitionsWithoutScopesClient {
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String filter, Context context);
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String marketplaceIdentifier, Context context);
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ MarketplaceRegistrationDefinitionInner get(String marketplaceIdentifier);
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/OperationsClient.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/OperationsClient.java
new file mode 100644
index 000000000000..58610c3ef3ad
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/OperationsClient.java
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.managedservices.fluent.models.OperationListInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Gets a list of the operations.
+ *
+ * @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 the operations along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listWithResponse(Context context);
+
+ /**
+ * Gets a list of the operations.
+ *
+ * @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 the operations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ OperationListInner list();
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/OperationsWithScopesClient.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/OperationsWithScopesClient.java
new file mode 100644
index 000000000000..75b5216a500f
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/OperationsWithScopesClient.java
@@ -0,0 +1,39 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.managedservices.fluent.models.OperationListInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsWithScopesClient. */
+public interface OperationsWithScopesClient {
+ /**
+ * Gets a list of the operations with the scope.
+ *
+ * @param scope The scope of the 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 list of the operations with the scope along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listWithResponse(String scope, Context context);
+
+ /**
+ * Gets a list of the operations with the scope.
+ *
+ * @param scope The scope of the 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 list of the operations with the scope.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ OperationListInner list(String scope);
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/RegistrationAssignmentsClient.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/RegistrationAssignmentsClient.java
new file mode 100644
index 000000000000..42f1d1885e8e
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/RegistrationAssignmentsClient.java
@@ -0,0 +1,190 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.managedservices.fluent.models.RegistrationAssignmentInner;
+
+/** An instance of this class provides access to all the operations defined in RegistrationAssignmentsClient. */
+public interface RegistrationAssignmentsClient {
+ /**
+ * Gets the details of the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @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 details of the specified registration assignment along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String scope, String registrationAssignmentId, Boolean expandRegistrationDefinition, Context context);
+
+ /**
+ * Gets the details of the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 details of the specified registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RegistrationAssignmentInner get(String scope, String registrationAssignmentId);
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId);
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId, Context context);
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId);
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId, Context context);
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 the registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, RegistrationAssignmentInner> beginCreateOrUpdate(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody);
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 the registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, RegistrationAssignmentInner> beginCreateOrUpdate(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody, Context context);
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RegistrationAssignmentInner createOrUpdate(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody);
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RegistrationAssignmentInner createOrUpdate(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody, Context context);
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the 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 list of the registration assignments as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String scope);
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the resource.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration assignments as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(
+ String scope, Boolean expandRegistrationDefinition, String filter, Context context);
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/RegistrationDefinitionsClient.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/RegistrationDefinitionsClient.java
new file mode 100644
index 000000000000..87ca4c11eb3b
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/RegistrationDefinitionsClient.java
@@ -0,0 +1,159 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.managedservices.fluent.models.RegistrationDefinitionInner;
+
+/** An instance of this class provides access to all the operations defined in RegistrationDefinitionsClient. */
+public interface RegistrationDefinitionsClient {
+ /**
+ * Gets the registration definition details.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @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 registration definition details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String scope, String registrationDefinitionId, Context context);
+
+ /**
+ * Gets the registration definition details.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @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 registration definition details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RegistrationDefinitionInner get(String scope, String registrationDefinitionId);
+
+ /**
+ * Deletes the registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the 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 Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String registrationDefinitionId, String scope, Context context);
+
+ /**
+ * Deletes the registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the 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 registrationDefinitionId, String scope);
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 the registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, RegistrationDefinitionInner> beginCreateOrUpdate(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody);
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 the registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, RegistrationDefinitionInner> beginCreateOrUpdate(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody, Context context);
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RegistrationDefinitionInner createOrUpdate(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody);
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ RegistrationDefinitionInner createOrUpdate(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody, Context context);
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the 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 list of the registration definitions as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String scope);
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration definitions as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String scope, String filter, Context context);
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/MarketplaceRegistrationDefinitionInner.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/MarketplaceRegistrationDefinitionInner.java
new file mode 100644
index 000000000000..f2545dd767c4
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/MarketplaceRegistrationDefinitionInner.java
@@ -0,0 +1,86 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinitionProperties;
+import com.azure.resourcemanager.managedservices.models.Plan;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The MarketplaceRegistrationDefinition model. */
+@Fluent
+public final class MarketplaceRegistrationDefinitionInner extends ProxyResource {
+ /*
+ * The properties of the marketplace registration definition.
+ */
+ @JsonProperty(value = "properties")
+ private MarketplaceRegistrationDefinitionProperties properties;
+
+ /*
+ * The details for the Managed Services offer’s plan in Azure Marketplace.
+ */
+ @JsonProperty(value = "plan")
+ private Plan plan;
+
+ /** Creates an instance of MarketplaceRegistrationDefinitionInner class. */
+ public MarketplaceRegistrationDefinitionInner() {
+ }
+
+ /**
+ * Get the properties property: The properties of the marketplace registration definition.
+ *
+ * @return the properties value.
+ */
+ public MarketplaceRegistrationDefinitionProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The properties of the marketplace registration definition.
+ *
+ * @param properties the properties value to set.
+ * @return the MarketplaceRegistrationDefinitionInner object itself.
+ */
+ public MarketplaceRegistrationDefinitionInner withProperties(
+ MarketplaceRegistrationDefinitionProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the plan property: The details for the Managed Services offer’s plan in Azure Marketplace.
+ *
+ * @return the plan value.
+ */
+ public Plan plan() {
+ return this.plan;
+ }
+
+ /**
+ * Set the plan property: The details for the Managed Services offer’s plan in Azure Marketplace.
+ *
+ * @param plan the plan value to set.
+ * @return the MarketplaceRegistrationDefinitionInner object itself.
+ */
+ public MarketplaceRegistrationDefinitionInner withPlan(Plan plan) {
+ this.plan = plan;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ if (plan() != null) {
+ plan().validate();
+ }
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/OperationListInner.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/OperationListInner.java
new file mode 100644
index 000000000000..044a95661321
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/OperationListInner.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.resourcemanager.managedservices.models.Operation;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The list of the operations. */
+@Immutable
+public final class OperationListInner {
+ /*
+ * The list of Microsoft.ManagedServices operations.
+ */
+ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
+ private List value;
+
+ /** Creates an instance of OperationListInner class. */
+ public OperationListInner() {
+ }
+
+ /**
+ * Get the value property: The list of Microsoft.ManagedServices operations.
+ *
+ * @return the value value.
+ */
+ public List value() {
+ return this.value;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (value() != null) {
+ value().forEach(e -> e.validate());
+ }
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/RegistrationAssignmentInner.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/RegistrationAssignmentInner.java
new file mode 100644
index 000000000000..534e81c426b3
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/RegistrationAssignmentInner.java
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.managedservices.models.RegistrationAssignmentProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The registration assignment. */
+@Fluent
+public final class RegistrationAssignmentInner extends ProxyResource {
+ /*
+ * The properties of a registration assignment.
+ */
+ @JsonProperty(value = "properties")
+ private RegistrationAssignmentProperties properties;
+
+ /*
+ * The metadata for the registration assignment resource.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of RegistrationAssignmentInner class. */
+ public RegistrationAssignmentInner() {
+ }
+
+ /**
+ * Get the properties property: The properties of a registration assignment.
+ *
+ * @return the properties value.
+ */
+ public RegistrationAssignmentProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The properties of a registration assignment.
+ *
+ * @param properties the properties value to set.
+ * @return the RegistrationAssignmentInner object itself.
+ */
+ public RegistrationAssignmentInner withProperties(RegistrationAssignmentProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: The metadata for the registration assignment resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/RegistrationDefinitionInner.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/RegistrationDefinitionInner.java
new file mode 100644
index 000000000000..ae12ca8a7958
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/RegistrationDefinitionInner.java
@@ -0,0 +1,101 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.ProxyResource;
+import com.azure.core.management.SystemData;
+import com.azure.resourcemanager.managedservices.models.Plan;
+import com.azure.resourcemanager.managedservices.models.RegistrationDefinitionProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The registration definition. */
+@Fluent
+public final class RegistrationDefinitionInner extends ProxyResource {
+ /*
+ * The properties of a registration definition.
+ */
+ @JsonProperty(value = "properties")
+ private RegistrationDefinitionProperties properties;
+
+ /*
+ * The details for the Managed Services offer’s plan in Azure Marketplace.
+ */
+ @JsonProperty(value = "plan")
+ private Plan plan;
+
+ /*
+ * The metadata for the registration assignment resource.
+ */
+ @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
+ private SystemData systemData;
+
+ /** Creates an instance of RegistrationDefinitionInner class. */
+ public RegistrationDefinitionInner() {
+ }
+
+ /**
+ * Get the properties property: The properties of a registration definition.
+ *
+ * @return the properties value.
+ */
+ public RegistrationDefinitionProperties properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The properties of a registration definition.
+ *
+ * @param properties the properties value to set.
+ * @return the RegistrationDefinitionInner object itself.
+ */
+ public RegistrationDefinitionInner withProperties(RegistrationDefinitionProperties properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the plan property: The details for the Managed Services offer’s plan in Azure Marketplace.
+ *
+ * @return the plan value.
+ */
+ public Plan plan() {
+ return this.plan;
+ }
+
+ /**
+ * Set the plan property: The details for the Managed Services offer’s plan in Azure Marketplace.
+ *
+ * @param plan the plan value to set.
+ * @return the RegistrationDefinitionInner object itself.
+ */
+ public RegistrationDefinitionInner withPlan(Plan plan) {
+ this.plan = plan;
+ return this;
+ }
+
+ /**
+ * Get the systemData property: The metadata for the registration assignment resource.
+ *
+ * @return the systemData value.
+ */
+ public SystemData systemData() {
+ return this.systemData;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (properties() != null) {
+ properties().validate();
+ }
+ if (plan() != null) {
+ plan().validate();
+ }
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/package-info.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/package-info.java
new file mode 100644
index 000000000000..de64906447bd
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/models/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the inner data models for ManagedServicesClient. The specification for ManagedServices. */
+package com.azure.resourcemanager.managedservices.fluent.models;
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/package-info.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/package-info.java
new file mode 100644
index 000000000000..af4a9b5447c8
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/fluent/package-info.java
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/** Package containing the service clients for ManagedServicesClient. The specification for ManagedServices. */
+package com.azure.resourcemanager.managedservices.fluent;
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/ManagedServicesClientBuilder.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/ManagedServicesClientBuilder.java
new file mode 100644
index 000000000000..3fdc4986250f
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/ManagedServicesClientBuilder.java
@@ -0,0 +1,123 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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 ManagedServicesClientImpl type. */
+@ServiceClientBuilder(serviceClients = {ManagedServicesClientImpl.class})
+public final class ManagedServicesClientBuilder {
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the ManagedServicesClientBuilder.
+ */
+ public ManagedServicesClientBuilder endpoint(String endpoint) {
+ this.endpoint = endpoint;
+ return this;
+ }
+
+ /*
+ * The environment to connect to
+ */
+ private AzureEnvironment environment;
+
+ /**
+ * Sets The environment to connect to.
+ *
+ * @param environment the environment value.
+ * @return the ManagedServicesClientBuilder.
+ */
+ public ManagedServicesClientBuilder 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 ManagedServicesClientBuilder.
+ */
+ public ManagedServicesClientBuilder 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 ManagedServicesClientBuilder.
+ */
+ public ManagedServicesClientBuilder 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 ManagedServicesClientBuilder.
+ */
+ public ManagedServicesClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of ManagedServicesClientImpl with the provided parameters.
+ *
+ * @return an instance of ManagedServicesClientImpl.
+ */
+ public ManagedServicesClientImpl 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();
+ ManagedServicesClientImpl client =
+ new ManagedServicesClientImpl(
+ localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint);
+ return client;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/ManagedServicesClientImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/ManagedServicesClientImpl.java
new file mode 100644
index 000000000000..cdbaaac12d96
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/ManagedServicesClientImpl.java
@@ -0,0 +1,346 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.implementation;
+
+import com.azure.core.annotation.ServiceClient;
+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.managedservices.fluent.ManagedServicesClient;
+import com.azure.resourcemanager.managedservices.fluent.MarketplaceRegistrationDefinitionsClient;
+import com.azure.resourcemanager.managedservices.fluent.MarketplaceRegistrationDefinitionsWithoutScopesClient;
+import com.azure.resourcemanager.managedservices.fluent.OperationsClient;
+import com.azure.resourcemanager.managedservices.fluent.OperationsWithScopesClient;
+import com.azure.resourcemanager.managedservices.fluent.RegistrationAssignmentsClient;
+import com.azure.resourcemanager.managedservices.fluent.RegistrationDefinitionsClient;
+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 ManagedServicesClientImpl type. */
+@ServiceClient(builder = ManagedServicesClientBuilder.class)
+public final class ManagedServicesClientImpl implements ManagedServicesClient {
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /** The serializer to serialize an object into a string. */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /** The default poll interval for long-running operation. */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /** The RegistrationDefinitionsClient object to access its operations. */
+ private final RegistrationDefinitionsClient registrationDefinitions;
+
+ /**
+ * Gets the RegistrationDefinitionsClient object to access its operations.
+ *
+ * @return the RegistrationDefinitionsClient object.
+ */
+ public RegistrationDefinitionsClient getRegistrationDefinitions() {
+ return this.registrationDefinitions;
+ }
+
+ /** The RegistrationAssignmentsClient object to access its operations. */
+ private final RegistrationAssignmentsClient registrationAssignments;
+
+ /**
+ * Gets the RegistrationAssignmentsClient object to access its operations.
+ *
+ * @return the RegistrationAssignmentsClient object.
+ */
+ public RegistrationAssignmentsClient getRegistrationAssignments() {
+ return this.registrationAssignments;
+ }
+
+ /** The MarketplaceRegistrationDefinitionsClient object to access its operations. */
+ private final MarketplaceRegistrationDefinitionsClient marketplaceRegistrationDefinitions;
+
+ /**
+ * Gets the MarketplaceRegistrationDefinitionsClient object to access its operations.
+ *
+ * @return the MarketplaceRegistrationDefinitionsClient object.
+ */
+ public MarketplaceRegistrationDefinitionsClient getMarketplaceRegistrationDefinitions() {
+ return this.marketplaceRegistrationDefinitions;
+ }
+
+ /** The MarketplaceRegistrationDefinitionsWithoutScopesClient object to access its operations. */
+ private final MarketplaceRegistrationDefinitionsWithoutScopesClient marketplaceRegistrationDefinitionsWithoutScopes;
+
+ /**
+ * Gets the MarketplaceRegistrationDefinitionsWithoutScopesClient object to access its operations.
+ *
+ * @return the MarketplaceRegistrationDefinitionsWithoutScopesClient object.
+ */
+ public MarketplaceRegistrationDefinitionsWithoutScopesClient getMarketplaceRegistrationDefinitionsWithoutScopes() {
+ return this.marketplaceRegistrationDefinitionsWithoutScopes;
+ }
+
+ /** 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 OperationsWithScopesClient object to access its operations. */
+ private final OperationsWithScopesClient operationsWithScopes;
+
+ /**
+ * Gets the OperationsWithScopesClient object to access its operations.
+ *
+ * @return the OperationsWithScopesClient object.
+ */
+ public OperationsWithScopesClient getOperationsWithScopes() {
+ return this.operationsWithScopes;
+ }
+
+ /**
+ * Initializes an instance of ManagedServicesClient 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 server parameter.
+ */
+ ManagedServicesClientImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.endpoint = endpoint;
+ this.apiVersion = "2022-10-01";
+ this.registrationDefinitions = new RegistrationDefinitionsClientImpl(this);
+ this.registrationAssignments = new RegistrationAssignmentsClientImpl(this);
+ this.marketplaceRegistrationDefinitions = new MarketplaceRegistrationDefinitionsClientImpl(this);
+ this.marketplaceRegistrationDefinitionsWithoutScopes =
+ new MarketplaceRegistrationDefinitionsWithoutScopesClientImpl(this);
+ this.operations = new OperationsClientImpl(this);
+ this.operationsWithScopes = new OperationsWithScopesClientImpl(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(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(ManagedServicesClientImpl.class);
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionImpl.java
new file mode 100644
index 000000000000..9d0e3a57cdaa
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionImpl.java
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.implementation;
+
+import com.azure.resourcemanager.managedservices.fluent.models.MarketplaceRegistrationDefinitionInner;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinition;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinitionProperties;
+import com.azure.resourcemanager.managedservices.models.Plan;
+
+public final class MarketplaceRegistrationDefinitionImpl implements MarketplaceRegistrationDefinition {
+ private MarketplaceRegistrationDefinitionInner innerObject;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ MarketplaceRegistrationDefinitionImpl(
+ MarketplaceRegistrationDefinitionInner innerObject,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public MarketplaceRegistrationDefinitionProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public Plan plan() {
+ return this.innerModel().plan();
+ }
+
+ public MarketplaceRegistrationDefinitionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsClientImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsClientImpl.java
new file mode 100644
index 000000000000..89d631919a41
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsClientImpl.java
@@ -0,0 +1,472 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.managedservices.fluent.MarketplaceRegistrationDefinitionsClient;
+import com.azure.resourcemanager.managedservices.fluent.models.MarketplaceRegistrationDefinitionInner;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinitionList;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in MarketplaceRegistrationDefinitionsClient.
+ */
+public final class MarketplaceRegistrationDefinitionsClientImpl implements MarketplaceRegistrationDefinitionsClient {
+ /** The proxy service used to perform REST calls. */
+ private final MarketplaceRegistrationDefinitionsService service;
+
+ /** The service client containing this operation class. */
+ private final ManagedServicesClientImpl client;
+
+ /**
+ * Initializes an instance of MarketplaceRegistrationDefinitionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ MarketplaceRegistrationDefinitionsClientImpl(ManagedServicesClientImpl client) {
+ this.service =
+ RestProxy
+ .create(
+ MarketplaceRegistrationDefinitionsService.class,
+ client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ManagedServicesClientMarketplaceRegistrationDefinitions to be used by
+ * the proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ManagedServicesClien")
+ private interface MarketplaceRegistrationDefinitionsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/{scope}/providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @QueryParam("$filter") String filter,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/{scope}/providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions/{marketplaceIdentifier}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @PathParam("marketplaceIdentifier") String marketplaceIdentifier,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String scope, String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(this.client.getEndpoint(), scope, filter, 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()));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String scope, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), scope, filter, this.client.getApiVersion(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String scope, String filter) {
+ return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the 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 list of the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String scope) {
+ final String filter = null;
+ return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String scope, String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(scope, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the 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 list of the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String scope) {
+ final String filter = null;
+ return new PagedIterable<>(listAsync(scope, filter));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String scope, String filter, Context context) {
+ return new PagedIterable<>(listAsync(scope, filter, context));
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String scope, String marketplaceIdentifier) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (marketplaceIdentifier == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter marketplaceIdentifier is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ scope,
+ marketplaceIdentifier,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String scope, String marketplaceIdentifier, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (marketplaceIdentifier == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter marketplaceIdentifier is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(this.client.getEndpoint(), scope, marketplaceIdentifier, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String scope, String marketplaceIdentifier) {
+ return getWithResponseAsync(scope, marketplaceIdentifier).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String scope, String marketplaceIdentifier, Context context) {
+ return getWithResponseAsync(scope, marketplaceIdentifier, context).block();
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param scope The scope of the resource.
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MarketplaceRegistrationDefinitionInner get(String scope, String marketplaceIdentifier) {
+ return getWithResponse(scope, marketplaceIdentifier, Context.NONE).getValue();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @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 marketplace registration definitions 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
+ * The nextLink parameter.
+ * @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 marketplace registration definitions 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/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsImpl.java
new file mode 100644
index 000000000000..09b225625008
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsImpl.java
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.managedservices.fluent.MarketplaceRegistrationDefinitionsClient;
+import com.azure.resourcemanager.managedservices.fluent.models.MarketplaceRegistrationDefinitionInner;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinition;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinitions;
+
+public final class MarketplaceRegistrationDefinitionsImpl implements MarketplaceRegistrationDefinitions {
+ private static final ClientLogger LOGGER = new ClientLogger(MarketplaceRegistrationDefinitionsImpl.class);
+
+ private final MarketplaceRegistrationDefinitionsClient innerClient;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ public MarketplaceRegistrationDefinitionsImpl(
+ MarketplaceRegistrationDefinitionsClient innerClient,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String scope) {
+ PagedIterable inner = this.serviceClient().list(scope);
+ return Utils.mapPage(inner, inner1 -> new MarketplaceRegistrationDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String scope, String filter, Context context) {
+ PagedIterable inner = this.serviceClient().list(scope, filter, context);
+ return Utils.mapPage(inner, inner1 -> new MarketplaceRegistrationDefinitionImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(
+ String scope, String marketplaceIdentifier, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(scope, marketplaceIdentifier, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new MarketplaceRegistrationDefinitionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public MarketplaceRegistrationDefinition get(String scope, String marketplaceIdentifier) {
+ MarketplaceRegistrationDefinitionInner inner = this.serviceClient().get(scope, marketplaceIdentifier);
+ if (inner != null) {
+ return new MarketplaceRegistrationDefinitionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private MarketplaceRegistrationDefinitionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsWithoutScopesClientImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsWithoutScopesClientImpl.java
new file mode 100644
index 000000000000..83e610313f4d
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsWithoutScopesClientImpl.java
@@ -0,0 +1,442 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.managedservices.fluent.MarketplaceRegistrationDefinitionsWithoutScopesClient;
+import com.azure.resourcemanager.managedservices.fluent.models.MarketplaceRegistrationDefinitionInner;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinitionList;
+import reactor.core.publisher.Mono;
+
+/**
+ * An instance of this class provides access to all the operations defined in
+ * MarketplaceRegistrationDefinitionsWithoutScopesClient.
+ */
+public final class MarketplaceRegistrationDefinitionsWithoutScopesClientImpl
+ implements MarketplaceRegistrationDefinitionsWithoutScopesClient {
+ /** The proxy service used to perform REST calls. */
+ private final MarketplaceRegistrationDefinitionsWithoutScopesService service;
+
+ /** The service client containing this operation class. */
+ private final ManagedServicesClientImpl client;
+
+ /**
+ * Initializes an instance of MarketplaceRegistrationDefinitionsWithoutScopesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ MarketplaceRegistrationDefinitionsWithoutScopesClientImpl(ManagedServicesClientImpl client) {
+ this.service =
+ RestProxy
+ .create(
+ MarketplaceRegistrationDefinitionsWithoutScopesService.class,
+ client.getHttpPipeline(),
+ client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ManagedServicesClientMarketplaceRegistrationDefinitionsWithoutScopes
+ * to be used by the proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ManagedServicesClien")
+ private interface MarketplaceRegistrationDefinitionsWithoutScopesService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("$filter") String filter,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.ManagedServices/marketplaceRegistrationDefinitions/{marketplaceIdentifier}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam("marketplaceIdentifier") String marketplaceIdentifier,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String filter) {
+ 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(), filter, 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()));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String filter, 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(), filter, this.client.getApiVersion(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String filter) {
+ return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ final String filter = null;
+ return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ final String filter = null;
+ return new PagedIterable<>(listAsync(filter));
+ }
+
+ /**
+ * Gets a list of the marketplace registration definitions for the marketplace identifier.
+ *
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the marketplace registration definitions for the marketplace identifier as paginated response
+ * with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String filter, Context context) {
+ return new PagedIterable<>(listAsync(filter, context));
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(String marketplaceIdentifier) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (marketplaceIdentifier == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter marketplaceIdentifier is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ marketplaceIdentifier,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier along with {@link Response} on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String marketplaceIdentifier, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (marketplaceIdentifier == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter marketplaceIdentifier is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(this.client.getEndpoint(), marketplaceIdentifier, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String marketplaceIdentifier) {
+ return getWithResponseAsync(marketplaceIdentifier).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String marketplaceIdentifier, Context context) {
+ return getWithResponseAsync(marketplaceIdentifier, context).block();
+ }
+
+ /**
+ * Get the marketplace registration definition for the marketplace identifier.
+ *
+ * @param marketplaceIdentifier The Azure Marketplace identifier. Expected formats:
+ * {publisher}.{product[-preview]}.{planName}.{version} or {publisher}.{product[-preview]}.{planName} or
+ * {publisher}.{product[-preview]} or {publisher}).
+ * @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 marketplace registration definition for the marketplace identifier.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public MarketplaceRegistrationDefinitionInner get(String marketplaceIdentifier) {
+ return getWithResponse(marketplaceIdentifier, Context.NONE).getValue();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @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 marketplace registration definitions 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
+ * The nextLink parameter.
+ * @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 marketplace registration definitions 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/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsWithoutScopesImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsWithoutScopesImpl.java
new file mode 100644
index 000000000000..a7cc1a43f016
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/MarketplaceRegistrationDefinitionsWithoutScopesImpl.java
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.managedservices.fluent.MarketplaceRegistrationDefinitionsWithoutScopesClient;
+import com.azure.resourcemanager.managedservices.fluent.models.MarketplaceRegistrationDefinitionInner;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinition;
+import com.azure.resourcemanager.managedservices.models.MarketplaceRegistrationDefinitionsWithoutScopes;
+
+public final class MarketplaceRegistrationDefinitionsWithoutScopesImpl
+ implements MarketplaceRegistrationDefinitionsWithoutScopes {
+ private static final ClientLogger LOGGER =
+ new ClientLogger(MarketplaceRegistrationDefinitionsWithoutScopesImpl.class);
+
+ private final MarketplaceRegistrationDefinitionsWithoutScopesClient innerClient;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ public MarketplaceRegistrationDefinitionsWithoutScopesImpl(
+ MarketplaceRegistrationDefinitionsWithoutScopesClient innerClient,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new MarketplaceRegistrationDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String filter, Context context) {
+ PagedIterable inner = this.serviceClient().list(filter, context);
+ return Utils.mapPage(inner, inner1 -> new MarketplaceRegistrationDefinitionImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(String marketplaceIdentifier, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(marketplaceIdentifier, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new MarketplaceRegistrationDefinitionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public MarketplaceRegistrationDefinition get(String marketplaceIdentifier) {
+ MarketplaceRegistrationDefinitionInner inner = this.serviceClient().get(marketplaceIdentifier);
+ if (inner != null) {
+ return new MarketplaceRegistrationDefinitionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private MarketplaceRegistrationDefinitionsWithoutScopesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationListImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationListImpl.java
new file mode 100644
index 000000000000..80f3864047d3
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationListImpl.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.implementation;
+
+import com.azure.resourcemanager.managedservices.fluent.models.OperationListInner;
+import com.azure.resourcemanager.managedservices.models.Operation;
+import com.azure.resourcemanager.managedservices.models.OperationList;
+import java.util.Collections;
+import java.util.List;
+
+public final class OperationListImpl implements OperationList {
+ private OperationListInner innerObject;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ OperationListImpl(
+ OperationListInner innerObject,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public List value() {
+ List inner = this.innerModel().value();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public OperationListInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsClientImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsClientImpl.java
new file mode 100644
index 000000000000..d34863145fc9
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsClientImpl.java
@@ -0,0 +1,145 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.managedservices.fluent.OperationsClient;
+import com.azure.resourcemanager.managedservices.fluent.models.OperationListInner;
+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 ManagedServicesClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsClientImpl(ManagedServicesClientImpl client) {
+ this.service =
+ RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ManagedServicesClientOperations to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ManagedServicesClien")
+ private interface OperationsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/providers/Microsoft.ManagedServices/operations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets a list of the operations.
+ *
+ * @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 the operations along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listWithResponseAsync() {
+ 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))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets a list of the operations.
+ *
+ * @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 the operations along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listWithResponseAsync(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);
+ }
+
+ /**
+ * Gets a list of the operations.
+ *
+ * @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 the operations on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono listAsync() {
+ return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets a list of the operations.
+ *
+ * @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 the operations along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response listWithResponse(Context context) {
+ return listWithResponseAsync(context).block();
+ }
+
+ /**
+ * Gets a list of the operations.
+ *
+ * @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 the operations.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public OperationListInner list() {
+ return listWithResponse(Context.NONE).getValue();
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsImpl.java
new file mode 100644
index 000000000000..c0c5a33bde7e
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsImpl.java
@@ -0,0 +1,58 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.implementation;
+
+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.managedservices.fluent.OperationsClient;
+import com.azure.resourcemanager.managedservices.fluent.models.OperationListInner;
+import com.azure.resourcemanager.managedservices.models.OperationList;
+import com.azure.resourcemanager.managedservices.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.managedservices.ManagedServicesManager serviceManager;
+
+ public OperationsImpl(
+ OperationsClient innerClient, com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response listWithResponse(Context context) {
+ Response inner = this.serviceClient().listWithResponse(context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new OperationListImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public OperationList list() {
+ OperationListInner inner = this.serviceClient().list();
+ if (inner != null) {
+ return new OperationListImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private OperationsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsWithScopesClientImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsWithScopesClientImpl.java
new file mode 100644
index 000000000000..3958f6262793
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsWithScopesClientImpl.java
@@ -0,0 +1,164 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.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.managedservices.fluent.OperationsWithScopesClient;
+import com.azure.resourcemanager.managedservices.fluent.models.OperationListInner;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in OperationsWithScopesClient. */
+public final class OperationsWithScopesClientImpl implements OperationsWithScopesClient {
+ /** The proxy service used to perform REST calls. */
+ private final OperationsWithScopesService service;
+
+ /** The service client containing this operation class. */
+ private final ManagedServicesClientImpl client;
+
+ /**
+ * Initializes an instance of OperationsWithScopesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ OperationsWithScopesClientImpl(ManagedServicesClientImpl client) {
+ this.service =
+ RestProxy
+ .create(OperationsWithScopesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ManagedServicesClientOperationsWithScopes to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ManagedServicesClien")
+ private interface OperationsWithScopesService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/{scope}/providers/Microsoft.ManagedServices/operations")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets a list of the operations with the scope.
+ *
+ * @param scope The scope of the 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 list of the operations with the scope along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listWithResponseAsync(String scope) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets a list of the operations with the scope.
+ *
+ * @param scope The scope of the 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 list of the operations with the scope along with {@link Response} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listWithResponseAsync(String scope, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context);
+ }
+
+ /**
+ * Gets a list of the operations with the scope.
+ *
+ * @param scope The scope of the 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 list of the operations with the scope on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono listAsync(String scope) {
+ return listWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets a list of the operations with the scope.
+ *
+ * @param scope The scope of the 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 list of the operations with the scope along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response listWithResponse(String scope, Context context) {
+ return listWithResponseAsync(scope, context).block();
+ }
+
+ /**
+ * Gets a list of the operations with the scope.
+ *
+ * @param scope The scope of the 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 list of the operations with the scope.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public OperationListInner list(String scope) {
+ return listWithResponse(scope, Context.NONE).getValue();
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsWithScopesImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsWithScopesImpl.java
new file mode 100644
index 000000000000..f586241cc0f5
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/OperationsWithScopesImpl.java
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.implementation;
+
+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.managedservices.fluent.OperationsWithScopesClient;
+import com.azure.resourcemanager.managedservices.fluent.models.OperationListInner;
+import com.azure.resourcemanager.managedservices.models.OperationList;
+import com.azure.resourcemanager.managedservices.models.OperationsWithScopes;
+
+public final class OperationsWithScopesImpl implements OperationsWithScopes {
+ private static final ClientLogger LOGGER = new ClientLogger(OperationsWithScopesImpl.class);
+
+ private final OperationsWithScopesClient innerClient;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ public OperationsWithScopesImpl(
+ OperationsWithScopesClient innerClient,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response listWithResponse(String scope, Context context) {
+ Response inner = this.serviceClient().listWithResponse(scope, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new OperationListImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public OperationList list(String scope) {
+ OperationListInner inner = this.serviceClient().list(scope);
+ if (inner != null) {
+ return new OperationListImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private OperationsWithScopesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentImpl.java
new file mode 100644
index 000000000000..f910e8441b57
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentImpl.java
@@ -0,0 +1,148 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.managedservices.fluent.models.RegistrationAssignmentInner;
+import com.azure.resourcemanager.managedservices.models.RegistrationAssignment;
+import com.azure.resourcemanager.managedservices.models.RegistrationAssignmentProperties;
+
+public final class RegistrationAssignmentImpl
+ implements RegistrationAssignment, RegistrationAssignment.Definition, RegistrationAssignment.Update {
+ private RegistrationAssignmentInner innerObject;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public RegistrationAssignmentProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public RegistrationAssignmentInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+
+ private String scope;
+
+ private String registrationAssignmentId;
+
+ public RegistrationAssignmentImpl withExistingScope(String scope) {
+ this.scope = scope;
+ return this;
+ }
+
+ public RegistrationAssignment create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationAssignments()
+ .createOrUpdate(scope, registrationAssignmentId, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public RegistrationAssignment create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationAssignments()
+ .createOrUpdate(scope, registrationAssignmentId, this.innerModel(), context);
+ return this;
+ }
+
+ RegistrationAssignmentImpl(
+ String name, com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerObject = new RegistrationAssignmentInner();
+ this.serviceManager = serviceManager;
+ this.registrationAssignmentId = name;
+ }
+
+ public RegistrationAssignmentImpl update() {
+ return this;
+ }
+
+ public RegistrationAssignment apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationAssignments()
+ .createOrUpdate(scope, registrationAssignmentId, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public RegistrationAssignment apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationAssignments()
+ .createOrUpdate(scope, registrationAssignmentId, this.innerModel(), context);
+ return this;
+ }
+
+ RegistrationAssignmentImpl(
+ RegistrationAssignmentInner innerObject,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.scope =
+ Utils
+ .getValueFromIdByParameterName(
+ innerObject.id(),
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "scope");
+ this.registrationAssignmentId =
+ Utils
+ .getValueFromIdByParameterName(
+ innerObject.id(),
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "registrationAssignmentId");
+ }
+
+ public RegistrationAssignment refresh() {
+ Boolean localExpandRegistrationDefinition = null;
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationAssignments()
+ .getWithResponse(scope, registrationAssignmentId, localExpandRegistrationDefinition, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public RegistrationAssignment refresh(Context context) {
+ Boolean localExpandRegistrationDefinition = null;
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationAssignments()
+ .getWithResponse(scope, registrationAssignmentId, localExpandRegistrationDefinition, context)
+ .getValue();
+ return this;
+ }
+
+ public RegistrationAssignmentImpl withProperties(RegistrationAssignmentProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentsClientImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentsClientImpl.java
new file mode 100644
index 000000000000..541e72452021
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentsClientImpl.java
@@ -0,0 +1,1012 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.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.managedservices.fluent.RegistrationAssignmentsClient;
+import com.azure.resourcemanager.managedservices.fluent.models.RegistrationAssignmentInner;
+import com.azure.resourcemanager.managedservices.models.RegistrationAssignmentList;
+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 RegistrationAssignmentsClient. */
+public final class RegistrationAssignmentsClientImpl implements RegistrationAssignmentsClient {
+ /** The proxy service used to perform REST calls. */
+ private final RegistrationAssignmentsService service;
+
+ /** The service client containing this operation class. */
+ private final ManagedServicesClientImpl client;
+
+ /**
+ * Initializes an instance of RegistrationAssignmentsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ RegistrationAssignmentsClientImpl(ManagedServicesClientImpl client) {
+ this.service =
+ RestProxy
+ .create(RegistrationAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ManagedServicesClientRegistrationAssignments to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ManagedServicesClien")
+ private interface RegistrationAssignmentsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @PathParam("registrationAssignmentId") String registrationAssignmentId,
+ @QueryParam("$expandRegistrationDefinition") Boolean expandRegistrationDefinition,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete("/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @PathParam("registrationAssignmentId") String registrationAssignmentId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put("/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @PathParam("registrationAssignmentId") String registrationAssignmentId,
+ @QueryParam("api-version") String apiVersion,
+ @BodyParam("application/json") RegistrationAssignmentInner requestBody,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/{scope}/providers/Microsoft.ManagedServices/registrationAssignments")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @QueryParam("$expandRegistrationDefinition") Boolean expandRegistrationDefinition,
+ @QueryParam("api-version") String apiVersion,
+ @QueryParam("$filter") String filter,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets the details of the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @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 details of the specified registration assignment along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String scope, String registrationAssignmentId, Boolean expandRegistrationDefinition) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (registrationAssignmentId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationAssignmentId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ scope,
+ registrationAssignmentId,
+ expandRegistrationDefinition,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the details of the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @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 details of the specified registration assignment along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String scope, String registrationAssignmentId, Boolean expandRegistrationDefinition, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (registrationAssignmentId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationAssignmentId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ scope,
+ registrationAssignmentId,
+ expandRegistrationDefinition,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Gets the details of the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 details of the specified registration assignment on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String scope, String registrationAssignmentId) {
+ final Boolean expandRegistrationDefinition = null;
+ return getWithResponseAsync(scope, registrationAssignmentId, expandRegistrationDefinition)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets the details of the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @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 details of the specified registration assignment along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String scope, String registrationAssignmentId, Boolean expandRegistrationDefinition, Context context) {
+ return getWithResponseAsync(scope, registrationAssignmentId, expandRegistrationDefinition, context).block();
+ }
+
+ /**
+ * Gets the details of the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 details of the specified registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public RegistrationAssignmentInner get(String scope, String registrationAssignmentId) {
+ final Boolean expandRegistrationDefinition = null;
+ return getWithResponse(scope, registrationAssignmentId, expandRegistrationDefinition, Context.NONE).getValue();
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (registrationAssignmentId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationAssignmentId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ scope,
+ registrationAssignmentId,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (registrationAssignmentId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationAssignmentId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ scope,
+ registrationAssignmentId,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId) {
+ Mono>> mono = deleteWithResponseAsync(scope, registrationAssignmentId);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(scope, registrationAssignmentId, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId) {
+ return beginDeleteAsync(scope, registrationAssignmentId).getSyncPoller();
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId, Context context) {
+ return beginDeleteAsync(scope, registrationAssignmentId, context).getSyncPoller();
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId) {
+ return beginDeleteAsync(scope, registrationAssignmentId).last().flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId, Context context) {
+ return beginDeleteAsync(scope, registrationAssignmentId, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId) {
+ deleteAsync(scope, registrationAssignmentId).block();
+ }
+
+ /**
+ * Deletes the specified registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @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 scope, String registrationAssignmentId, Context context) {
+ deleteAsync(scope, registrationAssignmentId, context).block();
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 registration assignment along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (registrationAssignmentId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationAssignmentId is required and cannot be null."));
+ }
+ if (requestBody == null) {
+ return Mono.error(new IllegalArgumentException("Parameter requestBody is required and cannot be null."));
+ } else {
+ requestBody.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ scope,
+ registrationAssignmentId,
+ this.client.getApiVersion(),
+ requestBody,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 registration assignment along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (registrationAssignmentId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationAssignmentId is required and cannot be null."));
+ }
+ if (requestBody == null) {
+ return Mono.error(new IllegalArgumentException("Parameter requestBody is required and cannot be null."));
+ } else {
+ requestBody.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ scope,
+ registrationAssignmentId,
+ this.client.getApiVersion(),
+ requestBody,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 the registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, RegistrationAssignmentInner> beginCreateOrUpdateAsync(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(scope, registrationAssignmentId, requestBody);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ RegistrationAssignmentInner.class,
+ RegistrationAssignmentInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 the registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, RegistrationAssignmentInner> beginCreateOrUpdateAsync(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(scope, registrationAssignmentId, requestBody, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ RegistrationAssignmentInner.class,
+ RegistrationAssignmentInner.class,
+ context);
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 the registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, RegistrationAssignmentInner> beginCreateOrUpdate(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody) {
+ return beginCreateOrUpdateAsync(scope, registrationAssignmentId, requestBody).getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 the registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, RegistrationAssignmentInner> beginCreateOrUpdate(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody, Context context) {
+ return beginCreateOrUpdateAsync(scope, registrationAssignmentId, requestBody, context).getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 registration assignment on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody) {
+ return beginCreateOrUpdateAsync(scope, registrationAssignmentId, requestBody)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 registration assignment on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody, Context context) {
+ return beginCreateOrUpdateAsync(scope, registrationAssignmentId, requestBody, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public RegistrationAssignmentInner createOrUpdate(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody) {
+ return createOrUpdateAsync(scope, registrationAssignmentId, requestBody).block();
+ }
+
+ /**
+ * Creates or updates a registration assignment.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationAssignmentId The GUID of the registration assignment.
+ * @param requestBody The parameters required to create new registration assignment.
+ * @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 registration assignment.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public RegistrationAssignmentInner createOrUpdate(
+ String scope, String registrationAssignmentId, RegistrationAssignmentInner requestBody, Context context) {
+ return createOrUpdateAsync(scope, registrationAssignmentId, requestBody, context).block();
+ }
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the resource.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration assignments along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String scope, Boolean expandRegistrationDefinition, String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ scope,
+ expandRegistrationDefinition,
+ this.client.getApiVersion(),
+ filter,
+ 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()));
+ }
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the resource.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration assignments along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String scope, Boolean expandRegistrationDefinition, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ scope,
+ expandRegistrationDefinition,
+ this.client.getApiVersion(),
+ filter,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the resource.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration assignments as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String scope, Boolean expandRegistrationDefinition, String filter) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(scope, expandRegistrationDefinition, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the 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 list of the registration assignments as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String scope) {
+ final Boolean expandRegistrationDefinition = null;
+ final String filter = null;
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(scope, expandRegistrationDefinition, filter),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the resource.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration assignments as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String scope, Boolean expandRegistrationDefinition, String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(scope, expandRegistrationDefinition, filter, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the 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 list of the registration assignments as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String scope) {
+ final Boolean expandRegistrationDefinition = null;
+ final String filter = null;
+ return new PagedIterable<>(listAsync(scope, expandRegistrationDefinition, filter));
+ }
+
+ /**
+ * Gets a list of the registration assignments.
+ *
+ * @param scope The scope of the resource.
+ * @param expandRegistrationDefinition The flag indicating whether to return the registration definition details
+ * along with the registration assignment details.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration assignments as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(
+ String scope, Boolean expandRegistrationDefinition, String filter, Context context) {
+ return new PagedIterable<>(listAsync(scope, expandRegistrationDefinition, filter, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @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 registration assignments 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
+ * The nextLink parameter.
+ * @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 registration assignments 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/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentsImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentsImpl.java
new file mode 100644
index 000000000000..af1bffa8941b
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationAssignmentsImpl.java
@@ -0,0 +1,216 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.managedservices.fluent.RegistrationAssignmentsClient;
+import com.azure.resourcemanager.managedservices.fluent.models.RegistrationAssignmentInner;
+import com.azure.resourcemanager.managedservices.models.RegistrationAssignment;
+import com.azure.resourcemanager.managedservices.models.RegistrationAssignments;
+
+public final class RegistrationAssignmentsImpl implements RegistrationAssignments {
+ private static final ClientLogger LOGGER = new ClientLogger(RegistrationAssignmentsImpl.class);
+
+ private final RegistrationAssignmentsClient innerClient;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ public RegistrationAssignmentsImpl(
+ RegistrationAssignmentsClient innerClient,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(
+ String scope, String registrationAssignmentId, Boolean expandRegistrationDefinition, Context context) {
+ Response inner =
+ this
+ .serviceClient()
+ .getWithResponse(scope, registrationAssignmentId, expandRegistrationDefinition, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new RegistrationAssignmentImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public RegistrationAssignment get(String scope, String registrationAssignmentId) {
+ RegistrationAssignmentInner inner = this.serviceClient().get(scope, registrationAssignmentId);
+ if (inner != null) {
+ return new RegistrationAssignmentImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void deleteByResourceGroup(String scope, String registrationAssignmentId) {
+ this.serviceClient().delete(scope, registrationAssignmentId);
+ }
+
+ public void delete(String scope, String registrationAssignmentId, Context context) {
+ this.serviceClient().delete(scope, registrationAssignmentId, context);
+ }
+
+ public PagedIterable list(String scope) {
+ PagedIterable inner = this.serviceClient().list(scope);
+ return Utils.mapPage(inner, inner1 -> new RegistrationAssignmentImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(
+ String scope, Boolean expandRegistrationDefinition, String filter, Context context) {
+ PagedIterable inner =
+ this.serviceClient().list(scope, expandRegistrationDefinition, filter, context);
+ return Utils.mapPage(inner, inner1 -> new RegistrationAssignmentImpl(inner1, this.manager()));
+ }
+
+ public RegistrationAssignment getById(String id) {
+ String scope =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "scope");
+ if (scope == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id)));
+ }
+ String registrationAssignmentId =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "registrationAssignmentId");
+ if (registrationAssignmentId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'registrationAssignments'.",
+ id)));
+ }
+ Boolean localExpandRegistrationDefinition = null;
+ return this
+ .getWithResponse(scope, registrationAssignmentId, localExpandRegistrationDefinition, Context.NONE)
+ .getValue();
+ }
+
+ public Response getByIdWithResponse(
+ String id, Boolean expandRegistrationDefinition, Context context) {
+ String scope =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "scope");
+ if (scope == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id)));
+ }
+ String registrationAssignmentId =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "registrationAssignmentId");
+ if (registrationAssignmentId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'registrationAssignments'.",
+ id)));
+ }
+ return this.getWithResponse(scope, registrationAssignmentId, expandRegistrationDefinition, context);
+ }
+
+ public void deleteById(String id) {
+ String scope =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "scope");
+ if (scope == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id)));
+ }
+ String registrationAssignmentId =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "registrationAssignmentId");
+ if (registrationAssignmentId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'registrationAssignments'.",
+ id)));
+ }
+ this.delete(scope, registrationAssignmentId, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String scope =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "scope");
+ if (scope == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id)));
+ }
+ String registrationAssignmentId =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationAssignments/{registrationAssignmentId}",
+ "registrationAssignmentId");
+ if (registrationAssignmentId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'registrationAssignments'.",
+ id)));
+ }
+ this.delete(scope, registrationAssignmentId, context);
+ }
+
+ private RegistrationAssignmentsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+
+ public RegistrationAssignmentImpl define(String name) {
+ return new RegistrationAssignmentImpl(name, this.manager());
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionImpl.java
new file mode 100644
index 000000000000..1a4c24642ace
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionImpl.java
@@ -0,0 +1,156 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.managedservices.fluent.models.RegistrationDefinitionInner;
+import com.azure.resourcemanager.managedservices.models.Plan;
+import com.azure.resourcemanager.managedservices.models.RegistrationDefinition;
+import com.azure.resourcemanager.managedservices.models.RegistrationDefinitionProperties;
+
+public final class RegistrationDefinitionImpl
+ implements RegistrationDefinition, RegistrationDefinition.Definition, RegistrationDefinition.Update {
+ private RegistrationDefinitionInner innerObject;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public RegistrationDefinitionProperties properties() {
+ return this.innerModel().properties();
+ }
+
+ public Plan plan() {
+ return this.innerModel().plan();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public RegistrationDefinitionInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+
+ private String registrationDefinitionId;
+
+ private String scope;
+
+ public RegistrationDefinitionImpl withExistingScope(String scope) {
+ this.scope = scope;
+ return this;
+ }
+
+ public RegistrationDefinition create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationDefinitions()
+ .createOrUpdate(registrationDefinitionId, scope, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public RegistrationDefinition create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationDefinitions()
+ .createOrUpdate(registrationDefinitionId, scope, this.innerModel(), context);
+ return this;
+ }
+
+ RegistrationDefinitionImpl(
+ String name, com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerObject = new RegistrationDefinitionInner();
+ this.serviceManager = serviceManager;
+ this.registrationDefinitionId = name;
+ }
+
+ public RegistrationDefinitionImpl update() {
+ return this;
+ }
+
+ public RegistrationDefinition apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationDefinitions()
+ .createOrUpdate(registrationDefinitionId, scope, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public RegistrationDefinition apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationDefinitions()
+ .createOrUpdate(registrationDefinitionId, scope, this.innerModel(), context);
+ return this;
+ }
+
+ RegistrationDefinitionImpl(
+ RegistrationDefinitionInner innerObject,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.registrationDefinitionId =
+ Utils
+ .getValueFromIdByParameterName(
+ innerObject.id(),
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "registrationDefinitionId");
+ this.scope =
+ Utils
+ .getValueFromIdByParameterName(
+ innerObject.id(),
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "scope");
+ }
+
+ public RegistrationDefinition refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationDefinitions()
+ .getWithResponse(scope, registrationDefinitionId, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public RegistrationDefinition refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getRegistrationDefinitions()
+ .getWithResponse(scope, registrationDefinitionId, context)
+ .getValue();
+ return this;
+ }
+
+ public RegistrationDefinitionImpl withProperties(RegistrationDefinitionProperties properties) {
+ this.innerModel().withProperties(properties);
+ return this;
+ }
+
+ public RegistrationDefinitionImpl withPlan(Plan plan) {
+ this.innerModel().withPlan(plan);
+ return this;
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionsClientImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionsClientImpl.java
new file mode 100644
index 000000000000..017913cfb582
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionsClientImpl.java
@@ -0,0 +1,873 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.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.managedservices.fluent.RegistrationDefinitionsClient;
+import com.azure.resourcemanager.managedservices.fluent.models.RegistrationDefinitionInner;
+import com.azure.resourcemanager.managedservices.models.RegistrationDefinitionList;
+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 RegistrationDefinitionsClient. */
+public final class RegistrationDefinitionsClientImpl implements RegistrationDefinitionsClient {
+ /** The proxy service used to perform REST calls. */
+ private final RegistrationDefinitionsService service;
+
+ /** The service client containing this operation class. */
+ private final ManagedServicesClientImpl client;
+
+ /**
+ * Initializes an instance of RegistrationDefinitionsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ RegistrationDefinitionsClientImpl(ManagedServicesClientImpl client) {
+ this.service =
+ RestProxy
+ .create(RegistrationDefinitionsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ManagedServicesClientRegistrationDefinitions to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ManagedServicesClien")
+ private interface RegistrationDefinitionsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @PathParam("registrationDefinitionId") String registrationDefinitionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete("/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("registrationDefinitionId") String registrationDefinitionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put("/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("registrationDefinitionId") String registrationDefinitionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @BodyParam("application/json") RegistrationDefinitionInner requestBody,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam(value = "scope", encoded = true) String scope,
+ @QueryParam("api-version") String apiVersion,
+ @QueryParam("$filter") String filter,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets the registration definition details.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @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 registration definition details along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String scope, String registrationDefinitionId) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (registrationDefinitionId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationDefinitionId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ scope,
+ registrationDefinitionId,
+ this.client.getApiVersion(),
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the registration definition details.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @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 registration definition details along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String scope, String registrationDefinitionId, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (registrationDefinitionId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationDefinitionId is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ scope,
+ registrationDefinitionId,
+ this.client.getApiVersion(),
+ accept,
+ context);
+ }
+
+ /**
+ * Gets the registration definition details.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @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 registration definition details on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(String scope, String registrationDefinitionId) {
+ return getWithResponseAsync(scope, registrationDefinitionId).flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets the registration definition details.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @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 registration definition details along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String scope, String registrationDefinitionId, Context context) {
+ return getWithResponseAsync(scope, registrationDefinitionId, context).block();
+ }
+
+ /**
+ * Gets the registration definition details.
+ *
+ * @param scope The scope of the resource.
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @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 registration definition details.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public RegistrationDefinitionInner get(String scope, String registrationDefinitionId) {
+ return getWithResponse(scope, registrationDefinitionId, Context.NONE).getValue();
+ }
+
+ /**
+ * Deletes the registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the 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 registrationDefinitionId, String scope) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (registrationDefinitionId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationDefinitionId is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ registrationDefinitionId,
+ this.client.getApiVersion(),
+ scope,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Deletes the registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the 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 registrationDefinitionId, String scope, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (registrationDefinitionId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationDefinitionId is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ registrationDefinitionId,
+ this.client.getApiVersion(),
+ scope,
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes the registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the 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 registrationDefinitionId, String scope) {
+ return deleteWithResponseAsync(registrationDefinitionId, scope).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Deletes the registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the 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}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(String registrationDefinitionId, String scope, Context context) {
+ return deleteWithResponseAsync(registrationDefinitionId, scope, context).block();
+ }
+
+ /**
+ * Deletes the registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the 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 registrationDefinitionId, String scope) {
+ deleteWithResponse(registrationDefinitionId, scope, Context.NONE);
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 registration definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (registrationDefinitionId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationDefinitionId is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (requestBody == null) {
+ return Mono.error(new IllegalArgumentException("Parameter requestBody is required and cannot be null."));
+ } else {
+ requestBody.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ registrationDefinitionId,
+ this.client.getApiVersion(),
+ scope,
+ requestBody,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 registration definition along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (registrationDefinitionId == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter registrationDefinitionId is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ if (requestBody == null) {
+ return Mono.error(new IllegalArgumentException("Parameter requestBody is required and cannot be null."));
+ } else {
+ requestBody.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ registrationDefinitionId,
+ this.client.getApiVersion(),
+ scope,
+ requestBody,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 the registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, RegistrationDefinitionInner> beginCreateOrUpdateAsync(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(registrationDefinitionId, scope, requestBody);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ RegistrationDefinitionInner.class,
+ RegistrationDefinitionInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 the registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, RegistrationDefinitionInner> beginCreateOrUpdateAsync(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(registrationDefinitionId, scope, requestBody, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ RegistrationDefinitionInner.class,
+ RegistrationDefinitionInner.class,
+ context);
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 the registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, RegistrationDefinitionInner> beginCreateOrUpdate(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody) {
+ return beginCreateOrUpdateAsync(registrationDefinitionId, scope, requestBody).getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 the registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, RegistrationDefinitionInner> beginCreateOrUpdate(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody, Context context) {
+ return beginCreateOrUpdateAsync(registrationDefinitionId, scope, requestBody, context).getSyncPoller();
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 registration definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody) {
+ return beginCreateOrUpdateAsync(registrationDefinitionId, scope, requestBody)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 registration definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody, Context context) {
+ return beginCreateOrUpdateAsync(registrationDefinitionId, scope, requestBody, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public RegistrationDefinitionInner createOrUpdate(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody) {
+ return createOrUpdateAsync(registrationDefinitionId, scope, requestBody).block();
+ }
+
+ /**
+ * Creates or updates a registration definition.
+ *
+ * @param registrationDefinitionId The GUID of the registration definition.
+ * @param scope The scope of the resource.
+ * @param requestBody The parameters required to create a new registration definition.
+ * @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 registration definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public RegistrationDefinitionInner createOrUpdate(
+ String registrationDefinitionId, String scope, RegistrationDefinitionInner requestBody, Context context) {
+ return createOrUpdateAsync(registrationDefinitionId, scope, requestBody, context).block();
+ }
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration definitions along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(String scope, String filter) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, 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()));
+ }
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration definitions along with {@link PagedResponse} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String scope, String filter, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (scope == null) {
+ return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), filter, accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration definitions as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String scope, String filter) {
+ return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the 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 list of the registration definitions as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String scope) {
+ final String filter = null;
+ return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration definitions as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String scope, String filter, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(scope, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the 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 list of the registration definitions as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String scope) {
+ final String filter = null;
+ return new PagedIterable<>(listAsync(scope, filter));
+ }
+
+ /**
+ * Gets a list of the registration definitions.
+ *
+ * @param scope The scope of the resource.
+ * @param filter The filter query parameter to filter managed services resources by.
+ * @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 the registration definitions as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String scope, String filter, Context context) {
+ return new PagedIterable<>(listAsync(scope, filter, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * The nextLink parameter.
+ * @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 registration definitions 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
+ * The nextLink parameter.
+ * @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 registration definitions 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/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionsImpl.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionsImpl.java
new file mode 100644
index 000000000000..667ac2879840
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/RegistrationDefinitionsImpl.java
@@ -0,0 +1,209 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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.managedservices.fluent.RegistrationDefinitionsClient;
+import com.azure.resourcemanager.managedservices.fluent.models.RegistrationDefinitionInner;
+import com.azure.resourcemanager.managedservices.models.RegistrationDefinition;
+import com.azure.resourcemanager.managedservices.models.RegistrationDefinitions;
+
+public final class RegistrationDefinitionsImpl implements RegistrationDefinitions {
+ private static final ClientLogger LOGGER = new ClientLogger(RegistrationDefinitionsImpl.class);
+
+ private final RegistrationDefinitionsClient innerClient;
+
+ private final com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager;
+
+ public RegistrationDefinitionsImpl(
+ RegistrationDefinitionsClient innerClient,
+ com.azure.resourcemanager.managedservices.ManagedServicesManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public Response getWithResponse(
+ String scope, String registrationDefinitionId, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(scope, registrationDefinitionId, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new RegistrationDefinitionImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public RegistrationDefinition get(String scope, String registrationDefinitionId) {
+ RegistrationDefinitionInner inner = this.serviceClient().get(scope, registrationDefinitionId);
+ if (inner != null) {
+ return new RegistrationDefinitionImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteByResourceGroupWithResponse(
+ String registrationDefinitionId, String scope, Context context) {
+ return this.serviceClient().deleteWithResponse(registrationDefinitionId, scope, context);
+ }
+
+ public void deleteByResourceGroup(String registrationDefinitionId, String scope) {
+ this.serviceClient().delete(registrationDefinitionId, scope);
+ }
+
+ public PagedIterable list(String scope) {
+ PagedIterable inner = this.serviceClient().list(scope);
+ return Utils.mapPage(inner, inner1 -> new RegistrationDefinitionImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String scope, String filter, Context context) {
+ PagedIterable inner = this.serviceClient().list(scope, filter, context);
+ return Utils.mapPage(inner, inner1 -> new RegistrationDefinitionImpl(inner1, this.manager()));
+ }
+
+ public RegistrationDefinition getById(String id) {
+ String scope =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "scope");
+ if (scope == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id)));
+ }
+ String registrationDefinitionId =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "registrationDefinitionId");
+ if (registrationDefinitionId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'registrationDefinitions'.",
+ id)));
+ }
+ return this.getWithResponse(scope, registrationDefinitionId, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String scope =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "scope");
+ if (scope == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id)));
+ }
+ String registrationDefinitionId =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "registrationDefinitionId");
+ if (registrationDefinitionId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'registrationDefinitions'.",
+ id)));
+ }
+ return this.getWithResponse(scope, registrationDefinitionId, context);
+ }
+
+ public void deleteById(String id) {
+ String registrationDefinitionId =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "registrationDefinitionId");
+ if (registrationDefinitionId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'registrationDefinitions'.",
+ id)));
+ }
+ String scope =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "scope");
+ if (scope == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id)));
+ }
+ this.deleteByResourceGroupWithResponse(registrationDefinitionId, scope, Context.NONE);
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String registrationDefinitionId =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "registrationDefinitionId");
+ if (registrationDefinitionId == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format(
+ "The resource ID '%s' is not valid. Missing path segment 'registrationDefinitions'.",
+ id)));
+ }
+ String scope =
+ Utils
+ .getValueFromIdByParameterName(
+ id,
+ "/{scope}/providers/Microsoft.ManagedServices/registrationDefinitions/{registrationDefinitionId}",
+ "scope");
+ if (scope == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id)));
+ }
+ return this.deleteByResourceGroupWithResponse(registrationDefinitionId, scope, context);
+ }
+
+ private RegistrationDefinitionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.managedservices.ManagedServicesManager manager() {
+ return this.serviceManager;
+ }
+
+ public RegistrationDefinitionImpl define(String name) {
+ return new RegistrationDefinitionImpl(name, this.manager());
+ }
+}
diff --git a/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/Utils.java b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/Utils.java
new file mode 100644
index 000000000000..19955d654bc8
--- /dev/null
+++ b/sdk/managedservices/azure-resourcemanager-managedservices/src/main/java/com/azure/resourcemanager/managedservices/implementation/Utils.java
@@ -0,0 +1,204 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.managedservices.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 Utils {
+ 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.size() > 0 && 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, PagedResponse>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function