/* * 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.chimesdkidentity.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *

* Creates an Amazon Chime SDK messaging AppInstance under an AWS * account. Only SDK messaging customers use this API. * CreateAppInstance supports idempotency behavior as described in * the AWS API Standard. *

*

* identity *

*/ public class CreateAppInstanceRequest extends AmazonWebServiceRequest implements Serializable { /** *

* The name of the AppInstance. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [ * -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*
*/ private String name; /** *

* The metadata of the AppInstance. Limited to a 1KB string in * UTF-8. *

*

* Constraints:
* Length: 0 - 1024
* Pattern: .*
*/ private String metadata; /** *

* The unique ID of the request. Use different tokens to create different * AppInstances. *

*

* Constraints:
* Length: 2 - 64
* Pattern: [-_a-zA-Z0-9]*
*/ private String clientRequestToken; /** *

* Tags assigned to the AppInstance. *

*/ private java.util.List tags; /** *

* The name of the AppInstance. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [ * -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*
* * @return

* The name of the AppInstance. *

*/ public String getName() { return name; } /** *

* The name of the AppInstance. *

*

* Constraints:
* Length: 1 - 256
* Pattern: [ * -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*
* * @param name

* The name of the AppInstance. *

*/ public void setName(String name) { this.name = name; } /** *

* The name of the AppInstance. *

*

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

* Constraints:
* Length: 1 - 256
* Pattern: [ * -\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]*
* * @param name

* The name of the AppInstance. *

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

* The metadata of the AppInstance. Limited to a 1KB string in * UTF-8. *

*

* Constraints:
* Length: 0 - 1024
* Pattern: .*
* * @return

* The metadata of the AppInstance. Limited to a 1KB * string in UTF-8. *

*/ public String getMetadata() { return metadata; } /** *

* The metadata of the AppInstance. Limited to a 1KB string in * UTF-8. *

*

* Constraints:
* Length: 0 - 1024
* Pattern: .*
* * @param metadata

* The metadata of the AppInstance. Limited to a 1KB * string in UTF-8. *

*/ public void setMetadata(String metadata) { this.metadata = metadata; } /** *

* The metadata of the AppInstance. Limited to a 1KB string in * UTF-8. *

*

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

* Constraints:
* Length: 0 - 1024
* Pattern: .*
* * @param metadata

* The metadata of the AppInstance. Limited to a 1KB * string in UTF-8. *

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

* The unique ID of the request. Use different tokens to create different * AppInstances. *

*

* Constraints:
* Length: 2 - 64
* Pattern: [-_a-zA-Z0-9]*
* * @return

* The unique ID of the request. Use different tokens to create * different AppInstances. *

*/ public String getClientRequestToken() { return clientRequestToken; } /** *

* The unique ID of the request. Use different tokens to create different * AppInstances. *

*

* Constraints:
* Length: 2 - 64
* Pattern: [-_a-zA-Z0-9]*
* * @param clientRequestToken

* The unique ID of the request. Use different tokens to create * different AppInstances. *

*/ public void setClientRequestToken(String clientRequestToken) { this.clientRequestToken = clientRequestToken; } /** *

* The unique ID of the request. Use different tokens to create different * AppInstances. *

*

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

* Constraints:
* Length: 2 - 64
* Pattern: [-_a-zA-Z0-9]*
* * @param clientRequestToken

* The unique ID of the request. Use different tokens to create * different AppInstances. *

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

* Tags assigned to the AppInstance. *

* * @return

* Tags assigned to the AppInstance. *

*/ public java.util.List getTags() { return tags; } /** *

* Tags assigned to the AppInstance. *

* * @param tags

* Tags assigned to the AppInstance. *

*/ public void setTags(java.util.Collection tags) { if (tags == null) { this.tags = null; return; } this.tags = new java.util.ArrayList(tags); } /** *

* Tags assigned to the AppInstance. *

*

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

* Tags assigned to the AppInstance. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateAppInstanceRequest withTags(Tag... tags) { if (getTags() == null) { this.tags = new java.util.ArrayList(tags.length); } for (Tag value : tags) { this.tags.add(value); } return this; } /** *

* Tags assigned to the AppInstance. *

*

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

* Tags assigned to the AppInstance. *

* @return A reference to this updated object so that method calls can be * chained together. */ public CreateAppInstanceRequest withTags(java.util.Collection tags) { setTags(tags); 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 (getName() != null) sb.append("Name: " + getName() + ","); if (getMetadata() != null) sb.append("Metadata: " + getMetadata() + ","); if (getClientRequestToken() != null) sb.append("ClientRequestToken: " + getClientRequestToken() + ","); if (getTags() != null) sb.append("Tags: " + getTags()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getMetadata() == null) ? 0 : getMetadata().hashCode()); hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateAppInstanceRequest == false) return false; CreateAppInstanceRequest other = (CreateAppInstanceRequest) obj; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getMetadata() == null ^ this.getMetadata() == null) return false; if (other.getMetadata() != null && other.getMetadata().equals(this.getMetadata()) == false) return false; if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) return false; if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } }