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