com.azure.resourcemanager.healthbot.implementation.BotsImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-healthbot Show documentation
Show all versions of azure-resourcemanager-healthbot Show documentation
This package contains Microsoft Azure SDK for Healthbot Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Healthcare Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package tag package-2020-12-08.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.healthbot.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.healthbot.fluent.BotsClient;
import com.azure.resourcemanager.healthbot.fluent.models.HealthBotInner;
import com.azure.resourcemanager.healthbot.models.Bots;
import com.azure.resourcemanager.healthbot.models.HealthBot;
public final class BotsImpl implements Bots {
private static final ClientLogger LOGGER = new ClientLogger(BotsImpl.class);
private final BotsClient innerClient;
private final com.azure.resourcemanager.healthbot.HealthbotManager serviceManager;
public BotsImpl(BotsClient innerClient, com.azure.resourcemanager.healthbot.HealthbotManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public Response getByResourceGroupWithResponse(String resourceGroupName, String botName,
Context context) {
Response inner
= this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, botName, context);
if (inner != null) {
return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
new HealthBotImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public HealthBot getByResourceGroup(String resourceGroupName, String botName) {
HealthBotInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, botName);
if (inner != null) {
return new HealthBotImpl(inner, this.manager());
} else {
return null;
}
}
public void deleteByResourceGroup(String resourceGroupName, String botName) {
this.serviceClient().delete(resourceGroupName, botName);
}
public void delete(String resourceGroupName, String botName, Context context) {
this.serviceClient().delete(resourceGroupName, botName, context);
}
public PagedIterable listByResourceGroup(String resourceGroupName) {
PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager()));
}
public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager()));
}
public PagedIterable list() {
PagedIterable inner = this.serviceClient().list();
return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager()));
}
public PagedIterable list(Context context) {
PagedIterable inner = this.serviceClient().list(context);
return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager()));
}
public HealthBot getById(String id) {
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
if (resourceGroupName == null) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
}
String botName = ResourceManagerUtils.getValueFromIdByName(id, "healthBots");
if (botName == null) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'healthBots'.", id)));
}
return this.getByResourceGroupWithResponse(resourceGroupName, botName, Context.NONE).getValue();
}
public Response getByIdWithResponse(String id, Context context) {
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
if (resourceGroupName == null) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
}
String botName = ResourceManagerUtils.getValueFromIdByName(id, "healthBots");
if (botName == null) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'healthBots'.", id)));
}
return this.getByResourceGroupWithResponse(resourceGroupName, botName, context);
}
public void deleteById(String id) {
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
if (resourceGroupName == null) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
}
String botName = ResourceManagerUtils.getValueFromIdByName(id, "healthBots");
if (botName == null) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'healthBots'.", id)));
}
this.delete(resourceGroupName, botName, Context.NONE);
}
public void deleteByIdWithResponse(String id, Context context) {
String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups");
if (resourceGroupName == null) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
}
String botName = ResourceManagerUtils.getValueFromIdByName(id, "healthBots");
if (botName == null) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
String.format("The resource ID '%s' is not valid. Missing path segment 'healthBots'.", id)));
}
this.delete(resourceGroupName, botName, context);
}
private BotsClient serviceClient() {
return this.innerClient;
}
private com.azure.resourcemanager.healthbot.HealthbotManager manager() {
return this.serviceManager;
}
public HealthBotImpl define(String name) {
return new HealthBotImpl(name, this.manager());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy