diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md index c98aaabefa15c..b11e166b9397e 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-07-08) +- Azure Resource Manager DelegatedNetwork client library for Java. This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.1 (2021-03-26) diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md index f1d0fdec13d66..7e2ef3d350209 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-delegatednetwork - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml index e6b72a3df2c69..521721c6660c9 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/pom.xml @@ -1,67 +1,86 @@ - 4.0.0 - - com.azure - azure-client-sdk-parent - 1.7.0 - ../../parents/azure-client-sdk-parent - + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + - com.azure.resourcemanager - azure-resourcemanager-delegatednetwork - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-delegatednetwork + 1.0.0-beta.2 + jar - Microsoft Azure SDK for DelegatedNetwork Management - This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15. - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for DelegatedNetwork Management + This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15. + https://github.com/Azure/azure-sdk-for-java - - - The MIT License (MIT) - http://opensource.org/licenses/MIT - repo - - + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + - - https://github.com/Azure/azure-sdk-for-java - scm:git:git@github.com:Azure/azure-sdk-for-java.git - scm:git:git@github.com:Azure/azure-sdk-for-java.git - HEAD - - - - microsoft - Microsoft - - - - UTF-8 - - - - - com.azure - azure-core - 1.18.0 - - - com.azure - azure-core-management - 1.3.1 - - - - - - org.jacoco - jacoco-maven-plugin - 0.8.5 - - true - - - - + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + + com.azure + azure-core + 1.18.0 + + + com.azure + azure-core-management + 1.3.1 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + true + + + + org.revapi + revapi-maven-plugin + 0.11.2 + + + + + java.method.addedToInterface + + + true + .* + com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)* + + + + + + + diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java index 11a2ce3389f29..3a7222bd27c52 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java @@ -9,7 +9,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -17,6 +16,7 @@ import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; @@ -93,6 +93,7 @@ public static final class Configurable { private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; private Duration defaultPollInterval; @@ -132,6 +133,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) { 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. * @@ -188,6 +200,9 @@ public DelegatedNetworkManager authenticate(TokenCredential credential, AzurePro userAgentBuilder.append(" (auto-generated)"); } + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } if (retryPolicy == null) { retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); } @@ -197,10 +212,8 @@ public DelegatedNetworkManager authenticate(TokenCredential credential, AzurePro HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies - .add( - new BearerTokenAuthenticationPolicy( - credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java index 5754145b96159..3cb3e077dfc3d 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java @@ -110,19 +110,21 @@ OrchestratorInner create( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName); + SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Boolean forceDelete); /** * Deletes the Orchestrator Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -130,7 +132,21 @@ OrchestratorInner create( * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName, Context context); + SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context); + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String resourceName, Boolean forceDelete); /** * Deletes the Orchestrator Instance. @@ -149,13 +165,14 @@ OrchestratorInner create( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceName, Context context); + void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context); /** * Update Orchestrator Instance. diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java index 0caf85444ff84..4422f00906c86 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedControllerInner.java @@ -4,95 +4,32 @@ package com.azure.resourcemanager.delegatednetwork.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.delegatednetwork.models.ControllerResource; -import com.azure.resourcemanager.delegatednetwork.models.ControllerState; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedControllerProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of a DNC controller. */ -@JsonFlatten -@Immutable -public class DelegatedControllerInner extends ControllerResource { +@Fluent +public final class DelegatedControllerInner extends ControllerResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedControllerInner.class); /* - * Resource guid. + * Properties of the provision operation request. */ - @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The current state of dnc controller resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ControllerState provisioningState; - - /* - * dnc application id should be used by customer to authenticate with dnc - * gateway. - */ - @JsonProperty(value = "properties.dncAppId", access = JsonProperty.Access.WRITE_ONLY) - private String dncAppId; - - /* - * tenant id of dnc application id - */ - @JsonProperty(value = "properties.dncTenantId", access = JsonProperty.Access.WRITE_ONLY) - private String dncTenantId; - - /* - * dnc endpoint url that customers can use to connect to - */ - @JsonProperty(value = "properties.dncEndpoint", access = JsonProperty.Access.WRITE_ONLY) - private String dncEndpoint; - - /** - * Get the resourceGuid property: Resource guid. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The current state of dnc controller resource. - * - * @return the provisioningState value. - */ - public ControllerState provisioningState() { - return this.provisioningState; - } - - /** - * Get the dncAppId property: dnc application id should be used by customer to authenticate with dnc gateway. - * - * @return the dncAppId value. - */ - public String dncAppId() { - return this.dncAppId; - } - - /** - * Get the dncTenantId property: tenant id of dnc application id. - * - * @return the dncTenantId value. - */ - public String dncTenantId() { - return this.dncTenantId; - } + @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) + private DelegatedControllerProperties properties; /** - * Get the dncEndpoint property: dnc endpoint url that customers can use to connect to. + * Get the properties property: Properties of the provision operation request. * - * @return the dncEndpoint value. + * @return the properties value. */ - public String dncEndpoint() { - return this.dncEndpoint; + public DelegatedControllerProperties properties() { + return this.properties; } /** {@inheritDoc} */ @@ -117,5 +54,8 @@ public DelegatedControllerInner withTags(Map tags) { @Override public void validate() { super.validate(); + if (properties() != null) { + properties().validate(); + } } } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java index f1d158e5da6d4..8a0c4d2bd686d 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/DelegatedSubnetInner.java @@ -5,101 +5,41 @@ package com.azure.resourcemanager.delegatednetwork.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetProperties; import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetResource; -import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetState; -import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of a orchestrator. */ -@JsonFlatten @Fluent -public class DelegatedSubnetInner extends DelegatedSubnetResource { +public final class DelegatedSubnetInner extends DelegatedSubnetResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetInner.class); /* - * Resource guid. + * Properties of the provision operation request. */ - @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The current state of dnc delegated subnet resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private DelegatedSubnetState provisioningState; - - /* - * subnet details - */ - @JsonProperty(value = "properties.subnetDetails") - private SubnetDetails subnetDetails; - - /* - * Properties of the controller. - */ - @JsonProperty(value = "properties.controllerDetails") - private ControllerDetails controllerDetails; - - /** - * Get the resourceGuid property: Resource guid. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The current state of dnc delegated subnet resource. - * - * @return the provisioningState value. - */ - public DelegatedSubnetState provisioningState() { - return this.provisioningState; - } - - /** - * Get the subnetDetails property: subnet details. - * - * @return the subnetDetails value. - */ - public SubnetDetails subnetDetails() { - return this.subnetDetails; - } + @JsonProperty(value = "properties") + private DelegatedSubnetProperties properties; /** - * Set the subnetDetails property: subnet details. + * Get the properties property: Properties of the provision operation request. * - * @param subnetDetails the subnetDetails value to set. - * @return the DelegatedSubnetInner object itself. - */ - public DelegatedSubnetInner withSubnetDetails(SubnetDetails subnetDetails) { - this.subnetDetails = subnetDetails; - return this; - } - - /** - * Get the controllerDetails property: Properties of the controller. - * - * @return the controllerDetails value. + * @return the properties value. */ - public ControllerDetails controllerDetails() { - return this.controllerDetails; + public DelegatedSubnetProperties properties() { + return this.properties; } /** - * Set the controllerDetails property: Properties of the controller. + * Set the properties property: Properties of the provision operation request. * - * @param controllerDetails the controllerDetails value to set. + * @param properties the properties value to set. * @return the DelegatedSubnetInner object itself. */ - public DelegatedSubnetInner withControllerDetails(ControllerDetails controllerDetails) { - this.controllerDetails = controllerDetails; + public DelegatedSubnetInner withProperties(DelegatedSubnetProperties properties) { + this.properties = properties; return this; } @@ -125,11 +65,8 @@ public DelegatedSubnetInner withTags(Map tags) { @Override public void validate() { super.validate(); - if (subnetDetails() != null) { - subnetDetails().validate(); - } - if (controllerDetails() != null) { - controllerDetails().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java index 0c92f1200f070..0a7fdcb08b472 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/models/OrchestratorInner.java @@ -5,212 +5,43 @@ package com.azure.resourcemanager.delegatednetwork.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorIdentity; -import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceState; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorKind; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResource; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Represents an instance of a orchestrator. */ -@JsonFlatten @Fluent -public class OrchestratorInner extends OrchestratorResource { +public final class OrchestratorInner extends OrchestratorResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorInner.class); /* - * Resource guid. + * Properties of the provision operation request. */ - @JsonProperty(value = "properties.resourceGuid", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGuid; - - /* - * The current state of orchestratorInstance resource. - */ - @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private OrchestratorInstanceState provisioningState; - - /* - * AAD ID used with apiserver - */ - @JsonProperty(value = "properties.orchestratorAppId") - private String orchestratorAppId; - - /* - * TenantID of server App ID - */ - @JsonProperty(value = "properties.orchestratorTenantId") - private String orchestratorTenantId; - - /* - * RootCA certificate of kubernetes cluster base64 encoded - */ - @JsonProperty(value = "properties.clusterRootCA") - private String clusterRootCA; - - /* - * K8s APIServer url. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified - */ - @JsonProperty(value = "properties.apiServerEndpoint") - private String apiServerEndpoint; - - /* - * private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified - */ - @JsonProperty(value = "properties.privateLinkResourceId") - private String privateLinkResourceId; - - /* - * Properties of the controller. - */ - @JsonProperty(value = "properties.controllerDetails") - private ControllerDetails controllerDetails; - - /** - * Get the resourceGuid property: Resource guid. - * - * @return the resourceGuid value. - */ - public String resourceGuid() { - return this.resourceGuid; - } - - /** - * Get the provisioningState property: The current state of orchestratorInstance resource. - * - * @return the provisioningState value. - */ - public OrchestratorInstanceState provisioningState() { - return this.provisioningState; - } - - /** - * Get the orchestratorAppId property: AAD ID used with apiserver. - * - * @return the orchestratorAppId value. - */ - public String orchestratorAppId() { - return this.orchestratorAppId; - } - - /** - * Set the orchestratorAppId property: AAD ID used with apiserver. - * - * @param orchestratorAppId the orchestratorAppId value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withOrchestratorAppId(String orchestratorAppId) { - this.orchestratorAppId = orchestratorAppId; - return this; - } - - /** - * Get the orchestratorTenantId property: TenantID of server App ID. - * - * @return the orchestratorTenantId value. - */ - public String orchestratorTenantId() { - return this.orchestratorTenantId; - } - - /** - * Set the orchestratorTenantId property: TenantID of server App ID. - * - * @param orchestratorTenantId the orchestratorTenantId value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withOrchestratorTenantId(String orchestratorTenantId) { - this.orchestratorTenantId = orchestratorTenantId; - return this; - } - - /** - * Get the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. - * - * @return the clusterRootCA value. - */ - public String clusterRootCA() { - return this.clusterRootCA; - } - - /** - * Set the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. - * - * @param clusterRootCA the clusterRootCA value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withClusterRootCA(String clusterRootCA) { - this.clusterRootCA = clusterRootCA; - return this; - } - - /** - * Get the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId - * can be specified. - * - * @return the apiServerEndpoint value. - */ - public String apiServerEndpoint() { - return this.apiServerEndpoint; - } - - /** - * Set the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId - * can be specified. - * - * @param apiServerEndpoint the apiServerEndpoint value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withApiServerEndpoint(String apiServerEndpoint) { - this.apiServerEndpoint = apiServerEndpoint; - return this; - } - - /** - * Get the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * - * @return the privateLinkResourceId value. - */ - public String privateLinkResourceId() { - return this.privateLinkResourceId; - } - - /** - * Set the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * - * @param privateLinkResourceId the privateLinkResourceId value to set. - * @return the OrchestratorInner object itself. - */ - public OrchestratorInner withPrivateLinkResourceId(String privateLinkResourceId) { - this.privateLinkResourceId = privateLinkResourceId; - return this; - } + @JsonProperty(value = "properties") + private OrchestratorResourceProperties properties; /** - * Get the controllerDetails property: Properties of the controller. + * Get the properties property: Properties of the provision operation request. * - * @return the controllerDetails value. + * @return the properties value. */ - public ControllerDetails controllerDetails() { - return this.controllerDetails; + public OrchestratorResourceProperties properties() { + return this.properties; } /** - * Set the controllerDetails property: Properties of the controller. + * Set the properties property: Properties of the provision operation request. * - * @param controllerDetails the controllerDetails value to set. + * @param properties the properties value to set. * @return the OrchestratorInner object itself. */ - public OrchestratorInner withControllerDetails(ControllerDetails controllerDetails) { - this.controllerDetails = controllerDetails; + public OrchestratorInner withProperties(OrchestratorResourceProperties properties) { + this.properties = properties; return this; } @@ -250,8 +81,8 @@ public OrchestratorInner withTags(Map tags) { @Override public void validate() { super.validate(); - if (controllerDetails() != null) { - controllerDetails().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java index b80b43b13394a..5427764991367 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedControllerImpl.java @@ -8,8 +8,8 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedControllerInner; import com.azure.resourcemanager.delegatednetwork.models.ControllerResourceUpdateParameters; -import com.azure.resourcemanager.delegatednetwork.models.ControllerState; import com.azure.resourcemanager.delegatednetwork.models.DelegatedController; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedControllerProperties; import java.util.Collections; import java.util.Map; @@ -44,24 +44,8 @@ public Map tags() { } } - public String resourceGuid() { - return this.innerModel().resourceGuid(); - } - - public ControllerState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String dncAppId() { - return this.innerModel().dncAppId(); - } - - public String dncTenantId() { - return this.innerModel().dncTenantId(); - } - - public String dncEndpoint() { - return this.innerModel().dncEndpoint(); + public DelegatedControllerProperties properties() { + return this.innerModel().properties(); } public Region region() { diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetImpl.java index d022d165867fb..0ea946fbdc010 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/DelegatedSubnetImpl.java @@ -7,11 +7,9 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.delegatednetwork.fluent.models.DelegatedSubnetInner; -import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnet; -import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetState; +import com.azure.resourcemanager.delegatednetwork.models.DelegatedSubnetProperties; import com.azure.resourcemanager.delegatednetwork.models.ResourceUpdateParameters; -import com.azure.resourcemanager.delegatednetwork.models.SubnetDetails; import java.util.Collections; import java.util.Map; @@ -45,20 +43,8 @@ public Map tags() { } } - public String resourceGuid() { - return this.innerModel().resourceGuid(); - } - - public DelegatedSubnetState provisioningState() { - return this.innerModel().provisioningState(); - } - - public SubnetDetails subnetDetails() { - return this.innerModel().subnetDetails(); - } - - public ControllerDetails controllerDetails() { - return this.innerModel().controllerDetails(); + public DelegatedSubnetProperties properties() { + return this.innerModel().properties(); } public Region region() { @@ -185,13 +171,8 @@ public DelegatedSubnetImpl withTags(Map tags) { } } - public DelegatedSubnetImpl withSubnetDetails(SubnetDetails subnetDetails) { - this.innerModel().withSubnetDetails(subnetDetails); - return this; - } - - public DelegatedSubnetImpl withControllerDetails(ControllerDetails controllerDetails) { - this.innerModel().withControllerDetails(controllerDetails); + public DelegatedSubnetImpl withProperties(DelegatedSubnetProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java index 4419c88e709e7..a19a5d02e096a 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorImpl.java @@ -7,11 +7,10 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.delegatednetwork.fluent.models.OrchestratorInner; -import com.azure.resourcemanager.delegatednetwork.models.ControllerDetails; import com.azure.resourcemanager.delegatednetwork.models.Orchestrator; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorIdentity; -import com.azure.resourcemanager.delegatednetwork.models.OrchestratorInstanceState; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorKind; +import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceProperties; import com.azure.resourcemanager.delegatednetwork.models.OrchestratorResourceUpdateParameters; import java.util.Collections; import java.util.Map; @@ -54,36 +53,8 @@ public OrchestratorIdentity identity() { return this.innerModel().identity(); } - public String resourceGuid() { - return this.innerModel().resourceGuid(); - } - - public OrchestratorInstanceState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String orchestratorAppId() { - return this.innerModel().orchestratorAppId(); - } - - public String orchestratorTenantId() { - return this.innerModel().orchestratorTenantId(); - } - - public String clusterRootCA() { - return this.innerModel().clusterRootCA(); - } - - public String apiServerEndpoint() { - return this.innerModel().apiServerEndpoint(); - } - - public String privateLinkResourceId() { - return this.innerModel().privateLinkResourceId(); - } - - public ControllerDetails controllerDetails() { - return this.innerModel().controllerDetails(); + public OrchestratorResourceProperties properties() { + return this.innerModel().properties(); } public Region region() { @@ -221,33 +192,8 @@ public OrchestratorImpl withIdentity(OrchestratorIdentity identity) { return this; } - public OrchestratorImpl withOrchestratorAppId(String orchestratorAppId) { - this.innerModel().withOrchestratorAppId(orchestratorAppId); - return this; - } - - public OrchestratorImpl withOrchestratorTenantId(String orchestratorTenantId) { - this.innerModel().withOrchestratorTenantId(orchestratorTenantId); - return this; - } - - public OrchestratorImpl withClusterRootCA(String clusterRootCA) { - this.innerModel().withClusterRootCA(clusterRootCA); - return this; - } - - public OrchestratorImpl withApiServerEndpoint(String apiServerEndpoint) { - this.innerModel().withApiServerEndpoint(apiServerEndpoint); - return this; - } - - public OrchestratorImpl withPrivateLinkResourceId(String privateLinkResourceId) { - this.innerModel().withPrivateLinkResourceId(privateLinkResourceId); - return this; - } - - public OrchestratorImpl withControllerDetails(ControllerDetails controllerDetails) { - this.innerModel().withControllerDetails(controllerDetails); + public OrchestratorImpl withProperties(OrchestratorResourceProperties properties) { + this.innerModel().withProperties(properties); return this; } diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java index 60a07e956be01..ebcded51dca1d 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesClientImpl.java @@ -114,6 +114,7 @@ Mono>> delete( @PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("forceDelete") Boolean forceDelete, @HeaderParam("Accept") String accept, Context context); @@ -594,13 +595,15 @@ public OrchestratorInner create( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String resourceName) { + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String resourceName, Boolean forceDelete) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -631,6 +634,7 @@ private Mono>> deleteWithResponseAsync(String resource resourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), + forceDelete, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -641,6 +645,7 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -649,7 +654,7 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceName, Context context) { + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -678,6 +683,7 @@ private Mono>> deleteWithResponseAsync( resourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), + forceDelete, accept, context); } @@ -687,14 +693,16 @@ private Mono>> deleteWithResponseAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String resourceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String resourceName, Boolean forceDelete) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, forceDelete); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); @@ -705,6 +713,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -713,9 +722,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.SINGLE) private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceName, Context context) { + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName, context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, resourceName, forceDelete, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); @@ -726,14 +736,16 @@ private PollerFlux, Void> beginDeleteAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SyncPoller, Void> beginDelete(String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).getSyncPoller(); + public SyncPoller, Void> beginDelete( + String resourceGroupName, String resourceName, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete).getSyncPoller(); } /** @@ -741,6 +753,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -749,8 +762,26 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, */ @ServiceMethod(returns = ReturnType.SINGLE) public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context).getSyncPoller(); + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete, context).getSyncPoller(); + } + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the completion. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String resourceName, Boolean forceDelete) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -765,7 +796,10 @@ public SyncPoller, Void> beginDelete( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String resourceGroupName, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceName).last().flatMap(this.client::getLroFinalResultOrError); + final Boolean forceDelete = null; + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -773,6 +807,7 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -780,12 +815,28 @@ private Mono deleteAsync(String resourceGroupName, String resourceName) { * @return the completion. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceName, context) + private Mono deleteAsync( + String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + return beginDeleteAsync(resourceGroupName, resourceName, forceDelete, context) .last() .flatMap(this.client::getLroFinalResultOrError); } + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete) { + deleteAsync(resourceGroupName, resourceName, forceDelete).block(); + } + /** * Deletes the Orchestrator Instance. * @@ -797,7 +848,8 @@ private Mono deleteAsync(String resourceGroupName, String resourceName, Co */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String resourceName) { - deleteAsync(resourceGroupName, resourceName).block(); + final Boolean forceDelete = null; + deleteAsync(resourceGroupName, resourceName, forceDelete).block(); } /** @@ -805,14 +857,15 @@ public void delete(String resourceGroupName, String resourceName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceName, Context context) { - deleteAsync(resourceGroupName, resourceName, context).block(); + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + deleteAsync(resourceGroupName, resourceName, forceDelete, context).block(); } /** diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java index af5ad06b2e41e..59ccca1eaeeac 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/implementation/OrchestratorInstanceServicesImpl.java @@ -53,12 +53,16 @@ public Response getByResourceGroupWithResponse( } } - public void deleteByResourceGroup(String resourceGroupName, String resourceName) { + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete) { + this.serviceClient().delete(resourceGroupName, resourceName, forceDelete); + } + + public void delete(String resourceGroupName, String resourceName) { this.serviceClient().delete(resourceGroupName, resourceName); } - public void delete(String resourceGroupName, String resourceName, Context context) { - this.serviceClient().delete(resourceGroupName, resourceName, context); + public void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context) { + this.serviceClient().delete(resourceGroupName, resourceName, forceDelete, context); } public PagedIterable list() { @@ -135,10 +139,11 @@ public void deleteById(String id) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); } - this.delete(resourceGroupName, resourceName, Context.NONE); + Boolean localForceDelete = null; + this.delete(resourceGroupName, resourceName, localForceDelete, Context.NONE); } - public void deleteByIdWithResponse(String id, Context context) { + public void deleteByIdWithResponse(String id, Boolean forceDelete, Context context) { String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { throw logger @@ -154,7 +159,7 @@ public void deleteByIdWithResponse(String id, Context context) { new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'orchestrators'.", id))); } - this.delete(resourceGroupName, resourceName, context); + this.delete(resourceGroupName, resourceName, forceDelete, context); } private OrchestratorInstanceServicesClient serviceClient() { diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java index 6202737e7b144..8e686ebd3227b 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ControllerResource.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.delegatednetwork.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** Represents an instance of a resource. */ -@Immutable +@Fluent public class ControllerResource extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ControllerResource.class); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java index 4543837b860e6..47816ae8690c9 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedController.java @@ -47,39 +47,11 @@ public interface DelegatedController { Map tags(); /** - * Gets the resourceGuid property: Resource guid. + * Gets the properties property: Properties of the provision operation request. * - * @return the resourceGuid value. + * @return the properties value. */ - String resourceGuid(); - - /** - * Gets the provisioningState property: The current state of dnc controller resource. - * - * @return the provisioningState value. - */ - ControllerState provisioningState(); - - /** - * Gets the dncAppId property: dnc application id should be used by customer to authenticate with dnc gateway. - * - * @return the dncAppId value. - */ - String dncAppId(); - - /** - * Gets the dncTenantId property: tenant id of dnc application id. - * - * @return the dncTenantId value. - */ - String dncTenantId(); - - /** - * Gets the dncEndpoint property: dnc endpoint url that customers can use to connect to. - * - * @return the dncEndpoint value. - */ - String dncEndpoint(); + DelegatedControllerProperties properties(); /** * Gets the region of the resource. diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllerProperties.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllerProperties.java new file mode 100644 index 0000000000000..f83e36cd7ea2a --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedControllerProperties.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of Delegated controller resource. */ +@Immutable +public final class DelegatedControllerProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedControllerProperties.class); + + /* + * Resource guid. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of dnc controller resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ControllerState provisioningState; + + /* + * dnc application id should be used by customer to authenticate with dnc + * gateway. + */ + @JsonProperty(value = "dncAppId", access = JsonProperty.Access.WRITE_ONLY) + private String dncAppId; + + /* + * tenant id of dnc application id + */ + @JsonProperty(value = "dncTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String dncTenantId; + + /* + * dnc endpoint url that customers can use to connect to + */ + @JsonProperty(value = "dncEndpoint", access = JsonProperty.Access.WRITE_ONLY) + private String dncEndpoint; + + /** + * Get the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of dnc controller resource. + * + * @return the provisioningState value. + */ + public ControllerState provisioningState() { + return this.provisioningState; + } + + /** + * Get the dncAppId property: dnc application id should be used by customer to authenticate with dnc gateway. + * + * @return the dncAppId value. + */ + public String dncAppId() { + return this.dncAppId; + } + + /** + * Get the dncTenantId property: tenant id of dnc application id. + * + * @return the dncTenantId value. + */ + public String dncTenantId() { + return this.dncTenantId; + } + + /** + * Get the dncEndpoint property: dnc endpoint url that customers can use to connect to. + * + * @return the dncEndpoint value. + */ + public String dncEndpoint() { + return this.dncEndpoint; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnet.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnet.java index 5b5fb68ce855a..1e0d359d7b391 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnet.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnet.java @@ -47,32 +47,11 @@ public interface DelegatedSubnet { Map tags(); /** - * Gets the resourceGuid property: Resource guid. + * Gets the properties property: Properties of the provision operation request. * - * @return the resourceGuid value. + * @return the properties value. */ - String resourceGuid(); - - /** - * Gets the provisioningState property: The current state of dnc delegated subnet resource. - * - * @return the provisioningState value. - */ - DelegatedSubnetState provisioningState(); - - /** - * Gets the subnetDetails property: subnet details. - * - * @return the subnetDetails value. - */ - SubnetDetails subnetDetails(); - - /** - * Gets the controllerDetails property: Properties of the controller. - * - * @return the controllerDetails value. - */ - ControllerDetails controllerDetails(); + DelegatedSubnetProperties properties(); /** * Gets the region of the resource. @@ -139,10 +118,7 @@ interface WithResourceGroup { * The stage of the DelegatedSubnet definition which contains all the minimum required properties for the * resource to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithSubnetDetails, - DefinitionStages.WithControllerDetails { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. * @@ -168,25 +144,15 @@ interface WithTags { */ WithCreate withTags(Map tags); } - /** The stage of the DelegatedSubnet definition allowing to specify subnetDetails. */ - interface WithSubnetDetails { - /** - * Specifies the subnetDetails property: subnet details. - * - * @param subnetDetails subnet details. - * @return the next definition stage. - */ - WithCreate withSubnetDetails(SubnetDetails subnetDetails); - } - /** The stage of the DelegatedSubnet definition allowing to specify controllerDetails. */ - interface WithControllerDetails { + /** The stage of the DelegatedSubnet definition allowing to specify properties. */ + interface WithProperties { /** - * Specifies the controllerDetails property: Properties of the controller.. + * Specifies the properties property: Properties of the provision operation request.. * - * @param controllerDetails Properties of the controller. + * @param properties Properties of the provision operation request. * @return the next definition stage. */ - WithCreate withControllerDetails(ControllerDetails controllerDetails); + WithCreate withProperties(DelegatedSubnetProperties properties); } } /** diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetProperties.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetProperties.java new file mode 100644 index 0000000000000..4c759ff4cabf3 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetProperties.java @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of delegated subnet. */ +@Fluent +public final class DelegatedSubnetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetProperties.class); + + /* + * Resource guid. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of dnc delegated subnet resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private DelegatedSubnetState provisioningState; + + /* + * subnet details + */ + @JsonProperty(value = "subnetDetails") + private SubnetDetails subnetDetails; + + /* + * Properties of the controller. + */ + @JsonProperty(value = "controllerDetails") + private ControllerDetails controllerDetails; + + /** + * Get the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of dnc delegated subnet resource. + * + * @return the provisioningState value. + */ + public DelegatedSubnetState provisioningState() { + return this.provisioningState; + } + + /** + * Get the subnetDetails property: subnet details. + * + * @return the subnetDetails value. + */ + public SubnetDetails subnetDetails() { + return this.subnetDetails; + } + + /** + * Set the subnetDetails property: subnet details. + * + * @param subnetDetails the subnetDetails value to set. + * @return the DelegatedSubnetProperties object itself. + */ + public DelegatedSubnetProperties withSubnetDetails(SubnetDetails subnetDetails) { + this.subnetDetails = subnetDetails; + return this; + } + + /** + * Get the controllerDetails property: Properties of the controller. + * + * @return the controllerDetails value. + */ + public ControllerDetails controllerDetails() { + return this.controllerDetails; + } + + /** + * Set the controllerDetails property: Properties of the controller. + * + * @param controllerDetails the controllerDetails value to set. + * @return the DelegatedSubnetProperties object itself. + */ + public DelegatedSubnetProperties withControllerDetails(ControllerDetails controllerDetails) { + this.controllerDetails = controllerDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subnetDetails() != null) { + subnetDetails().validate(); + } + if (controllerDetails() != null) { + controllerDetails().validate(); + } + } +} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java index 9fb78eb638a1a..dfaae98b8993e 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/DelegatedSubnetResource.java @@ -4,14 +4,14 @@ package com.azure.resourcemanager.delegatednetwork.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import java.util.Map; /** Represents an instance of a resource. */ -@Immutable +@Fluent public class DelegatedSubnetResource extends Resource { @JsonIgnore private final ClientLogger logger = new ClientLogger(DelegatedSubnetResource.class); diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ErrorAdditionalInfo.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ErrorAdditionalInfo.java deleted file mode 100644 index f8c3777495079..0000000000000 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/ErrorAdditionalInfo.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.delegatednetwork.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource management error additional info. */ -@Immutable -public final class ErrorAdditionalInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); - - /* - * The additional info type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The additional info. - */ - @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) - private Object info; - - /** - * Get the type property: The additional info type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the info property: The additional info. - * - * @return the info value. - */ - public Object info() { - return this.info; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java index 8619c781996ca..d6bdbfb56c55c 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/Orchestrator.java @@ -61,62 +61,11 @@ public interface Orchestrator { OrchestratorIdentity identity(); /** - * Gets the resourceGuid property: Resource guid. + * Gets the properties property: Properties of the provision operation request. * - * @return the resourceGuid value. + * @return the properties value. */ - String resourceGuid(); - - /** - * Gets the provisioningState property: The current state of orchestratorInstance resource. - * - * @return the provisioningState value. - */ - OrchestratorInstanceState provisioningState(); - - /** - * Gets the orchestratorAppId property: AAD ID used with apiserver. - * - * @return the orchestratorAppId value. - */ - String orchestratorAppId(); - - /** - * Gets the orchestratorTenantId property: TenantID of server App ID. - * - * @return the orchestratorTenantId value. - */ - String orchestratorTenantId(); - - /** - * Gets the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. - * - * @return the clusterRootCA value. - */ - String clusterRootCA(); - - /** - * Gets the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId - * can be specified. - * - * @return the apiServerEndpoint value. - */ - String apiServerEndpoint(); - - /** - * Gets the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * - * @return the privateLinkResourceId value. - */ - String privateLinkResourceId(); - - /** - * Gets the controllerDetails property: Properties of the controller. - * - * @return the controllerDetails value. - */ - ControllerDetails controllerDetails(); + OrchestratorResourceProperties properties(); /** * Gets the region of the resource. @@ -195,14 +144,7 @@ interface WithKind { * to be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithIdentity, - DefinitionStages.WithOrchestratorAppId, - DefinitionStages.WithOrchestratorTenantId, - DefinitionStages.WithClusterRootCA, - DefinitionStages.WithApiServerEndpoint, - DefinitionStages.WithPrivateLinkResourceId, - DefinitionStages.WithControllerDetails { + extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { /** * Executes the create request. * @@ -238,69 +180,15 @@ interface WithIdentity { */ WithCreate withIdentity(OrchestratorIdentity identity); } - /** The stage of the Orchestrator definition allowing to specify orchestratorAppId. */ - interface WithOrchestratorAppId { - /** - * Specifies the orchestratorAppId property: AAD ID used with apiserver. - * - * @param orchestratorAppId AAD ID used with apiserver. - * @return the next definition stage. - */ - WithCreate withOrchestratorAppId(String orchestratorAppId); - } - /** The stage of the Orchestrator definition allowing to specify orchestratorTenantId. */ - interface WithOrchestratorTenantId { - /** - * Specifies the orchestratorTenantId property: TenantID of server App ID. - * - * @param orchestratorTenantId TenantID of server App ID. - * @return the next definition stage. - */ - WithCreate withOrchestratorTenantId(String orchestratorTenantId); - } - /** The stage of the Orchestrator definition allowing to specify clusterRootCA. */ - interface WithClusterRootCA { - /** - * Specifies the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. - * - * @param clusterRootCA RootCA certificate of kubernetes cluster base64 encoded. - * @return the next definition stage. - */ - WithCreate withClusterRootCA(String clusterRootCA); - } - /** The stage of the Orchestrator definition allowing to specify apiServerEndpoint. */ - interface WithApiServerEndpoint { - /** - * Specifies the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * - * @param apiServerEndpoint K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId can - * be specified. - * @return the next definition stage. - */ - WithCreate withApiServerEndpoint(String apiServerEndpoint); - } - /** The stage of the Orchestrator definition allowing to specify privateLinkResourceId. */ - interface WithPrivateLinkResourceId { - /** - * Specifies the privateLinkResourceId property: private link arm resource id. Either one of - * apiServerEndpoint or privateLinkResourceId can be specified. - * - * @param privateLinkResourceId private link arm resource id. Either one of apiServerEndpoint or - * privateLinkResourceId can be specified. - * @return the next definition stage. - */ - WithCreate withPrivateLinkResourceId(String privateLinkResourceId); - } - /** The stage of the Orchestrator definition allowing to specify controllerDetails. */ - interface WithControllerDetails { + /** The stage of the Orchestrator definition allowing to specify properties. */ + interface WithProperties { /** - * Specifies the controllerDetails property: Properties of the controller.. + * Specifies the properties property: Properties of the provision operation request.. * - * @param controllerDetails Properties of the controller. + * @param properties Properties of the provision operation request. * @return the next definition stage. */ - WithCreate withControllerDetails(ControllerDetails controllerDetails); + WithCreate withProperties(OrchestratorResourceProperties properties); } } /** diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java index ff05de8c4cd15..7193123d4048c 100644 --- a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorInstanceServices.java @@ -41,23 +41,36 @@ Response getByResourceGroupWithResponse( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByResourceGroup(String resourceGroupName, String resourceName); + void delete(String resourceGroupName, String resourceName, Boolean forceDelete); /** * Deletes the Orchestrator Instance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String resourceName); + + /** + * Deletes the Orchestrator Instance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void delete(String resourceGroupName, String resourceName, Context context); + void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context); /** * Get all the orchestratorInstance resources in a subscription. @@ -139,12 +152,13 @@ Response getByResourceGroupWithResponse( * Deletes the Orchestrator Instance. * * @param id the resource ID. + * @param forceDelete Force delete resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByIdWithResponse(String id, Context context); + void deleteByIdWithResponse(String id, Boolean forceDelete, Context context); /** * Begins definition for a new Orchestrator resource. diff --git a/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceProperties.java b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceProperties.java new file mode 100644 index 0000000000000..46102d368ada2 --- /dev/null +++ b/sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/models/OrchestratorResourceProperties.java @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.delegatednetwork.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Properties of orchestrator. */ +@Fluent +public final class OrchestratorResourceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OrchestratorResourceProperties.class); + + /* + * Resource guid. + */ + @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGuid; + + /* + * The current state of orchestratorInstance resource. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private OrchestratorInstanceState provisioningState; + + /* + * AAD ID used with apiserver + */ + @JsonProperty(value = "orchestratorAppId") + private String orchestratorAppId; + + /* + * TenantID of server App ID + */ + @JsonProperty(value = "orchestratorTenantId") + private String orchestratorTenantId; + + /* + * RootCA certificate of kubernetes cluster base64 encoded + */ + @JsonProperty(value = "clusterRootCA") + private String clusterRootCA; + + /* + * K8s APIServer url. Either one of apiServerEndpoint or + * privateLinkResourceId can be specified + */ + @JsonProperty(value = "apiServerEndpoint") + private String apiServerEndpoint; + + /* + * private link arm resource id. Either one of apiServerEndpoint or + * privateLinkResourceId can be specified + */ + @JsonProperty(value = "privateLinkResourceId") + private String privateLinkResourceId; + + /* + * Properties of the controller. + */ + @JsonProperty(value = "controllerDetails", required = true) + private ControllerDetails controllerDetails; + + /** + * Get the resourceGuid property: Resource guid. + * + * @return the resourceGuid value. + */ + public String resourceGuid() { + return this.resourceGuid; + } + + /** + * Get the provisioningState property: The current state of orchestratorInstance resource. + * + * @return the provisioningState value. + */ + public OrchestratorInstanceState provisioningState() { + return this.provisioningState; + } + + /** + * Get the orchestratorAppId property: AAD ID used with apiserver. + * + * @return the orchestratorAppId value. + */ + public String orchestratorAppId() { + return this.orchestratorAppId; + } + + /** + * Set the orchestratorAppId property: AAD ID used with apiserver. + * + * @param orchestratorAppId the orchestratorAppId value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withOrchestratorAppId(String orchestratorAppId) { + this.orchestratorAppId = orchestratorAppId; + return this; + } + + /** + * Get the orchestratorTenantId property: TenantID of server App ID. + * + * @return the orchestratorTenantId value. + */ + public String orchestratorTenantId() { + return this.orchestratorTenantId; + } + + /** + * Set the orchestratorTenantId property: TenantID of server App ID. + * + * @param orchestratorTenantId the orchestratorTenantId value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withOrchestratorTenantId(String orchestratorTenantId) { + this.orchestratorTenantId = orchestratorTenantId; + return this; + } + + /** + * Get the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. + * + * @return the clusterRootCA value. + */ + public String clusterRootCA() { + return this.clusterRootCA; + } + + /** + * Set the clusterRootCA property: RootCA certificate of kubernetes cluster base64 encoded. + * + * @param clusterRootCA the clusterRootCA value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withClusterRootCA(String clusterRootCA) { + this.clusterRootCA = clusterRootCA; + return this; + } + + /** + * Get the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId + * can be specified. + * + * @return the apiServerEndpoint value. + */ + public String apiServerEndpoint() { + return this.apiServerEndpoint; + } + + /** + * Set the apiServerEndpoint property: K8s APIServer url. Either one of apiServerEndpoint or privateLinkResourceId + * can be specified. + * + * @param apiServerEndpoint the apiServerEndpoint value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withApiServerEndpoint(String apiServerEndpoint) { + this.apiServerEndpoint = apiServerEndpoint; + return this; + } + + /** + * Get the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or + * privateLinkResourceId can be specified. + * + * @return the privateLinkResourceId value. + */ + public String privateLinkResourceId() { + return this.privateLinkResourceId; + } + + /** + * Set the privateLinkResourceId property: private link arm resource id. Either one of apiServerEndpoint or + * privateLinkResourceId can be specified. + * + * @param privateLinkResourceId the privateLinkResourceId value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withPrivateLinkResourceId(String privateLinkResourceId) { + this.privateLinkResourceId = privateLinkResourceId; + return this; + } + + /** + * Get the controllerDetails property: Properties of the controller. + * + * @return the controllerDetails value. + */ + public ControllerDetails controllerDetails() { + return this.controllerDetails; + } + + /** + * Set the controllerDetails property: Properties of the controller. + * + * @param controllerDetails the controllerDetails value to set. + * @return the OrchestratorResourceProperties object itself. + */ + public OrchestratorResourceProperties withControllerDetails(ControllerDetails controllerDetails) { + this.controllerDetails = controllerDetails; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (controllerDetails() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property controllerDetails in model OrchestratorResourceProperties")); + } else { + controllerDetails().validate(); + } + } +}