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 ContainerInstance service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the ContainerInstance service API instance.
+ */
+ public ContainerInstanceManager 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.containerinstance.generated")
+ .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 ContainerInstanceManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /**
+ * Gets the resource collection API of ContainerGroups. It manages ContainerGroup.
+ *
+ * @return Resource collection API of ContainerGroups.
+ */
+ public ContainerGroups containerGroups() {
+ if (this.containerGroups == null) {
+ this.containerGroups = new ContainerGroupsImpl(clientObject.getContainerGroups(), this);
+ }
+ return containerGroups;
+ }
+
+ /**
+ * 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 Locations.
+ *
+ * @return Resource collection API of Locations.
+ */
+ public Locations locations() {
+ if (this.locations == null) {
+ this.locations = new LocationsImpl(clientObject.getLocations(), this);
+ }
+ return locations;
+ }
+
+ /**
+ * Gets the resource collection API of Containers.
+ *
+ * @return Resource collection API of Containers.
+ */
+ public Containers containers() {
+ if (this.containers == null) {
+ this.containers = new ContainersImpl(clientObject.getContainers(), this);
+ }
+ return containers;
+ }
+
+ /**
+ * Gets the resource collection API of SubnetServiceAssociationLinks.
+ *
+ * @return Resource collection API of SubnetServiceAssociationLinks.
+ */
+ public SubnetServiceAssociationLinks subnetServiceAssociationLinks() {
+ if (this.subnetServiceAssociationLinks == null) {
+ this.subnetServiceAssociationLinks =
+ new SubnetServiceAssociationLinksImpl(clientObject.getSubnetServiceAssociationLinks(), this);
+ }
+ return subnetServiceAssociationLinks;
+ }
+
+ /**
+ * @return Wrapped service client ContainerInstanceManagementClient providing direct access to the underlying
+ * auto-generated API implementation, based on Azure REST API.
+ */
+ public ContainerInstanceManagementClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java
new file mode 100644
index 000000000000..dfbeeed2d35e
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerGroupsClient.java
@@ -0,0 +1,430 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.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.Resource;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner;
+import java.util.List;
+
+/** An instance of this class provides access to all the operations defined in ContainerGroupsClient. */
+public interface ContainerGroupsClient {
+ /**
+ * Get a list of container groups in the specified subscription. This operation returns properties of each container
+ * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and
+ * volumes.
+ *
+ * @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 container groups in the specified subscription as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Get a list of container groups in the specified subscription. This operation returns properties of each container
+ * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and
+ * volumes.
+ *
+ * @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 container groups in the specified subscription as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Get a list of container groups in a specified subscription and resource group. This operation returns properties
+ * of each container group including containers, image registry credentials, restart policy, IP address type, OS
+ * type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 container groups in a specified subscription and resource group as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Get a list of container groups in a specified subscription and resource group. This operation returns properties
+ * of each container group including containers, image registry credentials, restart policy, IP address type, OS
+ * type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 container groups in a specified subscription and resource group as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Gets the properties of the specified container group in the specified subscription and resource group. The
+ * operation returns the properties of each container group including containers, image registry credentials,
+ * restart policy, IP address type, OS type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 properties of the specified container group in the specified subscription and resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName);
+
+ /**
+ * Gets the properties of the specified container group in the specified subscription and resource group. The
+ * operation returns the properties of each container group including containers, image registry credentials,
+ * restart policy, IP address type, OS type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 properties of the specified container group in the specified subscription and resource group along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String containerGroupName, Context context);
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ContainerGroupInner> beginCreateOrUpdate(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup);
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ContainerGroupInner> beginCreateOrUpdate(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context);
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContainerGroupInner createOrUpdate(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup);
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContainerGroupInner createOrUpdate(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context);
+
+ /**
+ * Updates container group tags with specified values.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param resource The container group resource with just the tags to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource);
+
+ /**
+ * Updates container group tags with specified values.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param resource The container group resource with just the tags to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response updateWithResponse(
+ String resourceGroupName, String containerGroupName, Resource resource, Context context);
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ContainerGroupInner> beginDelete(
+ String resourceGroupName, String containerGroupName);
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, ContainerGroupInner> beginDelete(
+ String resourceGroupName, String containerGroupName, Context context);
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContainerGroupInner delete(String resourceGroupName, String containerGroupName);
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContainerGroupInner delete(String resourceGroupName, String containerGroupName, Context context);
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginRestart(String resourceGroupName, String containerGroupName);
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginRestart(
+ String resourceGroupName, String containerGroupName, Context context);
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 restart(String resourceGroupName, String containerGroupName);
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 restart(String resourceGroupName, String containerGroupName, Context context);
+
+ /**
+ * Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 stop(String resourceGroupName, String containerGroupName);
+
+ /**
+ * Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 stopWithResponse(String resourceGroupName, String containerGroupName, Context context);
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginStart(String resourceGroupName, String containerGroupName);
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginStart(String resourceGroupName, String containerGroupName, Context context);
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 start(String resourceGroupName, String containerGroupName);
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 start(String resourceGroupName, String containerGroupName, Context context);
+
+ /**
+ * Gets all the network dependencies for this container group to allow complete control of network setting and
+ * configuration. For container groups, this will always be an empty list.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 all the network dependencies for this container group to allow complete control of network setting and
+ * configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName);
+
+ /**
+ * Gets all the network dependencies for this container group to allow complete control of network setting and
+ * configuration. For container groups, this will always be an empty list.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 all the network dependencies for this container group to allow complete control of network setting and
+ * configuration along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response> getOutboundNetworkDependenciesEndpointsWithResponse(
+ String resourceGroupName, String containerGroupName, Context context);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java
new file mode 100644
index 000000000000..c5b4c468cd63
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainerInstanceManagementClient.java
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for ContainerInstanceManagementClient class. */
+public interface ContainerInstanceManagementClient {
+ /**
+ * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+ * part of the URI for every service call.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the ContainerGroupsClient object to access its operations.
+ *
+ * @return the ContainerGroupsClient object.
+ */
+ ContainerGroupsClient getContainerGroups();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the LocationsClient object to access its operations.
+ *
+ * @return the LocationsClient object.
+ */
+ LocationsClient getLocations();
+
+ /**
+ * Gets the ContainersClient object to access its operations.
+ *
+ * @return the ContainersClient object.
+ */
+ ContainersClient getContainers();
+
+ /**
+ * Gets the SubnetServiceAssociationLinksClient object to access its operations.
+ *
+ * @return the SubnetServiceAssociationLinksClient object.
+ */
+ SubnetServiceAssociationLinksClient getSubnetServiceAssociationLinks();
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java
new file mode 100644
index 000000000000..f8f7b71bbc2d
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/ContainersClient.java
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.models.ContainerAttachResponseInner;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest;
+
+/** An instance of this class provides access to all the operations defined in ContainersClient. */
+public interface ContainersClient {
+ /**
+ * Get the logs for a specified container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @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 logs for a specified container instance in a specified resource group and container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName);
+
+ /**
+ * Get the logs for a specified container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param tail The number of lines to show from the tail of the container instance log. If not provided, all
+ * available logs are shown up to 4mb.
+ * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided,
+ * defaults to false.
+ * @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 logs for a specified container instance in a specified resource group and container group along with
+ * {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response listLogsWithResponse(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ Integer tail,
+ Boolean timestamps,
+ Context context);
+
+ /**
+ * Executes a command for a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param containerExecRequest The request for the exec command.
+ * @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 information for the container exec command.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContainerExecResponseInner executeCommand(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ ContainerExecRequest containerExecRequest);
+
+ /**
+ * Executes a command for a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param containerExecRequest The request for the exec command.
+ * @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 information for the container exec command along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response executeCommandWithResponse(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ ContainerExecRequest containerExecRequest,
+ Context context);
+
+ /**
+ * Attach to the output stream of a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @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 information for the output stream from container attach.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ContainerAttachResponseInner attach(String resourceGroupName, String containerGroupName, String containerName);
+
+ /**
+ * Attach to the output stream of a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @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 information for the output stream from container attach along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response attachWithResponse(
+ String resourceGroupName, String containerGroupName, String containerName, Context context);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java
new file mode 100644
index 000000000000..23676bdb6fbf
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/LocationsClient.java
@@ -0,0 +1,93 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.UsageInner;
+
+/** An instance of this class provides access to all the operations defined in LocationsClient. */
+public interface LocationsClient {
+ /**
+ * Get the usage for a subscription.
+ *
+ * @param location The identifier for the physical azure location.
+ * @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 usage for a subscription as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listUsage(String location);
+
+ /**
+ * Get the usage for a subscription.
+ *
+ * @param location The identifier for the physical azure location.
+ * @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 usage for a subscription as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listUsage(String location, Context context);
+
+ /**
+ * Get the list of cached images on specific OS type for a subscription in a region.
+ *
+ * @param location The identifier for the physical azure location.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of cached images on specific OS type for a subscription in a region as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listCachedImages(String location);
+
+ /**
+ * Get the list of cached images on specific OS type for a subscription in a region.
+ *
+ * @param location The identifier for the physical azure location.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of cached images on specific OS type for a subscription in a region as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listCachedImages(String location, Context context);
+
+ /**
+ * Get the list of CPU/memory/GPU capabilities of a region.
+ *
+ * @param location The identifier for the physical azure location.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listCapabilities(String location);
+
+ /**
+ * Get the list of CPU/memory/GPU capabilities of a region.
+ *
+ * @param location The identifier for the physical azure location.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the list of CPU/memory/GPU capabilities of a region as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listCapabilities(String location, Context context);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java
new file mode 100644
index 000000000000..6679f6629088
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/OperationsClient.java
@@ -0,0 +1,38 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.OperationInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * List the operations for Azure Container Instance service.
+ *
+ * @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 operation list response that contains all operations for Azure Container Instance service as
+ * paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * List the operations for Azure Container Instance service.
+ *
+ * @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 operation list response that contains all operations for Azure Container Instance service as
+ * paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java
new file mode 100644
index 000000000000..920be0f863de
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/SubnetServiceAssociationLinksClient.java
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+
+/** An instance of this class provides access to all the operations defined in SubnetServiceAssociationLinksClient. */
+public interface SubnetServiceAssociationLinksClient {
+ /**
+ * Delete container group virtual network association links. The operation does not delete other resources provided
+ * by the user.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param virtualNetworkName The name of the virtual network.
+ * @param subnetName The name of the subnet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String virtualNetworkName, String subnetName);
+
+ /**
+ * Delete container group virtual network association links. The operation does not delete other resources provided
+ * by the user.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param virtualNetworkName The name of the virtual network.
+ * @param subnetName The name of the subnet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of long-running operation.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ SyncPoller, Void> beginDelete(
+ String resourceGroupName, String virtualNetworkName, String subnetName, Context context);
+
+ /**
+ * Delete container group virtual network association links. The operation does not delete other resources provided
+ * by the user.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param virtualNetworkName The name of the virtual network.
+ * @param subnetName The name of the subnet.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String virtualNetworkName, String subnetName);
+
+ /**
+ * Delete container group virtual network association links. The operation does not delete other resources provided
+ * by the user.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param virtualNetworkName The name of the virtual network.
+ * @param subnetName The name of the subnet.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String virtualNetworkName, String subnetName, Context context);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java
new file mode 100644
index 000000000000..5c9339b0a340
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CachedImagesInner.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The cached image and OS type. */
+@Fluent
+public final class CachedImagesInner {
+ /*
+ * The OS type of the cached image.
+ */
+ @JsonProperty(value = "osType", required = true)
+ private String osType;
+
+ /*
+ * The cached image name.
+ */
+ @JsonProperty(value = "image", required = true)
+ private String image;
+
+ /**
+ * Get the osType property: The OS type of the cached image.
+ *
+ * @return the osType value.
+ */
+ public String osType() {
+ return this.osType;
+ }
+
+ /**
+ * Set the osType property: The OS type of the cached image.
+ *
+ * @param osType the osType value to set.
+ * @return the CachedImagesInner object itself.
+ */
+ public CachedImagesInner withOsType(String osType) {
+ this.osType = osType;
+ return this;
+ }
+
+ /**
+ * Get the image property: The cached image name.
+ *
+ * @return the image value.
+ */
+ public String image() {
+ return this.image;
+ }
+
+ /**
+ * Set the image property: The cached image name.
+ *
+ * @param image the image value to set.
+ * @return the CachedImagesInner object itself.
+ */
+ public CachedImagesInner withImage(String image) {
+ this.image = image;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (osType() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property osType in model CachedImagesInner"));
+ }
+ if (image() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property image in model CachedImagesInner"));
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(CachedImagesInner.class);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java
new file mode 100644
index 000000000000..2d596264fd0e
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/CapabilitiesInner.java
@@ -0,0 +1,114 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.resourcemanager.containerinstance.generated.models.CapabilitiesCapabilities;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The regional capabilities. */
+@Immutable
+public final class CapabilitiesInner {
+ /*
+ * The resource type that this capability describes.
+ */
+ @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY)
+ private String resourceType;
+
+ /*
+ * The OS type that this capability describes.
+ */
+ @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY)
+ private String osType;
+
+ /*
+ * The resource location.
+ */
+ @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY)
+ private String location;
+
+ /*
+ * The ip address type that this capability describes.
+ */
+ @JsonProperty(value = "ipAddressType", access = JsonProperty.Access.WRITE_ONLY)
+ private String ipAddressType;
+
+ /*
+ * The GPU sku that this capability describes.
+ */
+ @JsonProperty(value = "gpu", access = JsonProperty.Access.WRITE_ONLY)
+ private String gpu;
+
+ /*
+ * The supported capabilities.
+ */
+ @JsonProperty(value = "capabilities", access = JsonProperty.Access.WRITE_ONLY)
+ private CapabilitiesCapabilities capabilities;
+
+ /**
+ * Get the resourceType property: The resource type that this capability describes.
+ *
+ * @return the resourceType value.
+ */
+ public String resourceType() {
+ return this.resourceType;
+ }
+
+ /**
+ * Get the osType property: The OS type that this capability describes.
+ *
+ * @return the osType value.
+ */
+ public String osType() {
+ return this.osType;
+ }
+
+ /**
+ * Get the location property: The resource location.
+ *
+ * @return the location value.
+ */
+ public String location() {
+ return this.location;
+ }
+
+ /**
+ * Get the ipAddressType property: The ip address type that this capability describes.
+ *
+ * @return the ipAddressType value.
+ */
+ public String ipAddressType() {
+ return this.ipAddressType;
+ }
+
+ /**
+ * Get the gpu property: The GPU sku that this capability describes.
+ *
+ * @return the gpu value.
+ */
+ public String gpu() {
+ return this.gpu;
+ }
+
+ /**
+ * Get the capabilities property: The supported capabilities.
+ *
+ * @return the capabilities value.
+ */
+ public CapabilitiesCapabilities capabilities() {
+ return this.capabilities;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (capabilities() != null) {
+ capabilities().validate();
+ }
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java
new file mode 100644
index 000000000000..3c61f1eaa710
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerAttachResponseInner.java
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The information for the output stream from container attach. */
+@Fluent
+public final class ContainerAttachResponseInner {
+ /*
+ * The uri for the output stream from the attach.
+ */
+ @JsonProperty(value = "webSocketUri")
+ private String webSocketUri;
+
+ /*
+ * The password to the output stream from the attach. Send as an
+ * Authorization header value when connecting to the websocketUri.
+ */
+ @JsonProperty(value = "password")
+ private String password;
+
+ /**
+ * Get the webSocketUri property: The uri for the output stream from the attach.
+ *
+ * @return the webSocketUri value.
+ */
+ public String webSocketUri() {
+ return this.webSocketUri;
+ }
+
+ /**
+ * Set the webSocketUri property: The uri for the output stream from the attach.
+ *
+ * @param webSocketUri the webSocketUri value to set.
+ * @return the ContainerAttachResponseInner object itself.
+ */
+ public ContainerAttachResponseInner withWebSocketUri(String webSocketUri) {
+ this.webSocketUri = webSocketUri;
+ return this;
+ }
+
+ /**
+ * Get the password property: The password to the output stream from the attach. Send as an Authorization header
+ * value when connecting to the websocketUri.
+ *
+ * @return the password value.
+ */
+ public String password() {
+ return this.password;
+ }
+
+ /**
+ * Set the password property: The password to the output stream from the attach. Send as an Authorization header
+ * value when connecting to the websocketUri.
+ *
+ * @param password the password value to set.
+ * @return the ContainerAttachResponseInner object itself.
+ */
+ public ContainerAttachResponseInner withPassword(String password) {
+ this.password = password;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.java
new file mode 100644
index 000000000000..f76adafe5bf5
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerExecResponseInner.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.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The information for the container exec command. */
+@Fluent
+public final class ContainerExecResponseInner {
+ /*
+ * The uri for the exec websocket.
+ */
+ @JsonProperty(value = "webSocketUri")
+ private String webSocketUri;
+
+ /*
+ * The password to start the exec command.
+ */
+ @JsonProperty(value = "password")
+ private String password;
+
+ /**
+ * Get the webSocketUri property: The uri for the exec websocket.
+ *
+ * @return the webSocketUri value.
+ */
+ public String webSocketUri() {
+ return this.webSocketUri;
+ }
+
+ /**
+ * Set the webSocketUri property: The uri for the exec websocket.
+ *
+ * @param webSocketUri the webSocketUri value to set.
+ * @return the ContainerExecResponseInner object itself.
+ */
+ public ContainerExecResponseInner withWebSocketUri(String webSocketUri) {
+ this.webSocketUri = webSocketUri;
+ return this;
+ }
+
+ /**
+ * Get the password property: The password to start the exec command.
+ *
+ * @return the password value.
+ */
+ public String password() {
+ return this.password;
+ }
+
+ /**
+ * Set the password property: The password to start the exec command.
+ *
+ * @param password the password value to set.
+ * @return the ContainerExecResponseInner object itself.
+ */
+ public ContainerExecResponseInner withPassword(String password) {
+ this.password = password;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java
new file mode 100644
index 000000000000..1e5549e81e65
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupInner.java
@@ -0,0 +1,431 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.management.Resource;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.containerinstance.generated.models.Container;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId;
+import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration;
+import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties;
+import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential;
+import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition;
+import com.azure.resourcemanager.containerinstance.generated.models.IpAddress;
+import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes;
+import com.azure.resourcemanager.containerinstance.generated.models.Volume;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/** A container group. */
+@Fluent
+public final class ContainerGroupInner extends Resource {
+ /*
+ * The zones for the container group.
+ */
+ @JsonProperty(value = "zones")
+ private List zones;
+
+ /*
+ * The identity of the container group, if configured.
+ */
+ @JsonProperty(value = "identity")
+ private ContainerGroupIdentity identity;
+
+ /*
+ * The container group properties
+ */
+ @JsonProperty(value = "properties", required = true)
+ private ContainerGroupPropertiesProperties innerProperties = new ContainerGroupPropertiesProperties();
+
+ /**
+ * Get the zones property: The zones for the container group.
+ *
+ * @return the zones value.
+ */
+ public List zones() {
+ return this.zones;
+ }
+
+ /**
+ * Set the zones property: The zones for the container group.
+ *
+ * @param zones the zones value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withZones(List zones) {
+ this.zones = zones;
+ return this;
+ }
+
+ /**
+ * Get the identity property: The identity of the container group, if configured.
+ *
+ * @return the identity value.
+ */
+ public ContainerGroupIdentity identity() {
+ return this.identity;
+ }
+
+ /**
+ * Set the identity property: The identity of the container group, if configured.
+ *
+ * @param identity the identity value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withIdentity(ContainerGroupIdentity identity) {
+ this.identity = identity;
+ return this;
+ }
+
+ /**
+ * Get the innerProperties property: The container group properties.
+ *
+ * @return the innerProperties value.
+ */
+ private ContainerGroupPropertiesProperties innerProperties() {
+ return this.innerProperties;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ContainerGroupInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ContainerGroupInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Get the provisioningState property: The provisioning state of the container group. This only appears in the
+ * response.
+ *
+ * @return the provisioningState value.
+ */
+ public String provisioningState() {
+ return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
+ }
+
+ /**
+ * Get the containers property: The containers within the container group.
+ *
+ * @return the containers value.
+ */
+ public List containers() {
+ return this.innerProperties() == null ? null : this.innerProperties().containers();
+ }
+
+ /**
+ * Set the containers property: The containers within the container group.
+ *
+ * @param containers the containers value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withContainers(List containers) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withContainers(containers);
+ return this;
+ }
+
+ /**
+ * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created
+ * from.
+ *
+ * @return the imageRegistryCredentials value.
+ */
+ public List imageRegistryCredentials() {
+ return this.innerProperties() == null ? null : this.innerProperties().imageRegistryCredentials();
+ }
+
+ /**
+ * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created
+ * from.
+ *
+ * @param imageRegistryCredentials the imageRegistryCredentials value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withImageRegistryCredentials(List imageRegistryCredentials) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withImageRegistryCredentials(imageRegistryCredentials);
+ return this;
+ }
+
+ /**
+ * Get the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always
+ * restart - `OnFailure` Restart on failure - `Never` Never restart.
+ *
+ * @return the restartPolicy value.
+ */
+ public ContainerGroupRestartPolicy restartPolicy() {
+ return this.innerProperties() == null ? null : this.innerProperties().restartPolicy();
+ }
+
+ /**
+ * Set the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always
+ * restart - `OnFailure` Restart on failure - `Never` Never restart.
+ *
+ * @param restartPolicy the restartPolicy value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withRestartPolicy(restartPolicy);
+ return this;
+ }
+
+ /**
+ * Get the ipAddress property: The IP address type of the container group.
+ *
+ * @return the ipAddress value.
+ */
+ public IpAddress ipAddress() {
+ return this.innerProperties() == null ? null : this.innerProperties().ipAddress();
+ }
+
+ /**
+ * Set the ipAddress property: The IP address type of the container group.
+ *
+ * @param ipAddress the ipAddress value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withIpAddress(IpAddress ipAddress) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withIpAddress(ipAddress);
+ return this;
+ }
+
+ /**
+ * Get the osType property: The operating system type required by the containers in the container group.
+ *
+ * @return the osType value.
+ */
+ public OperatingSystemTypes osType() {
+ return this.innerProperties() == null ? null : this.innerProperties().osType();
+ }
+
+ /**
+ * Set the osType property: The operating system type required by the containers in the container group.
+ *
+ * @param osType the osType value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withOsType(OperatingSystemTypes osType) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withOsType(osType);
+ return this;
+ }
+
+ /**
+ * Get the volumes property: The list of volumes that can be mounted by containers in this container group.
+ *
+ * @return the volumes value.
+ */
+ public List volumes() {
+ return this.innerProperties() == null ? null : this.innerProperties().volumes();
+ }
+
+ /**
+ * Set the volumes property: The list of volumes that can be mounted by containers in this container group.
+ *
+ * @param volumes the volumes value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withVolumes(List volumes) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withVolumes(volumes);
+ return this;
+ }
+
+ /**
+ * Get the instanceView property: The instance view of the container group. Only valid in response.
+ *
+ * @return the instanceView value.
+ */
+ public ContainerGroupPropertiesInstanceView instanceView() {
+ return this.innerProperties() == null ? null : this.innerProperties().instanceView();
+ }
+
+ /**
+ * Get the diagnostics property: The diagnostic information for a container group.
+ *
+ * @return the diagnostics value.
+ */
+ public ContainerGroupDiagnostics diagnostics() {
+ return this.innerProperties() == null ? null : this.innerProperties().diagnostics();
+ }
+
+ /**
+ * Set the diagnostics property: The diagnostic information for a container group.
+ *
+ * @param diagnostics the diagnostics value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withDiagnostics(ContainerGroupDiagnostics diagnostics) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withDiagnostics(diagnostics);
+ return this;
+ }
+
+ /**
+ * Get the subnetIds property: The subnet resource IDs for a container group.
+ *
+ * @return the subnetIds value.
+ */
+ public List subnetIds() {
+ return this.innerProperties() == null ? null : this.innerProperties().subnetIds();
+ }
+
+ /**
+ * Set the subnetIds property: The subnet resource IDs for a container group.
+ *
+ * @param subnetIds the subnetIds value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withSubnetIds(List subnetIds) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withSubnetIds(subnetIds);
+ return this;
+ }
+
+ /**
+ * Get the dnsConfig property: The DNS config information for a container group.
+ *
+ * @return the dnsConfig value.
+ */
+ public DnsConfiguration dnsConfig() {
+ return this.innerProperties() == null ? null : this.innerProperties().dnsConfig();
+ }
+
+ /**
+ * Set the dnsConfig property: The DNS config information for a container group.
+ *
+ * @param dnsConfig the dnsConfig value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withDnsConfig(DnsConfiguration dnsConfig) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withDnsConfig(dnsConfig);
+ return this;
+ }
+
+ /**
+ * Get the sku property: The SKU for a container group.
+ *
+ * @return the sku value.
+ */
+ public ContainerGroupSku sku() {
+ return this.innerProperties() == null ? null : this.innerProperties().sku();
+ }
+
+ /**
+ * Set the sku property: The SKU for a container group.
+ *
+ * @param sku the sku value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withSku(ContainerGroupSku sku) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withSku(sku);
+ return this;
+ }
+
+ /**
+ * Get the encryptionProperties property: The encryption properties for a container group.
+ *
+ * @return the encryptionProperties value.
+ */
+ public EncryptionProperties encryptionProperties() {
+ return this.innerProperties() == null ? null : this.innerProperties().encryptionProperties();
+ }
+
+ /**
+ * Set the encryptionProperties property: The encryption properties for a container group.
+ *
+ * @param encryptionProperties the encryptionProperties value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withEncryptionProperties(EncryptionProperties encryptionProperties) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withEncryptionProperties(encryptionProperties);
+ return this;
+ }
+
+ /**
+ * Get the initContainers property: The init containers for a container group.
+ *
+ * @return the initContainers value.
+ */
+ public List initContainers() {
+ return this.innerProperties() == null ? null : this.innerProperties().initContainers();
+ }
+
+ /**
+ * Set the initContainers property: The init containers for a container group.
+ *
+ * @param initContainers the initContainers value to set.
+ * @return the ContainerGroupInner object itself.
+ */
+ public ContainerGroupInner withInitContainers(List initContainers) {
+ if (this.innerProperties() == null) {
+ this.innerProperties = new ContainerGroupPropertiesProperties();
+ }
+ this.innerProperties().withInitContainers(initContainers);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (identity() != null) {
+ identity().validate();
+ }
+ if (innerProperties() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property innerProperties in model ContainerGroupInner"));
+ } else {
+ innerProperties().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupInner.class);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java
new file mode 100644
index 000000000000..9cb267e9ba32
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerGroupPropertiesProperties.java
@@ -0,0 +1,434 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.containerinstance.generated.models.Container;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId;
+import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration;
+import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties;
+import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential;
+import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition;
+import com.azure.resourcemanager.containerinstance.generated.models.IpAddress;
+import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes;
+import com.azure.resourcemanager.containerinstance.generated.models.Volume;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The container group properties. */
+@Fluent
+public final class ContainerGroupPropertiesProperties {
+ /*
+ * The provisioning state of the container group. This only appears in the
+ * response.
+ */
+ @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private String provisioningState;
+
+ /*
+ * The containers within the container group.
+ */
+ @JsonProperty(value = "containers", required = true)
+ private List containers;
+
+ /*
+ * The image registry credentials by which the container group is created
+ * from.
+ */
+ @JsonProperty(value = "imageRegistryCredentials")
+ private List imageRegistryCredentials;
+
+ /*
+ * Restart policy for all containers within the container group.
+ * - `Always` Always restart
+ * - `OnFailure` Restart on failure
+ * - `Never` Never restart
+ *
+ */
+ @JsonProperty(value = "restartPolicy")
+ private ContainerGroupRestartPolicy restartPolicy;
+
+ /*
+ * The IP address type of the container group.
+ */
+ @JsonProperty(value = "ipAddress")
+ private IpAddress ipAddress;
+
+ /*
+ * The operating system type required by the containers in the container
+ * group.
+ */
+ @JsonProperty(value = "osType", required = true)
+ private OperatingSystemTypes osType;
+
+ /*
+ * The list of volumes that can be mounted by containers in this container
+ * group.
+ */
+ @JsonProperty(value = "volumes")
+ private List volumes;
+
+ /*
+ * The instance view of the container group. Only valid in response.
+ */
+ @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY)
+ private ContainerGroupPropertiesInstanceView instanceView;
+
+ /*
+ * The diagnostic information for a container group.
+ */
+ @JsonProperty(value = "diagnostics")
+ private ContainerGroupDiagnostics diagnostics;
+
+ /*
+ * The subnet resource IDs for a container group.
+ */
+ @JsonProperty(value = "subnetIds")
+ private List subnetIds;
+
+ /*
+ * The DNS config information for a container group.
+ */
+ @JsonProperty(value = "dnsConfig")
+ private DnsConfiguration dnsConfig;
+
+ /*
+ * The SKU for a container group.
+ */
+ @JsonProperty(value = "sku")
+ private ContainerGroupSku sku;
+
+ /*
+ * The encryption properties for a container group.
+ */
+ @JsonProperty(value = "encryptionProperties")
+ private EncryptionProperties encryptionProperties;
+
+ /*
+ * The init containers for a container group.
+ */
+ @JsonProperty(value = "initContainers")
+ private List initContainers;
+
+ /**
+ * Get the provisioningState property: The provisioning state of the container group. This only appears in the
+ * response.
+ *
+ * @return the provisioningState value.
+ */
+ public String provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the containers property: The containers within the container group.
+ *
+ * @return the containers value.
+ */
+ public List containers() {
+ return this.containers;
+ }
+
+ /**
+ * Set the containers property: The containers within the container group.
+ *
+ * @param containers the containers value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withContainers(List containers) {
+ this.containers = containers;
+ return this;
+ }
+
+ /**
+ * Get the imageRegistryCredentials property: The image registry credentials by which the container group is created
+ * from.
+ *
+ * @return the imageRegistryCredentials value.
+ */
+ public List imageRegistryCredentials() {
+ return this.imageRegistryCredentials;
+ }
+
+ /**
+ * Set the imageRegistryCredentials property: The image registry credentials by which the container group is created
+ * from.
+ *
+ * @param imageRegistryCredentials the imageRegistryCredentials value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withImageRegistryCredentials(
+ List imageRegistryCredentials) {
+ this.imageRegistryCredentials = imageRegistryCredentials;
+ return this;
+ }
+
+ /**
+ * Get the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always
+ * restart - `OnFailure` Restart on failure - `Never` Never restart.
+ *
+ * @return the restartPolicy value.
+ */
+ public ContainerGroupRestartPolicy restartPolicy() {
+ return this.restartPolicy;
+ }
+
+ /**
+ * Set the restartPolicy property: Restart policy for all containers within the container group. - `Always` Always
+ * restart - `OnFailure` Restart on failure - `Never` Never restart.
+ *
+ * @param restartPolicy the restartPolicy value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) {
+ this.restartPolicy = restartPolicy;
+ return this;
+ }
+
+ /**
+ * Get the ipAddress property: The IP address type of the container group.
+ *
+ * @return the ipAddress value.
+ */
+ public IpAddress ipAddress() {
+ return this.ipAddress;
+ }
+
+ /**
+ * Set the ipAddress property: The IP address type of the container group.
+ *
+ * @param ipAddress the ipAddress value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withIpAddress(IpAddress ipAddress) {
+ this.ipAddress = ipAddress;
+ return this;
+ }
+
+ /**
+ * Get the osType property: The operating system type required by the containers in the container group.
+ *
+ * @return the osType value.
+ */
+ public OperatingSystemTypes osType() {
+ return this.osType;
+ }
+
+ /**
+ * Set the osType property: The operating system type required by the containers in the container group.
+ *
+ * @param osType the osType value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withOsType(OperatingSystemTypes osType) {
+ this.osType = osType;
+ return this;
+ }
+
+ /**
+ * Get the volumes property: The list of volumes that can be mounted by containers in this container group.
+ *
+ * @return the volumes value.
+ */
+ public List volumes() {
+ return this.volumes;
+ }
+
+ /**
+ * Set the volumes property: The list of volumes that can be mounted by containers in this container group.
+ *
+ * @param volumes the volumes value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withVolumes(List volumes) {
+ this.volumes = volumes;
+ return this;
+ }
+
+ /**
+ * Get the instanceView property: The instance view of the container group. Only valid in response.
+ *
+ * @return the instanceView value.
+ */
+ public ContainerGroupPropertiesInstanceView instanceView() {
+ return this.instanceView;
+ }
+
+ /**
+ * Get the diagnostics property: The diagnostic information for a container group.
+ *
+ * @return the diagnostics value.
+ */
+ public ContainerGroupDiagnostics diagnostics() {
+ return this.diagnostics;
+ }
+
+ /**
+ * Set the diagnostics property: The diagnostic information for a container group.
+ *
+ * @param diagnostics the diagnostics value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withDiagnostics(ContainerGroupDiagnostics diagnostics) {
+ this.diagnostics = diagnostics;
+ return this;
+ }
+
+ /**
+ * Get the subnetIds property: The subnet resource IDs for a container group.
+ *
+ * @return the subnetIds value.
+ */
+ public List subnetIds() {
+ return this.subnetIds;
+ }
+
+ /**
+ * Set the subnetIds property: The subnet resource IDs for a container group.
+ *
+ * @param subnetIds the subnetIds value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withSubnetIds(List subnetIds) {
+ this.subnetIds = subnetIds;
+ return this;
+ }
+
+ /**
+ * Get the dnsConfig property: The DNS config information for a container group.
+ *
+ * @return the dnsConfig value.
+ */
+ public DnsConfiguration dnsConfig() {
+ return this.dnsConfig;
+ }
+
+ /**
+ * Set the dnsConfig property: The DNS config information for a container group.
+ *
+ * @param dnsConfig the dnsConfig value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withDnsConfig(DnsConfiguration dnsConfig) {
+ this.dnsConfig = dnsConfig;
+ return this;
+ }
+
+ /**
+ * Get the sku property: The SKU for a container group.
+ *
+ * @return the sku value.
+ */
+ public ContainerGroupSku sku() {
+ return this.sku;
+ }
+
+ /**
+ * Set the sku property: The SKU for a container group.
+ *
+ * @param sku the sku value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withSku(ContainerGroupSku sku) {
+ this.sku = sku;
+ return this;
+ }
+
+ /**
+ * Get the encryptionProperties property: The encryption properties for a container group.
+ *
+ * @return the encryptionProperties value.
+ */
+ public EncryptionProperties encryptionProperties() {
+ return this.encryptionProperties;
+ }
+
+ /**
+ * Set the encryptionProperties property: The encryption properties for a container group.
+ *
+ * @param encryptionProperties the encryptionProperties value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withEncryptionProperties(EncryptionProperties encryptionProperties) {
+ this.encryptionProperties = encryptionProperties;
+ return this;
+ }
+
+ /**
+ * Get the initContainers property: The init containers for a container group.
+ *
+ * @return the initContainers value.
+ */
+ public List initContainers() {
+ return this.initContainers;
+ }
+
+ /**
+ * Set the initContainers property: The init containers for a container group.
+ *
+ * @param initContainers the initContainers value to set.
+ * @return the ContainerGroupPropertiesProperties object itself.
+ */
+ public ContainerGroupPropertiesProperties withInitContainers(List initContainers) {
+ this.initContainers = initContainers;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (containers() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property containers in model ContainerGroupPropertiesProperties"));
+ } else {
+ containers().forEach(e -> e.validate());
+ }
+ if (imageRegistryCredentials() != null) {
+ imageRegistryCredentials().forEach(e -> e.validate());
+ }
+ if (ipAddress() != null) {
+ ipAddress().validate();
+ }
+ if (osType() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ "Missing required property osType in model ContainerGroupPropertiesProperties"));
+ }
+ if (volumes() != null) {
+ volumes().forEach(e -> e.validate());
+ }
+ if (instanceView() != null) {
+ instanceView().validate();
+ }
+ if (diagnostics() != null) {
+ diagnostics().validate();
+ }
+ if (subnetIds() != null) {
+ subnetIds().forEach(e -> e.validate());
+ }
+ if (dnsConfig() != null) {
+ dnsConfig().validate();
+ }
+ if (encryptionProperties() != null) {
+ encryptionProperties().validate();
+ }
+ if (initContainers() != null) {
+ initContainers().forEach(e -> e.validate());
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupPropertiesProperties.class);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java
new file mode 100644
index 000000000000..48b6cb876540
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/ContainerProperties.java
@@ -0,0 +1,283 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerPort;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerProbe;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerPropertiesInstanceView;
+import com.azure.resourcemanager.containerinstance.generated.models.EnvironmentVariable;
+import com.azure.resourcemanager.containerinstance.generated.models.ResourceRequirements;
+import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The container instance properties. */
+@Fluent
+public final class ContainerProperties {
+ /*
+ * The name of the image used to create the container instance.
+ */
+ @JsonProperty(value = "image", required = true)
+ private String image;
+
+ /*
+ * The commands to execute within the container instance in exec form.
+ */
+ @JsonProperty(value = "command")
+ private List command;
+
+ /*
+ * The exposed ports on the container instance.
+ */
+ @JsonProperty(value = "ports")
+ private List ports;
+
+ /*
+ * The environment variables to set in the container instance.
+ */
+ @JsonProperty(value = "environmentVariables")
+ private List environmentVariables;
+
+ /*
+ * The instance view of the container instance. Only valid in response.
+ */
+ @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY)
+ private ContainerPropertiesInstanceView instanceView;
+
+ /*
+ * The resource requirements of the container instance.
+ */
+ @JsonProperty(value = "resources", required = true)
+ private ResourceRequirements resources;
+
+ /*
+ * The volume mounts available to the container instance.
+ */
+ @JsonProperty(value = "volumeMounts")
+ private List volumeMounts;
+
+ /*
+ * The liveness probe.
+ */
+ @JsonProperty(value = "livenessProbe")
+ private ContainerProbe livenessProbe;
+
+ /*
+ * The readiness probe.
+ */
+ @JsonProperty(value = "readinessProbe")
+ private ContainerProbe readinessProbe;
+
+ /**
+ * Get the image property: The name of the image used to create the container instance.
+ *
+ * @return the image value.
+ */
+ public String image() {
+ return this.image;
+ }
+
+ /**
+ * Set the image property: The name of the image used to create the container instance.
+ *
+ * @param image the image value to set.
+ * @return the ContainerProperties object itself.
+ */
+ public ContainerProperties withImage(String image) {
+ this.image = image;
+ return this;
+ }
+
+ /**
+ * Get the command property: The commands to execute within the container instance in exec form.
+ *
+ * @return the command value.
+ */
+ public List command() {
+ return this.command;
+ }
+
+ /**
+ * Set the command property: The commands to execute within the container instance in exec form.
+ *
+ * @param command the command value to set.
+ * @return the ContainerProperties object itself.
+ */
+ public ContainerProperties withCommand(List command) {
+ this.command = command;
+ return this;
+ }
+
+ /**
+ * Get the ports property: The exposed ports on the container instance.
+ *
+ * @return the ports value.
+ */
+ public List ports() {
+ return this.ports;
+ }
+
+ /**
+ * Set the ports property: The exposed ports on the container instance.
+ *
+ * @param ports the ports value to set.
+ * @return the ContainerProperties object itself.
+ */
+ public ContainerProperties withPorts(List ports) {
+ this.ports = ports;
+ return this;
+ }
+
+ /**
+ * Get the environmentVariables property: The environment variables to set in the container instance.
+ *
+ * @return the environmentVariables value.
+ */
+ public List environmentVariables() {
+ return this.environmentVariables;
+ }
+
+ /**
+ * Set the environmentVariables property: The environment variables to set in the container instance.
+ *
+ * @param environmentVariables the environmentVariables value to set.
+ * @return the ContainerProperties object itself.
+ */
+ public ContainerProperties withEnvironmentVariables(List environmentVariables) {
+ this.environmentVariables = environmentVariables;
+ return this;
+ }
+
+ /**
+ * Get the instanceView property: The instance view of the container instance. Only valid in response.
+ *
+ * @return the instanceView value.
+ */
+ public ContainerPropertiesInstanceView instanceView() {
+ return this.instanceView;
+ }
+
+ /**
+ * Get the resources property: The resource requirements of the container instance.
+ *
+ * @return the resources value.
+ */
+ public ResourceRequirements resources() {
+ return this.resources;
+ }
+
+ /**
+ * Set the resources property: The resource requirements of the container instance.
+ *
+ * @param resources the resources value to set.
+ * @return the ContainerProperties object itself.
+ */
+ public ContainerProperties withResources(ResourceRequirements resources) {
+ this.resources = resources;
+ return this;
+ }
+
+ /**
+ * Get the volumeMounts property: The volume mounts available to the container instance.
+ *
+ * @return the volumeMounts value.
+ */
+ public List volumeMounts() {
+ return this.volumeMounts;
+ }
+
+ /**
+ * Set the volumeMounts property: The volume mounts available to the container instance.
+ *
+ * @param volumeMounts the volumeMounts value to set.
+ * @return the ContainerProperties object itself.
+ */
+ public ContainerProperties withVolumeMounts(List volumeMounts) {
+ this.volumeMounts = volumeMounts;
+ return this;
+ }
+
+ /**
+ * Get the livenessProbe property: The liveness probe.
+ *
+ * @return the livenessProbe value.
+ */
+ public ContainerProbe livenessProbe() {
+ return this.livenessProbe;
+ }
+
+ /**
+ * Set the livenessProbe property: The liveness probe.
+ *
+ * @param livenessProbe the livenessProbe value to set.
+ * @return the ContainerProperties object itself.
+ */
+ public ContainerProperties withLivenessProbe(ContainerProbe livenessProbe) {
+ this.livenessProbe = livenessProbe;
+ return this;
+ }
+
+ /**
+ * Get the readinessProbe property: The readiness probe.
+ *
+ * @return the readinessProbe value.
+ */
+ public ContainerProbe readinessProbe() {
+ return this.readinessProbe;
+ }
+
+ /**
+ * Set the readinessProbe property: The readiness probe.
+ *
+ * @param readinessProbe the readinessProbe value to set.
+ * @return the ContainerProperties object itself.
+ */
+ public ContainerProperties withReadinessProbe(ContainerProbe readinessProbe) {
+ this.readinessProbe = readinessProbe;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (image() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property image in model ContainerProperties"));
+ }
+ if (ports() != null) {
+ ports().forEach(e -> e.validate());
+ }
+ if (environmentVariables() != null) {
+ environmentVariables().forEach(e -> e.validate());
+ }
+ if (instanceView() != null) {
+ instanceView().validate();
+ }
+ if (resources() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property resources in model ContainerProperties"));
+ } else {
+ resources().validate();
+ }
+ if (volumeMounts() != null) {
+ volumeMounts().forEach(e -> e.validate());
+ }
+ if (livenessProbe() != null) {
+ livenessProbe().validate();
+ }
+ if (readinessProbe() != null) {
+ readinessProbe().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(ContainerProperties.class);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java
new file mode 100644
index 000000000000..e07813b8da75
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/InitContainerPropertiesDefinition.java
@@ -0,0 +1,152 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.resourcemanager.containerinstance.generated.models.EnvironmentVariable;
+import com.azure.resourcemanager.containerinstance.generated.models.InitContainerPropertiesDefinitionInstanceView;
+import com.azure.resourcemanager.containerinstance.generated.models.VolumeMount;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** The init container definition properties. */
+@Fluent
+public final class InitContainerPropertiesDefinition {
+ /*
+ * The image of the init container.
+ */
+ @JsonProperty(value = "image")
+ private String image;
+
+ /*
+ * The command to execute within the init container in exec form.
+ */
+ @JsonProperty(value = "command")
+ private List command;
+
+ /*
+ * The environment variables to set in the init container.
+ */
+ @JsonProperty(value = "environmentVariables")
+ private List environmentVariables;
+
+ /*
+ * The instance view of the init container. Only valid in response.
+ */
+ @JsonProperty(value = "instanceView", access = JsonProperty.Access.WRITE_ONLY)
+ private InitContainerPropertiesDefinitionInstanceView instanceView;
+
+ /*
+ * The volume mounts available to the init container.
+ */
+ @JsonProperty(value = "volumeMounts")
+ private List volumeMounts;
+
+ /**
+ * Get the image property: The image of the init container.
+ *
+ * @return the image value.
+ */
+ public String image() {
+ return this.image;
+ }
+
+ /**
+ * Set the image property: The image of the init container.
+ *
+ * @param image the image value to set.
+ * @return the InitContainerPropertiesDefinition object itself.
+ */
+ public InitContainerPropertiesDefinition withImage(String image) {
+ this.image = image;
+ return this;
+ }
+
+ /**
+ * Get the command property: The command to execute within the init container in exec form.
+ *
+ * @return the command value.
+ */
+ public List command() {
+ return this.command;
+ }
+
+ /**
+ * Set the command property: The command to execute within the init container in exec form.
+ *
+ * @param command the command value to set.
+ * @return the InitContainerPropertiesDefinition object itself.
+ */
+ public InitContainerPropertiesDefinition withCommand(List command) {
+ this.command = command;
+ return this;
+ }
+
+ /**
+ * Get the environmentVariables property: The environment variables to set in the init container.
+ *
+ * @return the environmentVariables value.
+ */
+ public List environmentVariables() {
+ return this.environmentVariables;
+ }
+
+ /**
+ * Set the environmentVariables property: The environment variables to set in the init container.
+ *
+ * @param environmentVariables the environmentVariables value to set.
+ * @return the InitContainerPropertiesDefinition object itself.
+ */
+ public InitContainerPropertiesDefinition withEnvironmentVariables(List environmentVariables) {
+ this.environmentVariables = environmentVariables;
+ return this;
+ }
+
+ /**
+ * Get the instanceView property: The instance view of the init container. Only valid in response.
+ *
+ * @return the instanceView value.
+ */
+ public InitContainerPropertiesDefinitionInstanceView instanceView() {
+ return this.instanceView;
+ }
+
+ /**
+ * Get the volumeMounts property: The volume mounts available to the init container.
+ *
+ * @return the volumeMounts value.
+ */
+ public List volumeMounts() {
+ return this.volumeMounts;
+ }
+
+ /**
+ * Set the volumeMounts property: The volume mounts available to the init container.
+ *
+ * @param volumeMounts the volumeMounts value to set.
+ * @return the InitContainerPropertiesDefinition object itself.
+ */
+ public InitContainerPropertiesDefinition withVolumeMounts(List volumeMounts) {
+ this.volumeMounts = volumeMounts;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (environmentVariables() != null) {
+ environmentVariables().forEach(e -> e.validate());
+ }
+ if (instanceView() != null) {
+ instanceView().validate();
+ }
+ if (volumeMounts() != null) {
+ volumeMounts().forEach(e -> e.validate());
+ }
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java
new file mode 100644
index 000000000000..33992fa4d821
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/LogsInner.java
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The logs. */
+@Fluent
+public final class LogsInner {
+ /*
+ * The content of the log.
+ */
+ @JsonProperty(value = "content")
+ private String content;
+
+ /**
+ * Get the content property: The content of the log.
+ *
+ * @return the content value.
+ */
+ public String content() {
+ return this.content;
+ }
+
+ /**
+ * Set the content property: The content of the log.
+ *
+ * @param content the content value to set.
+ * @return the LogsInner object itself.
+ */
+ public LogsInner withContent(String content) {
+ this.content = content;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java
new file mode 100644
index 000000000000..3975d84431b7
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/OperationInner.java
@@ -0,0 +1,141 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerInstanceOperationsOrigin;
+import com.azure.resourcemanager.containerinstance.generated.models.OperationDisplay;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** An operation for Azure Container Instance service. */
+@Fluent
+public final class OperationInner {
+ /*
+ * The name of the operation.
+ */
+ @JsonProperty(value = "name", required = true)
+ private String name;
+
+ /*
+ * The display information of the operation.
+ */
+ @JsonProperty(value = "display", required = true)
+ private OperationDisplay display;
+
+ /*
+ * The additional properties.
+ */
+ @JsonProperty(value = "properties")
+ private Object properties;
+
+ /*
+ * The intended executor of the operation.
+ */
+ @JsonProperty(value = "origin")
+ private ContainerInstanceOperationsOrigin origin;
+
+ /**
+ * Get the name property: The name of the operation.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: The name of the operation.
+ *
+ * @param name the name value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the display property: The display information of the operation.
+ *
+ * @return the display value.
+ */
+ public OperationDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: The display information of the operation.
+ *
+ * @param display the display value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withDisplay(OperationDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the properties property: The additional properties.
+ *
+ * @return the properties value.
+ */
+ public Object properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: The additional properties.
+ *
+ * @param properties the properties value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withProperties(Object properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation.
+ *
+ * @return the origin value.
+ */
+ public ContainerInstanceOperationsOrigin origin() {
+ return this.origin;
+ }
+
+ /**
+ * Set the origin property: The intended executor of the operation.
+ *
+ * @param origin the origin value to set.
+ * @return the OperationInner object itself.
+ */
+ public OperationInner withOrigin(ContainerInstanceOperationsOrigin origin) {
+ this.origin = origin;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (name() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property name in model OperationInner"));
+ }
+ if (display() == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException("Missing required property display in model OperationInner"));
+ } else {
+ display().validate();
+ }
+ }
+
+ private static final ClientLogger LOGGER = new ClientLogger(OperationInner.class);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java
new file mode 100644
index 000000000000..b7361fe0c6e6
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/UsageInner.java
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.resourcemanager.containerinstance.generated.models.UsageName;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** A single usage result. */
+@Immutable
+public final class UsageInner {
+ /*
+ * Id of the usage result
+ */
+ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
+ private String id;
+
+ /*
+ * Unit of the usage result
+ */
+ @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY)
+ private String unit;
+
+ /*
+ * The current usage of the resource
+ */
+ @JsonProperty(value = "currentValue", access = JsonProperty.Access.WRITE_ONLY)
+ private Integer currentValue;
+
+ /*
+ * The maximum permitted usage of the resource.
+ */
+ @JsonProperty(value = "limit", access = JsonProperty.Access.WRITE_ONLY)
+ private Integer limit;
+
+ /*
+ * The name object of the resource
+ */
+ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
+ private UsageName name;
+
+ /**
+ * Get the id property: Id of the usage result.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Get the unit property: Unit of the usage result.
+ *
+ * @return the unit value.
+ */
+ public String unit() {
+ return this.unit;
+ }
+
+ /**
+ * Get the currentValue property: The current usage of the resource.
+ *
+ * @return the currentValue value.
+ */
+ public Integer currentValue() {
+ return this.currentValue;
+ }
+
+ /**
+ * Get the limit property: The maximum permitted usage of the resource.
+ *
+ * @return the limit value.
+ */
+ public Integer limit() {
+ return this.limit;
+ }
+
+ /**
+ * Get the name property: The name object of the resource.
+ *
+ * @return the name value.
+ */
+ public UsageName name() {
+ return this.name;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (name() != null) {
+ name().validate();
+ }
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/models/package-info.java
new file mode 100644
index 000000000000..bb018aa296a5
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/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 ContainerInstanceManagementClient. null. */
+package com.azure.resourcemanager.containerinstance.generated.fluent.models;
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/fluent/package-info.java
new file mode 100644
index 000000000000..57d35f85a895
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/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 ContainerInstanceManagementClient. null. */
+package com.azure.resourcemanager.containerinstance.generated.fluent;
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java
new file mode 100644
index 000000000000..0c571d4df632
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CachedImagesImpl.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.implementation;
+
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.CachedImagesInner;
+import com.azure.resourcemanager.containerinstance.generated.models.CachedImages;
+
+public final class CachedImagesImpl implements CachedImages {
+ private CachedImagesInner innerObject;
+
+ private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager;
+
+ CachedImagesImpl(
+ CachedImagesInner innerObject,
+ com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String osType() {
+ return this.innerModel().osType();
+ }
+
+ public String image() {
+ return this.innerModel().image();
+ }
+
+ public CachedImagesInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java
new file mode 100644
index 000000000000..fe9402098c09
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/CapabilitiesImpl.java
@@ -0,0 +1,54 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.implementation;
+
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.CapabilitiesInner;
+import com.azure.resourcemanager.containerinstance.generated.models.Capabilities;
+import com.azure.resourcemanager.containerinstance.generated.models.CapabilitiesCapabilities;
+
+public final class CapabilitiesImpl implements Capabilities {
+ private CapabilitiesInner innerObject;
+
+ private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager;
+
+ CapabilitiesImpl(
+ CapabilitiesInner innerObject,
+ com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String resourceType() {
+ return this.innerModel().resourceType();
+ }
+
+ public String osType() {
+ return this.innerModel().osType();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public String ipAddressType() {
+ return this.innerModel().ipAddressType();
+ }
+
+ public String gpu() {
+ return this.innerModel().gpu();
+ }
+
+ public CapabilitiesCapabilities capabilities() {
+ return this.innerModel().capabilities();
+ }
+
+ public CapabilitiesInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java
new file mode 100644
index 000000000000..8ed6def34bc8
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerAttachResponseImpl.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.implementation;
+
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerAttachResponse;
+
+public final class ContainerAttachResponseImpl implements ContainerAttachResponse {
+ private ContainerAttachResponseInner innerObject;
+
+ private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager;
+
+ ContainerAttachResponseImpl(
+ ContainerAttachResponseInner innerObject,
+ com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String webSocketUri() {
+ return this.innerModel().webSocketUri();
+ }
+
+ public String password() {
+ return this.innerModel().password();
+ }
+
+ public ContainerAttachResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java
new file mode 100644
index 000000000000..7a8f27caf675
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerExecResponseImpl.java
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.implementation;
+
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecResponse;
+
+public final class ContainerExecResponseImpl implements ContainerExecResponse {
+ private ContainerExecResponseInner innerObject;
+
+ private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager;
+
+ ContainerExecResponseImpl(
+ ContainerExecResponseInner innerObject,
+ com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String webSocketUri() {
+ return this.innerModel().webSocketUri();
+ }
+
+ public String password() {
+ return this.innerModel().password();
+ }
+
+ public ContainerExecResponseInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java
new file mode 100644
index 000000000000..13ac8fcb4214
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupImpl.java
@@ -0,0 +1,339 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.implementation;
+
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.Region;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner;
+import com.azure.resourcemanager.containerinstance.generated.models.Container;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroup;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupDiagnostics;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupIdentity;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupPropertiesInstanceView;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupRestartPolicy;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSku;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupSubnetId;
+import com.azure.resourcemanager.containerinstance.generated.models.DnsConfiguration;
+import com.azure.resourcemanager.containerinstance.generated.models.EncryptionProperties;
+import com.azure.resourcemanager.containerinstance.generated.models.ImageRegistryCredential;
+import com.azure.resourcemanager.containerinstance.generated.models.InitContainerDefinition;
+import com.azure.resourcemanager.containerinstance.generated.models.IpAddress;
+import com.azure.resourcemanager.containerinstance.generated.models.OperatingSystemTypes;
+import com.azure.resourcemanager.containerinstance.generated.models.Volume;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class ContainerGroupImpl implements ContainerGroup, ContainerGroup.Definition {
+ private ContainerGroupInner innerObject;
+
+ private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager;
+
+ ContainerGroupImpl(
+ ContainerGroupInner innerObject,
+ com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager 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 String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public List zones() {
+ List inner = this.innerModel().zones();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ContainerGroupIdentity identity() {
+ return this.innerModel().identity();
+ }
+
+ public String provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public List containers() {
+ List inner = this.innerModel().containers();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public List imageRegistryCredentials() {
+ List inner = this.innerModel().imageRegistryCredentials();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ContainerGroupRestartPolicy restartPolicy() {
+ return this.innerModel().restartPolicy();
+ }
+
+ public IpAddress ipAddress() {
+ return this.innerModel().ipAddress();
+ }
+
+ public OperatingSystemTypes osType() {
+ return this.innerModel().osType();
+ }
+
+ public List volumes() {
+ List inner = this.innerModel().volumes();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public ContainerGroupPropertiesInstanceView instanceView() {
+ return this.innerModel().instanceView();
+ }
+
+ public ContainerGroupDiagnostics diagnostics() {
+ return this.innerModel().diagnostics();
+ }
+
+ public List subnetIds() {
+ List inner = this.innerModel().subnetIds();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public DnsConfiguration dnsConfig() {
+ return this.innerModel().dnsConfig();
+ }
+
+ public ContainerGroupSku sku() {
+ return this.innerModel().sku();
+ }
+
+ public EncryptionProperties encryptionProperties() {
+ return this.innerModel().encryptionProperties();
+ }
+
+ public List initContainers() {
+ List inner = this.innerModel().initContainers();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public ContainerGroupInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String containerGroupName;
+
+ public ContainerGroupImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public ContainerGroup create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getContainerGroups()
+ .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public ContainerGroup create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getContainerGroups()
+ .createOrUpdate(resourceGroupName, containerGroupName, this.innerModel(), context);
+ return this;
+ }
+
+ ContainerGroupImpl(
+ String name, com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) {
+ this.innerObject = new ContainerGroupInner();
+ this.serviceManager = serviceManager;
+ this.containerGroupName = name;
+ }
+
+ public ContainerGroup refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getContainerGroups()
+ .getByResourceGroupWithResponse(resourceGroupName, containerGroupName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ContainerGroup refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getContainerGroups()
+ .getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context)
+ .getValue();
+ return this;
+ }
+
+ public void restart() {
+ serviceManager.containerGroups().restart(resourceGroupName, containerGroupName);
+ }
+
+ public void restart(Context context) {
+ serviceManager.containerGroups().restart(resourceGroupName, containerGroupName, context);
+ }
+
+ public void stop() {
+ serviceManager.containerGroups().stop(resourceGroupName, containerGroupName);
+ }
+
+ public Response stopWithResponse(Context context) {
+ return serviceManager.containerGroups().stopWithResponse(resourceGroupName, containerGroupName, context);
+ }
+
+ public void start() {
+ serviceManager.containerGroups().start(resourceGroupName, containerGroupName);
+ }
+
+ public void start(Context context) {
+ serviceManager.containerGroups().start(resourceGroupName, containerGroupName, context);
+ }
+
+ public ContainerGroupImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public ContainerGroupImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public ContainerGroupImpl withContainers(List containers) {
+ this.innerModel().withContainers(containers);
+ return this;
+ }
+
+ public ContainerGroupImpl withOsType(OperatingSystemTypes osType) {
+ this.innerModel().withOsType(osType);
+ return this;
+ }
+
+ public ContainerGroupImpl withTags(Map tags) {
+ this.innerModel().withTags(tags);
+ return this;
+ }
+
+ public ContainerGroupImpl withZones(List zones) {
+ this.innerModel().withZones(zones);
+ return this;
+ }
+
+ public ContainerGroupImpl withIdentity(ContainerGroupIdentity identity) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ }
+
+ public ContainerGroupImpl withImageRegistryCredentials(List imageRegistryCredentials) {
+ this.innerModel().withImageRegistryCredentials(imageRegistryCredentials);
+ return this;
+ }
+
+ public ContainerGroupImpl withRestartPolicy(ContainerGroupRestartPolicy restartPolicy) {
+ this.innerModel().withRestartPolicy(restartPolicy);
+ return this;
+ }
+
+ public ContainerGroupImpl withIpAddress(IpAddress ipAddress) {
+ this.innerModel().withIpAddress(ipAddress);
+ return this;
+ }
+
+ public ContainerGroupImpl withVolumes(List volumes) {
+ this.innerModel().withVolumes(volumes);
+ return this;
+ }
+
+ public ContainerGroupImpl withDiagnostics(ContainerGroupDiagnostics diagnostics) {
+ this.innerModel().withDiagnostics(diagnostics);
+ return this;
+ }
+
+ public ContainerGroupImpl withSubnetIds(List subnetIds) {
+ this.innerModel().withSubnetIds(subnetIds);
+ return this;
+ }
+
+ public ContainerGroupImpl withDnsConfig(DnsConfiguration dnsConfig) {
+ this.innerModel().withDnsConfig(dnsConfig);
+ return this;
+ }
+
+ public ContainerGroupImpl withSku(ContainerGroupSku sku) {
+ this.innerModel().withSku(sku);
+ return this;
+ }
+
+ public ContainerGroupImpl withEncryptionProperties(EncryptionProperties encryptionProperties) {
+ this.innerModel().withEncryptionProperties(encryptionProperties);
+ return this;
+ }
+
+ public ContainerGroupImpl withInitContainers(List initContainers) {
+ this.innerModel().withInitContainers(initContainers);
+ return this;
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java
new file mode 100644
index 000000000000..d0ec2363a422
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsClientImpl.java
@@ -0,0 +1,2331 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Post;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.Resource;
+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.containerinstance.generated.fluent.ContainerGroupsClient;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroupListResult;
+import java.nio.ByteBuffer;
+import java.util.List;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ContainerGroupsClient. */
+public final class ContainerGroupsClientImpl implements ContainerGroupsClient {
+ /** The proxy service used to perform REST calls. */
+ private final ContainerGroupsService service;
+
+ /** The service client containing this operation class. */
+ private final ContainerInstanceManagementClientImpl client;
+
+ /**
+ * Initializes an instance of ContainerGroupsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ContainerGroupsClientImpl(ContainerInstanceManagementClientImpl client) {
+ this.service =
+ RestProxy.create(ContainerGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ContainerInstanceManagementClientContainerGroups to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ContainerInstanceMan")
+ private interface ContainerGroupsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerInstance/containerGroups")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getByResourceGroup(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> createOrUpdate(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @BodyParam("application/json") ContainerGroupInner containerGroup,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @BodyParam("application/json") Resource resource,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}/restart")
+ @ExpectedResponses({204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> restart(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}/stop")
+ @ExpectedResponses({204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> stop(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}/start")
+ @ExpectedResponses({202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> start(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}/outboundNetworkDependenciesEndpoints")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> getOutboundNetworkDependenciesEndpoints(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @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);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Get a list of container groups in the specified subscription. This operation returns properties of each container
+ * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and
+ * volumes.
+ *
+ * @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 container groups in the specified subscription along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ 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()));
+ }
+
+ /**
+ * Get a list of container groups in the specified subscription. This operation returns properties of each container
+ * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and
+ * volumes.
+ *
+ * @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 container groups in the specified subscription along with {@link PagedResponse} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get a list of container groups in the specified subscription. This operation returns properties of each container
+ * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and
+ * volumes.
+ *
+ * @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 container groups in the specified subscription as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Get a list of container groups in the specified subscription. This operation returns properties of each container
+ * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and
+ * volumes.
+ *
+ * @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 container groups in the specified subscription as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Get a list of container groups in the specified subscription. This operation returns properties of each container
+ * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and
+ * volumes.
+ *
+ * @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 container groups in the specified subscription as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Get a list of container groups in the specified subscription. This operation returns properties of each container
+ * group including containers, image registry credentials, restart policy, IP address type, OS type, state, and
+ * volumes.
+ *
+ * @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 container groups in the specified subscription as paginated response with {@link
+ * PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Get a list of container groups in a specified subscription and resource group. This operation returns properties
+ * of each container group including containers, image registry credentials, restart policy, IP address type, OS
+ * type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 container groups in a specified subscription and resource group along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a list of container groups in a specified subscription and resource group. This operation returns properties
+ * of each container group including containers, image registry credentials, restart policy, IP address type, OS
+ * type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 container groups in a specified subscription and resource group along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get a list of container groups in a specified subscription and resource group. This operation returns properties
+ * of each container group including containers, image registry credentials, restart policy, IP address type, OS
+ * type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 container groups in a specified subscription and resource group as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Get a list of container groups in a specified subscription and resource group. This operation returns properties
+ * of each container group including containers, image registry credentials, restart policy, IP address type, OS
+ * type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 container groups in a specified subscription and resource group as paginated response with
+ * {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Get a list of container groups in a specified subscription and resource group. This operation returns properties
+ * of each container group including containers, image registry credentials, restart policy, IP address type, OS
+ * type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 container groups in a specified subscription and resource group as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Get a list of container groups in a specified subscription and resource group. This operation returns properties
+ * of each container group including containers, image registry credentials, restart policy, IP address type, OS
+ * type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @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 container groups in a specified subscription and resource group as paginated response with
+ * {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Gets the properties of the specified container group in the specified subscription and resource group. The
+ * operation returns the properties of each container group including containers, image registry credentials,
+ * restart policy, IP address type, OS type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 properties of the specified container group in the specified subscription and resource group along
+ * with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String containerGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets the properties of the specified container group in the specified subscription and resource group. The
+ * operation returns the properties of each container group including containers, image registry credentials,
+ * restart policy, IP address type, OS type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 properties of the specified container group in the specified subscription and resource group along
+ * with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets the properties of the specified container group in the specified subscription and resource group. The
+ * operation returns the properties of each container group including containers, image registry credentials,
+ * restart policy, IP address type, OS type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 properties of the specified container group in the specified subscription and resource group on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String containerGroupName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, containerGroupName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets the properties of the specified container group in the specified subscription and resource group. The
+ * operation returns the properties of each container group including containers, image registry credentials,
+ * restart policy, IP address type, OS type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 properties of the specified container group in the specified subscription and resource group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContainerGroupInner getByResourceGroup(String resourceGroupName, String containerGroupName) {
+ return getByResourceGroupAsync(resourceGroupName, containerGroupName).block();
+ }
+
+ /**
+ * Gets the properties of the specified container group in the specified subscription and resource group. The
+ * operation returns the properties of each container group including containers, image registry credentials,
+ * restart policy, IP address type, OS type, state, and volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 properties of the specified container group in the specified subscription and resource group along
+ * with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String containerGroupName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, containerGroupName, context).block();
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (containerGroup == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerGroup is required and cannot be null."));
+ } else {
+ containerGroup.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ containerGroup,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> createOrUpdateWithResponseAsync(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (containerGroup == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerGroup is required and cannot be null."));
+ } else {
+ containerGroup.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .createOrUpdate(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ containerGroup,
+ accept,
+ context);
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ContainerGroupInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, containerGroupName, containerGroup);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ContainerGroupInner.class,
+ ContainerGroupInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link PollerFlux} for polling of a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ContainerGroupInner> beginCreateOrUpdateAsync(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ createOrUpdateWithResponseAsync(resourceGroupName, containerGroupName, containerGroup, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), ContainerGroupInner.class, ContainerGroupInner.class, context);
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ContainerGroupInner> beginCreateOrUpdate(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
+ return beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).getSyncPoller();
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link SyncPoller} for polling of a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ContainerGroupInner> beginCreateOrUpdate(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context).getSyncPoller();
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
+ return beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono createOrUpdateAsync(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) {
+ return beginCreateOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContainerGroupInner createOrUpdate(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup) {
+ return createOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup).block();
+ }
+
+ /**
+ * Create or update container groups with specified configurations.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerGroup The properties of the container group to be created or updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContainerGroupInner createOrUpdate(
+ String resourceGroupName, String containerGroupName, ContainerGroupInner containerGroup, Context context) {
+ return createOrUpdateAsync(resourceGroupName, containerGroupName, containerGroup, context).block();
+ }
+
+ /**
+ * Updates container group tags with specified values.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param resource The container group resource with just the tags to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName, String containerGroupName, Resource resource) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ resource,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Updates container group tags with specified values.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param resource The container group resource with just the tags to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName, String containerGroupName, Resource resource, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (resource == null) {
+ return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ resource,
+ accept,
+ context);
+ }
+
+ /**
+ * Updates container group tags with specified values.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param resource The container group resource with just the tags to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono updateAsync(
+ String resourceGroupName, String containerGroupName, Resource resource) {
+ return updateWithResponseAsync(resourceGroupName, containerGroupName, resource)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Updates container group tags with specified values.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param resource The container group resource with just the tags to be updated.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContainerGroupInner update(String resourceGroupName, String containerGroupName, Resource resource) {
+ return updateAsync(resourceGroupName, containerGroupName, resource).block();
+ }
+
+ /**
+ * Updates container group tags with specified values.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param resource The container group resource with just the tags to be updated.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a container group along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(
+ String resourceGroupName, String containerGroupName, Resource resource, Context context) {
+ return updateWithResponseAsync(resourceGroupName, containerGroupName, resource, context).block();
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 container group along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String containerGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 container group along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context);
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ContainerGroupInner> beginDeleteAsync(
+ String resourceGroupName, String containerGroupName) {
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerGroupName);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ ContainerGroupInner.class,
+ ContainerGroupInner.class,
+ this.client.getContext());
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ private PollerFlux, ContainerGroupInner> beginDeleteAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerGroupName, context);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), ContainerGroupInner.class, ContainerGroupInner.class, context);
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ContainerGroupInner> beginDelete(
+ String resourceGroupName, String containerGroupName) {
+ return beginDeleteAsync(resourceGroupName, containerGroupName).getSyncPoller();
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 a container group.
+ */
+ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
+ public SyncPoller, ContainerGroupInner> beginDelete(
+ String resourceGroupName, String containerGroupName, Context context) {
+ return beginDeleteAsync(resourceGroupName, containerGroupName, context).getSyncPoller();
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 container group on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String resourceGroupName, String containerGroupName) {
+ return beginDeleteAsync(resourceGroupName, containerGroupName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 container group on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ return beginDeleteAsync(resourceGroupName, containerGroupName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContainerGroupInner delete(String resourceGroupName, String containerGroupName) {
+ return deleteAsync(resourceGroupName, containerGroupName).block();
+ }
+
+ /**
+ * Delete the specified container group in the specified subscription and resource group. The operation does not
+ * delete other resources provided by the user, such as volumes.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContainerGroupInner delete(String resourceGroupName, String containerGroupName, Context context) {
+ return deleteAsync(resourceGroupName, containerGroupName, context).block();
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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>> restartWithResponseAsync(
+ String resourceGroupName, String containerGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .restart(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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>> restartWithResponseAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .restart(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context);
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginRestartAsync(String resourceGroupName, String containerGroupName) {
+ Mono>> mono = restartWithResponseAsync(resourceGroupName, containerGroupName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginRestartAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ restartWithResponseAsync(resourceGroupName, containerGroupName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginRestart(String resourceGroupName, String containerGroupName) {
+ return beginRestartAsync(resourceGroupName, containerGroupName).getSyncPoller();
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginRestart(
+ String resourceGroupName, String containerGroupName, Context context) {
+ return beginRestartAsync(resourceGroupName, containerGroupName, context).getSyncPoller();
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 restartAsync(String resourceGroupName, String containerGroupName) {
+ return beginRestartAsync(resourceGroupName, containerGroupName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 restartAsync(String resourceGroupName, String containerGroupName, Context context) {
+ return beginRestartAsync(resourceGroupName, containerGroupName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 restart(String resourceGroupName, String containerGroupName) {
+ restartAsync(resourceGroupName, containerGroupName).block();
+ }
+
+ /**
+ * Restarts all containers in a container group in place. If container image has updates, new image will be
+ * downloaded.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 restart(String resourceGroupName, String containerGroupName, Context context) {
+ restartAsync(resourceGroupName, containerGroupName, context).block();
+ }
+
+ /**
+ * Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> stopWithResponseAsync(String resourceGroupName, String containerGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .stop(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> stopWithResponseAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .stop(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context);
+ }
+
+ /**
+ * Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 stopAsync(String resourceGroupName, String containerGroupName) {
+ return stopWithResponseAsync(resourceGroupName, containerGroupName).flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 stop(String resourceGroupName, String containerGroupName) {
+ stopAsync(resourceGroupName, containerGroupName).block();
+ }
+
+ /**
+ * Stops all containers in a container group. Compute resources will be deallocated and billing will stop.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 stopWithResponse(String resourceGroupName, String containerGroupName, Context context) {
+ return stopWithResponseAsync(resourceGroupName, containerGroupName, context).block();
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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>> startWithResponseAsync(
+ String resourceGroupName, String containerGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .start(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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>> startWithResponseAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .start(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context);
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginStartAsync(String resourceGroupName, String containerGroupName) {
+ Mono>> mono = startWithResponseAsync(resourceGroupName, containerGroupName);
+ return this
+ .client
+ .getLroResult(
+ mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext());
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginStartAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = startWithResponseAsync(resourceGroupName, containerGroupName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginStart(String resourceGroupName, String containerGroupName) {
+ return beginStartAsync(resourceGroupName, containerGroupName).getSyncPoller();
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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> beginStart(
+ String resourceGroupName, String containerGroupName, Context context) {
+ return beginStartAsync(resourceGroupName, containerGroupName, context).getSyncPoller();
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 startAsync(String resourceGroupName, String containerGroupName) {
+ return beginStartAsync(resourceGroupName, containerGroupName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 startAsync(String resourceGroupName, String containerGroupName, Context context) {
+ return beginStartAsync(resourceGroupName, containerGroupName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 start(String resourceGroupName, String containerGroupName) {
+ startAsync(resourceGroupName, containerGroupName).block();
+ }
+
+ /**
+ * Starts all containers in a container group. Compute resources will be allocated and billing will start.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 start(String resourceGroupName, String containerGroupName, Context context) {
+ startAsync(resourceGroupName, containerGroupName, context).block();
+ }
+
+ /**
+ * Gets all the network dependencies for this container group to allow complete control of network setting and
+ * configuration. For container groups, this will always be an empty list.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 all the network dependencies for this container group to allow complete control of network setting and
+ * configuration along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> getOutboundNetworkDependenciesEndpointsWithResponseAsync(
+ String resourceGroupName, String containerGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getOutboundNetworkDependenciesEndpoints(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Gets all the network dependencies for this container group to allow complete control of network setting and
+ * configuration. For container groups, this will always be an empty list.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 all the network dependencies for this container group to allow complete control of network setting and
+ * configuration along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> getOutboundNetworkDependenciesEndpointsWithResponseAsync(
+ String resourceGroupName, String containerGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getOutboundNetworkDependenciesEndpoints(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets all the network dependencies for this container group to allow complete control of network setting and
+ * configuration. For container groups, this will always be an empty list.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 all the network dependencies for this container group to allow complete control of network setting and
+ * configuration on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getOutboundNetworkDependenciesEndpointsAsync(
+ String resourceGroupName, String containerGroupName) {
+ return getOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, containerGroupName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Gets all the network dependencies for this container group to allow complete control of network setting and
+ * configuration. For container groups, this will always be an empty list.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 all the network dependencies for this container group to allow complete control of network setting and
+ * configuration.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName) {
+ return getOutboundNetworkDependenciesEndpointsAsync(resourceGroupName, containerGroupName).block();
+ }
+
+ /**
+ * Gets all the network dependencies for this container group to allow complete control of network setting and
+ * configuration. For container groups, this will always be an empty list.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @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 all the network dependencies for this container group to allow complete control of network setting and
+ * configuration along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response> getOutboundNetworkDependenciesEndpointsWithResponse(
+ String resourceGroupName, String containerGroupName, Context context) {
+ return getOutboundNetworkDependenciesEndpointsWithResponseAsync(resourceGroupName, containerGroupName, context)
+ .block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 container group list response that contains the container group properties 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 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 container group list response that contains the container group properties 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));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink 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 container group list response that contains the container group properties along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The 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 container group list response that contains the container group properties along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java
new file mode 100644
index 000000000000..c62c394d525f
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerGroupsImpl.java
@@ -0,0 +1,252 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.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.management.Resource;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerGroupsClient;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerGroupInner;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroup;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerGroups;
+import java.util.Collections;
+import java.util.List;
+
+public final class ContainerGroupsImpl implements ContainerGroups {
+ private static final ClientLogger LOGGER = new ClientLogger(ContainerGroupsImpl.class);
+
+ private final ContainerGroupsClient innerClient;
+
+ private final com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager;
+
+ public ContainerGroupsImpl(
+ ContainerGroupsClient innerClient,
+ com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list() {
+ PagedIterable inner = this.serviceClient().list();
+ return Utils.mapPage(inner, inner1 -> new ContainerGroupImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(Context context) {
+ PagedIterable inner = this.serviceClient().list(context);
+ return Utils.mapPage(inner, inner1 -> new ContainerGroupImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new ContainerGroupImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new ContainerGroupImpl(inner1, this.manager()));
+ }
+
+ public ContainerGroup getByResourceGroup(String resourceGroupName, String containerGroupName) {
+ ContainerGroupInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, containerGroupName);
+ if (inner != null) {
+ return new ContainerGroupImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String containerGroupName, Context context) {
+ Response inner =
+ this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new ContainerGroupImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ContainerGroup update(String resourceGroupName, String containerGroupName, Resource resource) {
+ ContainerGroupInner inner = this.serviceClient().update(resourceGroupName, containerGroupName, resource);
+ if (inner != null) {
+ return new ContainerGroupImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response updateWithResponse(
+ String resourceGroupName, String containerGroupName, Resource resource, Context context) {
+ Response inner =
+ this.serviceClient().updateWithResponse(resourceGroupName, containerGroupName, resource, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new ContainerGroupImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public ContainerGroup deleteByResourceGroup(String resourceGroupName, String containerGroupName) {
+ ContainerGroupInner inner = this.serviceClient().delete(resourceGroupName, containerGroupName);
+ if (inner != null) {
+ return new ContainerGroupImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public ContainerGroup delete(String resourceGroupName, String containerGroupName, Context context) {
+ ContainerGroupInner inner = this.serviceClient().delete(resourceGroupName, containerGroupName, context);
+ if (inner != null) {
+ return new ContainerGroupImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public void restart(String resourceGroupName, String containerGroupName) {
+ this.serviceClient().restart(resourceGroupName, containerGroupName);
+ }
+
+ public void restart(String resourceGroupName, String containerGroupName, Context context) {
+ this.serviceClient().restart(resourceGroupName, containerGroupName, context);
+ }
+
+ public void stop(String resourceGroupName, String containerGroupName) {
+ this.serviceClient().stop(resourceGroupName, containerGroupName);
+ }
+
+ public Response stopWithResponse(String resourceGroupName, String containerGroupName, Context context) {
+ return this.serviceClient().stopWithResponse(resourceGroupName, containerGroupName, context);
+ }
+
+ public void start(String resourceGroupName, String containerGroupName) {
+ this.serviceClient().start(resourceGroupName, containerGroupName);
+ }
+
+ public void start(String resourceGroupName, String containerGroupName, Context context) {
+ this.serviceClient().start(resourceGroupName, containerGroupName, context);
+ }
+
+ public List getOutboundNetworkDependenciesEndpoints(String resourceGroupName, String containerGroupName) {
+ List inner =
+ this.serviceClient().getOutboundNetworkDependenciesEndpoints(resourceGroupName, containerGroupName);
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Response> getOutboundNetworkDependenciesEndpointsWithResponse(
+ String resourceGroupName, String containerGroupName, Context context) {
+ return this
+ .serviceClient()
+ .getOutboundNetworkDependenciesEndpointsWithResponse(resourceGroupName, containerGroupName, context);
+ }
+
+ public ContainerGroup getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String containerGroupName = Utils.getValueFromIdByName(id, "containerGroups");
+ if (containerGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, containerGroupName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String containerGroupName = Utils.getValueFromIdByName(id, "containerGroups");
+ if (containerGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id)));
+ }
+ return this.getByResourceGroupWithResponse(resourceGroupName, containerGroupName, context);
+ }
+
+ public ContainerGroup deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String containerGroupName = Utils.getValueFromIdByName(id, "containerGroups");
+ if (containerGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id)));
+ }
+ return this.delete(resourceGroupName, containerGroupName, Context.NONE);
+ }
+
+ public ContainerGroup deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String containerGroupName = Utils.getValueFromIdByName(id, "containerGroups");
+ if (containerGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'containerGroups'.", id)));
+ }
+ return this.delete(resourceGroupName, containerGroupName, context);
+ }
+
+ private ContainerGroupsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.containerinstance.generated.ContainerInstanceManager manager() {
+ return this.serviceManager;
+ }
+
+ public ContainerGroupImpl define(String name) {
+ return new ContainerGroupImpl(name, this.manager());
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.java
new file mode 100644
index 000000000000..ae751f4cb0db
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientBuilder.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.containerinstance.generated.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 ContainerInstanceManagementClientImpl type. */
+@ServiceClientBuilder(serviceClients = {ContainerInstanceManagementClientImpl.class})
+public final class ContainerInstanceManagementClientBuilder {
+ /*
+ * Subscription credentials which uniquely identify Microsoft Azure
+ * subscription. The subscription ID forms part of the URI for every
+ * service call.
+ */
+ private String subscriptionId;
+
+ /**
+ * Sets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+ * part of the URI for every service call.
+ *
+ * @param subscriptionId the subscriptionId value.
+ * @return the ContainerInstanceManagementClientBuilder.
+ */
+ public ContainerInstanceManagementClientBuilder subscriptionId(String subscriptionId) {
+ this.subscriptionId = subscriptionId;
+ return this;
+ }
+
+ /*
+ * server parameter
+ */
+ private String endpoint;
+
+ /**
+ * Sets server parameter.
+ *
+ * @param endpoint the endpoint value.
+ * @return the ContainerInstanceManagementClientBuilder.
+ */
+ public ContainerInstanceManagementClientBuilder 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 ContainerInstanceManagementClientBuilder.
+ */
+ public ContainerInstanceManagementClientBuilder 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 ContainerInstanceManagementClientBuilder.
+ */
+ public ContainerInstanceManagementClientBuilder 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 ContainerInstanceManagementClientBuilder.
+ */
+ public ContainerInstanceManagementClientBuilder 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 ContainerInstanceManagementClientBuilder.
+ */
+ public ContainerInstanceManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) {
+ this.serializerAdapter = serializerAdapter;
+ return this;
+ }
+
+ /**
+ * Builds an instance of ContainerInstanceManagementClientImpl with the provided parameters.
+ *
+ * @return an instance of ContainerInstanceManagementClientImpl.
+ */
+ public ContainerInstanceManagementClientImpl buildClient() {
+ if (endpoint == null) {
+ this.endpoint = "https://management.azure.com";
+ }
+ if (environment == null) {
+ this.environment = AzureEnvironment.AZURE;
+ }
+ if (pipeline == null) {
+ this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
+ }
+ if (defaultPollInterval == null) {
+ this.defaultPollInterval = Duration.ofSeconds(30);
+ }
+ if (serializerAdapter == null) {
+ this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter();
+ }
+ ContainerInstanceManagementClientImpl client =
+ new ContainerInstanceManagementClientImpl(
+ pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint);
+ return client;
+ }
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java
new file mode 100644
index 000000000000..c5fe218da4f3
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainerInstanceManagementClientImpl.java
@@ -0,0 +1,351 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.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.containerinstance.generated.fluent.ContainerGroupsClient;
+import com.azure.resourcemanager.containerinstance.generated.fluent.ContainerInstanceManagementClient;
+import com.azure.resourcemanager.containerinstance.generated.fluent.ContainersClient;
+import com.azure.resourcemanager.containerinstance.generated.fluent.LocationsClient;
+import com.azure.resourcemanager.containerinstance.generated.fluent.OperationsClient;
+import com.azure.resourcemanager.containerinstance.generated.fluent.SubnetServiceAssociationLinksClient;
+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 ContainerInstanceManagementClientImpl type. */
+@ServiceClient(builder = ContainerInstanceManagementClientBuilder.class)
+public final class ContainerInstanceManagementClientImpl implements ContainerInstanceManagementClient {
+ /**
+ * Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of
+ * the URI for every service call.
+ */
+ private final String subscriptionId;
+
+ /**
+ * Gets Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms
+ * part of the URI for every service call.
+ *
+ * @return the subscriptionId value.
+ */
+ public String getSubscriptionId() {
+ return this.subscriptionId;
+ }
+
+ /** server parameter. */
+ private final String endpoint;
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ public String getEndpoint() {
+ return this.endpoint;
+ }
+
+ /** Api Version. */
+ private final String apiVersion;
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ public String getApiVersion() {
+ return this.apiVersion;
+ }
+
+ /** The HTTP pipeline to send requests through. */
+ private final HttpPipeline httpPipeline;
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ public HttpPipeline getHttpPipeline() {
+ return this.httpPipeline;
+ }
+
+ /** The serializer to serialize an object into a string. */
+ private final SerializerAdapter serializerAdapter;
+
+ /**
+ * Gets The serializer to serialize an object into a string.
+ *
+ * @return the serializerAdapter value.
+ */
+ SerializerAdapter getSerializerAdapter() {
+ return this.serializerAdapter;
+ }
+
+ /** The default poll interval for long-running operation. */
+ private final Duration defaultPollInterval;
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ public Duration getDefaultPollInterval() {
+ return this.defaultPollInterval;
+ }
+
+ /** The ContainerGroupsClient object to access its operations. */
+ private final ContainerGroupsClient containerGroups;
+
+ /**
+ * Gets the ContainerGroupsClient object to access its operations.
+ *
+ * @return the ContainerGroupsClient object.
+ */
+ public ContainerGroupsClient getContainerGroups() {
+ return this.containerGroups;
+ }
+
+ /** 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 LocationsClient object to access its operations. */
+ private final LocationsClient locations;
+
+ /**
+ * Gets the LocationsClient object to access its operations.
+ *
+ * @return the LocationsClient object.
+ */
+ public LocationsClient getLocations() {
+ return this.locations;
+ }
+
+ /** The ContainersClient object to access its operations. */
+ private final ContainersClient containers;
+
+ /**
+ * Gets the ContainersClient object to access its operations.
+ *
+ * @return the ContainersClient object.
+ */
+ public ContainersClient getContainers() {
+ return this.containers;
+ }
+
+ /** The SubnetServiceAssociationLinksClient object to access its operations. */
+ private final SubnetServiceAssociationLinksClient subnetServiceAssociationLinks;
+
+ /**
+ * Gets the SubnetServiceAssociationLinksClient object to access its operations.
+ *
+ * @return the SubnetServiceAssociationLinksClient object.
+ */
+ public SubnetServiceAssociationLinksClient getSubnetServiceAssociationLinks() {
+ return this.subnetServiceAssociationLinks;
+ }
+
+ /**
+ * Initializes an instance of ContainerInstanceManagementClient client.
+ *
+ * @param httpPipeline The HTTP pipeline to send requests through.
+ * @param serializerAdapter The serializer to serialize an object into a string.
+ * @param defaultPollInterval The default poll interval for long-running operation.
+ * @param environment The Azure environment.
+ * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription. The
+ * subscription ID forms part of the URI for every service call.
+ * @param endpoint server parameter.
+ */
+ ContainerInstanceManagementClientImpl(
+ HttpPipeline httpPipeline,
+ SerializerAdapter serializerAdapter,
+ Duration defaultPollInterval,
+ AzureEnvironment environment,
+ String subscriptionId,
+ String endpoint) {
+ this.httpPipeline = httpPipeline;
+ this.serializerAdapter = serializerAdapter;
+ this.defaultPollInterval = defaultPollInterval;
+ this.subscriptionId = subscriptionId;
+ this.endpoint = endpoint;
+ this.apiVersion = "2021-10-01";
+ this.containerGroups = new ContainerGroupsClientImpl(this);
+ this.operations = new OperationsClientImpl(this);
+ this.locations = new LocationsClientImpl(this);
+ this.containers = new ContainersClientImpl(this);
+ this.subnetServiceAssociationLinks = new SubnetServiceAssociationLinksClientImpl(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(ContainerInstanceManagementClientImpl.class);
+}
diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java
new file mode 100644
index 000000000000..d5c104b0f44b
--- /dev/null
+++ b/sdk/containerinstance/azure-resourcemanager-containerinstance-generated/src/main/java/com/azure/resourcemanager/containerinstance/generated/implementation/ContainersClientImpl.java
@@ -0,0 +1,687 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.containerinstance.generated.implementation;
+
+import com.azure.core.annotation.BodyParam;
+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.Post;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceInterface;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.RestProxy;
+import com.azure.core.management.exception.ManagementException;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.containerinstance.generated.fluent.ContainersClient;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerAttachResponseInner;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.ContainerExecResponseInner;
+import com.azure.resourcemanager.containerinstance.generated.fluent.models.LogsInner;
+import com.azure.resourcemanager.containerinstance.generated.models.ContainerExecRequest;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ContainersClient. */
+public final class ContainersClientImpl implements ContainersClient {
+ /** The proxy service used to perform REST calls. */
+ private final ContainersService service;
+
+ /** The service client containing this operation class. */
+ private final ContainerInstanceManagementClientImpl client;
+
+ /**
+ * Initializes an instance of ContainersClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ContainersClientImpl(ContainerInstanceManagementClientImpl client) {
+ this.service =
+ RestProxy.create(ContainersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for ContainerInstanceManagementClientContainers to be used by the proxy
+ * service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "ContainerInstanceMan")
+ private interface ContainersService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}/containers/{containerName}/logs")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listLogs(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @PathParam("containerName") String containerName,
+ @QueryParam("tail") Integer tail,
+ @QueryParam("timestamps") Boolean timestamps,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}/containers/{containerName}/exec")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> executeCommand(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @PathParam("containerName") String containerName,
+ @BodyParam("application/json") ContainerExecRequest containerExecRequest,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerInstance"
+ + "/containerGroups/{containerGroupName}/containers/{containerName}/attach")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> attach(
+ @HostParam("$host") String endpoint,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("containerGroupName") String containerGroupName,
+ @PathParam("containerName") String containerName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Get the logs for a specified container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param tail The number of lines to show from the tail of the container instance log. If not provided, all
+ * available logs are shown up to 4mb.
+ * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided,
+ * defaults to false.
+ * @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 logs for a specified container instance in a specified resource group and container group along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listLogsWithResponseAsync(
+ String resourceGroupName, String containerGroupName, String containerName, Integer tail, Boolean timestamps) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (containerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listLogs(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ containerName,
+ tail,
+ timestamps,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the logs for a specified container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param tail The number of lines to show from the tail of the container instance log. If not provided, all
+ * available logs are shown up to 4mb.
+ * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided,
+ * defaults to false.
+ * @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 logs for a specified container instance in a specified resource group and container group along with
+ * {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listLogsWithResponseAsync(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ Integer tail,
+ Boolean timestamps,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (containerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listLogs(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ containerName,
+ tail,
+ timestamps,
+ accept,
+ context);
+ }
+
+ /**
+ * Get the logs for a specified container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param tail The number of lines to show from the tail of the container instance log. If not provided, all
+ * available logs are shown up to 4mb.
+ * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided,
+ * defaults to false.
+ * @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 logs for a specified container instance in a specified resource group and container group on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono listLogsAsync(
+ String resourceGroupName, String containerGroupName, String containerName, Integer tail, Boolean timestamps) {
+ return listLogsWithResponseAsync(resourceGroupName, containerGroupName, containerName, tail, timestamps)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get the logs for a specified container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @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 logs for a specified container instance in a specified resource group and container group on
+ * successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono listLogsAsync(String resourceGroupName, String containerGroupName, String containerName) {
+ final Integer tail = null;
+ final Boolean timestamps = null;
+ return listLogsWithResponseAsync(resourceGroupName, containerGroupName, containerName, tail, timestamps)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get the logs for a specified container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @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 logs for a specified container instance in a specified resource group and container group.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName) {
+ final Integer tail = null;
+ final Boolean timestamps = null;
+ return listLogsAsync(resourceGroupName, containerGroupName, containerName, tail, timestamps).block();
+ }
+
+ /**
+ * Get the logs for a specified container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param tail The number of lines to show from the tail of the container instance log. If not provided, all
+ * available logs are shown up to 4mb.
+ * @param timestamps If true, adds a timestamp at the beginning of every line of log output. If not provided,
+ * defaults to false.
+ * @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 logs for a specified container instance in a specified resource group and container group along with
+ * {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response listLogsWithResponse(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ Integer tail,
+ Boolean timestamps,
+ Context context) {
+ return listLogsWithResponseAsync(
+ resourceGroupName, containerGroupName, containerName, tail, timestamps, context)
+ .block();
+ }
+
+ /**
+ * Executes a command for a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param containerExecRequest The request for the exec command.
+ * @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 information for the container exec command along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> executeCommandWithResponseAsync(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ ContainerExecRequest containerExecRequest) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (containerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
+ }
+ if (containerExecRequest == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null."));
+ } else {
+ containerExecRequest.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .executeCommand(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ containerName,
+ containerExecRequest,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Executes a command for a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param containerExecRequest The request for the exec command.
+ * @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 information for the container exec command along with {@link Response} on successful completion of
+ * {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> executeCommandWithResponseAsync(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ ContainerExecRequest containerExecRequest,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (containerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
+ }
+ if (containerExecRequest == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerExecRequest is required and cannot be null."));
+ } else {
+ containerExecRequest.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .executeCommand(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ containerName,
+ containerExecRequest,
+ accept,
+ context);
+ }
+
+ /**
+ * Executes a command for a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param containerExecRequest The request for the exec command.
+ * @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 information for the container exec command on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono executeCommandAsync(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ ContainerExecRequest containerExecRequest) {
+ return executeCommandWithResponseAsync(
+ resourceGroupName, containerGroupName, containerName, containerExecRequest)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Executes a command for a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param containerExecRequest The request for the exec command.
+ * @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 information for the container exec command.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ContainerExecResponseInner executeCommand(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ ContainerExecRequest containerExecRequest) {
+ return executeCommandAsync(resourceGroupName, containerGroupName, containerName, containerExecRequest).block();
+ }
+
+ /**
+ * Executes a command for a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @param containerExecRequest The request for the exec command.
+ * @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 information for the container exec command along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response executeCommandWithResponse(
+ String resourceGroupName,
+ String containerGroupName,
+ String containerName,
+ ContainerExecRequest containerExecRequest,
+ Context context) {
+ return executeCommandWithResponseAsync(
+ resourceGroupName, containerGroupName, containerName, containerExecRequest, context)
+ .block();
+ }
+
+ /**
+ * Attach to the output stream of a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @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 information for the output stream from container attach along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> attachWithResponseAsync(
+ String resourceGroupName, String containerGroupName, String containerName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (containerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .attach(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ containerName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Attach to the output stream of a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @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 information for the output stream from container attach along with {@link Response} on successful
+ * completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> attachWithResponseAsync(
+ String resourceGroupName, String containerGroupName, String containerName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (containerGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter containerGroupName is required and cannot be null."));
+ }
+ if (containerName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .attach(
+ this.client.getEndpoint(),
+ this.client.getSubscriptionId(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ containerGroupName,
+ containerName,
+ accept,
+ context);
+ }
+
+ /**
+ * Attach to the output stream of a specific container instance in a specified resource group and container group.
+ *
+ * @param resourceGroupName The name of the resource group.
+ * @param containerGroupName The name of the container group.
+ * @param containerName The name of the container instance.
+ * @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 information for the output stream from container attach on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono