/* * 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.verifiedpermissions.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* A structure that contains configuration of the identity source. *
** This data type is used as a response parameter for the CreateIdentitySource operation. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class IdentitySourceDetails implements Serializable, Cloneable, StructuredPojo { /** ** The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this * identity source. *
*/ private java.util.List* The Amazon Resource Name * (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy * store. *
*/ private String userPoolArn; /** ** The well-known URL that points to this user pool's OIDC discovery endpoint. This is a URL string in the following * format. This URL replaces the placeholders for both the Amazon Web Services Region and the user pool identifier * with those appropriate for this user pool. *
*
* https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration
*
* A string that identifies the type of OIDC service represented by this identity source. *
*
* At this time, the only valid value is cognito
.
*
* The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this * identity source. *
* * @return The application client IDs associated with the specified Amazon Cognito user pool that are enabled for * this identity source. */ public java.util.List* The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this * identity source. *
* * @param clientIds * The application client IDs associated with the specified Amazon Cognito user pool that are enabled for * this identity source. */ public void setClientIds(java.util.Collection* The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this * identity source. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setClientIds(java.util.Collection)} or {@link #withClientIds(java.util.Collection)} if you want to * override the existing values. *
* * @param clientIds * The application client IDs associated with the specified Amazon Cognito user pool that are enabled for * this identity source. * @return Returns a reference to this object so that method calls can be chained together. */ public IdentitySourceDetails withClientIds(String... clientIds) { if (this.clientIds == null) { setClientIds(new java.util.ArrayList* The application client IDs associated with the specified Amazon Cognito user pool that are enabled for this * identity source. *
* * @param clientIds * The application client IDs associated with the specified Amazon Cognito user pool that are enabled for * this identity source. * @return Returns a reference to this object so that method calls can be chained together. */ public IdentitySourceDetails withClientIds(java.util.Collection* The Amazon Resource Name * (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy * store. *
* * @param userPoolArn * The Amazon Resource * Name (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified * Permissions policy store. */ public void setUserPoolArn(String userPoolArn) { this.userPoolArn = userPoolArn; } /** ** The Amazon Resource Name * (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy * store. *
* * @return The Amazon Resource * Name (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified * Permissions policy store. */ public String getUserPoolArn() { return this.userPoolArn; } /** ** The Amazon Resource Name * (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified Permissions policy * store. *
* * @param userPoolArn * The Amazon Resource * Name (ARN) of the Amazon Cognito user pool whose identities are accessible to this Verified * Permissions policy store. * @return Returns a reference to this object so that method calls can be chained together. */ public IdentitySourceDetails withUserPoolArn(String userPoolArn) { setUserPoolArn(userPoolArn); return this; } /** ** The well-known URL that points to this user pool's OIDC discovery endpoint. This is a URL string in the following * format. This URL replaces the placeholders for both the Amazon Web Services Region and the user pool identifier * with those appropriate for this user pool. *
*
* https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration
*
* https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration
*/
public void setDiscoveryUrl(String discoveryUrl) {
this.discoveryUrl = discoveryUrl;
}
/**
*
* The well-known URL that points to this user pool's OIDC discovery endpoint. This is a URL string in the following * format. This URL replaces the placeholders for both the Amazon Web Services Region and the user pool identifier * with those appropriate for this user pool. *
*
* https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration
*
* https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration
*/
public String getDiscoveryUrl() {
return this.discoveryUrl;
}
/**
*
* The well-known URL that points to this user pool's OIDC discovery endpoint. This is a URL string in the following * format. This URL replaces the placeholders for both the Amazon Web Services Region and the user pool identifier * with those appropriate for this user pool. *
*
* https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration
*
* https://cognito-idp.<region>.amazonaws.com/<user-pool-id>/.well-known/openid-configuration
* @return Returns a reference to this object so that method calls can be chained together.
*/
public IdentitySourceDetails withDiscoveryUrl(String discoveryUrl) {
setDiscoveryUrl(discoveryUrl);
return this;
}
/**
*
* A string that identifies the type of OIDC service represented by this identity source. *
*
* At this time, the only valid value is cognito
.
*
* At this time, the only valid value is cognito
.
* @see OpenIdIssuer
*/
public void setOpenIdIssuer(String openIdIssuer) {
this.openIdIssuer = openIdIssuer;
}
/**
*
* A string that identifies the type of OIDC service represented by this identity source. *
*
* At this time, the only valid value is cognito
.
*
* At this time, the only valid value is cognito
.
* @see OpenIdIssuer
*/
public String getOpenIdIssuer() {
return this.openIdIssuer;
}
/**
*
* A string that identifies the type of OIDC service represented by this identity source. *
*
* At this time, the only valid value is cognito
.
*
* At this time, the only valid value is cognito
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OpenIdIssuer
*/
public IdentitySourceDetails withOpenIdIssuer(String openIdIssuer) {
setOpenIdIssuer(openIdIssuer);
return this;
}
/**
*
* A string that identifies the type of OIDC service represented by this identity source. *
*
* At this time, the only valid value is cognito
.
*
* At this time, the only valid value is cognito
.
* @return Returns a reference to this object so that method calls can be chained together.
* @see OpenIdIssuer
*/
public IdentitySourceDetails withOpenIdIssuer(OpenIdIssuer openIdIssuer) {
this.openIdIssuer = openIdIssuer.toString();
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 (getClientIds() != null)
sb.append("ClientIds: ").append(getClientIds()).append(",");
if (getUserPoolArn() != null)
sb.append("UserPoolArn: ").append(getUserPoolArn()).append(",");
if (getDiscoveryUrl() != null)
sb.append("DiscoveryUrl: ").append(getDiscoveryUrl()).append(",");
if (getOpenIdIssuer() != null)
sb.append("OpenIdIssuer: ").append(getOpenIdIssuer());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof IdentitySourceDetails == false)
return false;
IdentitySourceDetails other = (IdentitySourceDetails) obj;
if (other.getClientIds() == null ^ this.getClientIds() == null)
return false;
if (other.getClientIds() != null && other.getClientIds().equals(this.getClientIds()) == false)
return false;
if (other.getUserPoolArn() == null ^ this.getUserPoolArn() == null)
return false;
if (other.getUserPoolArn() != null && other.getUserPoolArn().equals(this.getUserPoolArn()) == false)
return false;
if (other.getDiscoveryUrl() == null ^ this.getDiscoveryUrl() == null)
return false;
if (other.getDiscoveryUrl() != null && other.getDiscoveryUrl().equals(this.getDiscoveryUrl()) == false)
return false;
if (other.getOpenIdIssuer() == null ^ this.getOpenIdIssuer() == null)
return false;
if (other.getOpenIdIssuer() != null && other.getOpenIdIssuer().equals(this.getOpenIdIssuer()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getClientIds() == null) ? 0 : getClientIds().hashCode());
hashCode = prime * hashCode + ((getUserPoolArn() == null) ? 0 : getUserPoolArn().hashCode());
hashCode = prime * hashCode + ((getDiscoveryUrl() == null) ? 0 : getDiscoveryUrl().hashCode());
hashCode = prime * hashCode + ((getOpenIdIssuer() == null) ? 0 : getOpenIdIssuer().hashCode());
return hashCode;
}
@Override
public IdentitySourceDetails clone() {
try {
return (IdentitySourceDetails) 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.IdentitySourceDetailsMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}