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

* Stores information about a message status. *

*/ public class ChannelMessageStatusStructure implements Serializable { /** *

* The message status value. *

*

* Constraints:
* Allowed Values: SENT, PENDING, FAILED, DENIED */ private String value; /** *

* Contains more details about the message status. *

*

* Constraints:
* Length: 0 - 256
* Pattern: [\s\S]*
*/ private String detail; /** *

* The message status value. *

*

* Constraints:
* Allowed Values: SENT, PENDING, FAILED, DENIED * * @return

* The message status value. *

* @see ChannelMessageStatus */ public String getValue() { return value; } /** *

* The message status value. *

*

* Constraints:
* Allowed Values: SENT, PENDING, FAILED, DENIED * * @param value

* The message status value. *

* @see ChannelMessageStatus */ public void setValue(String value) { this.value = value; } /** *

* The message status value. *

*

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

* Constraints:
* Allowed Values: SENT, PENDING, FAILED, DENIED * * @param value

* The message status value. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelMessageStatus */ public ChannelMessageStatusStructure withValue(String value) { this.value = value; return this; } /** *

* The message status value. *

*

* Constraints:
* Allowed Values: SENT, PENDING, FAILED, DENIED * * @param value

* The message status value. *

* @see ChannelMessageStatus */ public void setValue(ChannelMessageStatus value) { this.value = value.toString(); } /** *

* The message status value. *

*

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

* Constraints:
* Allowed Values: SENT, PENDING, FAILED, DENIED * * @param value

* The message status value. *

* @return A reference to this updated object so that method calls can be * chained together. * @see ChannelMessageStatus */ public ChannelMessageStatusStructure withValue(ChannelMessageStatus value) { this.value = value.toString(); return this; } /** *

* Contains more details about the message status. *

*

* Constraints:
* Length: 0 - 256
* Pattern: [\s\S]*
* * @return

* Contains more details about the message status. *

*/ public String getDetail() { return detail; } /** *

* Contains more details about the message status. *

*

* Constraints:
* Length: 0 - 256
* Pattern: [\s\S]*
* * @param detail

* Contains more details about the message status. *

*/ public void setDetail(String detail) { this.detail = detail; } /** *

* Contains more details about the message status. *

*

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

* Constraints:
* Length: 0 - 256
* Pattern: [\s\S]*
* * @param detail

* Contains more details about the message status. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ChannelMessageStatusStructure withDetail(String detail) { this.detail = detail; 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 (getValue() != null) sb.append("Value: " + getValue() + ","); if (getDetail() != null) sb.append("Detail: " + getDetail()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getValue() == null) ? 0 : getValue().hashCode()); hashCode = prime * hashCode + ((getDetail() == null) ? 0 : getDetail().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ChannelMessageStatusStructure == false) return false; ChannelMessageStatusStructure other = (ChannelMessageStatusStructure) obj; if (other.getValue() == null ^ this.getValue() == null) return false; if (other.getValue() != null && other.getValue().equals(this.getValue()) == false) return false; if (other.getDetail() == null ^ this.getDetail() == null) return false; if (other.getDetail() != null && other.getDetail().equals(this.getDetail()) == false) return false; return true; } }