diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml index 02e25aeb97e93..6c6859d2d2df5 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/pom.xml @@ -38,6 +38,11 @@ + + com.azure + azure-json + 1.1.0 + com.azure azure-core diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsAsyncClient.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsAsyncClient.java index e96f4a3f36f36..ca68189adeeae 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsAsyncClient.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsAsyncClient.java @@ -6,55 +6,61 @@ import com.azure.analytics.synapse.managedprivateendpoints.implementation.ManagedPrivateEndpointsImpl; import com.azure.analytics.synapse.managedprivateendpoints.models.ManagedPrivateEndpoint; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; import com.azure.core.exception.HttpResponseException; import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.Response; import reactor.core.publisher.Mono; -/** Initializes a new instance of the asynchronous ManagedPrivateEndpointsClient type. */ +/** + * Initializes a new instance of the asynchronous ManagedPrivateEndpointsClient type. + */ @ServiceClient(builder = ManagedPrivateEndpointsClientBuilder.class, isAsync = true) public final class ManagedPrivateEndpointsAsyncClient { + @Generated private final ManagedPrivateEndpointsImpl serviceClient; /** - * Initializes an instance of ManagedPrivateEndpoints client. - * + * Initializes an instance of ManagedPrivateEndpointsAsyncClient class. + * * @param serviceClient the service client implementation. */ + @Generated ManagedPrivateEndpointsAsyncClient(ManagedPrivateEndpointsImpl serviceClient) { this.serviceClient = serviceClient; } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed Private Endpoints. + * @return managed Private Endpoints along with {@link Response} on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponse( - String managedVirtualNetworkName, String managedPrivateEndpointName) { + public Mono> getWithResponse(String managedVirtualNetworkName, + String managedPrivateEndpointName) { return this.serviceClient.getWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName); } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed Private Endpoints. + * @return managed Private Endpoints on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono get(String managedVirtualNetworkName, String managedPrivateEndpointName) { return this.serviceClient.getAsync(managedVirtualNetworkName, managedPrivateEndpointName); @@ -62,70 +68,70 @@ public Mono get(String managedVirtualNetworkName, String /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed private endpoint. + * @return managed private endpoint along with {@link Response} on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponse( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint) { - return this.serviceClient.createWithResponseAsync( - managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint); + public Mono> createWithResponse(String managedVirtualNetworkName, + String managedPrivateEndpointName, ManagedPrivateEndpoint managedPrivateEndpoint) { + return this.serviceClient.createWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, + managedPrivateEndpoint); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed private endpoint. + * @return managed private endpoint on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono create( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint) { - return this.serviceClient.createAsync( - managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint); + public Mono create(String managedVirtualNetworkName, String managedPrivateEndpointName, + ManagedPrivateEndpoint managedPrivateEndpoint) { + return this.serviceClient.createAsync(managedVirtualNetworkName, managedPrivateEndpointName, + managedPrivateEndpoint); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponse( - String managedVirtualNetworkName, String managedPrivateEndpointName) { + public Mono> deleteWithResponse(String managedVirtualNetworkName, + String managedPrivateEndpointName) { return this.serviceClient.deleteWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) public Mono delete(String managedVirtualNetworkName, String managedPrivateEndpointName) { return this.serviceClient.deleteAsync(managedVirtualNetworkName, managedPrivateEndpointName); @@ -133,43 +139,16 @@ public Mono delete(String managedVirtualNetworkName, String managedPrivate /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public Mono> listSinglePage(String managedVirtualNetworkName) { - return this.serviceClient.listSinglePageAsync(managedVirtualNetworkName); - } - - /** - * List Managed Private Endpoints. - * - * @param managedVirtualNetworkName Managed virtual network name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints as paginated response with {@link PagedFlux}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux list(String managedVirtualNetworkName) { return this.serviceClient.listAsync(managedVirtualNetworkName); } - - /** - * Get the next page of items. - * - * @param nextLink The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public Mono> listNextSinglePage(String nextLink) { - return this.serviceClient.listNextSinglePageAsync(nextLink); - } } diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsClient.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsClient.java index 7b961228fc298..976973cf3f553 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsClient.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsClient.java @@ -6,6 +6,7 @@ import com.azure.analytics.synapse.managedprivateendpoints.implementation.ManagedPrivateEndpointsImpl; import com.azure.analytics.synapse.managedprivateendpoints.models.ManagedPrivateEndpoint; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; import com.azure.core.annotation.ServiceMethod; @@ -14,133 +15,139 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Initializes a new instance of the synchronous ManagedPrivateEndpointsClient type. */ +/** + * Initializes a new instance of the synchronous ManagedPrivateEndpointsClient type. + */ @ServiceClient(builder = ManagedPrivateEndpointsClientBuilder.class) public final class ManagedPrivateEndpointsClient { + @Generated private final ManagedPrivateEndpointsImpl serviceClient; /** - * Initializes an instance of ManagedPrivateEndpoints client. - * + * Initializes an instance of ManagedPrivateEndpointsClient class. + * * @param serviceClient the service client implementation. */ + @Generated ManagedPrivateEndpointsClient(ManagedPrivateEndpointsImpl serviceClient) { this.serviceClient = serviceClient; } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed Private Endpoints. + * @return managed Private Endpoints along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedPrivateEndpoint get(String managedVirtualNetworkName, String managedPrivateEndpointName) { - return this.serviceClient.get(managedVirtualNetworkName, managedPrivateEndpointName); + public Response getWithResponse(String managedVirtualNetworkName, + String managedPrivateEndpointName, Context context) { + return this.serviceClient.getWithResponse(managedVirtualNetworkName, managedPrivateEndpointName, context); } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed Private Endpoints. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String managedVirtualNetworkName, String managedPrivateEndpointName, Context context) { - return this.serviceClient.getWithResponse(managedVirtualNetworkName, managedPrivateEndpointName, context); + public ManagedPrivateEndpoint get(String managedVirtualNetworkName, String managedPrivateEndpointName) { + return this.serviceClient.get(managedVirtualNetworkName, managedPrivateEndpointName); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed private endpoint. + * @return managed private endpoint along with {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedPrivateEndpoint create( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint) { - return this.serviceClient.create(managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint); + public Response createWithResponse(String managedVirtualNetworkName, + String managedPrivateEndpointName, ManagedPrivateEndpoint managedPrivateEndpoint, Context context) { + return this.serviceClient.createWithResponse(managedVirtualNetworkName, managedPrivateEndpointName, + managedPrivateEndpoint, context); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed private endpoint. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint, - Context context) { - return this.serviceClient.createWithResponse( - managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint, context); + public ManagedPrivateEndpoint create(String managedVirtualNetworkName, String managedPrivateEndpointName, + ManagedPrivateEndpoint managedPrivateEndpoint) { + return this.serviceClient.create(managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String managedVirtualNetworkName, String managedPrivateEndpointName) { - this.serviceClient.delete(managedVirtualNetworkName, managedPrivateEndpointName); + public Response deleteWithResponse(String managedVirtualNetworkName, String managedPrivateEndpointName, + Context context) { + return this.serviceClient.deleteWithResponse(managedVirtualNetworkName, managedPrivateEndpointName, context); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ + @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String managedVirtualNetworkName, String managedPrivateEndpointName, Context context) { - return this.serviceClient.deleteWithResponse(managedVirtualNetworkName, managedPrivateEndpointName, context); + public void delete(String managedVirtualNetworkName, String managedPrivateEndpointName) { + this.serviceClient.delete(managedVirtualNetworkName, managedPrivateEndpointName); } /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String managedVirtualNetworkName) { return this.serviceClient.list(managedVirtualNetworkName); @@ -148,14 +155,15 @@ public PagedIterable list(String managedVirtualNetworkNa /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints as paginated response with {@link PagedIterable}. */ + @Generated @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String managedVirtualNetworkName, Context context) { return this.serviceClient.list(managedVirtualNetworkName, context); diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsClientBuilder.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsClientBuilder.java index 2ac74d9e5c718..7f5efe29cd317 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsClientBuilder.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/ManagedPrivateEndpointsClientBuilder.java @@ -5,136 +5,175 @@ package com.azure.analytics.synapse.managedprivateendpoints; import com.azure.analytics.synapse.managedprivateendpoints.implementation.ManagedPrivateEndpointsClientImpl; +import com.azure.core.annotation.Generated; import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.TokenCredentialTrait; import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.CookiePolicy; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; -/** A builder for creating a new instance of the ManagedPrivateEndpointsClient type. */ -@ServiceClientBuilder(serviceClients = {ManagedPrivateEndpointsClient.class, ManagedPrivateEndpointsAsyncClient.class}) -public final class ManagedPrivateEndpointsClientBuilder { +/** + * A builder for creating a new instance of the ManagedPrivateEndpointsClient type. + */ +@ServiceClientBuilder( + serviceClients = { ManagedPrivateEndpointsClient.class, ManagedPrivateEndpointsAsyncClient.class }) +public final class ManagedPrivateEndpointsClientBuilder implements HttpTrait, + ConfigurationTrait, + TokenCredentialTrait, EndpointTrait { + @Generated private static final String SDK_NAME = "name"; + @Generated private static final String SDK_VERSION = "version"; - static final String[] DEFAULT_SCOPES = new String[] {"https://dev.azuresynapse.net/.default"}; + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://dev.azuresynapse.net/.default" }; - private final Map properties = new HashMap<>(); + @Generated + private static final Map PROPERTIES = new HashMap<>(); + + @Generated + private final List pipelinePolicies; - /** Create an instance of the ManagedPrivateEndpointsClientBuilder. */ + /** + * Create an instance of the ManagedPrivateEndpointsClientBuilder. + */ + @Generated public ManagedPrivateEndpointsClientBuilder() { this.pipelinePolicies = new ArrayList<>(); } /* - * The workspace development endpoint, for example - * https://myworkspace.dev.azuresynapse.net. + * The HTTP pipeline to send requests through. */ - private String endpoint; + @Generated + private HttpPipeline pipeline; /** - * Sets The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net. - * - * @param endpoint the endpoint value. - * @return the ManagedPrivateEndpointsClientBuilder. + * {@inheritDoc}. */ - public ManagedPrivateEndpointsClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + @Generated + @Override + public ManagedPrivateEndpointsClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * Api Version + * The HTTP client used to send the request. */ - private String apiVersion; + @Generated + private HttpClient httpClient; /** - * Sets Api Version. - * - * @param apiVersion the apiVersion value. - * @return the ManagedPrivateEndpointsClientBuilder. + * {@inheritDoc}. */ - public ManagedPrivateEndpointsClientBuilder apiVersion(String apiVersion) { - this.apiVersion = apiVersion; + @Generated + @Override + public ManagedPrivateEndpointsClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; return this; } /* - * The HTTP pipeline to send requests through + * The logging configuration for HTTP requests and responses. */ - private HttpPipeline pipeline; + @Generated + private HttpLogOptions httpLogOptions; /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the ManagedPrivateEndpointsClientBuilder. + * {@inheritDoc}. */ - public ManagedPrivateEndpointsClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + @Generated + @Override + public ManagedPrivateEndpointsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; return this; } /* - * The serializer to serialize an object into a string + * The client options such as application ID and custom headers to set on a request. */ - private SerializerAdapter serializerAdapter; + @Generated + private ClientOptions clientOptions; /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the ManagedPrivateEndpointsClientBuilder. + * {@inheritDoc}. */ - public ManagedPrivateEndpointsClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; + @Generated + @Override + public ManagedPrivateEndpointsClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; return this; } /* - * The HTTP client used to send the request. + * The retry options to configure retry policy for failed requests. */ - private HttpClient httpClient; + @Generated + private RetryOptions retryOptions; /** - * Sets The HTTP client used to send the request. - * - * @param httpClient the httpClient value. - * @return the ManagedPrivateEndpointsClientBuilder. + * {@inheritDoc}. */ - public ManagedPrivateEndpointsClientBuilder httpClient(HttpClient httpClient) { - this.httpClient = httpClient; + @Generated + @Override + public ManagedPrivateEndpointsClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public ManagedPrivateEndpointsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); return this; } /* - * The configuration store that is used during construction of the service - * client. + * The configuration store that is used during construction of the service client. */ + @Generated private Configuration configuration; /** - * Sets The configuration store that is used during construction of the service client. - * - * @param configuration the configuration value. - * @return the ManagedPrivateEndpointsClientBuilder. + * {@inheritDoc}. */ + @Generated + @Override public ManagedPrivateEndpointsClientBuilder configuration(Configuration configuration) { this.configuration = configuration; return this; @@ -143,130 +182,167 @@ public ManagedPrivateEndpointsClientBuilder configuration(Configuration configur /* * The TokenCredential used for authentication. */ + @Generated private TokenCredential tokenCredential; /** - * Sets The TokenCredential used for authentication. - * - * @param tokenCredential the tokenCredential value. - * @return the ManagedPrivateEndpointsClientBuilder. + * {@inheritDoc}. */ + @Generated + @Override public ManagedPrivateEndpointsClientBuilder credential(TokenCredential tokenCredential) { this.tokenCredential = tokenCredential; return this; } /* - * The logging configuration for HTTP requests and responses. + * The service endpoint */ - private HttpLogOptions httpLogOptions; + @Generated + private String endpoint; /** - * Sets The logging configuration for HTTP requests and responses. - * - * @param httpLogOptions the httpLogOptions value. + * {@inheritDoc}. + */ + @Generated + @Override + public ManagedPrivateEndpointsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Api Version + */ + @Generated + private String apiVersion; + + /** + * Sets Api Version. + * + * @param apiVersion the apiVersion value. * @return the ManagedPrivateEndpointsClientBuilder. */ - public ManagedPrivateEndpointsClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = httpLogOptions; + @Generated + public ManagedPrivateEndpointsClientBuilder apiVersion(String apiVersion) { + this.apiVersion = apiVersion; return this; } /* - * The retry policy that will attempt to retry failed requests, if - * applicable. + * The serializer to serialize an object into a string */ - private RetryPolicy retryPolicy; + @Generated + private SerializerAdapter serializerAdapter; /** - * Sets The retry policy that will attempt to retry failed requests, if applicable. - * - * @param retryPolicy the retryPolicy value. + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. * @return the ManagedPrivateEndpointsClientBuilder. */ - public ManagedPrivateEndpointsClientBuilder retryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = retryPolicy; + @Generated + public ManagedPrivateEndpointsClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; return this; } /* - * The list of Http pipeline policies to add. + * The retry policy that will attempt to retry failed requests, if applicable. */ - private final List pipelinePolicies; + @Generated + private RetryPolicy retryPolicy; /** - * Adds a custom Http pipeline policy. - * - * @param customPolicy The custom Http pipeline policy to add. + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. * @return the ManagedPrivateEndpointsClientBuilder. */ - public ManagedPrivateEndpointsClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { - pipelinePolicies.add(customPolicy); + @Generated + public ManagedPrivateEndpointsClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; return this; } /** * Builds an instance of ManagedPrivateEndpointsClientImpl with the provided parameters. - * + * * @return an instance of ManagedPrivateEndpointsClientImpl. */ + @Generated private ManagedPrivateEndpointsClientImpl buildInnerClient() { - if (apiVersion == null) { - this.apiVersion = "2020-12-01"; - } - if (pipeline == null) { - this.pipeline = createHttpPipeline(); - } - if (serializerAdapter == null) { - this.serializerAdapter = JacksonAdapter.createDefaultSerializerAdapter(); - } - ManagedPrivateEndpointsClientImpl client = - new ManagedPrivateEndpointsClientImpl(pipeline, serializerAdapter, endpoint, apiVersion); + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localApiVersion = (apiVersion != null) ? apiVersion : "2020-12-01"; + SerializerAdapter localSerializerAdapter + = (serializerAdapter != null) ? serializerAdapter : JacksonAdapter.createDefaultSerializerAdapter(); + ManagedPrivateEndpointsClientImpl client = new ManagedPrivateEndpointsClientImpl(localPipeline, + localSerializerAdapter, this.endpoint, localApiVersion); return client; } + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @Generated private HttpPipeline createHttpPipeline() { - Configuration buildConfiguration = - (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; - if (httpLogOptions == null) { - httpLogOptions = new HttpLogOptions(); - } + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; List policies = new ArrayList<>(); - String clientName = properties.getOrDefault(SDK_NAME, "UnknownName"); - String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion"); - policies.add( - new UserAgentPolicy(httpLogOptions.getApplicationId(), clientName, clientVersion, buildConfiguration)); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy); - policies.add(new CookiePolicy()); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); if (tokenCredential != null) { policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); } - policies.addAll(this.pipelinePolicies); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .httpClient(httpClient) - .build(); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); return httpPipeline; } /** - * Builds an instance of ManagedPrivateEndpointsAsyncClient async client. - * + * Builds an instance of ManagedPrivateEndpointsAsyncClient class. + * * @return an instance of ManagedPrivateEndpointsAsyncClient. */ + @Generated public ManagedPrivateEndpointsAsyncClient buildAsyncClient() { return new ManagedPrivateEndpointsAsyncClient(buildInnerClient().getManagedPrivateEndpoints()); } /** - * Builds an instance of ManagedPrivateEndpointsClient sync client. - * + * Builds an instance of ManagedPrivateEndpointsClient class. + * * @return an instance of ManagedPrivateEndpointsClient. */ + @Generated public ManagedPrivateEndpointsClient buildClient() { return new ManagedPrivateEndpointsClient(buildInnerClient().getManagedPrivateEndpoints()); } diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/ManagedPrivateEndpointsClientImpl.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/ManagedPrivateEndpointsClientImpl.java index ce09b1eff43d5..a2613f9a22363 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/ManagedPrivateEndpointsClientImpl.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/ManagedPrivateEndpointsClientImpl.java @@ -6,68 +6,79 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -/** Initializes a new instance of the ManagedPrivateEndpointsClient type. */ +/** + * Initializes a new instance of the ManagedPrivateEndpointsClient type. + */ public final class ManagedPrivateEndpointsClientImpl { - /** The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net. */ + /** + * The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net. + */ private final String endpoint; /** * Gets The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ public SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The ManagedPrivateEndpointsImpl object to access its operations. */ + /** + * The ManagedPrivateEndpointsImpl object to access its operations. + */ private final ManagedPrivateEndpointsImpl managedPrivateEndpoints; /** * Gets the ManagedPrivateEndpointsImpl object to access its operations. - * + * * @return the ManagedPrivateEndpointsImpl object. */ public ManagedPrivateEndpointsImpl getManagedPrivateEndpoints() { @@ -76,23 +87,18 @@ public ManagedPrivateEndpointsImpl getManagedPrivateEndpoints() { /** * Initializes an instance of ManagedPrivateEndpointsClient client. - * + * * @param endpoint The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net. * @param apiVersion Api Version. */ public ManagedPrivateEndpointsClientImpl(String endpoint, String apiVersion) { - this( - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(), - JacksonAdapter.createDefaultSerializerAdapter(), - endpoint, - apiVersion); + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, apiVersion); } /** * Initializes an instance of ManagedPrivateEndpointsClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param endpoint The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net. * @param apiVersion Api Version. @@ -103,14 +109,14 @@ public ManagedPrivateEndpointsClientImpl(HttpPipeline httpPipeline, String endpo /** * Initializes an instance of ManagedPrivateEndpointsClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param endpoint The workspace development endpoint, for example https://myworkspace.dev.azuresynapse.net. * @param apiVersion Api Version. */ - public ManagedPrivateEndpointsClientImpl( - HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, String apiVersion) { + public ManagedPrivateEndpointsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + String endpoint, String apiVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/ManagedPrivateEndpointsImpl.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/ManagedPrivateEndpointsImpl.java index 619579a5bb858..e02d21882a2f6 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/ManagedPrivateEndpointsImpl.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/ManagedPrivateEndpointsImpl.java @@ -31,23 +31,28 @@ import com.azure.core.util.FluxUtil; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ManagedPrivateEndpoints. */ +/** + * An instance of this class provides access to all the operations defined in ManagedPrivateEndpoints. + */ public final class ManagedPrivateEndpointsImpl { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final ManagedPrivateEndpointsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ManagedPrivateEndpointsClientImpl client; /** * Initializes an instance of ManagedPrivateEndpointsImpl. - * + * * @param client the instance of the service client containing this operation class. */ ManagedPrivateEndpointsImpl(ManagedPrivateEndpointsClientImpl client) { - this.service = - RestProxy.create( - ManagedPrivateEndpointsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ManagedPrivateEndpointsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -59,220 +64,173 @@ public final class ManagedPrivateEndpointsImpl { @ServiceInterface(name = "ManagedPrivateEndpoi") public interface ManagedPrivateEndpointsService { @Get("/managedVirtualNetworks/{managedVirtualNetworkName}/managedPrivateEndpoints/{managedPrivateEndpointName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> get( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("managedVirtualNetworkName") String managedVirtualNetworkName, - @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managedVirtualNetworkName") String managedVirtualNetworkName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @HeaderParam("Accept") String accept, Context context); @Put("/managedVirtualNetworks/{managedVirtualNetworkName}/managedPrivateEndpoints/{managedPrivateEndpointName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> create( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("managedVirtualNetworkName") String managedVirtualNetworkName, - @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, - @BodyParam("application/json") ManagedPrivateEndpoint managedPrivateEndpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Delete( - "/managedVirtualNetworks/{managedVirtualNetworkName}/managedPrivateEndpoints/{managedPrivateEndpointName}") - @ExpectedResponses({202, 204}) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managedVirtualNetworkName") String managedVirtualNetworkName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, + @BodyParam("application/json") ManagedPrivateEndpoint managedPrivateEndpoint, + @HeaderParam("Accept") String accept, Context context); + + @Delete("/managedVirtualNetworks/{managedVirtualNetworkName}/managedPrivateEndpoints/{managedPrivateEndpointName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> delete( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("managedVirtualNetworkName") String managedVirtualNetworkName, - @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, - Context context); + Mono> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managedVirtualNetworkName") String managedVirtualNetworkName, + @PathParam("managedPrivateEndpointName") String managedPrivateEndpointName, Context context); @Get("/managedVirtualNetworks/{managedVirtualNetworkName}/managedPrivateEndpoints") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list( - @HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("managedVirtualNetworkName") String managedVirtualNetworkName, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, + @PathParam("managedVirtualNetworkName") String managedVirtualNetworkName, + @HeaderParam("Accept") String accept, Context context); @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed Private Endpoints. + * @return managed Private Endpoints along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String managedVirtualNetworkName, String managedPrivateEndpointName) { + public Mono> getWithResponseAsync(String managedVirtualNetworkName, + String managedPrivateEndpointName) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.get( - this.client.getEndpoint(), - this.client.getApiVersion(), - managedVirtualNetworkName, - managedPrivateEndpointName, - accept, - context)); + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + managedVirtualNetworkName, managedPrivateEndpointName, accept, context)); } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed Private Endpoints. + * @return managed Private Endpoints along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync( - String managedVirtualNetworkName, String managedPrivateEndpointName, Context context) { + public Mono> getWithResponseAsync(String managedVirtualNetworkName, + String managedPrivateEndpointName, Context context) { final String accept = "application/json"; - return service.get( - this.client.getEndpoint(), - this.client.getApiVersion(), - managedVirtualNetworkName, - managedPrivateEndpointName, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), managedVirtualNetworkName, + managedPrivateEndpointName, accept, context); } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed Private Endpoints. + * @return managed Private Endpoints on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getAsync(String managedVirtualNetworkName, String managedPrivateEndpointName) { return getWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed Private Endpoints. + * @return managed Private Endpoints on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync( - String managedVirtualNetworkName, String managedPrivateEndpointName, Context context) { + public Mono getAsync(String managedVirtualNetworkName, String managedPrivateEndpointName, + Context context) { return getWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed Private Endpoints. + * @return managed Private Endpoints along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedPrivateEndpoint get(String managedVirtualNetworkName, String managedPrivateEndpointName) { - return getAsync(managedVirtualNetworkName, managedPrivateEndpointName).block(); + public Response getWithResponse(String managedVirtualNetworkName, + String managedPrivateEndpointName, Context context) { + return getWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, context).block(); } /** * Get Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed Private Endpoints. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String managedVirtualNetworkName, String managedPrivateEndpointName, Context context) { - return getWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, context).block(); + public ManagedPrivateEndpoint get(String managedVirtualNetworkName, String managedPrivateEndpointName) { + return getWithResponse(managedVirtualNetworkName, managedPrivateEndpointName, Context.NONE).getValue(); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed private endpoint. + * @return managed private endpoint along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint) { + public Mono> createWithResponseAsync(String managedVirtualNetworkName, + String managedPrivateEndpointName, ManagedPrivateEndpoint managedPrivateEndpoint) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.create( - this.client.getEndpoint(), - this.client.getApiVersion(), - managedVirtualNetworkName, - managedPrivateEndpointName, - managedPrivateEndpoint, - accept, - context)); + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint, accept, context)); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. @@ -280,55 +238,37 @@ public Mono> createWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed private endpoint. + * @return managed private endpoint along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createWithResponseAsync( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint, - Context context) { + public Mono> createWithResponseAsync(String managedVirtualNetworkName, + String managedPrivateEndpointName, ManagedPrivateEndpoint managedPrivateEndpoint, Context context) { final String accept = "application/json"; - return service.create( - this.client.getEndpoint(), - this.client.getApiVersion(), - managedVirtualNetworkName, - managedPrivateEndpointName, - managedPrivateEndpoint, - accept, - context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), managedVirtualNetworkName, + managedPrivateEndpointName, managedPrivateEndpoint, accept, context); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed private endpoint. + * @return managed private endpoint on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint) { + public Mono createAsync(String managedVirtualNetworkName, String managedPrivateEndpointName, + ManagedPrivateEndpoint managedPrivateEndpoint) { return createWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. @@ -336,280 +276,261 @@ public Mono createAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed private endpoint. + * @return managed private endpoint on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createAsync( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint, - Context context) { - return createWithResponseAsync( - managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint, context) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + public Mono createAsync(String managedVirtualNetworkName, String managedPrivateEndpointName, + ManagedPrivateEndpoint managedPrivateEndpoint, Context context) { + return createWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint, + context).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return managed private endpoint. + * @return managed private endpoint along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagedPrivateEndpoint create( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint) { - return createAsync(managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint).block(); + public Response createWithResponse(String managedVirtualNetworkName, + String managedPrivateEndpointName, ManagedPrivateEndpoint managedPrivateEndpoint, Context context) { + return createWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint, + context).block(); } /** * Create Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param managedPrivateEndpoint Managed private endpoint properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed private endpoint. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String managedVirtualNetworkName, - String managedPrivateEndpointName, - ManagedPrivateEndpoint managedPrivateEndpoint, - Context context) { - return createWithResponseAsync( - managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint, context) - .block(); + public ManagedPrivateEndpoint create(String managedVirtualNetworkName, String managedPrivateEndpointName, + ManagedPrivateEndpoint managedPrivateEndpoint) { + return createWithResponse(managedVirtualNetworkName, managedPrivateEndpointName, managedPrivateEndpoint, + Context.NONE).getValue(); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String managedVirtualNetworkName, String managedPrivateEndpointName) { - return FluxUtil.withContext( - context -> - service.delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - managedVirtualNetworkName, - managedPrivateEndpointName, - context)); + public Mono> deleteWithResponseAsync(String managedVirtualNetworkName, + String managedPrivateEndpointName) { + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + managedVirtualNetworkName, managedPrivateEndpointName, context)); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteWithResponseAsync( - String managedVirtualNetworkName, String managedPrivateEndpointName, Context context) { - return service.delete( - this.client.getEndpoint(), - this.client.getApiVersion(), - managedVirtualNetworkName, - managedPrivateEndpointName, - context); + public Mono> deleteWithResponseAsync(String managedVirtualNetworkName, + String managedPrivateEndpointName, Context context) { + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), managedVirtualNetworkName, + managedPrivateEndpointName, context); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deleteAsync(String managedVirtualNetworkName, String managedPrivateEndpointName) { return deleteWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync( - String managedVirtualNetworkName, String managedPrivateEndpointName, Context context) { + public Mono deleteAsync(String managedVirtualNetworkName, String managedPrivateEndpointName, + Context context) { return deleteWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, context) - .flatMap((Response res) -> Mono.empty()); + .flatMap(ignored -> Mono.empty()); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String managedVirtualNetworkName, String managedPrivateEndpointName) { - deleteAsync(managedVirtualNetworkName, managedPrivateEndpointName).block(); + public Response deleteWithResponse(String managedVirtualNetworkName, String managedPrivateEndpointName, + Context context) { + return deleteWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, context).block(); } /** * Delete Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param managedPrivateEndpointName Managed private endpoint name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String managedVirtualNetworkName, String managedPrivateEndpointName, Context context) { - return deleteWithResponseAsync(managedVirtualNetworkName, managedPrivateEndpointName, context).block(); + public void delete(String managedVirtualNetworkName, String managedPrivateEndpointName) { + deleteWithResponse(managedVirtualNetworkName, managedPrivateEndpointName, Context.NONE); } /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listSinglePageAsync(String managedVirtualNetworkName) { final String accept = "application/json"; - return FluxUtil.withContext( - context -> - service.list( - this.client.getEndpoint(), - this.client.getApiVersion(), - managedVirtualNetworkName, - accept, - context)) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().getValue(), - res.getValue().getNextLink(), - null)); + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + managedVirtualNetworkName, accept, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), res.getValue().getNextLink(), null)); } /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listSinglePageAsync( - String managedVirtualNetworkName, Context context) { + public Mono> listSinglePageAsync(String managedVirtualNetworkName, + Context context) { final String accept = "application/json"; - return service.list( - this.client.getEndpoint(), - this.client.getApiVersion(), - managedVirtualNetworkName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().getValue(), - res.getValue().getNextLink(), - null)); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), managedVirtualNetworkName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), res.getValue().getNextLink(), null)); } /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String managedVirtualNetworkName) { - return new PagedFlux<>( - () -> listSinglePageAsync(managedVirtualNetworkName), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(managedVirtualNetworkName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String managedVirtualNetworkName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(managedVirtualNetworkName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(managedVirtualNetworkName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Managed Private Endpoints. + * + * @param managedVirtualNetworkName Managed virtual network name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed private endpoints along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse listSinglePage(String managedVirtualNetworkName) { + return listSinglePageAsync(managedVirtualNetworkName).block(); } /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse listSinglePage(String managedVirtualNetworkName, Context context) { + return listSinglePageAsync(managedVirtualNetworkName, context).block(); + } + + /** + * List Managed Private Endpoints. + * + * @param managedVirtualNetworkName Managed virtual network name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed private endpoints as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String managedVirtualNetworkName) { @@ -618,13 +539,13 @@ public PagedIterable list(String managedVirtualNetworkNa /** * List Managed Private Endpoints. - * + * * @param managedVirtualNetworkName Managed virtual network name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String managedVirtualNetworkName, Context context) { @@ -633,50 +554,67 @@ public PagedIterable list(String managedVirtualNetworkNa /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listNextSinglePageAsync(String nextLink) { final String accept = "application/json"; return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().getValue(), - res.getValue().getNextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), res.getValue().getNextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param nextLink The URL to get the next list of items. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of managed private endpoints. + * @return a list of managed private endpoints along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono> listNextSinglePageAsync(String nextLink, Context context) { final String accept = "application/json"; return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().getValue(), - res.getValue().getNextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().getValue(), res.getValue().getNextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed private endpoints along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse listNextSinglePage(String nextLink) { + return listNextSinglePageAsync(nextLink).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list of managed private endpoints along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse listNextSinglePage(String nextLink, Context context) { + return listNextSinglePageAsync(nextLink, context).block(); } } diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/package-info.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/package-info.java index 0b9244f683944..8007cd099f5a1 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/package-info.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/implementation/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the implementations for ManagedPrivateEndpointsClient. null. */ +/** + * Package containing the implementations for ManagedPrivateEndpointsClient. + * null. + */ package com.azure.analytics.synapse.managedprivateendpoints.implementation; diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpoint.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpoint.java index 2f634ec578f6d..826a11495384f 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpoint.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpoint.java @@ -5,41 +5,49 @@ package com.azure.analytics.synapse.managedprivateendpoints.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** Managed private endpoint. */ +/** + * Managed private endpoint. + */ @Fluent -public final class ManagedPrivateEndpoint { +public final class ManagedPrivateEndpoint implements JsonSerializable { /* * Fully qualified resource Id for the resource. Ex - - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{ + * resourceType}/{resourceName} */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; /* * The name of the resource */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * The type of the resource. Ex- Microsoft.Compute/virtualMachines or - * Microsoft.Storage/storageAccounts. + * The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) private String type; /* * Managed private endpoint properties */ - @JsonProperty(value = "properties") private ManagedPrivateEndpointProperties properties; + /** + * Creates an instance of ManagedPrivateEndpoint class. + */ + public ManagedPrivateEndpoint() { + } + /** * Get the id property: Fully qualified resource Id for the resource. Ex - * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - * + * * @return the id value. */ public String getId() { @@ -48,7 +56,7 @@ public String getId() { /** * Get the name property: The name of the resource. - * + * * @return the name value. */ public String getName() { @@ -58,7 +66,7 @@ public String getName() { /** * Get the type property: The type of the resource. Ex- Microsoft.Compute/virtualMachines or * Microsoft.Storage/storageAccounts. - * + * * @return the type value. */ public String getType() { @@ -67,7 +75,7 @@ public String getType() { /** * Get the properties property: Managed private endpoint properties. - * + * * @return the properties value. */ public ManagedPrivateEndpointProperties getProperties() { @@ -76,7 +84,7 @@ public ManagedPrivateEndpointProperties getProperties() { /** * Set the properties property: Managed private endpoint properties. - * + * * @param properties the properties value to set. * @return the ManagedPrivateEndpoint object itself. */ @@ -84,4 +92,46 @@ public ManagedPrivateEndpoint setProperties(ManagedPrivateEndpointProperties pro this.properties = properties; return this; } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedPrivateEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedPrivateEndpoint if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedPrivateEndpoint. + */ + public static ManagedPrivateEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedPrivateEndpoint deserializedManagedPrivateEndpoint = new ManagedPrivateEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedManagedPrivateEndpoint.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedManagedPrivateEndpoint.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedManagedPrivateEndpoint.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedManagedPrivateEndpoint.properties = ManagedPrivateEndpointProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedPrivateEndpoint; + }); + } } diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointConnectionState.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointConnectionState.java index 6750f17ac11bb..7c84a75b2a7d8 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointConnectionState.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointConnectionState.java @@ -5,32 +5,42 @@ package com.azure.analytics.synapse.managedprivateendpoints.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; -/** The connection state of a managed private endpoint. */ +/** + * The connection state of a managed private endpoint. + */ @Fluent -public final class ManagedPrivateEndpointConnectionState { +public final class ManagedPrivateEndpointConnectionState + implements JsonSerializable { /* * The approval status */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) private String status; /* * The managed private endpoint description */ - @JsonProperty(value = "description") private String description; /* * The actions required on the managed private endpoint */ - @JsonProperty(value = "actionsRequired") private String actionsRequired; + /** + * Creates an instance of ManagedPrivateEndpointConnectionState class. + */ + public ManagedPrivateEndpointConnectionState() { + } + /** * Get the status property: The approval status. - * + * * @return the status value. */ public String getStatus() { @@ -39,7 +49,7 @@ public String getStatus() { /** * Get the description property: The managed private endpoint description. - * + * * @return the description value. */ public String getDescription() { @@ -48,7 +58,7 @@ public String getDescription() { /** * Set the description property: The managed private endpoint description. - * + * * @param description the description value to set. * @return the ManagedPrivateEndpointConnectionState object itself. */ @@ -59,7 +69,7 @@ public ManagedPrivateEndpointConnectionState setDescription(String description) /** * Get the actionsRequired property: The actions required on the managed private endpoint. - * + * * @return the actionsRequired value. */ public String getActionsRequired() { @@ -68,7 +78,7 @@ public String getActionsRequired() { /** * Set the actionsRequired property: The actions required on the managed private endpoint. - * + * * @param actionsRequired the actionsRequired value to set. * @return the ManagedPrivateEndpointConnectionState object itself. */ @@ -76,4 +86,46 @@ public ManagedPrivateEndpointConnectionState setActionsRequired(String actionsRe this.actionsRequired = actionsRequired; return this; } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("actionsRequired", this.actionsRequired); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedPrivateEndpointConnectionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedPrivateEndpointConnectionState if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedPrivateEndpointConnectionState. + */ + public static ManagedPrivateEndpointConnectionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedPrivateEndpointConnectionState deserializedManagedPrivateEndpointConnectionState + = new ManagedPrivateEndpointConnectionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedManagedPrivateEndpointConnectionState.status = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedManagedPrivateEndpointConnectionState.description = reader.getString(); + } else if ("actionsRequired".equals(fieldName)) { + deserializedManagedPrivateEndpointConnectionState.actionsRequired = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedPrivateEndpointConnectionState; + }); + } } diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointListResponse.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointListResponse.java index 56ebc6c69af75..43076e57e3c19 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointListResponse.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointListResponse.java @@ -5,27 +5,37 @@ package com.azure.analytics.synapse.managedprivateendpoints.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** A list of managed private endpoints. */ +/** + * A list of managed private endpoints. + */ @Fluent -public final class ManagedPrivateEndpointListResponse { +public final class ManagedPrivateEndpointListResponse implements JsonSerializable { /* * List of managed private endpoints */ - @JsonProperty(value = "value") private List value; /* * The link to the next page of results, if any remaining results exist. */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** + * Creates an instance of ManagedPrivateEndpointListResponse class. + */ + public ManagedPrivateEndpointListResponse() { + } + /** * Get the value property: List of managed private endpoints. - * + * * @return the value value. */ public List getValue() { @@ -34,7 +44,7 @@ public List getValue() { /** * Set the value property: List of managed private endpoints. - * + * * @param value the value value to set. * @return the ManagedPrivateEndpointListResponse object itself. */ @@ -45,10 +55,51 @@ public ManagedPrivateEndpointListResponse setValue(List /** * Get the nextLink property: The link to the next page of results, if any remaining results exist. - * + * * @return the nextLink value. */ public String getNextLink() { return this.nextLink; } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedPrivateEndpointListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedPrivateEndpointListResponse if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedPrivateEndpointListResponse. + */ + public static ManagedPrivateEndpointListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedPrivateEndpointListResponse deserializedManagedPrivateEndpointListResponse + = new ManagedPrivateEndpointListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ManagedPrivateEndpoint.fromJson(reader1)); + deserializedManagedPrivateEndpointListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedManagedPrivateEndpointListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedPrivateEndpointListResponse; + }); + } } diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointProperties.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointProperties.java index d7683427c6913..46f9cc09f12ea 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointProperties.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/ManagedPrivateEndpointProperties.java @@ -5,64 +5,67 @@ package com.azure.analytics.synapse.managedprivateendpoints.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.List; -/** Properties of a managed private endpoint. */ +/** + * Properties of a managed private endpoint. + */ @Fluent -public final class ManagedPrivateEndpointProperties { +public final class ManagedPrivateEndpointProperties implements JsonSerializable { /* * The name of managed private endpoint */ - @JsonProperty(value = "name") private String name; /* - * The ARM resource ID of the resource to which the managed private - * endpoint is created + * The ARM resource ID of the resource to which the managed private endpoint is created */ - @JsonProperty(value = "privateLinkResourceId") private String privateLinkResourceId; /* * The groupId to which the managed private endpoint is created */ - @JsonProperty(value = "groupId") private String groupId; /* * The managed private endpoint provisioning state */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private String provisioningState; /* * The managed private endpoint connection state */ - @JsonProperty(value = "connectionState") private ManagedPrivateEndpointConnectionState connectionState; /* * Denotes whether the managed private endpoint is reserved */ - @JsonProperty(value = "isReserved", access = JsonProperty.Access.WRITE_ONLY) private Boolean isReserved; /* * List of fully qualified domain names */ - @JsonProperty(value = "fqdns") private List fqdns; /* * Denotes whether the managed private endpoint is compliant */ - @JsonProperty(value = "isCompliant") private Boolean isCompliant; + /** + * Creates an instance of ManagedPrivateEndpointProperties class. + */ + public ManagedPrivateEndpointProperties() { + } + /** * Get the name property: The name of managed private endpoint. - * + * * @return the name value. */ public String getName() { @@ -71,7 +74,7 @@ public String getName() { /** * Set the name property: The name of managed private endpoint. - * + * * @param name the name value to set. * @return the ManagedPrivateEndpointProperties object itself. */ @@ -83,7 +86,7 @@ public ManagedPrivateEndpointProperties setName(String name) { /** * Get the privateLinkResourceId property: The ARM resource ID of the resource to which the managed private endpoint * is created. - * + * * @return the privateLinkResourceId value. */ public String getPrivateLinkResourceId() { @@ -93,7 +96,7 @@ public String getPrivateLinkResourceId() { /** * Set the privateLinkResourceId property: The ARM resource ID of the resource to which the managed private endpoint * is created. - * + * * @param privateLinkResourceId the privateLinkResourceId value to set. * @return the ManagedPrivateEndpointProperties object itself. */ @@ -104,7 +107,7 @@ public ManagedPrivateEndpointProperties setPrivateLinkResourceId(String privateL /** * Get the groupId property: The groupId to which the managed private endpoint is created. - * + * * @return the groupId value. */ public String getGroupId() { @@ -113,7 +116,7 @@ public String getGroupId() { /** * Set the groupId property: The groupId to which the managed private endpoint is created. - * + * * @param groupId the groupId value to set. * @return the ManagedPrivateEndpointProperties object itself. */ @@ -124,7 +127,7 @@ public ManagedPrivateEndpointProperties setGroupId(String groupId) { /** * Get the provisioningState property: The managed private endpoint provisioning state. - * + * * @return the provisioningState value. */ public String getProvisioningState() { @@ -133,7 +136,7 @@ public String getProvisioningState() { /** * Get the connectionState property: The managed private endpoint connection state. - * + * * @return the connectionState value. */ public ManagedPrivateEndpointConnectionState getConnectionState() { @@ -142,7 +145,7 @@ public ManagedPrivateEndpointConnectionState getConnectionState() { /** * Set the connectionState property: The managed private endpoint connection state. - * + * * @param connectionState the connectionState value to set. * @return the ManagedPrivateEndpointProperties object itself. */ @@ -153,7 +156,7 @@ public ManagedPrivateEndpointProperties setConnectionState(ManagedPrivateEndpoin /** * Get the isReserved property: Denotes whether the managed private endpoint is reserved. - * + * * @return the isReserved value. */ public Boolean isReserved() { @@ -162,7 +165,7 @@ public Boolean isReserved() { /** * Get the fqdns property: List of fully qualified domain names. - * + * * @return the fqdns value. */ public List getFqdns() { @@ -171,7 +174,7 @@ public List getFqdns() { /** * Set the fqdns property: List of fully qualified domain names. - * + * * @param fqdns the fqdns value to set. * @return the ManagedPrivateEndpointProperties object itself. */ @@ -182,7 +185,7 @@ public ManagedPrivateEndpointProperties setFqdns(List fqdns) { /** * Get the isCompliant property: Denotes whether the managed private endpoint is compliant. - * + * * @return the isCompliant value. */ public Boolean isCompliant() { @@ -191,7 +194,7 @@ public Boolean isCompliant() { /** * Set the isCompliant property: Denotes whether the managed private endpoint is compliant. - * + * * @param isCompliant the isCompliant value to set. * @return the ManagedPrivateEndpointProperties object itself. */ @@ -199,4 +202,64 @@ public ManagedPrivateEndpointProperties setIsCompliant(Boolean isCompliant) { this.isCompliant = isCompliant; return this; } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("privateLinkResourceId", this.privateLinkResourceId); + jsonWriter.writeStringField("groupId", this.groupId); + jsonWriter.writeJsonField("connectionState", this.connectionState); + jsonWriter.writeArrayField("fqdns", this.fqdns, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("isCompliant", this.isCompliant); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ManagedPrivateEndpointProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ManagedPrivateEndpointProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ManagedPrivateEndpointProperties. + */ + public static ManagedPrivateEndpointProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ManagedPrivateEndpointProperties deserializedManagedPrivateEndpointProperties + = new ManagedPrivateEndpointProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedManagedPrivateEndpointProperties.name = reader.getString(); + } else if ("privateLinkResourceId".equals(fieldName)) { + deserializedManagedPrivateEndpointProperties.privateLinkResourceId = reader.getString(); + } else if ("groupId".equals(fieldName)) { + deserializedManagedPrivateEndpointProperties.groupId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedManagedPrivateEndpointProperties.provisioningState = reader.getString(); + } else if ("connectionState".equals(fieldName)) { + deserializedManagedPrivateEndpointProperties.connectionState + = ManagedPrivateEndpointConnectionState.fromJson(reader); + } else if ("isReserved".equals(fieldName)) { + deserializedManagedPrivateEndpointProperties.isReserved + = reader.getNullable(JsonReader::getBoolean); + } else if ("fqdns".equals(fieldName)) { + List fqdns = reader.readArray(reader1 -> reader1.getString()); + deserializedManagedPrivateEndpointProperties.fqdns = fqdns; + } else if ("isCompliant".equals(fieldName)) { + deserializedManagedPrivateEndpointProperties.isCompliant + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedManagedPrivateEndpointProperties; + }); + } } diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/package-info.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/package-info.java index 49d8e777025a7..6af8bb2e8767f 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/package-info.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for ManagedPrivateEndpointsClient. null. */ +/** + * Package containing the data models for ManagedPrivateEndpointsClient. + * null. + */ package com.azure.analytics.synapse.managedprivateendpoints.models; diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/package-info.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/package-info.java index 28a79fe162536..3649aaa498817 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/package-info.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/com/azure/analytics/synapse/managedprivateendpoints/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for ManagedPrivateEndpointsClient. null. */ +/** + * Package containing the classes for ManagedPrivateEndpointsClient. + * null. + */ package com.azure.analytics.synapse.managedprivateendpoints; diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/module-info.java b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/module-info.java index e60a6e4eac006..2e7b933083597 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/module-info.java +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/src/main/java/module-info.java @@ -7,6 +7,6 @@ exports com.azure.analytics.synapse.managedprivateendpoints; exports com.azure.analytics.synapse.managedprivateendpoints.models; - opens com.azure.analytics.synapse.managedprivateendpoints.models to com.fasterxml.jackson.databind; - + opens com.azure.analytics.synapse.managedprivateendpoints.implementation to com.azure.core; + opens com.azure.analytics.synapse.managedprivateendpoints.models to com.azure.core; } diff --git a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/swagger/README.md b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/swagger/README.md index acc0a57177a86..303628dc3a47f 100644 --- a/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/swagger/README.md +++ b/sdk/synapse/azure-analytics-synapse-managedprivateendpoints/swagger/README.md @@ -2,32 +2,37 @@ > see https://aka.ms/autorest +This is the AutoRest configuration file for Synapse Analytics Managed Private Endpoints. +--- +## Getting Started + +To build the SDK for Synapse Analytics Managed Private Endpoints, simply [Install AutoRest](https://aka.ms/autorest) and +in this folder, run: + +> `autorest` +To see additional help and options, run: + +> `autorest --help` ### Setup ```ps -Fork and clone https://github.com/Azure/autorest.java -git checkout main -git submodule update --init --recursive -mvn package -Dlocal -npm install npm install -g autorest ``` ### Generation + ```ps cd -autorest --java --use=C:/work/autorest.java +autorest ``` ### Code generation settings -```yaml -branch: 3d6211cf28f83236cdf78e7cfc50efd3fb7cba72 -repo: https://github.com/Azure/azure-rest-api-specs/blob/$(branch) -``` + +## Java ```yaml -input-file: - - $(repo)/specification/synapse/data-plane/Microsoft.Synapse/stable/2020-12-01/managedPrivateEndpoints.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/3d6211cf28f83236cdf78e7cfc50efd3fb7cba72/specification/synapse/data-plane/Microsoft.Synapse/stable/2020-12-01/managedPrivateEndpoints.json java: true +use: '@autorest/java@4.1.34' output-folder: ..\ generate-client-as-impl: true generate-sync-async-clients: true diff --git a/sdk/synapse/azure-analytics-synapse-monitoring/CHANGELOG.md b/sdk/synapse/azure-analytics-synapse-monitoring/CHANGELOG.md index b6d2e132c1a12..47174c9bdcc94 100644 --- a/sdk/synapse/azure-analytics-synapse-monitoring/CHANGELOG.md +++ b/sdk/synapse/azure-analytics-synapse-monitoring/CHANGELOG.md @@ -1,15 +1,23 @@ # Release History ## 1.0.0-beta.4 (2021-08-10) + +### Features Added + - Update to 2020-12-01 API version ## 1.0.0-beta.3 (2021-04-06) -### Dependency Updates +### Other Changes + +#### Dependency Updates + - Update azure-core to 1.15.0 ## 1.0.0-beta.2 (2021-02-09) +### Bugs Fixed + - Support specifying the service API version. (AutoRest update) - Send missing "Accept" request headers @@ -20,7 +28,7 @@ the Java ecosystem, and as consistent across different languages and platforms a our efforts can be found in the [Azure SDK Design Guidelines for Java](https://azure.github.io/azure-sdk/java_introduction.html). -### New Features +### Features Added - It uses Azure Synapse 2019-11-01-preview API - One client design: