com.amazonaws.services.iamrolesanywhere.model.CreateProfileRequest 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 CreateProfileRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* Used to determine if a custom role session name will be accepted in a temporary credential request.
*
*/
private Boolean acceptRoleSessionName;
/**
*
* Used to determine how long sessions vended using this profile are valid for. See the Expiration
* section of the CreateSession API documentation page for more details. In requests, if this value is not provided, the
* default value will be 3600.
*
*/
private Integer durationSeconds;
/**
*
* Specifies whether the profile is enabled.
*
*/
private Boolean enabled;
/**
*
* A list of managed policy ARNs that apply to the vended session credentials.
*
*/
private java.util.List managedPolicyArns;
/**
*
* The name of the profile.
*
*/
private String name;
/**
*
* Specifies whether instance properties are required in temporary credential requests with this profile.
*
*/
private Boolean requireInstanceProperties;
/**
*
* A list of IAM roles that this profile can assume in a temporary credential request.
*
*/
private java.util.List roleArns;
/**
*
* A session policy that applies to the trust boundary of the vended session credentials.
*
*/
private String sessionPolicy;
/**
*
* The tags to attach to the profile.
*
*/
private java.util.List tags;
/**
*
* Used to determine if a custom role session name will be accepted in a temporary credential request.
*
*
* @param acceptRoleSessionName
* Used to determine if a custom role session name will be accepted in a temporary credential request.
*/
public void setAcceptRoleSessionName(Boolean acceptRoleSessionName) {
this.acceptRoleSessionName = acceptRoleSessionName;
}
/**
*
* Used to determine if a custom role session name will be accepted in a temporary credential request.
*
*
* @return Used to determine if a custom role session name will be accepted in a temporary credential request.
*/
public Boolean getAcceptRoleSessionName() {
return this.acceptRoleSessionName;
}
/**
*
* Used to determine if a custom role session name will be accepted in a temporary credential request.
*
*
* @param acceptRoleSessionName
* Used to determine if a custom role session name will be accepted in a temporary credential request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withAcceptRoleSessionName(Boolean acceptRoleSessionName) {
setAcceptRoleSessionName(acceptRoleSessionName);
return this;
}
/**
*
* Used to determine if a custom role session name will be accepted in a temporary credential request.
*
*
* @return Used to determine if a custom role session name will be accepted in a temporary credential request.
*/
public Boolean isAcceptRoleSessionName() {
return this.acceptRoleSessionName;
}
/**
*
* Used to determine how long sessions vended using this profile are valid for. See the Expiration
* section of the CreateSession API documentation page for more details. In requests, if this value is not provided, the
* default value will be 3600.
*
*
* @param durationSeconds
* Used to determine how long sessions vended using this profile are valid for. See the
* Expiration
section of the CreateSession API documentation page for more details. In requests, if this value is not provided,
* the default value will be 3600.
*/
public void setDurationSeconds(Integer durationSeconds) {
this.durationSeconds = durationSeconds;
}
/**
*
* Used to determine how long sessions vended using this profile are valid for. See the Expiration
* section of the CreateSession API documentation page for more details. In requests, if this value is not provided, the
* default value will be 3600.
*
*
* @return Used to determine how long sessions vended using this profile are valid for. See the
* Expiration
section of the CreateSession API documentation page for more details. In requests, if this value is not provided,
* the default value will be 3600.
*/
public Integer getDurationSeconds() {
return this.durationSeconds;
}
/**
*
* Used to determine how long sessions vended using this profile are valid for. See the Expiration
* section of the CreateSession API documentation page for more details. In requests, if this value is not provided, the
* default value will be 3600.
*
*
* @param durationSeconds
* Used to determine how long sessions vended using this profile are valid for. See the
* Expiration
section of the CreateSession API documentation page for more details. In requests, if this value is not provided,
* the default value will be 3600.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withDurationSeconds(Integer durationSeconds) {
setDurationSeconds(durationSeconds);
return this;
}
/**
*
* Specifies whether the profile is enabled.
*
*
* @param enabled
* Specifies whether the profile is enabled.
*/
public void setEnabled(Boolean enabled) {
this.enabled = enabled;
}
/**
*
* Specifies whether the profile is enabled.
*
*
* @return Specifies whether the profile is enabled.
*/
public Boolean getEnabled() {
return this.enabled;
}
/**
*
* Specifies whether the profile is enabled.
*
*
* @param enabled
* Specifies whether the profile is enabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withEnabled(Boolean enabled) {
setEnabled(enabled);
return this;
}
/**
*
* Specifies whether the profile is enabled.
*
*
* @return Specifies whether the profile is enabled.
*/
public Boolean isEnabled() {
return this.enabled;
}
/**
*
* A list of managed policy ARNs that apply to the vended session credentials.
*
*
* @return A list of managed policy ARNs that apply to the vended session credentials.
*/
public java.util.List getManagedPolicyArns() {
return managedPolicyArns;
}
/**
*
* A list of managed policy ARNs that apply to the vended session credentials.
*
*
* @param managedPolicyArns
* A list of managed policy ARNs that apply to the vended session credentials.
*/
public void setManagedPolicyArns(java.util.Collection managedPolicyArns) {
if (managedPolicyArns == null) {
this.managedPolicyArns = null;
return;
}
this.managedPolicyArns = new java.util.ArrayList(managedPolicyArns);
}
/**
*
* A list of managed policy ARNs that apply to the vended session credentials.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setManagedPolicyArns(java.util.Collection)} or {@link #withManagedPolicyArns(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param managedPolicyArns
* A list of managed policy ARNs that apply to the vended session credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withManagedPolicyArns(String... managedPolicyArns) {
if (this.managedPolicyArns == null) {
setManagedPolicyArns(new java.util.ArrayList(managedPolicyArns.length));
}
for (String ele : managedPolicyArns) {
this.managedPolicyArns.add(ele);
}
return this;
}
/**
*
* A list of managed policy ARNs that apply to the vended session credentials.
*
*
* @param managedPolicyArns
* A list of managed policy ARNs that apply to the vended session credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withManagedPolicyArns(java.util.Collection managedPolicyArns) {
setManagedPolicyArns(managedPolicyArns);
return this;
}
/**
*
* The name of the profile.
*
*
* @param name
* The name of the profile.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the profile.
*
*
* @return The name of the profile.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the profile.
*
*
* @param name
* The name of the profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withName(String name) {
setName(name);
return this;
}
/**
*
* Specifies whether instance properties are required in temporary credential requests with this profile.
*
*
* @param requireInstanceProperties
* Specifies whether instance properties are required in temporary credential requests with this profile.
*/
public void setRequireInstanceProperties(Boolean requireInstanceProperties) {
this.requireInstanceProperties = requireInstanceProperties;
}
/**
*
* Specifies whether instance properties are required in temporary credential requests with this profile.
*
*
* @return Specifies whether instance properties are required in temporary credential requests with this profile.
*/
public Boolean getRequireInstanceProperties() {
return this.requireInstanceProperties;
}
/**
*
* Specifies whether instance properties are required in temporary credential requests with this profile.
*
*
* @param requireInstanceProperties
* Specifies whether instance properties are required in temporary credential requests with this profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withRequireInstanceProperties(Boolean requireInstanceProperties) {
setRequireInstanceProperties(requireInstanceProperties);
return this;
}
/**
*
* Specifies whether instance properties are required in temporary credential requests with this profile.
*
*
* @return Specifies whether instance properties are required in temporary credential requests with this profile.
*/
public Boolean isRequireInstanceProperties() {
return this.requireInstanceProperties;
}
/**
*
* A list of IAM roles that this profile can assume in a temporary credential request.
*
*
* @return A list of IAM roles that this profile can assume in a temporary credential request.
*/
public java.util.List getRoleArns() {
return roleArns;
}
/**
*
* A list of IAM roles that this profile can assume in a temporary credential request.
*
*
* @param roleArns
* A list of IAM roles that this profile can assume in a temporary credential request.
*/
public void setRoleArns(java.util.Collection roleArns) {
if (roleArns == null) {
this.roleArns = null;
return;
}
this.roleArns = new java.util.ArrayList(roleArns);
}
/**
*
* A list of IAM roles that this profile can assume in a temporary credential request.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setRoleArns(java.util.Collection)} or {@link #withRoleArns(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param roleArns
* A list of IAM roles that this profile can assume in a temporary credential request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withRoleArns(String... roleArns) {
if (this.roleArns == null) {
setRoleArns(new java.util.ArrayList(roleArns.length));
}
for (String ele : roleArns) {
this.roleArns.add(ele);
}
return this;
}
/**
*
* A list of IAM roles that this profile can assume in a temporary credential request.
*
*
* @param roleArns
* A list of IAM roles that this profile can assume in a temporary credential request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withRoleArns(java.util.Collection roleArns) {
setRoleArns(roleArns);
return this;
}
/**
*
* A session policy that applies to the trust boundary of the vended session credentials.
*
*
* @param sessionPolicy
* A session policy that applies to the trust boundary of the vended session credentials.
*/
public void setSessionPolicy(String sessionPolicy) {
this.sessionPolicy = sessionPolicy;
}
/**
*
* A session policy that applies to the trust boundary of the vended session credentials.
*
*
* @return A session policy that applies to the trust boundary of the vended session credentials.
*/
public String getSessionPolicy() {
return this.sessionPolicy;
}
/**
*
* A session policy that applies to the trust boundary of the vended session credentials.
*
*
* @param sessionPolicy
* A session policy that applies to the trust boundary of the vended session credentials.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withSessionPolicy(String sessionPolicy) {
setSessionPolicy(sessionPolicy);
return this;
}
/**
*
* The tags to attach to the profile.
*
*
* @return The tags to attach to the profile.
*/
public java.util.List getTags() {
return tags;
}
/**
*
* The tags to attach to the profile.
*
*
* @param tags
* The tags to attach to the profile.
*/
public void setTags(java.util.Collection tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new java.util.ArrayList(tags);
}
/**
*
* The tags to attach to the profile.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param tags
* The tags to attach to the profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new java.util.ArrayList(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
*
* The tags to attach to the profile.
*
*
* @param tags
* The tags to attach to the profile.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateProfileRequest withTags(java.util.Collection tags) {
setTags(tags);
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 (getAcceptRoleSessionName() != null)
sb.append("AcceptRoleSessionName: ").append(getAcceptRoleSessionName()).append(",");
if (getDurationSeconds() != null)
sb.append("DurationSeconds: ").append(getDurationSeconds()).append(",");
if (getEnabled() != null)
sb.append("Enabled: ").append(getEnabled()).append(",");
if (getManagedPolicyArns() != null)
sb.append("ManagedPolicyArns: ").append(getManagedPolicyArns()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getRequireInstanceProperties() != null)
sb.append("RequireInstanceProperties: ").append(getRequireInstanceProperties()).append(",");
if (getRoleArns() != null)
sb.append("RoleArns: ").append(getRoleArns()).append(",");
if (getSessionPolicy() != null)
sb.append("SessionPolicy: ").append(getSessionPolicy()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateProfileRequest == false)
return false;
CreateProfileRequest other = (CreateProfileRequest) obj;
if (other.getAcceptRoleSessionName() == null ^ this.getAcceptRoleSessionName() == null)
return false;
if (other.getAcceptRoleSessionName() != null && other.getAcceptRoleSessionName().equals(this.getAcceptRoleSessionName()) == false)
return false;
if (other.getDurationSeconds() == null ^ this.getDurationSeconds() == null)
return false;
if (other.getDurationSeconds() != null && other.getDurationSeconds().equals(this.getDurationSeconds()) == false)
return false;
if (other.getEnabled() == null ^ this.getEnabled() == null)
return false;
if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false)
return false;
if (other.getManagedPolicyArns() == null ^ this.getManagedPolicyArns() == null)
return false;
if (other.getManagedPolicyArns() != null && other.getManagedPolicyArns().equals(this.getManagedPolicyArns()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getRequireInstanceProperties() == null ^ this.getRequireInstanceProperties() == null)
return false;
if (other.getRequireInstanceProperties() != null && other.getRequireInstanceProperties().equals(this.getRequireInstanceProperties()) == false)
return false;
if (other.getRoleArns() == null ^ this.getRoleArns() == null)
return false;
if (other.getRoleArns() != null && other.getRoleArns().equals(this.getRoleArns()) == false)
return false;
if (other.getSessionPolicy() == null ^ this.getSessionPolicy() == null)
return false;
if (other.getSessionPolicy() != null && other.getSessionPolicy().equals(this.getSessionPolicy()) == 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;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAcceptRoleSessionName() == null) ? 0 : getAcceptRoleSessionName().hashCode());
hashCode = prime * hashCode + ((getDurationSeconds() == null) ? 0 : getDurationSeconds().hashCode());
hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
hashCode = prime * hashCode + ((getManagedPolicyArns() == null) ? 0 : getManagedPolicyArns().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getRequireInstanceProperties() == null) ? 0 : getRequireInstanceProperties().hashCode());
hashCode = prime * hashCode + ((getRoleArns() == null) ? 0 : getRoleArns().hashCode());
hashCode = prime * hashCode + ((getSessionPolicy() == null) ? 0 : getSessionPolicy().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public CreateProfileRequest clone() {
return (CreateProfileRequest) super.clone();
}
}