/* * 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.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 UpdateProfileRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The number of seconds the vended session credentials are valid for. *
*/ private Integer durationSeconds; /** ** A list of managed policy ARNs that apply to the vended session credentials. *
*/ private java.util.List* The name of the profile. *
*/ private String name; /** ** The unique identifier of the profile. *
*/ private String profileId; /** ** A list of IAM roles that this profile can assume in a temporary credential request. *
*/ private java.util.List* A session policy that applies to the trust boundary of the vended session credentials. *
*/ private String sessionPolicy; /** ** The number of seconds the vended session credentials are valid for. *
* * @param durationSeconds * The number of seconds the vended session credentials are valid for. */ public void setDurationSeconds(Integer durationSeconds) { this.durationSeconds = durationSeconds; } /** ** The number of seconds the vended session credentials are valid for. *
* * @return The number of seconds the vended session credentials are valid for. */ public Integer getDurationSeconds() { return this.durationSeconds; } /** ** The number of seconds the vended session credentials are valid for. *
* * @param durationSeconds * The number of seconds the vended session credentials are valid for. * @return Returns a reference to this object so that method calls can be chained together. */ public UpdateProfileRequest withDurationSeconds(Integer durationSeconds) { setDurationSeconds(durationSeconds); return this; } /** ** 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* 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* 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 UpdateProfileRequest withManagedPolicyArns(String... managedPolicyArns) { if (this.managedPolicyArns == null) { setManagedPolicyArns(new java.util.ArrayList* 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 UpdateProfileRequest withManagedPolicyArns(java.util.Collection* 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 UpdateProfileRequest withName(String name) { setName(name); 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 UpdateProfileRequest withProfileId(String profileId) { setProfileId(profileId); return this; } /** ** 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* 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* 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 UpdateProfileRequest withRoleArns(String... roleArns) { if (this.roleArns == null) { setRoleArns(new java.util.ArrayList* 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 UpdateProfileRequest withRoleArns(java.util.Collection* 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 UpdateProfileRequest withSessionPolicy(String sessionPolicy) { setSessionPolicy(sessionPolicy); 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 (getDurationSeconds() != null) sb.append("DurationSeconds: ").append(getDurationSeconds()).append(","); if (getManagedPolicyArns() != null) sb.append("ManagedPolicyArns: ").append(getManagedPolicyArns()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getProfileId() != null) sb.append("ProfileId: ").append(getProfileId()).append(","); if (getRoleArns() != null) sb.append("RoleArns: ").append(getRoleArns()).append(","); if (getSessionPolicy() != null) sb.append("SessionPolicy: ").append(getSessionPolicy()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof UpdateProfileRequest == false) return false; UpdateProfileRequest other = (UpdateProfileRequest) obj; if (other.getDurationSeconds() == null ^ this.getDurationSeconds() == null) return false; if (other.getDurationSeconds() != null && other.getDurationSeconds().equals(this.getDurationSeconds()) == 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.getProfileId() == null ^ this.getProfileId() == null) return false; if (other.getProfileId() != null && other.getProfileId().equals(this.getProfileId()) == 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; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDurationSeconds() == null) ? 0 : getDurationSeconds().hashCode()); hashCode = prime * hashCode + ((getManagedPolicyArns() == null) ? 0 : getManagedPolicyArns().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getProfileId() == null) ? 0 : getProfileId().hashCode()); hashCode = prime * hashCode + ((getRoleArns() == null) ? 0 : getRoleArns().hashCode()); hashCode = prime * hashCode + ((getSessionPolicy() == null) ? 0 : getSessionPolicy().hashCode()); return hashCode; } @Override public UpdateProfileRequest clone() { return (UpdateProfileRequest) super.clone(); } }