com.azure.resourcemanager.elastic.implementation.ElasticVersionsImpl Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.elastic.implementation;
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.elastic.fluent.ElasticVersionsClient;
import com.azure.resourcemanager.elastic.fluent.models.ElasticVersionsListResponseInner;
import com.azure.resourcemanager.elastic.models.ElasticVersions;
import com.azure.resourcemanager.elastic.models.ElasticVersionsListResponse;
public final class ElasticVersionsImpl implements ElasticVersions {
private static final ClientLogger LOGGER = new ClientLogger(ElasticVersionsImpl.class);
private final ElasticVersionsClient innerClient;
private final com.azure.resourcemanager.elastic.ElasticManager serviceManager;
public ElasticVersionsImpl(
ElasticVersionsClient innerClient, com.azure.resourcemanager.elastic.ElasticManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public Response listWithResponse(String region, Context context) {
Response inner = this.serviceClient().listWithResponse(region, context);
if (inner != null) {
return new SimpleResponse<>(
inner.getRequest(),
inner.getStatusCode(),
inner.getHeaders(),
new ElasticVersionsListResponseImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public ElasticVersionsListResponse list(String region) {
ElasticVersionsListResponseInner inner = this.serviceClient().list(region);
if (inner != null) {
return new ElasticVersionsListResponseImpl(inner, this.manager());
} else {
return null;
}
}
private ElasticVersionsClient serviceClient() {
return this.innerClient;
}
private com.azure.resourcemanager.elastic.ElasticManager manager() {
return this.serviceManager;
}
}