com.amazonaws.services.verifiedpermissions.model.OpenIdConnectTokenSelectionDetail 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 token type that you want to process from your OIDC identity provider. Your policy store can process either
* identity (ID) or access tokens from a given OIDC identity source.
*
*
* This data type is part of a OpenIdConnectConfigurationDetail structure, which is a parameter of GetIdentitySource.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class OpenIdConnectTokenSelectionDetail implements Serializable, Cloneable, StructuredPojo {
/**
*
* The OIDC configuration for processing access tokens. Contains allowed audience claims, for example
* https://auth.example.com
, and the claim that you want to map to the principal, for example
* sub
.
*
*/
private OpenIdConnectAccessTokenConfigurationDetail accessTokenOnly;
/**
*
* The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example
* 1example23456789
, and the claim that you want to map to the principal, for example sub
.
*
*/
private OpenIdConnectIdentityTokenConfigurationDetail identityTokenOnly;
/**
*
* The OIDC configuration for processing access tokens. Contains allowed audience claims, for example
* https://auth.example.com
, and the claim that you want to map to the principal, for example
* sub
.
*
*
* @param accessTokenOnly
* The OIDC configuration for processing access tokens. Contains allowed audience claims, for example
* https://auth.example.com
, and the claim that you want to map to the principal, for example
* sub
.
*/
public void setAccessTokenOnly(OpenIdConnectAccessTokenConfigurationDetail accessTokenOnly) {
this.accessTokenOnly = accessTokenOnly;
}
/**
*
* The OIDC configuration for processing access tokens. Contains allowed audience claims, for example
* https://auth.example.com
, and the claim that you want to map to the principal, for example
* sub
.
*
*
* @return The OIDC configuration for processing access tokens. Contains allowed audience claims, for example
* https://auth.example.com
, and the claim that you want to map to the principal, for example
* sub
.
*/
public OpenIdConnectAccessTokenConfigurationDetail getAccessTokenOnly() {
return this.accessTokenOnly;
}
/**
*
* The OIDC configuration for processing access tokens. Contains allowed audience claims, for example
* https://auth.example.com
, and the claim that you want to map to the principal, for example
* sub
.
*
*
* @param accessTokenOnly
* The OIDC configuration for processing access tokens. Contains allowed audience claims, for example
* https://auth.example.com
, and the claim that you want to map to the principal, for example
* sub
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OpenIdConnectTokenSelectionDetail withAccessTokenOnly(OpenIdConnectAccessTokenConfigurationDetail accessTokenOnly) {
setAccessTokenOnly(accessTokenOnly);
return this;
}
/**
*
* The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example
* 1example23456789
, and the claim that you want to map to the principal, for example sub
.
*
*
* @param identityTokenOnly
* The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example
* 1example23456789
, and the claim that you want to map to the principal, for example
* sub
.
*/
public void setIdentityTokenOnly(OpenIdConnectIdentityTokenConfigurationDetail identityTokenOnly) {
this.identityTokenOnly = identityTokenOnly;
}
/**
*
* The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example
* 1example23456789
, and the claim that you want to map to the principal, for example sub
.
*
*
* @return The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for
* example 1example23456789
, and the claim that you want to map to the principal, for example
* sub
.
*/
public OpenIdConnectIdentityTokenConfigurationDetail getIdentityTokenOnly() {
return this.identityTokenOnly;
}
/**
*
* The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example
* 1example23456789
, and the claim that you want to map to the principal, for example sub
.
*
*
* @param identityTokenOnly
* The OIDC configuration for processing identity (ID) tokens. Contains allowed client ID claims, for example
* 1example23456789
, and the claim that you want to map to the principal, for example
* sub
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public OpenIdConnectTokenSelectionDetail withIdentityTokenOnly(OpenIdConnectIdentityTokenConfigurationDetail identityTokenOnly) {
setIdentityTokenOnly(identityTokenOnly);
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 (getAccessTokenOnly() != null)
sb.append("AccessTokenOnly: ").append(getAccessTokenOnly()).append(",");
if (getIdentityTokenOnly() != null)
sb.append("IdentityTokenOnly: ").append(getIdentityTokenOnly());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof OpenIdConnectTokenSelectionDetail == false)
return false;
OpenIdConnectTokenSelectionDetail other = (OpenIdConnectTokenSelectionDetail) obj;
if (other.getAccessTokenOnly() == null ^ this.getAccessTokenOnly() == null)
return false;
if (other.getAccessTokenOnly() != null && other.getAccessTokenOnly().equals(this.getAccessTokenOnly()) == false)
return false;
if (other.getIdentityTokenOnly() == null ^ this.getIdentityTokenOnly() == null)
return false;
if (other.getIdentityTokenOnly() != null && other.getIdentityTokenOnly().equals(this.getIdentityTokenOnly()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccessTokenOnly() == null) ? 0 : getAccessTokenOnly().hashCode());
hashCode = prime * hashCode + ((getIdentityTokenOnly() == null) ? 0 : getIdentityTokenOnly().hashCode());
return hashCode;
}
@Override
public OpenIdConnectTokenSelectionDetail clone() {
try {
return (OpenIdConnectTokenSelectionDetail) 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.OpenIdConnectTokenSelectionDetailMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}