
com.azure.resourcemanager.eventgrid.implementation.PartnerTopicsClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-eventgrid Show documentation
Show all versions of azure-resourcemanager-eventgrid Show documentation
This package contains Microsoft Azure SDK for EventGrid Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure EventGrid Management Client. Package tag package-2021-10-preview.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.eventgrid.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.eventgrid.fluent.PartnerTopicsClient;
import com.azure.resourcemanager.eventgrid.fluent.models.PartnerTopicInner;
import com.azure.resourcemanager.eventgrid.models.PartnerTopicsListResult;
import com.azure.resourcemanager.eventgrid.models.PartnerTopicUpdateParameters;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* An instance of this class provides access to all the operations defined in PartnerTopicsClient.
*/
public final class PartnerTopicsClientImpl implements PartnerTopicsClient {
/**
* The proxy service used to perform REST calls.
*/
private final PartnerTopicsService service;
/**
* The service client containing this operation class.
*/
private final EventGridManagementClientImpl client;
/**
* Initializes an instance of PartnerTopicsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
PartnerTopicsClientImpl(EventGridManagementClientImpl client) {
this.service
= RestProxy.create(PartnerTopicsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for EventGridManagementClientPartnerTopics to be used by the proxy
* service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "EventGridManagementC")
public interface PartnerTopicsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("partnerTopicName") String partnerTopicName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("partnerTopicName") String partnerTopicName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") PartnerTopicInner partnerTopicInfo, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("partnerTopicName") String partnerTopicName, @QueryParam("api-version") String apiVersion,
Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> update(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("partnerTopicName") String partnerTopicName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") PartnerTopicUpdateParameters partnerTopicUpdateParameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerTopics")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/activate")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> activate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("partnerTopicName") String partnerTopicName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/deactivate")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> deactivate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("partnerTopicName") String partnerTopicName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listBySubscriptionNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroupNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
}
/**
* Get a partner topic.
*
* Get properties of a partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return properties of a partner topic along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String partnerTopicName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, partnerTopicName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a partner topic.
*
* Get properties of a partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return properties of a partner topic along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String partnerTopicName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
partnerTopicName, this.client.getApiVersion(), accept, context);
}
/**
* Get a partner topic.
*
* Get properties of a partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return properties of a partner topic on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getByResourceGroupAsync(String resourceGroupName, String partnerTopicName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, partnerTopicName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a partner topic.
*
* Get properties of a partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return properties of a partner topic along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(String resourceGroupName, String partnerTopicName,
Context context) {
return getByResourceGroupWithResponseAsync(resourceGroupName, partnerTopicName, context).block();
}
/**
* Get a partner topic.
*
* Get properties of a partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return properties of a partner topic.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PartnerTopicInner getByResourceGroup(String resourceGroupName, String partnerTopicName) {
return getByResourceGroupWithResponse(resourceGroupName, partnerTopicName, Context.NONE).getValue();
}
/**
* Create a partner topic.
*
* Asynchronously creates a new partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicInfo Partner Topic information.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createOrUpdateWithResponseAsync(String resourceGroupName,
String partnerTopicName, PartnerTopicInner partnerTopicInfo) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
if (partnerTopicInfo == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicInfo is required and cannot be null."));
} else {
partnerTopicInfo.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, partnerTopicName, this.client.getApiVersion(), partnerTopicInfo, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create a partner topic.
*
* Asynchronously creates a new partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicInfo Partner Topic information.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createOrUpdateWithResponseAsync(String resourceGroupName,
String partnerTopicName, PartnerTopicInner partnerTopicInfo, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
if (partnerTopicInfo == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicInfo is required and cannot be null."));
} else {
partnerTopicInfo.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
partnerTopicName, this.client.getApiVersion(), partnerTopicInfo, accept, context);
}
/**
* Create a partner topic.
*
* Asynchronously creates a new partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicInfo Partner Topic information.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String partnerTopicName,
PartnerTopicInner partnerTopicInfo) {
return createOrUpdateWithResponseAsync(resourceGroupName, partnerTopicName, partnerTopicInfo)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Create a partner topic.
*
* Asynchronously creates a new partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicInfo Partner Topic information.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createOrUpdateWithResponse(String resourceGroupName, String partnerTopicName,
PartnerTopicInner partnerTopicInfo, Context context) {
return createOrUpdateWithResponseAsync(resourceGroupName, partnerTopicName, partnerTopicInfo, context).block();
}
/**
* Create a partner topic.
*
* Asynchronously creates a new partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicInfo Partner Topic information.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PartnerTopicInner createOrUpdate(String resourceGroupName, String partnerTopicName,
PartnerTopicInner partnerTopicInfo) {
return createOrUpdateWithResponse(resourceGroupName, partnerTopicName, partnerTopicInfo, Context.NONE)
.getValue();
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName,
String partnerTopicName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, partnerTopicName, this.client.getApiVersion(), context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName, String partnerTopicName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
partnerTopicName, this.client.getApiVersion(), context);
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String partnerTopicName) {
Mono>> mono = deleteWithResponseAsync(resourceGroupName, partnerTopicName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String partnerTopicName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono = deleteWithResponseAsync(resourceGroupName, partnerTopicName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String partnerTopicName) {
return this.beginDeleteAsync(resourceGroupName, partnerTopicName).getSyncPoller();
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String partnerTopicName,
Context context) {
return this.beginDeleteAsync(resourceGroupName, partnerTopicName, context).getSyncPoller();
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String partnerTopicName) {
return beginDeleteAsync(resourceGroupName, partnerTopicName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String partnerTopicName, Context context) {
return beginDeleteAsync(resourceGroupName, partnerTopicName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String partnerTopicName) {
deleteAsync(resourceGroupName, partnerTopicName).block();
}
/**
* Delete a partner topic.
*
* Delete existing partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String partnerTopicName, Context context) {
deleteAsync(resourceGroupName, partnerTopicName, context).block();
}
/**
* Update a partner topic.
*
* Asynchronously updates a partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicUpdateParameters PartnerTopic update information.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateWithResponseAsync(String resourceGroupName, String partnerTopicName,
PartnerTopicUpdateParameters partnerTopicUpdateParameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
if (partnerTopicUpdateParameters == null) {
return Mono.error(
new IllegalArgumentException("Parameter partnerTopicUpdateParameters is required and cannot be null."));
} else {
partnerTopicUpdateParameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
partnerTopicName, this.client.getApiVersion(), partnerTopicUpdateParameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update a partner topic.
*
* Asynchronously updates a partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicUpdateParameters PartnerTopic update information.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response body along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateWithResponseAsync(String resourceGroupName, String partnerTopicName,
PartnerTopicUpdateParameters partnerTopicUpdateParameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
if (partnerTopicUpdateParameters == null) {
return Mono.error(
new IllegalArgumentException("Parameter partnerTopicUpdateParameters is required and cannot be null."));
} else {
partnerTopicUpdateParameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
partnerTopicName, this.client.getApiVersion(), partnerTopicUpdateParameters, accept, context);
}
/**
* Update a partner topic.
*
* Asynchronously updates a partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicUpdateParameters PartnerTopic update information.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response body on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String partnerTopicName,
PartnerTopicUpdateParameters partnerTopicUpdateParameters) {
return updateWithResponseAsync(resourceGroupName, partnerTopicName, partnerTopicUpdateParameters)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Update a partner topic.
*
* Asynchronously updates a partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicUpdateParameters PartnerTopic update information.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response body along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response updateWithResponse(String resourceGroupName, String partnerTopicName,
PartnerTopicUpdateParameters partnerTopicUpdateParameters, Context context) {
return updateWithResponseAsync(resourceGroupName, partnerTopicName, partnerTopicUpdateParameters, context)
.block();
}
/**
* Update a partner topic.
*
* Asynchronously updates a partner topic with the specified parameters.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param partnerTopicUpdateParameters PartnerTopic update information.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PartnerTopicInner update(String resourceGroupName, String partnerTopicName,
PartnerTopicUpdateParameters partnerTopicUpdateParameters) {
return updateWithResponse(resourceGroupName, partnerTopicName, partnerTopicUpdateParameters, Context.NONE)
.getValue();
}
/**
* List partner topics under an Azure subscription.
*
* List all the partner topics under an Azure subscription.
*
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String filter, Integer top) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(),
this.client.getApiVersion(), filter, top, accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List partner topics under an Azure subscription.
*
* List all the partner topics under an Azure subscription.
*
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String filter, Integer top, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), filter, top,
accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List partner topics under an Azure subscription.
*
* List all the partner topics under an Azure subscription.
*
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String filter, Integer top) {
return new PagedFlux<>(() -> listSinglePageAsync(filter, top),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
}
/**
* List partner topics under an Azure subscription.
*
* List all the partner topics under an Azure subscription.
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync() {
final String filter = null;
final Integer top = null;
return new PagedFlux<>(() -> listSinglePageAsync(filter, top),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
}
/**
* List partner topics under an Azure subscription.
*
* List all the partner topics under an Azure subscription.
*
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String filter, Integer top, Context context) {
return new PagedFlux<>(() -> listSinglePageAsync(filter, top, context),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
}
/**
* List partner topics under an Azure subscription.
*
* List all the partner topics under an Azure subscription.
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
final String filter = null;
final Integer top = null;
return new PagedIterable<>(listAsync(filter, top));
}
/**
* List partner topics under an Azure subscription.
*
* List all the partner topics under an Azure subscription.
*
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String filter, Integer top, Context context) {
return new PagedIterable<>(listAsync(filter, top, context));
}
/**
* List partner topics under a resource group.
*
* List all the partner topics under a resource group.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
String filter, Integer top) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, this.client.getApiVersion(), filter, top, accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List partner topics under a resource group.
*
* List all the partner topics under a resource group.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
String filter, Integer top, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
this.client.getApiVersion(), filter, top, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* List partner topics under a resource group.
*
* List all the partner topics under a resource group.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter,
Integer top) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* List partner topics under a resource group.
*
* List all the partner topics under a resource group.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
final String filter = null;
final Integer top = null;
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* List partner topics under a resource group.
*
* List all the partner topics under a resource group.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter, Integer top,
Context context) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, top, context),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
}
/**
* List partner topics under a resource group.
*
* List all the partner topics under a resource group.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
final String filter = null;
final Integer top = null;
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top));
}
/**
* List partner topics under a resource group.
*
* List all the partner topics under a resource group.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param filter The query used to filter the search results using OData syntax. Filtering is permitted on the
* 'name' property only and with limited number of OData operations. These operations are: the 'contains' function
* as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic
* operations are supported. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne
* 'PATTERN-1'. The following is not a valid filter example: $filter=location eq 'westus'.
* @param top The number of results to return per page for the list operation. Valid range for top parameter is 1 to
* 100. If not specified, the default number of results to be returned is 20 items per page.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName, String filter, Integer top,
Context context) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, top, context));
}
/**
* Activate a partner topic.
*
* Activate a newly created partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> activateWithResponseAsync(String resourceGroupName,
String partnerTopicName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.activate(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, partnerTopicName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Activate a partner topic.
*
* Activate a newly created partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> activateWithResponseAsync(String resourceGroupName,
String partnerTopicName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.activate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
partnerTopicName, this.client.getApiVersion(), accept, context);
}
/**
* Activate a partner topic.
*
* Activate a newly created partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono activateAsync(String resourceGroupName, String partnerTopicName) {
return activateWithResponseAsync(resourceGroupName, partnerTopicName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Activate a partner topic.
*
* Activate a newly created partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response activateWithResponse(String resourceGroupName, String partnerTopicName,
Context context) {
return activateWithResponseAsync(resourceGroupName, partnerTopicName, context).block();
}
/**
* Activate a partner topic.
*
* Activate a newly created partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PartnerTopicInner activate(String resourceGroupName, String partnerTopicName) {
return activateWithResponse(resourceGroupName, partnerTopicName, Context.NONE).getValue();
}
/**
* Deactivate a partner topic.
*
* Deactivate specific partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> deactivateWithResponseAsync(String resourceGroupName,
String partnerTopicName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deactivate(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, partnerTopicName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deactivate a partner topic.
*
* Deactivate specific partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> deactivateWithResponseAsync(String resourceGroupName,
String partnerTopicName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (partnerTopicName == null) {
return Mono
.error(new IllegalArgumentException("Parameter partnerTopicName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deactivate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
partnerTopicName, this.client.getApiVersion(), accept, context);
}
/**
* Deactivate a partner topic.
*
* Deactivate specific partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deactivateAsync(String resourceGroupName, String partnerTopicName) {
return deactivateWithResponseAsync(resourceGroupName, partnerTopicName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Deactivate a partner topic.
*
* Deactivate specific partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deactivateWithResponse(String resourceGroupName, String partnerTopicName,
Context context) {
return deactivateWithResponseAsync(resourceGroupName, partnerTopicName, context).block();
}
/**
* Deactivate a partner topic.
*
* Deactivate specific partner topic.
*
* @param resourceGroupName The name of the resource group within the user's subscription.
* @param partnerTopicName Name of the partner topic.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return event Grid Partner Topic.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public PartnerTopicInner deactivate(String resourceGroupName, String partnerTopicName) {
return deactivateWithResponse(resourceGroupName, partnerTopicName, Context.NONE).getValue();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listBySubscriptionNextSinglePageAsync(String nextLink,
Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the List Partner Topics operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(String nextLink,
Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy