/* * Copyright 2010-2020 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.simpleemail.model; import java.io.Serializable; /** *

* Contains the dimension configuration to use when you publish email sending * events to Amazon CloudWatch. *

*

* For information about publishing email sending events to Amazon CloudWatch, * see the Amazon SES Developer Guide. *

*/ public class CloudWatchDimensionConfiguration implements Serializable { /** *

* The name of an Amazon CloudWatch dimension associated with an email * sending metric. The name must: *

* */ private String dimensionName; /** *

* The place where Amazon SES finds the value of a dimension to publish to * Amazon CloudWatch. If you want Amazon SES to use the message tags that * you specify using an X-SES-MESSAGE-TAGS header or a * parameter to the SendEmail/SendRawEmail API, * choose messageTag. If you want Amazon SES to use your own * email headers, choose emailHeader. *

*

* Constraints:
* Allowed Values: messageTag, emailHeader, linkTag */ private String dimensionValueSource; /** *

* The default value of the dimension that is published to Amazon CloudWatch * if you do not provide the value of the dimension when you send an email. * The default value must: *

* */ private String defaultDimensionValue; /** *

* The name of an Amazon CloudWatch dimension associated with an email * sending metric. The name must: *

* * * @return

* The name of an Amazon CloudWatch dimension associated with an * email sending metric. The name must: *

* */ public String getDimensionName() { return dimensionName; } /** *

* The name of an Amazon CloudWatch dimension associated with an email * sending metric. The name must: *

* * * @param dimensionName

* The name of an Amazon CloudWatch dimension associated with an * email sending metric. The name must: *

* */ public void setDimensionName(String dimensionName) { this.dimensionName = dimensionName; } /** *

* The name of an Amazon CloudWatch dimension associated with an email * sending metric. The name must: *

* *

* Returns a reference to this object so that method calls can be chained * together. * * @param dimensionName

* The name of an Amazon CloudWatch dimension associated with an * email sending metric. The name must: *

* * @return A reference to this updated object so that method calls can be * chained together. */ public CloudWatchDimensionConfiguration withDimensionName(String dimensionName) { this.dimensionName = dimensionName; return this; } /** *

* The place where Amazon SES finds the value of a dimension to publish to * Amazon CloudWatch. If you want Amazon SES to use the message tags that * you specify using an X-SES-MESSAGE-TAGS header or a * parameter to the SendEmail/SendRawEmail API, * choose messageTag. If you want Amazon SES to use your own * email headers, choose emailHeader. *

*

* Constraints:
* Allowed Values: messageTag, emailHeader, linkTag * * @return

* The place where Amazon SES finds the value of a dimension to * publish to Amazon CloudWatch. If you want Amazon SES to use the * message tags that you specify using an * X-SES-MESSAGE-TAGS header or a parameter to the * SendEmail/SendRawEmail API, choose * messageTag. If you want Amazon SES to use your own * email headers, choose emailHeader. *

* @see DimensionValueSource */ public String getDimensionValueSource() { return dimensionValueSource; } /** *

* The place where Amazon SES finds the value of a dimension to publish to * Amazon CloudWatch. If you want Amazon SES to use the message tags that * you specify using an X-SES-MESSAGE-TAGS header or a * parameter to the SendEmail/SendRawEmail API, * choose messageTag. If you want Amazon SES to use your own * email headers, choose emailHeader. *

*

* Constraints:
* Allowed Values: messageTag, emailHeader, linkTag * * @param dimensionValueSource

* The place where Amazon SES finds the value of a dimension to * publish to Amazon CloudWatch. If you want Amazon SES to use * the message tags that you specify using an * X-SES-MESSAGE-TAGS header or a parameter to the * SendEmail/SendRawEmail API, choose * messageTag. If you want Amazon SES to use your * own email headers, choose emailHeader. *

* @see DimensionValueSource */ public void setDimensionValueSource(String dimensionValueSource) { this.dimensionValueSource = dimensionValueSource; } /** *

* The place where Amazon SES finds the value of a dimension to publish to * Amazon CloudWatch. If you want Amazon SES to use the message tags that * you specify using an X-SES-MESSAGE-TAGS header or a * parameter to the SendEmail/SendRawEmail API, * choose messageTag. If you want Amazon SES to use your own * email headers, choose emailHeader. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: messageTag, emailHeader, linkTag * * @param dimensionValueSource

* The place where Amazon SES finds the value of a dimension to * publish to Amazon CloudWatch. If you want Amazon SES to use * the message tags that you specify using an * X-SES-MESSAGE-TAGS header or a parameter to the * SendEmail/SendRawEmail API, choose * messageTag. If you want Amazon SES to use your * own email headers, choose emailHeader. *

* @return A reference to this updated object so that method calls can be * chained together. * @see DimensionValueSource */ public CloudWatchDimensionConfiguration withDimensionValueSource(String dimensionValueSource) { this.dimensionValueSource = dimensionValueSource; return this; } /** *

* The place where Amazon SES finds the value of a dimension to publish to * Amazon CloudWatch. If you want Amazon SES to use the message tags that * you specify using an X-SES-MESSAGE-TAGS header or a * parameter to the SendEmail/SendRawEmail API, * choose messageTag. If you want Amazon SES to use your own * email headers, choose emailHeader. *

*

* Constraints:
* Allowed Values: messageTag, emailHeader, linkTag * * @param dimensionValueSource

* The place where Amazon SES finds the value of a dimension to * publish to Amazon CloudWatch. If you want Amazon SES to use * the message tags that you specify using an * X-SES-MESSAGE-TAGS header or a parameter to the * SendEmail/SendRawEmail API, choose * messageTag. If you want Amazon SES to use your * own email headers, choose emailHeader. *

* @see DimensionValueSource */ public void setDimensionValueSource(DimensionValueSource dimensionValueSource) { this.dimensionValueSource = dimensionValueSource.toString(); } /** *

* The place where Amazon SES finds the value of a dimension to publish to * Amazon CloudWatch. If you want Amazon SES to use the message tags that * you specify using an X-SES-MESSAGE-TAGS header or a * parameter to the SendEmail/SendRawEmail API, * choose messageTag. If you want Amazon SES to use your own * email headers, choose emailHeader. *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: messageTag, emailHeader, linkTag * * @param dimensionValueSource

* The place where Amazon SES finds the value of a dimension to * publish to Amazon CloudWatch. If you want Amazon SES to use * the message tags that you specify using an * X-SES-MESSAGE-TAGS header or a parameter to the * SendEmail/SendRawEmail API, choose * messageTag. If you want Amazon SES to use your * own email headers, choose emailHeader. *

* @return A reference to this updated object so that method calls can be * chained together. * @see DimensionValueSource */ public CloudWatchDimensionConfiguration withDimensionValueSource( DimensionValueSource dimensionValueSource) { this.dimensionValueSource = dimensionValueSource.toString(); return this; } /** *

* The default value of the dimension that is published to Amazon CloudWatch * if you do not provide the value of the dimension when you send an email. * The default value must: *

* * * @return

* The default value of the dimension that is published to Amazon * CloudWatch if you do not provide the value of the dimension when * you send an email. The default value must: *

* */ public String getDefaultDimensionValue() { return defaultDimensionValue; } /** *

* The default value of the dimension that is published to Amazon CloudWatch * if you do not provide the value of the dimension when you send an email. * The default value must: *

* * * @param defaultDimensionValue

* The default value of the dimension that is published to Amazon * CloudWatch if you do not provide the value of the dimension * when you send an email. The default value must: *

* */ public void setDefaultDimensionValue(String defaultDimensionValue) { this.defaultDimensionValue = defaultDimensionValue; } /** *

* The default value of the dimension that is published to Amazon CloudWatch * if you do not provide the value of the dimension when you send an email. * The default value must: *

* *

* Returns a reference to this object so that method calls can be chained * together. * * @param defaultDimensionValue

* The default value of the dimension that is published to Amazon * CloudWatch if you do not provide the value of the dimension * when you send an email. The default value must: *

* * @return A reference to this updated object so that method calls can be * chained together. */ public CloudWatchDimensionConfiguration withDefaultDimensionValue(String defaultDimensionValue) { this.defaultDimensionValue = defaultDimensionValue; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDimensionName() != null) sb.append("DimensionName: " + getDimensionName() + ","); if (getDimensionValueSource() != null) sb.append("DimensionValueSource: " + getDimensionValueSource() + ","); if (getDefaultDimensionValue() != null) sb.append("DefaultDimensionValue: " + getDefaultDimensionValue()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDimensionName() == null) ? 0 : getDimensionName().hashCode()); hashCode = prime * hashCode + ((getDimensionValueSource() == null) ? 0 : getDimensionValueSource().hashCode()); hashCode = prime * hashCode + ((getDefaultDimensionValue() == null) ? 0 : getDefaultDimensionValue().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CloudWatchDimensionConfiguration == false) return false; CloudWatchDimensionConfiguration other = (CloudWatchDimensionConfiguration) obj; if (other.getDimensionName() == null ^ this.getDimensionName() == null) return false; if (other.getDimensionName() != null && other.getDimensionName().equals(this.getDimensionName()) == false) return false; if (other.getDimensionValueSource() == null ^ this.getDimensionValueSource() == null) return false; if (other.getDimensionValueSource() != null && other.getDimensionValueSource().equals(this.getDimensionValueSource()) == false) return false; if (other.getDefaultDimensionValue() == null ^ this.getDefaultDimensionValue() == null) return false; if (other.getDefaultDimensionValue() != null && other.getDefaultDimensionValue().equals(this.getDefaultDimensionValue()) == false) return false; return true; } }