All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.billing.implementation.AvailableBalancesImpl 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.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.AvailableBalancesClient;
import com.azure.resourcemanager.billing.fluent.models.AvailableBalanceInner;
import com.azure.resourcemanager.billing.models.AvailableBalance;
import com.azure.resourcemanager.billing.models.AvailableBalances;

public final class AvailableBalancesImpl implements AvailableBalances {
    private static final ClientLogger LOGGER = new ClientLogger(AvailableBalancesImpl.class);

    private final AvailableBalancesClient innerClient;

    private final com.azure.resourcemanager.billing.BillingManager serviceManager;

    public AvailableBalancesImpl(AvailableBalancesClient innerClient,
        com.azure.resourcemanager.billing.BillingManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public Response getByBillingAccountWithResponse(String billingAccountName, Context context) {
        Response inner
            = this.serviceClient().getByBillingAccountWithResponse(billingAccountName, context);
        if (inner != null) {
            return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
                new AvailableBalanceImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public AvailableBalance getByBillingAccount(String billingAccountName) {
        AvailableBalanceInner inner = this.serviceClient().getByBillingAccount(billingAccountName);
        if (inner != null) {
            return new AvailableBalanceImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public Response getByBillingProfileWithResponse(String billingAccountName,
        String billingProfileName, Context context) {
        Response inner
            = this.serviceClient().getByBillingProfileWithResponse(billingAccountName, billingProfileName, context);
        if (inner != null) {
            return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(),
                new AvailableBalanceImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public AvailableBalance getByBillingProfile(String billingAccountName, String billingProfileName) {
        AvailableBalanceInner inner = this.serviceClient().getByBillingProfile(billingAccountName, billingProfileName);
        if (inner != null) {
            return new AvailableBalanceImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    private AvailableBalancesClient serviceClient() {
        return this.innerClient;
    }

    private com.azure.resourcemanager.billing.BillingManager manager() {
        return this.serviceManager;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy