Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -12,7 +12,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 99-SNAPSHOT-d753183b-20201209-163011
* IBM OpenAPI SDK Code Generator Version: 3.87.0-91c7c775-20240320-213027
*/

package com.ibm.cloud.platform_services.usage_metering.v4;
Expand All @@ -33,17 +33,23 @@

/**
* IBM Cloud Usage Metering is a platform service that enables service providers to submit metrics collected for
* resource instances provisioned by IBM Cloud users. IBM and third-party service providers that are delivering an
* resource instances provisioned by IBM Cloud users. IBM and third-party service providers that are delivering an
* integrated billing service in IBM Cloud are required to submit usage for all active service instances every hour.
* This is important because inability to report usage can lead to loss of revenue collection for IBM, in turn causing
* This is important because inability to report usage can lead to loss of revenue collection for IBM, in turn causing
* loss of revenue share for the service providers.
*
* @version v4
* API Version: 4.0.8
*/
public class UsageMetering extends BaseService {

/**
* Default service name used when configuring the `UsageMetering` client.
*/
public static final String DEFAULT_SERVICE_NAME = "usage_metering";

/**
* Default service endpoint URL.
*/
public static final String DEFAULT_SERVICE_URL = "https://billing.cloud.ibm.com";

/**
Expand Down Expand Up @@ -85,7 +91,9 @@ public UsageMetering(String serviceName, Authenticator authenticator) {
/**
* Report Resource Controller resource usage.
*
* Report usage for resource instances that were provisioned through the resource controller.
* The Resource Controller is responsible for controlling and tracking the lifecycle of resources in an IBM Cloud
* account. Resources can mean anything from an instance of a service, or entities associated with an account. Report
* usage for these resource instances that were provisioned through the resource controller.
*
* @param reportResourceUsageOptions the {@link ReportResourceUsageOptions} containing the options for the call
* @return a {@link ServiceCall} with a result of type {@link ResponseAccepted}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -29,6 +29,11 @@ public static class Builder {
private String measure;
private Object quantity;

/**
* Instantiates a new Builder from an existing MeasureAndQuantity instance.
*
* @param measureAndQuantity the instance to initialize the Builder with
*/
private Builder(MeasureAndQuantity measureAndQuantity) {
this.measure = measureAndQuantity.measure;
this.quantity = measureAndQuantity.quantity;
Expand Down Expand Up @@ -83,6 +88,8 @@ public Builder quantity(Object quantity) {
}
}

protected MeasureAndQuantity() { }

protected MeasureAndQuantity(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.measure,
"measure cannot be null");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -32,6 +32,11 @@ public static class Builder {
private String resourceId;
private List<ResourceInstanceUsage> resourceUsage;

/**
* Instantiates a new Builder from an existing ReportResourceUsageOptions instance.
*
* @param reportResourceUsageOptions the instance to initialize the Builder with
*/
private Builder(ReportResourceUsageOptions reportResourceUsageOptions) {
this.resourceId = reportResourceUsageOptions.resourceId;
this.resourceUsage = reportResourceUsageOptions.resourceUsage;
Expand Down Expand Up @@ -64,9 +69,9 @@ public ReportResourceUsageOptions build() {
}

/**
* Adds an resourceUsage to resourceUsage.
* Adds a new element to resourceUsage.
*
* @param resourceUsage the new resourceUsage
* @param resourceUsage the new element to be added
* @return the ReportResourceUsageOptions builder
*/
public Builder addResourceUsage(ResourceInstanceUsage resourceUsage) {
Expand Down Expand Up @@ -103,6 +108,8 @@ public Builder resourceUsage(List<ResourceInstanceUsage> resourceUsage) {
}
}

protected ReportResourceUsageOptions() { }

protected ReportResourceUsageOptions(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notEmpty(builder.resourceId,
"resourceId cannot be empty");
Expand All @@ -124,7 +131,8 @@ public Builder newBuilder() {
/**
* Gets the resourceId.
*
* The resource for which the usage is submitted.
* The resource for which the usage is submitted. You can find this value as the Global catalog ID listed on the
* Brokers tab in Partner Center.
*
* @return the resourceId
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -47,6 +47,11 @@ public static class Builder {
private List<MeasureAndQuantity> measuredUsage;
private String consumerId;

/**
* Instantiates a new Builder from an existing ResourceInstanceUsage instance.
*
* @param resourceInstanceUsage the instance to initialize the Builder with
*/
private Builder(ResourceInstanceUsage resourceInstanceUsage) {
this.resourceInstanceId = resourceInstanceUsage.resourceInstanceId;
this.planId = resourceInstanceUsage.planId;
Expand Down Expand Up @@ -90,9 +95,9 @@ public ResourceInstanceUsage build() {
}

/**
* Adds an measuredUsage to measuredUsage.
* Adds a new element to measuredUsage.
*
* @param measuredUsage the new measuredUsage
* @param measuredUsage the new element to be added
* @return the ResourceInstanceUsage builder
*/
public Builder addMeasuredUsage(MeasureAndQuantity measuredUsage) {
Expand Down Expand Up @@ -184,6 +189,8 @@ public Builder consumerId(String consumerId) {
}
}

protected ResourceInstanceUsage() { }

protected ResourceInstanceUsage(Builder builder) {
com.ibm.cloud.sdk.core.util.Validator.notNull(builder.resourceInstanceId,
"resourceInstanceId cannot be null");
Expand Down Expand Up @@ -228,7 +235,7 @@ public String resourceInstanceId() {
/**
* Gets the planId.
*
* The plan with which the instance's usage should be metered.
* The ID of the pricing plan with which the instance's usage should be metered.
*
* @return the planId
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -24,6 +24,8 @@ public class ResourceUsageDetails extends GenericModel {
protected String code;
protected String message;

protected ResourceUsageDetails() { }

/**
* Gets the status.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -23,6 +23,8 @@ public class ResponseAccepted extends GenericModel {

protected List<ResourceUsageDetails> resources;

protected ResponseAccepted() { }

/**
* Gets the resources.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* (C) Copyright IBM Corp. 2020.
* (C) Copyright IBM Corp. 2024.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
Expand All @@ -11,6 +11,6 @@
* specific language governing permissions and limitations under the License.
*/
/**
* IBM Cloud Usage Metering v4.
* Usage Metering v4.
*/
package com.ibm.cloud.platform_services.usage_metering.v4;
Loading