com.amazonaws.services.simplesystemsmanagement.model.UpdateOpsMetadataRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ssm 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.simplesystemsmanagement.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 UpdateOpsMetadataRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the OpsMetadata Object to update.
*
*/
private String opsMetadataArn;
/**
*
* Metadata to add to an OpsMetadata object.
*
*/
private java.util.Map metadataToUpdate;
/**
*
* The metadata keys to delete from the OpsMetadata object.
*
*/
private com.amazonaws.internal.SdkInternalList keysToDelete;
/**
*
* The Amazon Resource Name (ARN) of the OpsMetadata Object to update.
*
*
* @param opsMetadataArn
* The Amazon Resource Name (ARN) of the OpsMetadata Object to update.
*/
public void setOpsMetadataArn(String opsMetadataArn) {
this.opsMetadataArn = opsMetadataArn;
}
/**
*
* The Amazon Resource Name (ARN) of the OpsMetadata Object to update.
*
*
* @return The Amazon Resource Name (ARN) of the OpsMetadata Object to update.
*/
public String getOpsMetadataArn() {
return this.opsMetadataArn;
}
/**
*
* The Amazon Resource Name (ARN) of the OpsMetadata Object to update.
*
*
* @param opsMetadataArn
* The Amazon Resource Name (ARN) of the OpsMetadata Object to update.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpsMetadataRequest withOpsMetadataArn(String opsMetadataArn) {
setOpsMetadataArn(opsMetadataArn);
return this;
}
/**
*
* Metadata to add to an OpsMetadata object.
*
*
* @return Metadata to add to an OpsMetadata object.
*/
public java.util.Map getMetadataToUpdate() {
return metadataToUpdate;
}
/**
*
* Metadata to add to an OpsMetadata object.
*
*
* @param metadataToUpdate
* Metadata to add to an OpsMetadata object.
*/
public void setMetadataToUpdate(java.util.Map metadataToUpdate) {
this.metadataToUpdate = metadataToUpdate;
}
/**
*
* Metadata to add to an OpsMetadata object.
*
*
* @param metadataToUpdate
* Metadata to add to an OpsMetadata object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpsMetadataRequest withMetadataToUpdate(java.util.Map metadataToUpdate) {
setMetadataToUpdate(metadataToUpdate);
return this;
}
/**
* Add a single MetadataToUpdate entry
*
* @see UpdateOpsMetadataRequest#withMetadataToUpdate
* @returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpsMetadataRequest addMetadataToUpdateEntry(String key, MetadataValue value) {
if (null == this.metadataToUpdate) {
this.metadataToUpdate = new java.util.HashMap();
}
if (this.metadataToUpdate.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.metadataToUpdate.put(key, value);
return this;
}
/**
* Removes all the entries added into MetadataToUpdate.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpsMetadataRequest clearMetadataToUpdateEntries() {
this.metadataToUpdate = null;
return this;
}
/**
*
* The metadata keys to delete from the OpsMetadata object.
*
*
* @return The metadata keys to delete from the OpsMetadata object.
*/
public java.util.List getKeysToDelete() {
if (keysToDelete == null) {
keysToDelete = new com.amazonaws.internal.SdkInternalList();
}
return keysToDelete;
}
/**
*
* The metadata keys to delete from the OpsMetadata object.
*
*
* @param keysToDelete
* The metadata keys to delete from the OpsMetadata object.
*/
public void setKeysToDelete(java.util.Collection keysToDelete) {
if (keysToDelete == null) {
this.keysToDelete = null;
return;
}
this.keysToDelete = new com.amazonaws.internal.SdkInternalList(keysToDelete);
}
/**
*
* The metadata keys to delete from the OpsMetadata object.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setKeysToDelete(java.util.Collection)} or {@link #withKeysToDelete(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param keysToDelete
* The metadata keys to delete from the OpsMetadata object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpsMetadataRequest withKeysToDelete(String... keysToDelete) {
if (this.keysToDelete == null) {
setKeysToDelete(new com.amazonaws.internal.SdkInternalList(keysToDelete.length));
}
for (String ele : keysToDelete) {
this.keysToDelete.add(ele);
}
return this;
}
/**
*
* The metadata keys to delete from the OpsMetadata object.
*
*
* @param keysToDelete
* The metadata keys to delete from the OpsMetadata object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpsMetadataRequest withKeysToDelete(java.util.Collection keysToDelete) {
setKeysToDelete(keysToDelete);
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 (getOpsMetadataArn() != null)
sb.append("OpsMetadataArn: ").append(getOpsMetadataArn()).append(",");
if (getMetadataToUpdate() != null)
sb.append("MetadataToUpdate: ").append(getMetadataToUpdate()).append(",");
if (getKeysToDelete() != null)
sb.append("KeysToDelete: ").append(getKeysToDelete());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateOpsMetadataRequest == false)
return false;
UpdateOpsMetadataRequest other = (UpdateOpsMetadataRequest) obj;
if (other.getOpsMetadataArn() == null ^ this.getOpsMetadataArn() == null)
return false;
if (other.getOpsMetadataArn() != null && other.getOpsMetadataArn().equals(this.getOpsMetadataArn()) == false)
return false;
if (other.getMetadataToUpdate() == null ^ this.getMetadataToUpdate() == null)
return false;
if (other.getMetadataToUpdate() != null && other.getMetadataToUpdate().equals(this.getMetadataToUpdate()) == false)
return false;
if (other.getKeysToDelete() == null ^ this.getKeysToDelete() == null)
return false;
if (other.getKeysToDelete() != null && other.getKeysToDelete().equals(this.getKeysToDelete()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getOpsMetadataArn() == null) ? 0 : getOpsMetadataArn().hashCode());
hashCode = prime * hashCode + ((getMetadataToUpdate() == null) ? 0 : getMetadataToUpdate().hashCode());
hashCode = prime * hashCode + ((getKeysToDelete() == null) ? 0 : getKeysToDelete().hashCode());
return hashCode;
}
@Override
public UpdateOpsMetadataRequest clone() {
return (UpdateOpsMetadataRequest) super.clone();
}
}