com.amazonaws.services.billingconductor.model.CreateCustomLineItemRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-billingconductor Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.billingconductor.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateCustomLineItemRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The token that is needed to support idempotency. Idempotency isn't currently supported, but will be implemented
* in a future update.
*
*/
private String clientToken;
/**
*
* The name of the custom line item.
*
*/
private String name;
/**
*
* The description of the custom line item. This is shown on the Bills page in association with the charge value.
*
*/
private String description;
/**
*
* The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
*
*/
private String billingGroupArn;
/**
*
* A time range for which the custom line item is effective.
*
*/
private CustomLineItemBillingPeriodRange billingPeriodRange;
/**
*
* A map that contains tag keys and tag values that are attached to a custom line item.
*
*/
private java.util.Map tags;
/**
*
* A CustomLineItemChargeDetails
that describes the charge details for a custom line item.
*
*/
private CustomLineItemChargeDetails chargeDetails;
/**
*
* The Amazon Web Services account in which this custom line item will be applied to.
*
*/
private String accountId;
/**
*
* The token that is needed to support idempotency. Idempotency isn't currently supported, but will be implemented
* in a future update.
*
*
* @param clientToken
* The token that is needed to support idempotency. Idempotency isn't currently supported, but will be
* implemented in a future update.
*/
public void setClientToken(String clientToken) {
this.clientToken = clientToken;
}
/**
*
* The token that is needed to support idempotency. Idempotency isn't currently supported, but will be implemented
* in a future update.
*
*
* @return The token that is needed to support idempotency. Idempotency isn't currently supported, but will be
* implemented in a future update.
*/
public String getClientToken() {
return this.clientToken;
}
/**
*
* The token that is needed to support idempotency. Idempotency isn't currently supported, but will be implemented
* in a future update.
*
*
* @param clientToken
* The token that is needed to support idempotency. Idempotency isn't currently supported, but will be
* implemented in a future update.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest withClientToken(String clientToken) {
setClientToken(clientToken);
return this;
}
/**
*
* The name of the custom line item.
*
*
* @param name
* The name of the custom line item.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the custom line item.
*
*
* @return The name of the custom line item.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the custom line item.
*
*
* @param name
* The name of the custom line item.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest withName(String name) {
setName(name);
return this;
}
/**
*
* The description of the custom line item. This is shown on the Bills page in association with the charge value.
*
*
* @param description
* The description of the custom line item. This is shown on the Bills page in association with the charge
* value.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the custom line item. This is shown on the Bills page in association with the charge value.
*
*
* @return The description of the custom line item. This is shown on the Bills page in association with the charge
* value.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the custom line item. This is shown on the Bills page in association with the charge value.
*
*
* @param description
* The description of the custom line item. This is shown on the Bills page in association with the charge
* value.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
*
*
* @param billingGroupArn
* The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
*/
public void setBillingGroupArn(String billingGroupArn) {
this.billingGroupArn = billingGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
*
*
* @return The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
*/
public String getBillingGroupArn() {
return this.billingGroupArn;
}
/**
*
* The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
*
*
* @param billingGroupArn
* The Amazon Resource Name (ARN) that references the billing group where the custom line item applies to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest withBillingGroupArn(String billingGroupArn) {
setBillingGroupArn(billingGroupArn);
return this;
}
/**
*
* A time range for which the custom line item is effective.
*
*
* @param billingPeriodRange
* A time range for which the custom line item is effective.
*/
public void setBillingPeriodRange(CustomLineItemBillingPeriodRange billingPeriodRange) {
this.billingPeriodRange = billingPeriodRange;
}
/**
*
* A time range for which the custom line item is effective.
*
*
* @return A time range for which the custom line item is effective.
*/
public CustomLineItemBillingPeriodRange getBillingPeriodRange() {
return this.billingPeriodRange;
}
/**
*
* A time range for which the custom line item is effective.
*
*
* @param billingPeriodRange
* A time range for which the custom line item is effective.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest withBillingPeriodRange(CustomLineItemBillingPeriodRange billingPeriodRange) {
setBillingPeriodRange(billingPeriodRange);
return this;
}
/**
*
* A map that contains tag keys and tag values that are attached to a custom line item.
*
*
* @return A map that contains tag keys and tag values that are attached to a custom line item.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* A map that contains tag keys and tag values that are attached to a custom line item.
*
*
* @param tags
* A map that contains tag keys and tag values that are attached to a custom line item.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* A map that contains tag keys and tag values that are attached to a custom line item.
*
*
* @param tags
* A map that contains tag keys and tag values that are attached to a custom line item.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see CreateCustomLineItemRequest#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap();
}
if (this.tags.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.tags.put(key, value);
return this;
}
/**
* Removes all the entries added into Tags.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* A CustomLineItemChargeDetails
that describes the charge details for a custom line item.
*
*
* @param chargeDetails
* A CustomLineItemChargeDetails
that describes the charge details for a custom line item.
*/
public void setChargeDetails(CustomLineItemChargeDetails chargeDetails) {
this.chargeDetails = chargeDetails;
}
/**
*
* A CustomLineItemChargeDetails
that describes the charge details for a custom line item.
*
*
* @return A CustomLineItemChargeDetails
that describes the charge details for a custom line item.
*/
public CustomLineItemChargeDetails getChargeDetails() {
return this.chargeDetails;
}
/**
*
* A CustomLineItemChargeDetails
that describes the charge details for a custom line item.
*
*
* @param chargeDetails
* A CustomLineItemChargeDetails
that describes the charge details for a custom line item.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest withChargeDetails(CustomLineItemChargeDetails chargeDetails) {
setChargeDetails(chargeDetails);
return this;
}
/**
*
* The Amazon Web Services account in which this custom line item will be applied to.
*
*
* @param accountId
* The Amazon Web Services account in which this custom line item will be applied to.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* The Amazon Web Services account in which this custom line item will be applied to.
*
*
* @return The Amazon Web Services account in which this custom line item will be applied to.
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* The Amazon Web Services account in which this custom line item will be applied to.
*
*
* @param accountId
* The Amazon Web Services account in which this custom line item will be applied to.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCustomLineItemRequest withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getClientToken() != null)
sb.append("ClientToken: ").append(getClientToken()).append(",");
if (getName() != null)
sb.append("Name: ").append("***Sensitive Data Redacted***").append(",");
if (getDescription() != null)
sb.append("Description: ").append("***Sensitive Data Redacted***").append(",");
if (getBillingGroupArn() != null)
sb.append("BillingGroupArn: ").append(getBillingGroupArn()).append(",");
if (getBillingPeriodRange() != null)
sb.append("BillingPeriodRange: ").append(getBillingPeriodRange()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getChargeDetails() != null)
sb.append("ChargeDetails: ").append(getChargeDetails()).append(",");
if (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateCustomLineItemRequest == false)
return false;
CreateCustomLineItemRequest other = (CreateCustomLineItemRequest) obj;
if (other.getClientToken() == null ^ this.getClientToken() == null)
return false;
if (other.getClientToken() != null && other.getClientToken().equals(this.getClientToken()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getBillingGroupArn() == null ^ this.getBillingGroupArn() == null)
return false;
if (other.getBillingGroupArn() != null && other.getBillingGroupArn().equals(this.getBillingGroupArn()) == false)
return false;
if (other.getBillingPeriodRange() == null ^ this.getBillingPeriodRange() == null)
return false;
if (other.getBillingPeriodRange() != null && other.getBillingPeriodRange().equals(this.getBillingPeriodRange()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getChargeDetails() == null ^ this.getChargeDetails() == null)
return false;
if (other.getChargeDetails() != null && other.getChargeDetails().equals(this.getChargeDetails()) == false)
return false;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getBillingGroupArn() == null) ? 0 : getBillingGroupArn().hashCode());
hashCode = prime * hashCode + ((getBillingPeriodRange() == null) ? 0 : getBillingPeriodRange().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getChargeDetails() == null) ? 0 : getChargeDetails().hashCode());
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
return hashCode;
}
@Override
public CreateCustomLineItemRequest clone() {
return (CreateCustomLineItemRequest) super.clone();
}
}