com.amazonaws.services.iamrolesanywhere.model.PutAttributeMappingRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-iamrolesanywhere 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.iamrolesanywhere.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 PutAttributeMappingRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
*
*/
private String certificateField;
/**
*
* A list of mapping entries for every supported specifier or sub-field.
*
*/
private java.util.List mappingRules;
/**
*
* The unique identifier of the profile.
*
*/
private String profileId;
/**
*
* Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
*
*
* @param certificateField
* Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
* @see CertificateField
*/
public void setCertificateField(String certificateField) {
this.certificateField = certificateField;
}
/**
*
* Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
*
*
* @return Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
* @see CertificateField
*/
public String getCertificateField() {
return this.certificateField;
}
/**
*
* Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
*
*
* @param certificateField
* Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CertificateField
*/
public PutAttributeMappingRequest withCertificateField(String certificateField) {
setCertificateField(certificateField);
return this;
}
/**
*
* Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
*
*
* @param certificateField
* Fields (x509Subject, x509Issuer and x509SAN) within X.509 certificates.
* @return Returns a reference to this object so that method calls can be chained together.
* @see CertificateField
*/
public PutAttributeMappingRequest withCertificateField(CertificateField certificateField) {
this.certificateField = certificateField.toString();
return this;
}
/**
*
* A list of mapping entries for every supported specifier or sub-field.
*
*
* @return A list of mapping entries for every supported specifier or sub-field.
*/
public java.util.List getMappingRules() {
return mappingRules;
}
/**
*
* A list of mapping entries for every supported specifier or sub-field.
*
*
* @param mappingRules
* A list of mapping entries for every supported specifier or sub-field.
*/
public void setMappingRules(java.util.Collection mappingRules) {
if (mappingRules == null) {
this.mappingRules = null;
return;
}
this.mappingRules = new java.util.ArrayList(mappingRules);
}
/**
*
* A list of mapping entries for every supported specifier or sub-field.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setMappingRules(java.util.Collection)} or {@link #withMappingRules(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param mappingRules
* A list of mapping entries for every supported specifier or sub-field.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutAttributeMappingRequest withMappingRules(MappingRule... mappingRules) {
if (this.mappingRules == null) {
setMappingRules(new java.util.ArrayList(mappingRules.length));
}
for (MappingRule ele : mappingRules) {
this.mappingRules.add(ele);
}
return this;
}
/**
*
* A list of mapping entries for every supported specifier or sub-field.
*
*
* @param mappingRules
* A list of mapping entries for every supported specifier or sub-field.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutAttributeMappingRequest withMappingRules(java.util.Collection mappingRules) {
setMappingRules(mappingRules);
return this;
}
/**
*
* The unique identifier of the profile.
*
*
* @param profileId
* The unique identifier of the profile.
*/
public void setProfileId(String profileId) {
this.profileId = profileId;
}
/**
*
* The unique identifier of the profile.
*
*
* @return The unique identifier of the profile.
*/
public String getProfileId() {
return this.profileId;
}
/**
*
* The unique identifier of the profile.
*
*
* @param profileId
* The unique identifier of the profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutAttributeMappingRequest withProfileId(String profileId) {
setProfileId(profileId);
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 (getCertificateField() != null)
sb.append("CertificateField: ").append(getCertificateField()).append(",");
if (getMappingRules() != null)
sb.append("MappingRules: ").append(getMappingRules()).append(",");
if (getProfileId() != null)
sb.append("ProfileId: ").append(getProfileId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof PutAttributeMappingRequest == false)
return false;
PutAttributeMappingRequest other = (PutAttributeMappingRequest) obj;
if (other.getCertificateField() == null ^ this.getCertificateField() == null)
return false;
if (other.getCertificateField() != null && other.getCertificateField().equals(this.getCertificateField()) == false)
return false;
if (other.getMappingRules() == null ^ this.getMappingRules() == null)
return false;
if (other.getMappingRules() != null && other.getMappingRules().equals(this.getMappingRules()) == false)
return false;
if (other.getProfileId() == null ^ this.getProfileId() == null)
return false;
if (other.getProfileId() != null && other.getProfileId().equals(this.getProfileId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getCertificateField() == null) ? 0 : getCertificateField().hashCode());
hashCode = prime * hashCode + ((getMappingRules() == null) ? 0 : getMappingRules().hashCode());
hashCode = prime * hashCode + ((getProfileId() == null) ? 0 : getProfileId().hashCode());
return hashCode;
}
@Override
public PutAttributeMappingRequest clone() {
return (PutAttributeMappingRequest) super.clone();
}
}