com.amazonaws.services.verifiedpermissions.model.UpdateOpenIdConnectAccessTokenConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-verifiedpermissions 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.verifiedpermissions.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* The configuration of an OpenID Connect (OIDC) identity source for handling access token claims. Contains the claim
* that you want to identify as the principal in an authorization request, and the values of the aud
claim,
* or audiences, that you want to accept.
*
*
* This data type is part of a UpdateOpenIdConnectTokenSelection structure, which is a parameter to UpdateIdentitySource.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateOpenIdConnectAccessTokenConfiguration implements Serializable, Cloneable, StructuredPojo {
/**
*
* The claim that determines the principal in OIDC access tokens. For example, sub
.
*
*/
private String principalIdClaim;
/**
*
* The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
*
*/
private java.util.List audiences;
/**
*
* The claim that determines the principal in OIDC access tokens. For example, sub
.
*
*
* @param principalIdClaim
* The claim that determines the principal in OIDC access tokens. For example, sub
.
*/
public void setPrincipalIdClaim(String principalIdClaim) {
this.principalIdClaim = principalIdClaim;
}
/**
*
* The claim that determines the principal in OIDC access tokens. For example, sub
.
*
*
* @return The claim that determines the principal in OIDC access tokens. For example, sub
.
*/
public String getPrincipalIdClaim() {
return this.principalIdClaim;
}
/**
*
* The claim that determines the principal in OIDC access tokens. For example, sub
.
*
*
* @param principalIdClaim
* The claim that determines the principal in OIDC access tokens. For example, sub
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpenIdConnectAccessTokenConfiguration withPrincipalIdClaim(String principalIdClaim) {
setPrincipalIdClaim(principalIdClaim);
return this;
}
/**
*
* The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
*
*
* @return The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
*/
public java.util.List getAudiences() {
return audiences;
}
/**
*
* The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
*
*
* @param audiences
* The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
*/
public void setAudiences(java.util.Collection audiences) {
if (audiences == null) {
this.audiences = null;
return;
}
this.audiences = new java.util.ArrayList(audiences);
}
/**
*
* The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setAudiences(java.util.Collection)} or {@link #withAudiences(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param audiences
* The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpenIdConnectAccessTokenConfiguration withAudiences(String... audiences) {
if (this.audiences == null) {
setAudiences(new java.util.ArrayList(audiences.length));
}
for (String ele : audiences) {
this.audiences.add(ele);
}
return this;
}
/**
*
* The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
*
*
* @param audiences
* The access token aud
claim values that you want to accept in your policy store. For example,
* https://myapp.example.com, https://myapp2.example.com
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateOpenIdConnectAccessTokenConfiguration withAudiences(java.util.Collection audiences) {
setAudiences(audiences);
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 (getPrincipalIdClaim() != null)
sb.append("PrincipalIdClaim: ").append("***Sensitive Data Redacted***").append(",");
if (getAudiences() != null)
sb.append("Audiences: ").append(getAudiences());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateOpenIdConnectAccessTokenConfiguration == false)
return false;
UpdateOpenIdConnectAccessTokenConfiguration other = (UpdateOpenIdConnectAccessTokenConfiguration) obj;
if (other.getPrincipalIdClaim() == null ^ this.getPrincipalIdClaim() == null)
return false;
if (other.getPrincipalIdClaim() != null && other.getPrincipalIdClaim().equals(this.getPrincipalIdClaim()) == false)
return false;
if (other.getAudiences() == null ^ this.getAudiences() == null)
return false;
if (other.getAudiences() != null && other.getAudiences().equals(this.getAudiences()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getPrincipalIdClaim() == null) ? 0 : getPrincipalIdClaim().hashCode());
hashCode = prime * hashCode + ((getAudiences() == null) ? 0 : getAudiences().hashCode());
return hashCode;
}
@Override
public UpdateOpenIdConnectAccessTokenConfiguration clone() {
try {
return (UpdateOpenIdConnectAccessTokenConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.verifiedpermissions.model.transform.UpdateOpenIdConnectAccessTokenConfigurationMarshaller.getInstance().marshall(this,
protocolMarshaller);
}
}