/* * Copyright 2018-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.iot.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* A map of key-value pairs containing the patterns that need to be replaced in a managed template job document schema. * You can use the description of each key as a guidance to specify the inputs during runtime when creating a job. *

* *

* documentParameters can only be used when creating jobs from Amazon Web Services managed templates. This * parameter can't be used with custom job templates or to create jobs from them. *

*
*/ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DocumentParameter implements Serializable, Cloneable, StructuredPojo { /** *

* Key of the map field containing the patterns that need to be replaced in a managed template job document schema. *

*/ private String key; /** *

* Description of the map field containing the patterns that need to be replaced in a managed template job document * schema. *

*/ private String description; /** *

* A regular expression of the patterns that need to be replaced in a managed template job document schema. *

*/ private String regex; /** *

* An example illustrating a pattern that need to be replaced in a managed template job document schema. *

*/ private String example; /** *

* Specifies whether a pattern that needs to be replaced in a managed template job document schema is optional or * required. *

*/ private Boolean optional; /** *

* Key of the map field containing the patterns that need to be replaced in a managed template job document schema. *

* * @param key * Key of the map field containing the patterns that need to be replaced in a managed template job document * schema. */ public void setKey(String key) { this.key = key; } /** *

* Key of the map field containing the patterns that need to be replaced in a managed template job document schema. *

* * @return Key of the map field containing the patterns that need to be replaced in a managed template job document * schema. */ public String getKey() { return this.key; } /** *

* Key of the map field containing the patterns that need to be replaced in a managed template job document schema. *

* * @param key * Key of the map field containing the patterns that need to be replaced in a managed template job document * schema. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentParameter withKey(String key) { setKey(key); return this; } /** *

* Description of the map field containing the patterns that need to be replaced in a managed template job document * schema. *

* * @param description * Description of the map field containing the patterns that need to be replaced in a managed template job * document schema. */ public void setDescription(String description) { this.description = description; } /** *

* Description of the map field containing the patterns that need to be replaced in a managed template job document * schema. *

* * @return Description of the map field containing the patterns that need to be replaced in a managed template job * document schema. */ public String getDescription() { return this.description; } /** *

* Description of the map field containing the patterns that need to be replaced in a managed template job document * schema. *

* * @param description * Description of the map field containing the patterns that need to be replaced in a managed template job * document schema. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentParameter withDescription(String description) { setDescription(description); return this; } /** *

* A regular expression of the patterns that need to be replaced in a managed template job document schema. *

* * @param regex * A regular expression of the patterns that need to be replaced in a managed template job document schema. */ public void setRegex(String regex) { this.regex = regex; } /** *

* A regular expression of the patterns that need to be replaced in a managed template job document schema. *

* * @return A regular expression of the patterns that need to be replaced in a managed template job document schema. */ public String getRegex() { return this.regex; } /** *

* A regular expression of the patterns that need to be replaced in a managed template job document schema. *

* * @param regex * A regular expression of the patterns that need to be replaced in a managed template job document schema. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentParameter withRegex(String regex) { setRegex(regex); return this; } /** *

* An example illustrating a pattern that need to be replaced in a managed template job document schema. *

* * @param example * An example illustrating a pattern that need to be replaced in a managed template job document schema. */ public void setExample(String example) { this.example = example; } /** *

* An example illustrating a pattern that need to be replaced in a managed template job document schema. *

* * @return An example illustrating a pattern that need to be replaced in a managed template job document schema. */ public String getExample() { return this.example; } /** *

* An example illustrating a pattern that need to be replaced in a managed template job document schema. *

* * @param example * An example illustrating a pattern that need to be replaced in a managed template job document schema. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentParameter withExample(String example) { setExample(example); return this; } /** *

* Specifies whether a pattern that needs to be replaced in a managed template job document schema is optional or * required. *

* * @param optional * Specifies whether a pattern that needs to be replaced in a managed template job document schema is * optional or required. */ public void setOptional(Boolean optional) { this.optional = optional; } /** *

* Specifies whether a pattern that needs to be replaced in a managed template job document schema is optional or * required. *

* * @return Specifies whether a pattern that needs to be replaced in a managed template job document schema is * optional or required. */ public Boolean getOptional() { return this.optional; } /** *

* Specifies whether a pattern that needs to be replaced in a managed template job document schema is optional or * required. *

* * @param optional * Specifies whether a pattern that needs to be replaced in a managed template job document schema is * optional or required. * @return Returns a reference to this object so that method calls can be chained together. */ public DocumentParameter withOptional(Boolean optional) { setOptional(optional); return this; } /** *

* Specifies whether a pattern that needs to be replaced in a managed template job document schema is optional or * required. *

* * @return Specifies whether a pattern that needs to be replaced in a managed template job document schema is * optional or required. */ public Boolean isOptional() { return this.optional; } /** * 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 (getKey() != null) sb.append("Key: ").append(getKey()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getRegex() != null) sb.append("Regex: ").append(getRegex()).append(","); if (getExample() != null) sb.append("Example: ").append(getExample()).append(","); if (getOptional() != null) sb.append("Optional: ").append(getOptional()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DocumentParameter == false) return false; DocumentParameter other = (DocumentParameter) obj; if (other.getKey() == null ^ this.getKey() == null) return false; if (other.getKey() != null && other.getKey().equals(this.getKey()) == 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.getRegex() == null ^ this.getRegex() == null) return false; if (other.getRegex() != null && other.getRegex().equals(this.getRegex()) == false) return false; if (other.getExample() == null ^ this.getExample() == null) return false; if (other.getExample() != null && other.getExample().equals(this.getExample()) == false) return false; if (other.getOptional() == null ^ this.getOptional() == null) return false; if (other.getOptional() != null && other.getOptional().equals(this.getOptional()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getRegex() == null) ? 0 : getRegex().hashCode()); hashCode = prime * hashCode + ((getExample() == null) ? 0 : getExample().hashCode()); hashCode = prime * hashCode + ((getOptional() == null) ? 0 : getOptional().hashCode()); return hashCode; } @Override public DocumentParameter clone() { try { return (DocumentParameter) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.iot.model.transform.DocumentParameterMarshaller.getInstance().marshall(this, protocolMarshaller); } }