
com.amazonaws.services.costexplorer.model.CreateAnomalySubscriptionRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-costexplorer Show documentation
/*
* Copyright 2020-2025 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.costexplorer.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 CreateAnomalySubscriptionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The cost anomaly subscription object that you want to create.
*
*/
private AnomalySubscription anomalySubscription;
/**
*
* An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions
* apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource.
* The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following: _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
*
*
*
*/
private java.util.List resourceTags;
/**
*
* The cost anomaly subscription object that you want to create.
*
*
* @param anomalySubscription
* The cost anomaly subscription object that you want to create.
*/
public void setAnomalySubscription(AnomalySubscription anomalySubscription) {
this.anomalySubscription = anomalySubscription;
}
/**
*
* The cost anomaly subscription object that you want to create.
*
*
* @return The cost anomaly subscription object that you want to create.
*/
public AnomalySubscription getAnomalySubscription() {
return this.anomalySubscription;
}
/**
*
* The cost anomaly subscription object that you want to create.
*
*
* @param anomalySubscription
* The cost anomaly subscription object that you want to create.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAnomalySubscriptionRequest withAnomalySubscription(AnomalySubscription anomalySubscription) {
setAnomalySubscription(anomalySubscription);
return this;
}
/**
*
* An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions
* apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource.
* The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following: _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
*
*
*
*
* @return An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following
* restrictions apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one
* resource. The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following:
* _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services
* use
*
*
*/
public java.util.List getResourceTags() {
return resourceTags;
}
/**
*
* An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions
* apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource.
* The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following: _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
*
*
*
*
* @param resourceTags
* An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following
* restrictions apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one
* resource. The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following:
* _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
*
*
*/
public void setResourceTags(java.util.Collection resourceTags) {
if (resourceTags == null) {
this.resourceTags = null;
return;
}
this.resourceTags = new java.util.ArrayList(resourceTags);
}
/**
*
* An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions
* apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource.
* The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following: _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
*
*
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResourceTags(java.util.Collection)} or {@link #withResourceTags(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param resourceTags
* An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following
* restrictions apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one
* resource. The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following:
* _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAnomalySubscriptionRequest withResourceTags(ResourceTag... resourceTags) {
if (this.resourceTags == null) {
setResourceTags(new java.util.ArrayList(resourceTags.length));
}
for (ResourceTag ele : resourceTags) {
this.resourceTags.add(ele);
}
return this;
}
/**
*
* An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions
* apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource.
* The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following: _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
*
*
*
*
* @param resourceTags
* An optional list of tags to associate with the specified
* AnomalySubscription
. You can use resource tags to control access to your
* subscription
using IAM policies.
*
* Each tag consists of a key and a value, and each key must be unique for the resource. The following
* restrictions apply to resource tags:
*
*
* -
*
* Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one
* resource. The remaining are reserved for Amazon Web Services use
*
*
* -
*
* The maximum length of a key is 128 characters
*
*
* -
*
* The maximum length of a value is 256 characters
*
*
* -
*
* Keys and values can only contain alphanumeric characters, spaces, and any of the following:
* _.:/=+@-
*
*
* -
*
* Keys and values are case sensitive
*
*
* -
*
* Keys and values are trimmed for any leading or trailing whitespaces
*
*
* -
*
* Don’t use aws:
as a prefix for your keys. This prefix is reserved for Amazon Web Services use
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateAnomalySubscriptionRequest withResourceTags(java.util.Collection resourceTags) {
setResourceTags(resourceTags);
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 (getAnomalySubscription() != null)
sb.append("AnomalySubscription: ").append(getAnomalySubscription()).append(",");
if (getResourceTags() != null)
sb.append("ResourceTags: ").append(getResourceTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateAnomalySubscriptionRequest == false)
return false;
CreateAnomalySubscriptionRequest other = (CreateAnomalySubscriptionRequest) obj;
if (other.getAnomalySubscription() == null ^ this.getAnomalySubscription() == null)
return false;
if (other.getAnomalySubscription() != null && other.getAnomalySubscription().equals(this.getAnomalySubscription()) == false)
return false;
if (other.getResourceTags() == null ^ this.getResourceTags() == null)
return false;
if (other.getResourceTags() != null && other.getResourceTags().equals(this.getResourceTags()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAnomalySubscription() == null) ? 0 : getAnomalySubscription().hashCode());
hashCode = prime * hashCode + ((getResourceTags() == null) ? 0 : getResourceTags().hashCode());
return hashCode;
}
@Override
public CreateAnomalySubscriptionRequest clone() {
return (CreateAnomalySubscriptionRequest) super.clone();
}
}