diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md index 5c1b9b364f6f..6af0148573a3 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2021-06-23) +- Azure Resource Manager HybridKubernetes client library for Java. This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-04-01-preview. 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-01) diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md index 8dfa2bd8605c..964dd001e606 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/README.md @@ -2,7 +2,7 @@ Azure Resource Manager HybridKubernetes client library for Java. -This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-03-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-04-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-hybridkubernetes - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -74,13 +74,15 @@ See [API design][design] for general introduction on design and key concepts on ## Examples + + ## Troubleshooting ## Next steps ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md). 1. Fork it 1. Create your feature branch (`git checkout -b my-new-feature`) @@ -93,7 +95,7 @@ For details on contributing to this repository, see the [contributing guide](htt [docs]: https://azure.github.io/azure-sdk-for-java/ [jdk]: https://docs.microsoft.com/java/azure/jdk/ [azure_subscription]: https://azure.microsoft.com/free/ -[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity -[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty -[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md -[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml index 9746db488bda..3e9d793601b1 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/pom.xml +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/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-hybridkubernetes - 1.0.0-beta.2 - jar + com.azure.resourcemanager + azure-resourcemanager-hybridkubernetes + 1.0.0-beta.2 + jar - Microsoft Azure SDK for HybridKubernetes Management - This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. Hybrid Kubernetes Client. Package tag package-2021-03-01. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt - https://github.com/Azure/azure-sdk-for-java + Microsoft Azure SDK for HybridKubernetes Management + This package contains Microsoft Azure SDK for HybridKubernetes Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Hybrid Kubernetes Client. Package tag package-2021-04-01-preview. + 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.17.0 - - - com.azure - azure-core-management - 1.3.0 - - - - - - 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.17.0 + + + com.azure + azure-core-management + 1.3.0 + + + + + + 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/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java index 3835b358ae68..b98bdb2bf576 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/HybridKubernetesManager.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; @@ -81,6 +81,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; @@ -120,6 +121,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. * @@ -176,6 +188,9 @@ public HybridKubernetesManager 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); } @@ -185,10 +200,8 @@ public HybridKubernetesManager 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/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java index 0b7b38ce9891..377b8d22fdab 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/ConnectedClustersClient.java @@ -12,7 +12,9 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialsProperties; /** An instance of this class provides access to all the operations defined in ConnectedClustersClient. */ public interface ConnectedClustersClient { @@ -77,6 +79,37 @@ SyncPoller, ConnectedClusterInner> beginCreate ConnectedClusterInner create( String resourceGroupName, String clusterName, ConnectedClusterInner connectedCluster, Context context); + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Parameters supplied to update Connected Cluster. + * @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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch); + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Parameters supplied to update Connected Cluster. + * @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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SyncPoller, ConnectedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context); + /** * API to update certain properties of the connected cluster resource. * @@ -105,7 +138,7 @@ ConnectedClusterInner update( * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( + ConnectedClusterInner update( String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context); /** @@ -190,6 +223,37 @@ Response getByResourceGroupWithResponse( @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String clusterName, Context context); + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CredentialResultsInner listClusterUserCredentials( + String resourceGroupName, String clusterName, ListClusterUserCredentialsProperties properties); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String clusterName, ListClusterUserCredentialsProperties properties, Context context); + /** * API to enumerate registered connected K8s clusters under a Resource Group. * diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java index 1470801b61e5..91af3f62d9ee 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/ConnectedClusterInner.java @@ -7,11 +7,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; +import com.azure.resourcemanager.hybridkubernetes.models.PrivateLinkState; import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; -import com.azure.resourcemanager.hybridkubernetes.models.SystemData; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; @@ -112,6 +113,20 @@ public class ConnectedClusterInner extends Resource { @JsonProperty(value = "properties.connectivityStatus", access = JsonProperty.Access.WRITE_ONLY) private ConnectivityStatus connectivityStatus; + /* + * Property which describes the state of private link on a connected + * cluster resource. + */ + @JsonProperty(value = "properties.privateLinkState") + private PrivateLinkState privateLinkState; + + /* + * The resource id of the private link scope this connected cluster is + * assigned to, if any. + */ + @JsonProperty(value = "properties.privateLinkScopeResourceId") + private String privateLinkScopeResourceId; + /** * Get the identity property: The identity of the connected cluster. * @@ -298,6 +313,50 @@ public ConnectivityStatus connectivityStatus() { return this.connectivityStatus; } + /** + * Get the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @return the privateLinkState value. + */ + public PrivateLinkState privateLinkState() { + return this.privateLinkState; + } + + /** + * Set the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @param privateLinkState the privateLinkState value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withPrivateLinkState(PrivateLinkState privateLinkState) { + this.privateLinkState = privateLinkState; + return this; + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + public String privateLinkScopeResourceId() { + return this.privateLinkScopeResourceId; + } + + /** + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. + * + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. + * @return the ConnectedClusterInner object itself. + */ + public ConnectedClusterInner withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + this.privateLinkScopeResourceId = privateLinkScopeResourceId; + return this; + } + /** {@inheritDoc} */ @Override public ConnectedClusterInner withLocation(String location) { @@ -325,9 +384,6 @@ public void validate() { } else { identity().validate(); } - if (systemData() != null) { - systemData().validate(); - } if (agentPublicKeyCertificate() == null) { throw logger .logExceptionAsError( diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java new file mode 100644 index 000000000000..2e6869c986f3 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/fluent/models/CredentialResultsInner.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResult; +import com.azure.resourcemanager.hybridkubernetes.models.HybridConnectionConfig; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The list of credential result response. */ +@Immutable +public final class CredentialResultsInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResultsInner.class); + + /* + * Contains the REP (rendezvous endpoint) and “Sender” access token. + */ + @JsonProperty(value = "hybridConnectionConfig", access = JsonProperty.Access.WRITE_ONLY) + private HybridConnectionConfig hybridConnectionConfig; + + /* + * Base64-encoded Kubernetes configuration file. + */ + @JsonProperty(value = "kubeconfigs", access = JsonProperty.Access.WRITE_ONLY) + private List kubeconfigs; + + /** + * Get the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Sender” access token. + * + * @return the hybridConnectionConfig value. + */ + public HybridConnectionConfig hybridConnectionConfig() { + return this.hybridConnectionConfig; + } + + /** + * Get the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + public List kubeconfigs() { + return this.kubeconfigs; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (hybridConnectionConfig() != null) { + hybridConnectionConfig().validate(); + } + if (kubeconfigs() != null) { + kubeconfigs().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java index 4f4736982dee..33643bc66dc9 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClusterImpl.java @@ -4,16 +4,19 @@ package com.azure.resourcemanager.hybridkubernetes.implementation; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterIdentity; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; import com.azure.resourcemanager.hybridkubernetes.models.ConnectivityStatus; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialsProperties; +import com.azure.resourcemanager.hybridkubernetes.models.PrivateLinkState; import com.azure.resourcemanager.hybridkubernetes.models.ProvisioningState; -import com.azure.resourcemanager.hybridkubernetes.models.SystemData; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -22,7 +25,7 @@ public final class ConnectedClusterImpl implements ConnectedCluster, ConnectedCluster.Definition, ConnectedCluster.Update { private ConnectedClusterInner innerObject; - private final HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; public String id() { return this.innerModel().id(); @@ -105,6 +108,14 @@ public ConnectivityStatus connectivityStatus() { return this.innerModel().connectivityStatus(); } + public PrivateLinkState privateLinkState() { + return this.innerModel().privateLinkState(); + } + + public String privateLinkScopeResourceId() { + return this.innerModel().privateLinkScopeResourceId(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -117,7 +128,7 @@ public ConnectedClusterInner innerModel() { return this.innerObject; } - private HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { return this.serviceManager; } @@ -150,7 +161,8 @@ public ConnectedCluster create(Context context) { return this; } - ConnectedClusterImpl(String name, HybridKubernetesManager serviceManager) { + ConnectedClusterImpl( + String name, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = new ConnectedClusterInner(); this.serviceManager = serviceManager; this.clusterName = name; @@ -166,8 +178,7 @@ public ConnectedCluster apply() { serviceManager .serviceClient() .getConnectedClusters() - .updateWithResponse(resourceGroupName, clusterName, updateConnectedClusterPatch, Context.NONE) - .getValue(); + .update(resourceGroupName, clusterName, updateConnectedClusterPatch, Context.NONE); return this; } @@ -176,12 +187,13 @@ public ConnectedCluster apply(Context context) { serviceManager .serviceClient() .getConnectedClusters() - .updateWithResponse(resourceGroupName, clusterName, updateConnectedClusterPatch, context) - .getValue(); + .update(resourceGroupName, clusterName, updateConnectedClusterPatch, context); return this; } - ConnectedClusterImpl(ConnectedClusterInner innerObject, HybridKubernetesManager serviceManager) { + ConnectedClusterImpl( + ConnectedClusterInner innerObject, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourcegroups"); @@ -208,6 +220,19 @@ public ConnectedCluster refresh(Context context) { return this; } + public CredentialResults listClusterUserCredentials(ListClusterUserCredentialsProperties properties) { + return serviceManager + .connectedClusters() + .listClusterUserCredentials(resourceGroupName, clusterName, properties); + } + + public Response listClusterUserCredentialsWithResponse( + ListClusterUserCredentialsProperties properties, Context context) { + return serviceManager + .connectedClusters() + .listClusterUserCredentialsWithResponse(resourceGroupName, clusterName, properties, context); + } + public ConnectedClusterImpl withRegion(Region location) { this.innerModel().withLocation(location.toString()); return this; @@ -253,9 +278,24 @@ public ConnectedClusterImpl withInfrastructure(String infrastructure) { return this; } - public ConnectedClusterImpl withProperties(Object properties) { - this.updateConnectedClusterPatch.withProperties(properties); - return this; + public ConnectedClusterImpl withPrivateLinkState(PrivateLinkState privateLinkState) { + if (isInCreateMode()) { + this.innerModel().withPrivateLinkState(privateLinkState); + return this; + } else { + this.updateConnectedClusterPatch.withPrivateLinkState(privateLinkState); + return this; + } + } + + public ConnectedClusterImpl withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + if (isInCreateMode()) { + this.innerModel().withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } else { + this.updateConnectedClusterPatch.withPrivateLinkScopeResourceId(privateLinkScopeResourceId); + return this; + } } private boolean isInCreateMode() { diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java index 0418689a6bde..5ad5011a5ebd 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersClientImpl.java @@ -14,6 +14,7 @@ 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; @@ -35,8 +36,10 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterList; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusterPatch; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialsProperties; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -89,9 +92,9 @@ Mono>> create( @Patch( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + "/connectedClusters/{clusterName}") - @ExpectedResponses({200}) + @ExpectedResponses({200, 202}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( + Mono>> update( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @@ -131,6 +134,22 @@ Mono>> delete( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" + + "/connectedClusters/{clusterName}/listClusterUserCredentials") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClusterUserCredentials( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ListClusterUserCredentialsProperties properties, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get( "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes" @@ -230,7 +249,7 @@ private Mono>> createWithResponseAsync( connectedCluster, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -458,7 +477,7 @@ public ConnectedClusterInner create( * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { if (this.client.getEndpoint() == null) { return Mono @@ -499,7 +518,7 @@ private Mono> updateWithResponseAsync( connectedClusterPatch, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -515,7 +534,7 @@ private Mono> updateWithResponseAsync( * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( + private Mono>> updateWithResponseAsync( String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { if (this.client.getEndpoint() == null) { return Mono @@ -556,6 +575,91 @@ private Mono> updateWithResponseAsync( context); } + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Parameters supplied to update Connected Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectedClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ConnectedClusterInner.class, + ConnectedClusterInner.class, + Context.NONE); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Parameters supplied to update Connected Cluster. + * @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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PollerFlux, ConnectedClusterInner> beginUpdateAsync( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ConnectedClusterInner.class, ConnectedClusterInner.class, context); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Parameters supplied to update Connected Cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { + return beginUpdateAsync(resourceGroupName, clusterName, connectedClusterPatch).getSyncPoller(); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Parameters supplied to update Connected Cluster. + * @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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SyncPoller, ConnectedClusterInner> beginUpdate( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, connectedClusterPatch, context).getSyncPoller(); + } + /** * API to update certain properties of the connected cluster resource. * @@ -570,15 +674,29 @@ private Mono> updateWithResponseAsync( @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch) { - return updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return beginUpdateAsync(resourceGroupName, clusterName, connectedClusterPatch) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * API to update certain properties of the connected cluster resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param connectedClusterPatch Parameters supplied to update Connected Cluster. + * @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 represents a connected cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, connectedClusterPatch, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -611,9 +729,9 @@ public ConnectedClusterInner update( * @return represents a connected cluster. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( + public ConnectedClusterInner update( String resourceGroupName, String clusterName, ConnectedClusterPatch connectedClusterPatch, Context context) { - return updateWithResponseAsync(resourceGroupName, clusterName, connectedClusterPatch, context).block(); + return updateAsync(resourceGroupName, clusterName, connectedClusterPatch, context).block(); } /** @@ -662,7 +780,7 @@ private Mono> getByResourceGroupWithResponseAsyn clusterName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -814,7 +932,7 @@ private Mono>> deleteWithResponseAsync(String resource clusterName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -996,6 +1114,180 @@ public void delete(String resourceGroupName, String clusterName, Context context deleteAsync(resourceGroupName, clusterName, context).block(); } + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync( + String resourceGroupName, String clusterName, ListClusterUserCredentialsProperties properties) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listClusterUserCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + properties, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listClusterUserCredentialsWithResponseAsync( + String resourceGroupName, + String clusterName, + ListClusterUserCredentialsProperties properties, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); + } else { + properties.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listClusterUserCredentials( + this.client.getEndpoint(), + this.client.getApiVersion(), + this.client.getSubscriptionId(), + resourceGroupName, + clusterName, + properties, + accept, + context); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listClusterUserCredentialsAsync( + String resourceGroupName, String clusterName, ListClusterUserCredentialsProperties properties) { + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, clusterName, properties) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CredentialResultsInner listClusterUserCredentials( + String resourceGroupName, String clusterName, ListClusterUserCredentialsProperties properties) { + return listClusterUserCredentialsAsync(resourceGroupName, clusterName, properties).block(); + } + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listClusterUserCredentialsWithResponse( + String resourceGroupName, + String clusterName, + ListClusterUserCredentialsProperties properties, + Context context) { + return listClusterUserCredentialsWithResponseAsync(resourceGroupName, clusterName, properties, context).block(); + } + /** * API to enumerate registered connected K8s clusters under a Resource Group. * @@ -1044,7 +1336,7 @@ private Mono> listByResourceGroupSinglePage res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1200,7 +1492,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1333,7 +1625,7 @@ private Mono> listByResourceGroupNextSingle res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1406,7 +1698,7 @@ private Mono> listBySubscriptionNextSingleP res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java index 607c370ee199..38a26f2d0ad6 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/ConnectedClustersImpl.java @@ -9,11 +9,13 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; import com.azure.resourcemanager.hybridkubernetes.fluent.ConnectedClustersClient; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedCluster; import com.azure.resourcemanager.hybridkubernetes.models.ConnectedClusters; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; +import com.azure.resourcemanager.hybridkubernetes.models.ListClusterUserCredentialsProperties; import com.fasterxml.jackson.annotation.JsonIgnore; public final class ConnectedClustersImpl implements ConnectedClusters { @@ -21,9 +23,11 @@ public final class ConnectedClustersImpl implements ConnectedClusters { private final ConnectedClustersClient innerClient; - private final HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - public ConnectedClustersImpl(ConnectedClustersClient innerClient, HybridKubernetesManager serviceManager) { + public ConnectedClustersImpl( + ConnectedClustersClient innerClient, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -60,6 +64,37 @@ public void delete(String resourceGroupName, String clusterName, Context context this.serviceClient().delete(resourceGroupName, clusterName, context); } + public CredentialResults listClusterUserCredentials( + String resourceGroupName, String clusterName, ListClusterUserCredentialsProperties properties) { + CredentialResultsInner inner = + this.serviceClient().listClusterUserCredentials(resourceGroupName, clusterName, properties); + if (inner != null) { + return new CredentialResultsImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listClusterUserCredentialsWithResponse( + String resourceGroupName, + String clusterName, + ListClusterUserCredentialsProperties properties, + Context context) { + Response inner = + this + .serviceClient() + .listClusterUserCredentialsWithResponse(resourceGroupName, clusterName, properties, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new CredentialResultsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return Utils.mapPage(inner, inner1 -> new ConnectedClusterImpl(inner1, this.manager())); @@ -169,7 +204,7 @@ private ConnectedClustersClient serviceClient() { return this.innerClient; } - private HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { return this.serviceManager; } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.java new file mode 100644 index 000000000000..09886a72077d --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/CredentialResultsImpl.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.hybridkubernetes.implementation; + +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResult; +import com.azure.resourcemanager.hybridkubernetes.models.CredentialResults; +import com.azure.resourcemanager.hybridkubernetes.models.HybridConnectionConfig; +import java.util.Collections; +import java.util.List; + +public final class CredentialResultsImpl implements CredentialResults { + private CredentialResultsInner innerObject; + + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; + + CredentialResultsImpl( + CredentialResultsInner innerObject, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public HybridConnectionConfig hybridConnectionConfig() { + return this.innerModel().hybridConnectionConfig(); + } + + public List kubeconfigs() { + List inner = this.innerModel().kubeconfigs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public CredentialResultsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java index 3fb7a045334d..66a6acb936d4 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/HybridKubernetesManagementClientImpl.java @@ -157,7 +157,7 @@ public OperationsClient getOperations() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-03-01"; + this.apiVersion = "2021-04-01-preview"; this.connectedClusters = new ConnectedClustersClientImpl(this); this.operations = new OperationsClientImpl(this); } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java index 68eed1e40fad..9d768e2e4c78 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.hybridkubernetes.implementation; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; import com.azure.resourcemanager.hybridkubernetes.models.Operation; import com.azure.resourcemanager.hybridkubernetes.models.OperationDisplay; @@ -12,9 +11,10 @@ public final class OperationImpl implements Operation { private OperationInner innerObject; - private final HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - OperationImpl(OperationInner innerObject, HybridKubernetesManager serviceManager) { + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -31,7 +31,7 @@ public OperationInner innerModel() { return this.innerObject; } - private HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { return this.serviceManager; } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java index 37a420749cbc..1f68bfa9e994 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsClientImpl.java @@ -108,7 +108,7 @@ private Mono> getSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -228,7 +228,7 @@ private Mono> getNextSinglePageAsync(String nextLi res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java index 5a268ff3d2af..0b38676f3666 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/OperationsImpl.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager; import com.azure.resourcemanager.hybridkubernetes.fluent.OperationsClient; import com.azure.resourcemanager.hybridkubernetes.fluent.models.OperationInner; import com.azure.resourcemanager.hybridkubernetes.models.Operation; @@ -19,9 +18,11 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final HybridKubernetesManager serviceManager; + private final com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager; - public OperationsImpl(OperationsClient innerClient, HybridKubernetesManager serviceManager) { + public OperationsImpl( + OperationsClient innerClient, + com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -40,7 +41,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private HybridKubernetesManager manager() { + private com.azure.resourcemanager.hybridkubernetes.HybridKubernetesManager manager() { return this.serviceManager; } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java index 1585060b87f1..c21531d2505e 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/implementation/Utils.java @@ -9,8 +9,6 @@ import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.CoreUtils; -import reactor.core.publisher.Mono; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -19,6 +17,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; +import reactor.core.publisher.Flux; final class Utils { static String getValueFromIdByName(String id, String name) { @@ -80,76 +79,84 @@ static PagedIterable mapPage(PagedIterable pageIterable, Function extends PagedIterable { - private final PagedIterable pageIterable; + private final PagedIterable pagedIterable; private final Function mapper; private final Function, PagedResponse> pageMapper; - private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { - super(new PagedFlux(() -> Mono.empty())); - this.pageIterable = pageIterable; + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; this.mapper = mapper; - this.pageMapper = - page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); } @Override public Stream stream() { - return pageIterable.stream().map(mapper); + return pagedIterable.stream().map(mapper); } @Override public Stream> streamByPage() { - return pageIterable.streamByPage().map(pageMapper); + return pagedIterable.streamByPage().map(pageMapper); } @Override public Stream> streamByPage(String continuationToken) { - return pageIterable.streamByPage(continuationToken).map(pageMapper); + return pagedIterable.streamByPage(continuationToken).map(pageMapper); } @Override public Stream> streamByPage(int preferredPageSize) { - return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); } @Override public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); } @Override public Iterator iterator() { - return new IteratorImpl(pageIterable.iterator(), mapper); + return new IteratorImpl(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken), pageMapper); + pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(preferredPageSize), pageMapper); + pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java new file mode 100644 index 000000000000..10c10b4ee19a --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/AuthenticationMethod.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AuthenticationMethod. */ +public final class AuthenticationMethod extends ExpandableStringEnum { + /** Static value Token for AuthenticationMethod. */ + public static final AuthenticationMethod TOKEN = fromString("Token"); + + /** Static value AAD for AuthenticationMethod. */ + public static final AuthenticationMethod AAD = fromString("AAD"); + + /** + * Creates or finds a AuthenticationMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding AuthenticationMethod. + */ + @JsonCreator + public static AuthenticationMethod fromString(String name) { + return fromString(name, AuthenticationMethod.class); + } + + /** @return known AuthenticationMethod values. */ + public static Collection values() { + return values(AuthenticationMethod.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java index 69378473439f..74d1e0733ebd 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedCluster.java @@ -4,7 +4,9 @@ package com.azure.resourcemanager.hybridkubernetes.models; +import com.azure.core.http.rest.Response; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.hybridkubernetes.fluent.models.ConnectedClusterInner; import java.time.OffsetDateTime; @@ -148,6 +150,22 @@ public interface ConnectedCluster { */ ConnectivityStatus connectivityStatus(); + /** + * Gets the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @return the privateLinkState value. + */ + PrivateLinkState privateLinkState(); + + /** + * Gets the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. + * + * @return the privateLinkScopeResourceId value. + */ + String privateLinkScopeResourceId(); + /** * Gets the region of the resource. * @@ -241,7 +259,9 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProvisioningState, DefinitionStages.WithDistribution, - DefinitionStages.WithInfrastructure { + DefinitionStages.WithInfrastructure, + DefinitionStages.WithPrivateLinkState, + DefinitionStages.WithPrivateLinkScopeResourceId { /** * Executes the create request. * @@ -299,6 +319,30 @@ interface WithInfrastructure { */ WithCreate withInfrastructure(String infrastructure); } + /** The stage of the ConnectedCluster definition allowing to specify privateLinkState. */ + interface WithPrivateLinkState { + /** + * Specifies the privateLinkState property: Property which describes the state of private link on a + * connected cluster resource.. + * + * @param privateLinkState Property which describes the state of private link on a connected cluster + * resource. + * @return the next definition stage. + */ + WithCreate withPrivateLinkState(PrivateLinkState privateLinkState); + } + /** The stage of the ConnectedCluster definition allowing to specify privateLinkScopeResourceId. */ + interface WithPrivateLinkScopeResourceId { + /** + * Specifies the privateLinkScopeResourceId property: The resource id of the private link scope this + * connected cluster is assigned to, if any.. + * + * @param privateLinkScopeResourceId The resource id of the private link scope this connected cluster is + * assigned to, if any. + * @return the next definition stage. + */ + WithCreate withPrivateLinkScopeResourceId(String privateLinkScopeResourceId); + } } /** * Begins update for the ConnectedCluster resource. @@ -308,7 +352,8 @@ interface WithInfrastructure { ConnectedCluster.Update update(); /** The template for ConnectedCluster update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { + interface Update + extends UpdateStages.WithTags, UpdateStages.WithPrivateLinkState, UpdateStages.WithPrivateLinkScopeResourceId { /** * Executes the update request. * @@ -336,17 +381,29 @@ interface WithTags { */ Update withTags(Map tags); } - /** The stage of the ConnectedCluster update allowing to specify properties. */ - interface WithProperties { + /** The stage of the ConnectedCluster update allowing to specify privateLinkState. */ + interface WithPrivateLinkState { + /** + * Specifies the privateLinkState property: Property which describes the state of private link on a + * connected cluster resource.. + * + * @param privateLinkState Property which describes the state of private link on a connected cluster + * resource. + * @return the next definition stage. + */ + Update withPrivateLinkState(PrivateLinkState privateLinkState); + } + /** The stage of the ConnectedCluster update allowing to specify privateLinkScopeResourceId. */ + interface WithPrivateLinkScopeResourceId { /** - * Specifies the properties property: Describes the connected cluster resource properties that can be - * updated during PATCH operation.. + * Specifies the privateLinkScopeResourceId property: The resource id of the private link scope this + * connected cluster is assigned to, if any.. * - * @param properties Describes the connected cluster resource properties that can be updated during PATCH - * operation. + * @param privateLinkScopeResourceId The resource id of the private link scope this connected cluster is + * assigned to, if any. * @return the next definition stage. */ - Update withProperties(Object properties); + Update withPrivateLinkScopeResourceId(String privateLinkScopeResourceId); } } /** @@ -363,4 +420,28 @@ interface WithProperties { * @return the refreshed resource. */ ConnectedCluster refresh(Context context); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param properties ListClusterUserCredentials properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + CredentialResults listClusterUserCredentials(ListClusterUserCredentialsProperties properties); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param properties ListClusterUserCredentials properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + Response listClusterUserCredentialsWithResponse( + ListClusterUserCredentialsProperties properties, Context context); } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java index e4640b64f518..22cf9c89daa1 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusterPatch.java @@ -5,14 +5,16 @@ package com.azure.resourcemanager.hybridkubernetes.models; import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.JsonFlatten; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Object containing updates for patch operations. */ +@JsonFlatten @Fluent -public final class ConnectedClusterPatch { +public class ConnectedClusterPatch { @JsonIgnore private final ClientLogger logger = new ClientLogger(ConnectedClusterPatch.class); /* @@ -22,11 +24,18 @@ public final class ConnectedClusterPatch { private Map tags; /* - * Describes the connected cluster resource properties that can be updated - * during PATCH operation. + * Property which describes the state of private link on a connected + * cluster resource. */ - @JsonProperty(value = "properties") - private Object properties; + @JsonProperty(value = "properties.privateLinkState") + private PrivateLinkState privateLinkState; + + /* + * The resource id of the private link scope this connected cluster is + * assigned to, if any. + */ + @JsonProperty(value = "properties.privateLinkScopeResourceId") + private String privateLinkScopeResourceId; /** * Get the tags property: Resource tags. @@ -49,24 +58,46 @@ public ConnectedClusterPatch withTags(Map tags) { } /** - * Get the properties property: Describes the connected cluster resource properties that can be updated during PATCH - * operation. + * Get the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @return the privateLinkState value. + */ + public PrivateLinkState privateLinkState() { + return this.privateLinkState; + } + + /** + * Set the privateLinkState property: Property which describes the state of private link on a connected cluster + * resource. + * + * @param privateLinkState the privateLinkState value to set. + * @return the ConnectedClusterPatch object itself. + */ + public ConnectedClusterPatch withPrivateLinkState(PrivateLinkState privateLinkState) { + this.privateLinkState = privateLinkState; + return this; + } + + /** + * Get the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. * - * @return the properties value. + * @return the privateLinkScopeResourceId value. */ - public Object properties() { - return this.properties; + public String privateLinkScopeResourceId() { + return this.privateLinkScopeResourceId; } /** - * Set the properties property: Describes the connected cluster resource properties that can be updated during PATCH - * operation. + * Set the privateLinkScopeResourceId property: The resource id of the private link scope this connected cluster is + * assigned to, if any. * - * @param properties the properties value to set. + * @param privateLinkScopeResourceId the privateLinkScopeResourceId value to set. * @return the ConnectedClusterPatch object itself. */ - public ConnectedClusterPatch withProperties(Object properties) { - this.properties = properties; + public ConnectedClusterPatch withPrivateLinkScopeResourceId(String privateLinkScopeResourceId) { + this.privateLinkScopeResourceId = privateLinkScopeResourceId; return this; } diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java index 02d1f89c7484..756030b9a2f2 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ConnectedClusters.java @@ -61,6 +61,35 @@ Response getByResourceGroupWithResponse( */ void delete(String resourceGroupName, String clusterName, Context context); + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + CredentialResults listClusterUserCredentials( + String resourceGroupName, String clusterName, ListClusterUserCredentialsProperties properties); + + /** + * Gets cluster user credentials of the connected cluster with a specified resource group and name. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the Kubernetes cluster on which get is called. + * @param properties ListClusterUserCredentials properties. + * @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 cluster user credentials of the connected cluster with a specified resource group and name. + */ + Response listClusterUserCredentialsWithResponse( + String resourceGroupName, String clusterName, ListClusterUserCredentialsProperties properties, Context context); + /** * API to enumerate registered connected K8s clusters under a Resource Group. * diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CreatedByType.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CreatedByType.java deleted file mode 100644 index 35ed5a2753b2..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CreatedByType.java +++ /dev/null @@ -1,40 +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.hybridkubernetes.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CreatedByType. */ -public final class CreatedByType extends ExpandableStringEnum { - /** Static value User for CreatedByType. */ - public static final CreatedByType USER = fromString("User"); - - /** Static value Application for CreatedByType. */ - public static final CreatedByType APPLICATION = fromString("Application"); - - /** Static value ManagedIdentity for CreatedByType. */ - public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** Static value Key for CreatedByType. */ - public static final CreatedByType KEY = fromString("Key"); - - /** - * Creates or finds a CreatedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreatedByType. - */ - @JsonCreator - public static CreatedByType fromString(String name) { - return fromString(name, CreatedByType.class); - } - - /** @return known CreatedByType values. */ - public static Collection values() { - return values(CreatedByType.class); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java similarity index 50% rename from sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java rename to sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java index 726973f76fe0..9019fae1f3cc 100644 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ErrorAdditionalInfo.java +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResult.java @@ -5,43 +5,44 @@ package com.azure.resourcemanager.hybridkubernetes.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; 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. */ +/** The credential result response. */ @Immutable -public final class ErrorAdditionalInfo { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ErrorAdditionalInfo.class); +public final class CredentialResult { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CredentialResult.class); /* - * The additional info type. + * The name of the credential. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; /* - * The additional info. + * Base64-encoded Kubernetes configuration file. */ - @JsonProperty(value = "info", access = JsonProperty.Access.WRITE_ONLY) - private Object info; + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private byte[] value; /** - * Get the type property: The additional info type. + * Get the name property: The name of the credential. * - * @return the type value. + * @return the name value. */ - public String type() { - return this.type; + public String name() { + return this.name; } /** - * Get the info property: The additional info. + * Get the value property: Base64-encoded Kubernetes configuration file. * - * @return the info value. + * @return the value value. */ - public Object info() { - return this.info; + public byte[] value() { + return CoreUtils.clone(this.value); } /** diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java new file mode 100644 index 000000000000..da6275bfc883 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/CredentialResults.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner; +import java.util.List; + +/** An immutable client-side representation of CredentialResults. */ +public interface CredentialResults { + /** + * Gets the hybridConnectionConfig property: Contains the REP (rendezvous endpoint) and “Sender” access token. + * + * @return the hybridConnectionConfig value. + */ + HybridConnectionConfig hybridConnectionConfig(); + + /** + * Gets the kubeconfigs property: Base64-encoded Kubernetes configuration file. + * + * @return the kubeconfigs value. + */ + List kubeconfigs(); + + /** + * Gets the inner com.azure.resourcemanager.hybridkubernetes.fluent.models.CredentialResultsInner object. + * + * @return the inner object. + */ + CredentialResultsInner innerModel(); +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java new file mode 100644 index 000000000000..63a2f138548c --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/HybridConnectionConfig.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.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; + +/** Contains the REP (rendezvous endpoint) and “Sender” access token. */ +@Immutable +public final class HybridConnectionConfig { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HybridConnectionConfig.class); + + /* + * Timestamp when this token will be expired. + */ + @JsonProperty(value = "expirationTime", access = JsonProperty.Access.WRITE_ONLY) + private Long expirationTime; + + /* + * Name of the connection + */ + @JsonProperty(value = "hybridConnectionName", access = JsonProperty.Access.WRITE_ONLY) + private String hybridConnectionName; + + /* + * Name of the relay. + */ + @JsonProperty(value = "relay", access = JsonProperty.Access.WRITE_ONLY) + private String relay; + + /* + * Sender access token + */ + @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) + private String token; + + /** + * Get the expirationTime property: Timestamp when this token will be expired. + * + * @return the expirationTime value. + */ + public Long expirationTime() { + return this.expirationTime; + } + + /** + * Get the hybridConnectionName property: Name of the connection. + * + * @return the hybridConnectionName value. + */ + public String hybridConnectionName() { + return this.hybridConnectionName; + } + + /** + * Get the relay property: Name of the relay. + * + * @return the relay value. + */ + public String relay() { + return this.relay; + } + + /** + * Get the token property: Sender access token. + * + * @return the token value. + */ + public String token() { + return this.token; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/LastModifiedByType.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/LastModifiedByType.java deleted file mode 100644 index 463cca77bf36..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/LastModifiedByType.java +++ /dev/null @@ -1,40 +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.hybridkubernetes.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for LastModifiedByType. */ -public final class LastModifiedByType extends ExpandableStringEnum { - /** Static value User for LastModifiedByType. */ - public static final LastModifiedByType USER = fromString("User"); - - /** Static value Application for LastModifiedByType. */ - public static final LastModifiedByType APPLICATION = fromString("Application"); - - /** Static value ManagedIdentity for LastModifiedByType. */ - public static final LastModifiedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** Static value Key for LastModifiedByType. */ - public static final LastModifiedByType KEY = fromString("Key"); - - /** - * Creates or finds a LastModifiedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding LastModifiedByType. - */ - @JsonCreator - public static LastModifiedByType fromString(String name) { - return fromString(name, LastModifiedByType.class); - } - - /** @return known LastModifiedByType values. */ - public static Collection values() { - return values(LastModifiedByType.class); - } -} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialsProperties.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialsProperties.java new file mode 100644 index 000000000000..85a5f1780007 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/ListClusterUserCredentialsProperties.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.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; + +/** The ListClusterUserCredentialsProperties model. */ +@Fluent +public final class ListClusterUserCredentialsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ListClusterUserCredentialsProperties.class); + + /* + * The mode of client authentication. + */ + @JsonProperty(value = "authenticationMethod", required = true) + private AuthenticationMethod authenticationMethod; + + /* + * Boolean value to indicate whether the request is for client side proxy + * or not + */ + @JsonProperty(value = "clientProxy", required = true) + private boolean clientProxy; + + /** + * Get the authenticationMethod property: The mode of client authentication. + * + * @return the authenticationMethod value. + */ + public AuthenticationMethod authenticationMethod() { + return this.authenticationMethod; + } + + /** + * Set the authenticationMethod property: The mode of client authentication. + * + * @param authenticationMethod the authenticationMethod value to set. + * @return the ListClusterUserCredentialsProperties object itself. + */ + public ListClusterUserCredentialsProperties withAuthenticationMethod(AuthenticationMethod authenticationMethod) { + this.authenticationMethod = authenticationMethod; + return this; + } + + /** + * Get the clientProxy property: Boolean value to indicate whether the request is for client side proxy or not. + * + * @return the clientProxy value. + */ + public boolean clientProxy() { + return this.clientProxy; + } + + /** + * Set the clientProxy property: Boolean value to indicate whether the request is for client side proxy or not. + * + * @param clientProxy the clientProxy value to set. + * @return the ListClusterUserCredentialsProperties object itself. + */ + public ListClusterUserCredentialsProperties withClientProxy(boolean clientProxy) { + this.clientProxy = clientProxy; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (authenticationMethod() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property authenticationMethod in model" + + " ListClusterUserCredentialsProperties")); + } + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/PrivateLinkState.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/PrivateLinkState.java new file mode 100644 index 000000000000..b14904f7bae8 --- /dev/null +++ b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/PrivateLinkState.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.hybridkubernetes.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PrivateLinkState. */ +public final class PrivateLinkState extends ExpandableStringEnum { + /** Static value Enabled for PrivateLinkState. */ + public static final PrivateLinkState ENABLED = fromString("Enabled"); + + /** Static value Disabled for PrivateLinkState. */ + public static final PrivateLinkState DISABLED = fromString("Disabled"); + + /** + * Creates or finds a PrivateLinkState from its string representation. + * + * @param name a name to look for. + * @return the corresponding PrivateLinkState. + */ + @JsonCreator + public static PrivateLinkState fromString(String name) { + return fromString(name, PrivateLinkState.class); + } + + /** @return known PrivateLinkState values. */ + public static Collection values() { + return values(PrivateLinkState.class); + } +} diff --git a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemData.java b/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemData.java deleted file mode 100644 index 15a1c4838044..000000000000 --- a/sdk/hybridkubernetes/azure-resourcemanager-hybridkubernetes/src/main/java/com/azure/resourcemanager/hybridkubernetes/models/SystemData.java +++ /dev/null @@ -1,181 +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.hybridkubernetes.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; -import java.time.OffsetDateTime; - -/** Metadata pertaining to creation and last modification of the resource. */ -@Fluent -public final class SystemData { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SystemData.class); - - /* - * The identity that created the resource. - */ - @JsonProperty(value = "createdBy") - private String createdBy; - - /* - * The type of identity that created the resource. - */ - @JsonProperty(value = "createdByType") - private CreatedByType createdByType; - - /* - * The timestamp of resource creation (UTC). - */ - @JsonProperty(value = "createdAt") - private OffsetDateTime createdAt; - - /* - * The identity that last modified the resource. - */ - @JsonProperty(value = "lastModifiedBy") - private String lastModifiedBy; - - /* - * The type of identity that last modified the resource. - */ - @JsonProperty(value = "lastModifiedByType") - private LastModifiedByType lastModifiedByType; - - /* - * The timestamp of resource modification (UTC). - */ - @JsonProperty(value = "lastModifiedAt") - private OffsetDateTime lastModifiedAt; - - /** - * Get the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Set the createdBy property: The identity that created the resource. - * - * @param createdBy the createdBy value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedBy(String createdBy) { - this.createdBy = createdBy; - return this; - } - - /** - * Get the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - public CreatedByType createdByType() { - return this.createdByType; - } - - /** - * Set the createdByType property: The type of identity that created the resource. - * - * @param createdByType the createdByType value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedByType(CreatedByType createdByType) { - this.createdByType = createdByType; - return this; - } - - /** - * Get the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The timestamp of resource creation (UTC). - * - * @param createdAt the createdAt value to set. - * @return the SystemData object itself. - */ - public SystemData withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: The identity that last modified the resource. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - public LastModifiedByType lastModifiedByType() { - return this.lastModifiedByType; - } - - /** - * Set the lastModifiedByType property: The type of identity that last modified the resource. - * - * @param lastModifiedByType the lastModifiedByType value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedByType(LastModifiedByType lastModifiedByType) { - this.lastModifiedByType = lastModifiedByType; - return this; - } - - /** - * Get the lastModifiedAt property: The timestamp of resource modification (UTC). - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * Set the lastModifiedAt property: The timestamp of resource modification (UTC). - * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the SystemData object itself. - */ - public SystemData withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -}