com.azure.resourcemanager.botservice.implementation.ChannelsImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-botservice Show documentation
Show all versions of azure-resourcemanager-botservice Show documentation
This package contains Microsoft Azure SDK for BotService Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Bot Service is a platform for creating smart conversational agents. Package tag package-2021-03-01.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.botservice.implementation;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.botservice.fluent.ChannelsClient;
import com.azure.resourcemanager.botservice.fluent.models.BotChannelInner;
import com.azure.resourcemanager.botservice.fluent.models.ListChannelWithKeysResponseInner;
import com.azure.resourcemanager.botservice.models.BotChannel;
import com.azure.resourcemanager.botservice.models.ChannelName;
import com.azure.resourcemanager.botservice.models.Channels;
import com.azure.resourcemanager.botservice.models.ListChannelWithKeysResponse;
import com.fasterxml.jackson.annotation.JsonIgnore;
public final class ChannelsImpl implements Channels {
@JsonIgnore private final ClientLogger logger = new ClientLogger(ChannelsImpl.class);
private final ChannelsClient innerClient;
private final com.azure.resourcemanager.botservice.BotServiceManager serviceManager;
public ChannelsImpl(
ChannelsClient innerClient, com.azure.resourcemanager.botservice.BotServiceManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public BotChannel create(
String resourceGroupName, String resourceName, ChannelName channelName, BotChannelInner parameters) {
BotChannelInner inner = this.serviceClient().create(resourceGroupName, resourceName, channelName, parameters);
if (inner != null) {
return new BotChannelImpl(inner, this.manager());
} else {
return null;
}
}
public Response createWithResponse(
String resourceGroupName,
String resourceName,
ChannelName channelName,
BotChannelInner parameters,
Context context) {
Response inner =
this.serviceClient().createWithResponse(resourceGroupName, resourceName, channelName, parameters, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new BotChannelImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public BotChannel update(
String resourceGroupName, String resourceName, ChannelName channelName, BotChannelInner parameters) {
BotChannelInner inner = this.serviceClient().update(resourceGroupName, resourceName, channelName, parameters);
if (inner != null) {
return new BotChannelImpl(inner, this.manager());
} else {
return null;
}
}
public Response updateWithResponse(
String resourceGroupName,
String resourceName,
ChannelName channelName,
BotChannelInner parameters,
Context context) {
Response inner =
this.serviceClient().updateWithResponse(resourceGroupName, resourceName, channelName, parameters, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new BotChannelImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public void delete(String resourceGroupName, String resourceName, String channelName) {
this.serviceClient().delete(resourceGroupName, resourceName, channelName);
}
public Response deleteWithResponse(
String resourceGroupName, String resourceName, String channelName, Context context) {
return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, channelName, context);
}
public BotChannel get(String resourceGroupName, String resourceName, String channelName) {
BotChannelInner inner = this.serviceClient().get(resourceGroupName, resourceName, channelName);
if (inner != null) {
return new BotChannelImpl(inner, this.manager());
} else {
return null;
}
}
public Response getWithResponse(
String resourceGroupName, String resourceName, String channelName, Context context) {
Response inner =
this.serviceClient().getWithResponse(resourceGroupName, resourceName, channelName, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new BotChannelImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public ListChannelWithKeysResponse listWithKeys(
String resourceGroupName, String resourceName, ChannelName channelName) {
ListChannelWithKeysResponseInner inner =
this.serviceClient().listWithKeys(resourceGroupName, resourceName, channelName);
if (inner != null) {
return new ListChannelWithKeysResponseImpl(inner, this.manager());
} else {
return null;
}
}
public Response listWithKeysWithResponse(
String resourceGroupName, String resourceName, ChannelName channelName, Context context) {
Response inner =
this.serviceClient().listWithKeysWithResponse(resourceGroupName, resourceName, channelName, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new ListChannelWithKeysResponseImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public PagedIterable listByResourceGroup(String resourceGroupName, String resourceName) {
PagedIterable inner =
this.serviceClient().listByResourceGroup(resourceGroupName, resourceName);
return Utils.mapPage(inner, inner1 -> new BotChannelImpl(inner1, this.manager()));
}
public PagedIterable listByResourceGroup(
String resourceGroupName, String resourceName, Context context) {
PagedIterable inner =
this.serviceClient().listByResourceGroup(resourceGroupName, resourceName, context);
return Utils.mapPage(inner, inner1 -> new BotChannelImpl(inner1, this.manager()));
}
private ChannelsClient serviceClient() {
return this.innerClient;
}
private com.azure.resourcemanager.botservice.BotServiceManager manager() {
return this.serviceManager;
}
}