
com.azure.resourcemanager.billing.implementation.DepartmentsImpl 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.billing.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.billing.fluent.DepartmentsClient;
import com.azure.resourcemanager.billing.fluent.models.DepartmentInner;
import com.azure.resourcemanager.billing.models.Department;
import com.azure.resourcemanager.billing.models.Departments;
public final class DepartmentsImpl implements Departments {
private static final ClientLogger LOGGER = new ClientLogger(DepartmentsImpl.class);
private final DepartmentsClient innerClient;
private final com.azure.resourcemanager.billing.BillingManager serviceManager;
public DepartmentsImpl(DepartmentsClient innerClient,
com.azure.resourcemanager.billing.BillingManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public Response getWithResponse(String billingAccountName, String departmentName, Context context) {
Response inner
= this.serviceClient().getWithResponse(billingAccountName, departmentName, context);
if (inner != null) {
return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
new DepartmentImpl(inner.getValue(), this.manager()));
} else {
return null;
}
}
public Department get(String billingAccountName, String departmentName) {
DepartmentInner inner = this.serviceClient().get(billingAccountName, departmentName);
if (inner != null) {
return new DepartmentImpl(inner, this.manager());
} else {
return null;
}
}
public PagedIterable listByBillingAccount(String billingAccountName) {
PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountName);
return ResourceManagerUtils.mapPage(inner, inner1 -> new DepartmentImpl(inner1, this.manager()));
}
public PagedIterable listByBillingAccount(String billingAccountName, String filter, String orderBy,
Long top, Long skip, String search, Context context) {
PagedIterable inner = this.serviceClient()
.listByBillingAccount(billingAccountName, filter, orderBy, top, skip, search, context);
return ResourceManagerUtils.mapPage(inner, inner1 -> new DepartmentImpl(inner1, this.manager()));
}
private DepartmentsClient serviceClient() {
return this.innerClient;
}
private com.azure.resourcemanager.billing.BillingManager manager() {
return this.serviceManager;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy