com.amazonaws.services.personalize.model.UpdateMetricAttributionRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-personalize 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.personalize.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 UpdateMetricAttributionRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* Add new metric attributes to the metric attribution.
*
*/
private java.util.List addMetrics;
/**
*
* Remove metric attributes from the metric attribution.
*
*/
private java.util.List removeMetrics;
/**
*
* An output config for the metric attribution.
*
*/
private MetricAttributionOutput metricsOutputConfig;
/**
*
* The Amazon Resource Name (ARN) for the metric attribution to update.
*
*/
private String metricAttributionArn;
/**
*
* Add new metric attributes to the metric attribution.
*
*
* @return Add new metric attributes to the metric attribution.
*/
public java.util.List getAddMetrics() {
return addMetrics;
}
/**
*
* Add new metric attributes to the metric attribution.
*
*
* @param addMetrics
* Add new metric attributes to the metric attribution.
*/
public void setAddMetrics(java.util.Collection addMetrics) {
if (addMetrics == null) {
this.addMetrics = null;
return;
}
this.addMetrics = new java.util.ArrayList(addMetrics);
}
/**
*
* Add new metric attributes to the metric attribution.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAddMetrics(java.util.Collection)} or {@link #withAddMetrics(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param addMetrics
* Add new metric attributes to the metric attribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateMetricAttributionRequest withAddMetrics(MetricAttribute... addMetrics) {
if (this.addMetrics == null) {
setAddMetrics(new java.util.ArrayList(addMetrics.length));
}
for (MetricAttribute ele : addMetrics) {
this.addMetrics.add(ele);
}
return this;
}
/**
*
* Add new metric attributes to the metric attribution.
*
*
* @param addMetrics
* Add new metric attributes to the metric attribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateMetricAttributionRequest withAddMetrics(java.util.Collection addMetrics) {
setAddMetrics(addMetrics);
return this;
}
/**
*
* Remove metric attributes from the metric attribution.
*
*
* @return Remove metric attributes from the metric attribution.
*/
public java.util.List getRemoveMetrics() {
return removeMetrics;
}
/**
*
* Remove metric attributes from the metric attribution.
*
*
* @param removeMetrics
* Remove metric attributes from the metric attribution.
*/
public void setRemoveMetrics(java.util.Collection removeMetrics) {
if (removeMetrics == null) {
this.removeMetrics = null;
return;
}
this.removeMetrics = new java.util.ArrayList(removeMetrics);
}
/**
*
* Remove metric attributes from the metric attribution.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRemoveMetrics(java.util.Collection)} or {@link #withRemoveMetrics(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param removeMetrics
* Remove metric attributes from the metric attribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateMetricAttributionRequest withRemoveMetrics(String... removeMetrics) {
if (this.removeMetrics == null) {
setRemoveMetrics(new java.util.ArrayList(removeMetrics.length));
}
for (String ele : removeMetrics) {
this.removeMetrics.add(ele);
}
return this;
}
/**
*
* Remove metric attributes from the metric attribution.
*
*
* @param removeMetrics
* Remove metric attributes from the metric attribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateMetricAttributionRequest withRemoveMetrics(java.util.Collection removeMetrics) {
setRemoveMetrics(removeMetrics);
return this;
}
/**
*
* An output config for the metric attribution.
*
*
* @param metricsOutputConfig
* An output config for the metric attribution.
*/
public void setMetricsOutputConfig(MetricAttributionOutput metricsOutputConfig) {
this.metricsOutputConfig = metricsOutputConfig;
}
/**
*
* An output config for the metric attribution.
*
*
* @return An output config for the metric attribution.
*/
public MetricAttributionOutput getMetricsOutputConfig() {
return this.metricsOutputConfig;
}
/**
*
* An output config for the metric attribution.
*
*
* @param metricsOutputConfig
* An output config for the metric attribution.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateMetricAttributionRequest withMetricsOutputConfig(MetricAttributionOutput metricsOutputConfig) {
setMetricsOutputConfig(metricsOutputConfig);
return this;
}
/**
*
* The Amazon Resource Name (ARN) for the metric attribution to update.
*
*
* @param metricAttributionArn
* The Amazon Resource Name (ARN) for the metric attribution to update.
*/
public void setMetricAttributionArn(String metricAttributionArn) {
this.metricAttributionArn = metricAttributionArn;
}
/**
*
* The Amazon Resource Name (ARN) for the metric attribution to update.
*
*
* @return The Amazon Resource Name (ARN) for the metric attribution to update.
*/
public String getMetricAttributionArn() {
return this.metricAttributionArn;
}
/**
*
* The Amazon Resource Name (ARN) for the metric attribution to update.
*
*
* @param metricAttributionArn
* The Amazon Resource Name (ARN) for the metric attribution to update.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateMetricAttributionRequest withMetricAttributionArn(String metricAttributionArn) {
setMetricAttributionArn(metricAttributionArn);
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 (getAddMetrics() != null)
sb.append("AddMetrics: ").append(getAddMetrics()).append(",");
if (getRemoveMetrics() != null)
sb.append("RemoveMetrics: ").append(getRemoveMetrics()).append(",");
if (getMetricsOutputConfig() != null)
sb.append("MetricsOutputConfig: ").append(getMetricsOutputConfig()).append(",");
if (getMetricAttributionArn() != null)
sb.append("MetricAttributionArn: ").append(getMetricAttributionArn());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateMetricAttributionRequest == false)
return false;
UpdateMetricAttributionRequest other = (UpdateMetricAttributionRequest) obj;
if (other.getAddMetrics() == null ^ this.getAddMetrics() == null)
return false;
if (other.getAddMetrics() != null && other.getAddMetrics().equals(this.getAddMetrics()) == false)
return false;
if (other.getRemoveMetrics() == null ^ this.getRemoveMetrics() == null)
return false;
if (other.getRemoveMetrics() != null && other.getRemoveMetrics().equals(this.getRemoveMetrics()) == false)
return false;
if (other.getMetricsOutputConfig() == null ^ this.getMetricsOutputConfig() == null)
return false;
if (other.getMetricsOutputConfig() != null && other.getMetricsOutputConfig().equals(this.getMetricsOutputConfig()) == false)
return false;
if (other.getMetricAttributionArn() == null ^ this.getMetricAttributionArn() == null)
return false;
if (other.getMetricAttributionArn() != null && other.getMetricAttributionArn().equals(this.getMetricAttributionArn()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAddMetrics() == null) ? 0 : getAddMetrics().hashCode());
hashCode = prime * hashCode + ((getRemoveMetrics() == null) ? 0 : getRemoveMetrics().hashCode());
hashCode = prime * hashCode + ((getMetricsOutputConfig() == null) ? 0 : getMetricsOutputConfig().hashCode());
hashCode = prime * hashCode + ((getMetricAttributionArn() == null) ? 0 : getMetricAttributionArn().hashCode());
return hashCode;
}
@Override
public UpdateMetricAttributionRequest clone() {
return (UpdateMetricAttributionRequest) super.clone();
}
}