@Generated(value="OracleSDKGenerator", comments="API Version: 20200107") public class UsageapiAsyncClient extends BaseAsyncClient implements UsageapiAsync
Async client implementation for Usageapi service.
There are two ways to use async client: 1. Use AsyncHandler: using AsyncHandler, if the response
to the call is an InputStream
, like getObject Api in object storage service,
developers need to process the stream in AsyncHandler, and not anywhere else, because the stream
will be closed right after the AsyncHandler is invoked.
2. Use Java Future: using Java Future, developers need to close the stream after they are done
with the Java Future.
Accessing the result should be done in a mutually exclusive manner, either through the Future or
the AsyncHandler, but not both. If the Future is used, the caller should pass in null as the
AsyncHandler. If the AsyncHandler is used, it is still safe to use the Future to determine
whether or not the request was completed via Future.isDone/isCancelled.
Please refer to
https://github.com/oracle/oci-java-sdk/blob/master/bmc-examples/src/main/java/ResteasyClientWithObjectStorageExample.java
Modifier and Type | Class and Description |
---|---|
static class |
UsageapiAsyncClient.Builder
Builder class for this client.
|
Modifier and Type | Field and Description |
---|---|
String |
clientCommonLibraryVersion
Compatible SDK version, provided by the codegen.
|
Optional<String> |
minimumClientCommonLibraryVersionFromClient
Minimum compatible SDK version, maybe provided by the codegen.
|
static Service |
SERVICE
Service instance for Usageapi.
|
Constructor and Description |
---|
UsageapiAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
ClientConfiguration configuration,
ClientConfigurator clientConfigurator,
RequestSignerFactory defaultRequestSignerFactory)
Deprecated.
Use the
builder instead. |
UsageapiAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
ClientConfiguration configuration,
ClientConfigurator clientConfigurator,
RequestSignerFactory defaultRequestSignerFactory,
List<ClientConfigurator> additionalClientConfigurators)
Deprecated.
Use the
builder instead. |
UsageapiAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
ClientConfiguration configuration,
ClientConfigurator clientConfigurator,
RequestSignerFactory defaultRequestSignerFactory,
List<ClientConfigurator> additionalClientConfigurators,
String endpoint)
Deprecated.
Use the
builder instead. |
UsageapiAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider,
ClientConfiguration configuration,
ClientConfigurator clientConfigurator,
RequestSignerFactory defaultRequestSignerFactory,
Map<SigningStrategy,RequestSignerFactory> signingStrategyRequestSignerFactories,
List<ClientConfigurator> additionalClientConfigurators,
String endpoint)
Deprecated.
Use the
builder instead. |
UsageapiAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider)
Deprecated.
Use the
builder instead. |
UsageapiAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider,
ClientConfiguration configuration)
Deprecated.
Use the
builder instead. |
UsageapiAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider,
ClientConfiguration configuration,
ClientConfigurator clientConfigurator)
Deprecated.
Use the
builder instead. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEndpoint, refreshClient, setEndpoint, useRealmSpecificEndpointTemplate
close
public static final Service SERVICE
Service instance for Usageapi.
public final String clientCommonLibraryVersion
@Deprecated public UsageapiAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider)
builder
instead.Create a new client instance.
authenticationDetailsProvider
- The authentication details (see UsageapiAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)@Deprecated public UsageapiAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration)
builder
instead.Create a new client instance.
authenticationDetailsProvider
- The authentication details (see UsageapiAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
- ClientBuilderBase.configuration
@Deprecated public UsageapiAsyncClient(BasicAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator)
builder
instead.Create a new client instance.
authenticationDetailsProvider
- The authentication details (see UsageapiAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
- ClientBuilderBase.configuration
clientConfigurator
- ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
@Deprecated public UsageapiAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory)
builder
instead.Create a new client instance.
authenticationDetailsProvider
- The authentication details (see UsageapiAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
- ClientBuilderBase.configuration
clientConfigurator
- ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
- ClientBuilderBase.requestSignerFactory
@Deprecated public UsageapiAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators)
builder
instead.Create a new client instance.
authenticationDetailsProvider
- The authentication details (see UsageapiAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
- ClientBuilderBase.configuration
clientConfigurator
- ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
- ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
- ClientBuilderBase.additionalClientConfigurators
@Deprecated public UsageapiAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
builder
instead.Create a new client instance.
authenticationDetailsProvider
- The authentication details (see UsageapiAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
- ClientBuilderBase.configuration
clientConfigurator
- ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
- ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
- ClientBuilderBase.additionalClientConfigurators
endpoint
- ClientBuilderBase.endpoint(java.lang.String)
@Deprecated public UsageapiAsyncClient(AbstractAuthenticationDetailsProvider authenticationDetailsProvider, ClientConfiguration configuration, ClientConfigurator clientConfigurator, RequestSignerFactory defaultRequestSignerFactory, Map<SigningStrategy,RequestSignerFactory> signingStrategyRequestSignerFactories, List<ClientConfigurator> additionalClientConfigurators, String endpoint)
builder
instead.Create a new client instance.
authenticationDetailsProvider
- The authentication details (see UsageapiAsyncClient.Builder.build(com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider)
)configuration
- ClientBuilderBase.configuration
clientConfigurator
- ClientBuilderBase.clientConfigurator(com.oracle.bmc.http.ClientConfigurator)
defaultRequestSignerFactory
- ClientBuilderBase.requestSignerFactory
additionalClientConfigurators
- ClientBuilderBase.additionalClientConfigurators
endpoint
- ClientBuilderBase.endpoint(java.lang.String)
signingStrategyRequestSignerFactories
- ClientBuilderBase.signingStrategyRequestSignerFactories
public static UsageapiAsyncClient.Builder builder()
Create a builder for this client.
public void setRegion(Region region)
UsageapiAsync
Sets the region to call (ex, Region.US_PHOENIX_1).
Note, this will call setEndpoint
after resolving the
endpoint. If the service is not available in this region, however, an
IllegalArgumentException will be raised.
setRegion
in interface UsageapiAsync
region
- The region of the service.public void setRegion(String regionId)
UsageapiAsync
Sets the region to call (ex, ‘us-phoenix-1’).
Note, this will first try to map the region ID to a known Region and call setRegion
.
If no known Region could be determined, it will create an endpoint based on the default
endpoint format (Region.formatDefaultRegionEndpoint(Service, String)
and then call setEndpoint
.
setRegion
in interface UsageapiAsync
regionId
- The public region ID.public Future<CreateCustomTableResponse> createCustomTable(CreateCustomTableRequest request, AsyncHandler<CreateCustomTableRequest,CreateCustomTableResponse> handler)
UsageapiAsync
Returns the created custom table.
createCustomTable
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<CreateEmailRecipientsGroupResponse> createEmailRecipientsGroup(CreateEmailRecipientsGroupRequest request, AsyncHandler<CreateEmailRecipientsGroupRequest,CreateEmailRecipientsGroupResponse> handler)
UsageapiAsync
Add a list of email recipients that can receive usage statements for the subscription.
createEmailRecipientsGroup
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<CreateQueryResponse> createQuery(CreateQueryRequest request, AsyncHandler<CreateQueryRequest,CreateQueryResponse> handler)
UsageapiAsync
Returns the created query.
createQuery
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<CreateScheduleResponse> createSchedule(CreateScheduleRequest request, AsyncHandler<CreateScheduleRequest,CreateScheduleResponse> handler)
UsageapiAsync
Returns the created schedule.
createSchedule
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<CreateUsageCarbonEmissionsQueryResponse> createUsageCarbonEmissionsQuery(CreateUsageCarbonEmissionsQueryRequest request, AsyncHandler<CreateUsageCarbonEmissionsQueryRequest,CreateUsageCarbonEmissionsQueryResponse> handler)
UsageapiAsync
Returns the created usage carbon emissions query.
createUsageCarbonEmissionsQuery
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<DeleteCustomTableResponse> deleteCustomTable(DeleteCustomTableRequest request, AsyncHandler<DeleteCustomTableRequest,DeleteCustomTableResponse> handler)
UsageapiAsync
Delete a saved custom table by the OCID.
deleteCustomTable
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<DeleteEmailRecipientsGroupResponse> deleteEmailRecipientsGroup(DeleteEmailRecipientsGroupRequest request, AsyncHandler<DeleteEmailRecipientsGroupRequest,DeleteEmailRecipientsGroupResponse> handler)
UsageapiAsync
Delete the email recipients group for the usage statement subscription.
deleteEmailRecipientsGroup
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<DeleteQueryResponse> deleteQuery(DeleteQueryRequest request, AsyncHandler<DeleteQueryRequest,DeleteQueryResponse> handler)
UsageapiAsync
Delete a saved query by the OCID.
deleteQuery
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<DeleteScheduleResponse> deleteSchedule(DeleteScheduleRequest request, AsyncHandler<DeleteScheduleRequest,DeleteScheduleResponse> handler)
UsageapiAsync
Delete a saved scheduled report by the OCID.
deleteSchedule
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<DeleteUsageCarbonEmissionsQueryResponse> deleteUsageCarbonEmissionsQuery(DeleteUsageCarbonEmissionsQueryRequest request, AsyncHandler<DeleteUsageCarbonEmissionsQueryRequest,DeleteUsageCarbonEmissionsQueryResponse> handler)
UsageapiAsync
Delete a usage carbon emissions saved query by the OCID.
deleteUsageCarbonEmissionsQuery
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<GetCustomTableResponse> getCustomTable(GetCustomTableRequest request, AsyncHandler<GetCustomTableRequest,GetCustomTableResponse> handler)
UsageapiAsync
Returns the saved custom table.
getCustomTable
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<GetEmailRecipientsGroupResponse> getEmailRecipientsGroup(GetEmailRecipientsGroupRequest request, AsyncHandler<GetEmailRecipientsGroupRequest,GetEmailRecipientsGroupResponse> handler)
UsageapiAsync
Return the saved usage statement email recipient group.
getEmailRecipientsGroup
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<GetQueryResponse> getQuery(GetQueryRequest request, AsyncHandler<GetQueryRequest,GetQueryResponse> handler)
UsageapiAsync
Returns the saved query.
getQuery
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<GetScheduleResponse> getSchedule(GetScheduleRequest request, AsyncHandler<GetScheduleRequest,GetScheduleResponse> handler)
UsageapiAsync
Returns the saved schedule.
getSchedule
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<GetScheduledRunResponse> getScheduledRun(GetScheduledRunRequest request, AsyncHandler<GetScheduledRunRequest,GetScheduledRunResponse> handler)
UsageapiAsync
Returns the saved schedule run.
getScheduledRun
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<GetUsageCarbonEmissionsQueryResponse> getUsageCarbonEmissionsQuery(GetUsageCarbonEmissionsQueryRequest request, AsyncHandler<GetUsageCarbonEmissionsQueryRequest,GetUsageCarbonEmissionsQueryResponse> handler)
UsageapiAsync
Returns the usage carbon emissions saved query.
getUsageCarbonEmissionsQuery
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<ListCustomTablesResponse> listCustomTables(ListCustomTablesRequest request, AsyncHandler<ListCustomTablesRequest,ListCustomTablesResponse> handler)
UsageapiAsync
Returns the saved custom table list.
listCustomTables
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<ListEmailRecipientsGroupsResponse> listEmailRecipientsGroups(ListEmailRecipientsGroupsRequest request, AsyncHandler<ListEmailRecipientsGroupsRequest,ListEmailRecipientsGroupsResponse> handler)
UsageapiAsync
Return the saved usage statement email recipient group.
listEmailRecipientsGroups
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<ListQueriesResponse> listQueries(ListQueriesRequest request, AsyncHandler<ListQueriesRequest,ListQueriesResponse> handler)
UsageapiAsync
Returns the saved query list.
listQueries
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<ListScheduledRunsResponse> listScheduledRuns(ListScheduledRunsRequest request, AsyncHandler<ListScheduledRunsRequest,ListScheduledRunsResponse> handler)
UsageapiAsync
Returns schedule history list.
listScheduledRuns
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<ListSchedulesResponse> listSchedules(ListSchedulesRequest request, AsyncHandler<ListSchedulesRequest,ListSchedulesResponse> handler)
UsageapiAsync
Returns the saved schedule list.
listSchedules
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<ListUsageCarbonEmissionsQueriesResponse> listUsageCarbonEmissionsQueries(ListUsageCarbonEmissionsQueriesRequest request, AsyncHandler<ListUsageCarbonEmissionsQueriesRequest,ListUsageCarbonEmissionsQueriesResponse> handler)
UsageapiAsync
Returns the usage carbon emissions saved query list.
listUsageCarbonEmissionsQueries
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<RequestAverageCarbonEmissionResponse> requestAverageCarbonEmission(RequestAverageCarbonEmissionRequest request, AsyncHandler<RequestAverageCarbonEmissionRequest,RequestAverageCarbonEmissionResponse> handler)
UsageapiAsync
Returns the average carbon emissions summary by SKU.
requestAverageCarbonEmission
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<RequestCleanEnergyUsageResponse> requestCleanEnergyUsage(RequestCleanEnergyUsageRequest request, AsyncHandler<RequestCleanEnergyUsageRequest,RequestCleanEnergyUsageResponse> handler)
UsageapiAsync
Returns the clean energy usage summary by region.
requestCleanEnergyUsage
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<RequestSummarizedConfigurationsResponse> requestSummarizedConfigurations(RequestSummarizedConfigurationsRequest request, AsyncHandler<RequestSummarizedConfigurationsRequest,RequestSummarizedConfigurationsResponse> handler)
UsageapiAsync
Returns the configurations list for the UI drop-down list.
requestSummarizedConfigurations
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<RequestSummarizedUsagesResponse> requestSummarizedUsages(RequestSummarizedUsagesRequest request, AsyncHandler<RequestSummarizedUsagesRequest,RequestSummarizedUsagesResponse> handler)
UsageapiAsync
Returns usage for the given account.
requestSummarizedUsages
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<RequestUsageCarbonEmissionConfigResponse> requestUsageCarbonEmissionConfig(RequestUsageCarbonEmissionConfigRequest request, AsyncHandler<RequestUsageCarbonEmissionConfigRequest,RequestUsageCarbonEmissionConfigResponse> handler)
UsageapiAsync
Returns the configuration list for the UI drop-down list of carbon emission console.
requestUsageCarbonEmissionConfig
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<RequestUsageCarbonEmissionsResponse> requestUsageCarbonEmissions(RequestUsageCarbonEmissionsRequest request, AsyncHandler<RequestUsageCarbonEmissionsRequest,RequestUsageCarbonEmissionsResponse> handler)
UsageapiAsync
Returns usage carbon emission for the given account.
requestUsageCarbonEmissions
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<UpdateCustomTableResponse> updateCustomTable(UpdateCustomTableRequest request, AsyncHandler<UpdateCustomTableRequest,UpdateCustomTableResponse> handler)
UsageapiAsync
Update a saved custom table by table id.
updateCustomTable
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<UpdateEmailRecipientsGroupResponse> updateEmailRecipientsGroup(UpdateEmailRecipientsGroupRequest request, AsyncHandler<UpdateEmailRecipientsGroupRequest,UpdateEmailRecipientsGroupResponse> handler)
UsageapiAsync
Update a saved email recipients group.
updateEmailRecipientsGroup
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<UpdateQueryResponse> updateQuery(UpdateQueryRequest request, AsyncHandler<UpdateQueryRequest,UpdateQueryResponse> handler)
UsageapiAsync
Update a saved query by the OCID.
updateQuery
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<UpdateScheduleResponse> updateSchedule(UpdateScheduleRequest request, AsyncHandler<UpdateScheduleRequest,UpdateScheduleResponse> handler)
UsageapiAsync
Update a saved schedule
updateSchedule
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.public Future<UpdateUsageCarbonEmissionsQueryResponse> updateUsageCarbonEmissionsQuery(UpdateUsageCarbonEmissionsQueryRequest request, AsyncHandler<UpdateUsageCarbonEmissionsQueryRequest,UpdateUsageCarbonEmissionsQueryResponse> handler)
UsageapiAsync
Update a usage carbon emissions saved query by the OCID.
updateUsageCarbonEmissionsQuery
in interface UsageapiAsync
request
- The request object containing the details to sendhandler
- The request handler to invoke upon completion, may be null.protected ClientConfigurator getDefaultConfigurator()
public void useRealmSpecificEndpointTemplate(boolean useOfRealmSpecificEndpointTemplateEnabled)
useOfRealmSpecificEndpointTemplateEnabled
- This flag can be set to true or false to
enable or disable the use of realm-specific endpoint template respectivelypublic final void populateServiceParametersInEndpoint(String endpoint, Map<String,Object> requiredParametersMap)
endpoint
- The endpoint template in userequiredParametersMap
- Map of parameter name as key and value set in request path or
query parameter as valuepublic final void updateBaseEndpoint(String endpoint)
endpoint
- The updated endpoint to usepublic final void setEndpoint(String endpoint)
public final String getEndpoint()
public final void refreshClient()
HttpClient
. This will call ClientConfigurator
s again, and
can be used to e.g. refresh the SSL certificate.public final void close()
close
in interface AutoCloseable
public String getClientCommonLibraryVersion()
public Optional<String> getMinimumClientCommonLibraryVersionFromClient()
protected <REQ extends BmcRequest<?>,RESP extends BmcResponse,RESP_BUILDER extends BmcResponse.Builder<RESP>> ClientCall<REQ,RESP,RESP_BUILDER> clientCall(REQ request, Supplier<RESP_BUILDER> responseBuilder)
Copyright © 2016–2024. All rights reserved.