
com.amazonaws.services.servicecatalog.model.AssociatePrincipalWithPortfolioRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-servicecatalog Show documentation
/*
* Copyright 2020-2025 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.servicecatalog.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 AssociatePrincipalWithPortfolioRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The language code.
*
*
* -
*
* jp
- Japanese
*
*
* -
*
* zh
- Chinese
*
*
*
*/
private String acceptLanguage;
/**
*
* The portfolio identifier.
*
*/
private String portfolioId;
/**
*
* The ARN of the principal (user, role, or group). If the PrincipalType
is IAM
, the
* supported value is a fully defined IAM Amazon
* Resource Name (ARN). If the PrincipalType
is IAM_PATTERN
, the supported value is an
* IAM
ARN without an AccountID in the following format:
*
*
* arn:partition:iam:::resource-type/resource-id
*
*
* The ARN resource-id can be either:
*
*
* -
*
* A fully formed resource-id. For example, arn:aws:iam:::role/resource-name or
* arn:aws:iam:::role/resource-path/resource-name
*
*
* -
*
* A wildcard ARN. The wildcard ARN accepts IAM_PATTERN
values with a "*" or "?" in the resource-id
* segment of the ARN. For example arn:partition:service:::resource-type/resource-path/resource-name. The new
* symbols are exclusive to the resource-path and resource-name and cannot replace the
* resource-type or other ARN values.
*
*
* The ARN path and principal name allow unlimited wildcard characters.
*
*
*
*
* Examples of an acceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::role/ResourceName_*
*
*
* -
*
* arn:aws:iam:::role/*/ResourceName_?
*
*
*
*
* Examples of an unacceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::*/ResourceName
*
*
*
*
* You can associate multiple IAM_PATTERN
s even if the account has no principal with that name.
*
*
* The "?" wildcard character matches zero or one of any character. This is similar to ".?" in regular regex
* context. The "*" wildcard character matches any number of any characters. This is similar to ".*" in regular
* regex context.
*
*
* In the IAM Principal ARN format (arn:partition:iam:::resource-type/resource-path/resource-name), valid
* resource-type values include user/, group/, or role/. The "?" and "*" characters are allowed
* only after the resource-type in the resource-id segment. You can use special characters anywhere within the
* resource-id.
*
*
* The "*" character also matches the "/" character, allowing paths to be formed within the resource-id. For
* example, arn:aws:iam:::role/*/ResourceName_? matches both
* arn:aws:iam:::role/pathA/pathB/ResourceName_1 and arn:aws:iam:::role/pathA/ResourceName_1.
*
*/
private String principalARN;
/**
*
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource Name
* (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without wildcard
* characters.
*
*/
private String principalType;
/**
*
* The language code.
*
*
* -
*
* jp
- Japanese
*
*
* -
*
* zh
- Chinese
*
*
*
*
* @param acceptLanguage
* The language code.
*
* -
*
* jp
- Japanese
*
*
* -
*
* zh
- Chinese
*
*
*/
public void setAcceptLanguage(String acceptLanguage) {
this.acceptLanguage = acceptLanguage;
}
/**
*
* The language code.
*
*
* -
*
* jp
- Japanese
*
*
* -
*
* zh
- Chinese
*
*
*
*
* @return The language code.
*
* -
*
* jp
- Japanese
*
*
* -
*
* zh
- Chinese
*
*
*/
public String getAcceptLanguage() {
return this.acceptLanguage;
}
/**
*
* The language code.
*
*
* -
*
* jp
- Japanese
*
*
* -
*
* zh
- Chinese
*
*
*
*
* @param acceptLanguage
* The language code.
*
* -
*
* jp
- Japanese
*
*
* -
*
* zh
- Chinese
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatePrincipalWithPortfolioRequest withAcceptLanguage(String acceptLanguage) {
setAcceptLanguage(acceptLanguage);
return this;
}
/**
*
* The portfolio identifier.
*
*
* @param portfolioId
* The portfolio identifier.
*/
public void setPortfolioId(String portfolioId) {
this.portfolioId = portfolioId;
}
/**
*
* The portfolio identifier.
*
*
* @return The portfolio identifier.
*/
public String getPortfolioId() {
return this.portfolioId;
}
/**
*
* The portfolio identifier.
*
*
* @param portfolioId
* The portfolio identifier.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatePrincipalWithPortfolioRequest withPortfolioId(String portfolioId) {
setPortfolioId(portfolioId);
return this;
}
/**
*
* The ARN of the principal (user, role, or group). If the PrincipalType
is IAM
, the
* supported value is a fully defined IAM Amazon
* Resource Name (ARN). If the PrincipalType
is IAM_PATTERN
, the supported value is an
* IAM
ARN without an AccountID in the following format:
*
*
* arn:partition:iam:::resource-type/resource-id
*
*
* The ARN resource-id can be either:
*
*
* -
*
* A fully formed resource-id. For example, arn:aws:iam:::role/resource-name or
* arn:aws:iam:::role/resource-path/resource-name
*
*
* -
*
* A wildcard ARN. The wildcard ARN accepts IAM_PATTERN
values with a "*" or "?" in the resource-id
* segment of the ARN. For example arn:partition:service:::resource-type/resource-path/resource-name. The new
* symbols are exclusive to the resource-path and resource-name and cannot replace the
* resource-type or other ARN values.
*
*
* The ARN path and principal name allow unlimited wildcard characters.
*
*
*
*
* Examples of an acceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::role/ResourceName_*
*
*
* -
*
* arn:aws:iam:::role/*/ResourceName_?
*
*
*
*
* Examples of an unacceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::*/ResourceName
*
*
*
*
* You can associate multiple IAM_PATTERN
s even if the account has no principal with that name.
*
*
* The "?" wildcard character matches zero or one of any character. This is similar to ".?" in regular regex
* context. The "*" wildcard character matches any number of any characters. This is similar to ".*" in regular
* regex context.
*
*
* In the IAM Principal ARN format (arn:partition:iam:::resource-type/resource-path/resource-name), valid
* resource-type values include user/, group/, or role/. The "?" and "*" characters are allowed
* only after the resource-type in the resource-id segment. You can use special characters anywhere within the
* resource-id.
*
*
* The "*" character also matches the "/" character, allowing paths to be formed within the resource-id. For
* example, arn:aws:iam:::role/*/ResourceName_? matches both
* arn:aws:iam:::role/pathA/pathB/ResourceName_1 and arn:aws:iam:::role/pathA/ResourceName_1.
*
*
* @param principalARN
* The ARN of the principal (user, role, or group). If the PrincipalType
is IAM
,
* the supported value is a fully defined IAM
* Amazon Resource Name (ARN). If the PrincipalType
is IAM_PATTERN
, the
* supported value is an IAM
ARN without an AccountID in the following format:
*
* arn:partition:iam:::resource-type/resource-id
*
*
* The ARN resource-id can be either:
*
*
* -
*
* A fully formed resource-id. For example, arn:aws:iam:::role/resource-name or
* arn:aws:iam:::role/resource-path/resource-name
*
*
* -
*
* A wildcard ARN. The wildcard ARN accepts IAM_PATTERN
values with a "*" or "?" in the
* resource-id segment of the ARN. For example
* arn:partition:service:::resource-type/resource-path/resource-name. The new symbols are exclusive to
* the resource-path and resource-name and cannot replace the resource-type or other ARN
* values.
*
*
* The ARN path and principal name allow unlimited wildcard characters.
*
*
*
*
* Examples of an acceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::role/ResourceName_*
*
*
* -
*
* arn:aws:iam:::role/*/ResourceName_?
*
*
*
*
* Examples of an unacceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::*/ResourceName
*
*
*
*
* You can associate multiple IAM_PATTERN
s even if the account has no principal with that name.
*
*
* The "?" wildcard character matches zero or one of any character. This is similar to ".?" in regular regex
* context. The "*" wildcard character matches any number of any characters. This is similar to ".*" in
* regular regex context.
*
*
* In the IAM Principal ARN format (arn:partition:iam:::resource-type/resource-path/resource-name),
* valid resource-type values include user/, group/, or role/. The "?" and "*"
* characters are allowed only after the resource-type in the resource-id segment. You can use special
* characters anywhere within the resource-id.
*
*
* The "*" character also matches the "/" character, allowing paths to be formed within the
* resource-id. For example, arn:aws:iam:::role/*/ResourceName_? matches both
* arn:aws:iam:::role/pathA/pathB/ResourceName_1 and arn:aws:iam:::role/pathA/ResourceName_1.
*/
public void setPrincipalARN(String principalARN) {
this.principalARN = principalARN;
}
/**
*
* The ARN of the principal (user, role, or group). If the PrincipalType
is IAM
, the
* supported value is a fully defined IAM Amazon
* Resource Name (ARN). If the PrincipalType
is IAM_PATTERN
, the supported value is an
* IAM
ARN without an AccountID in the following format:
*
*
* arn:partition:iam:::resource-type/resource-id
*
*
* The ARN resource-id can be either:
*
*
* -
*
* A fully formed resource-id. For example, arn:aws:iam:::role/resource-name or
* arn:aws:iam:::role/resource-path/resource-name
*
*
* -
*
* A wildcard ARN. The wildcard ARN accepts IAM_PATTERN
values with a "*" or "?" in the resource-id
* segment of the ARN. For example arn:partition:service:::resource-type/resource-path/resource-name. The new
* symbols are exclusive to the resource-path and resource-name and cannot replace the
* resource-type or other ARN values.
*
*
* The ARN path and principal name allow unlimited wildcard characters.
*
*
*
*
* Examples of an acceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::role/ResourceName_*
*
*
* -
*
* arn:aws:iam:::role/*/ResourceName_?
*
*
*
*
* Examples of an unacceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::*/ResourceName
*
*
*
*
* You can associate multiple IAM_PATTERN
s even if the account has no principal with that name.
*
*
* The "?" wildcard character matches zero or one of any character. This is similar to ".?" in regular regex
* context. The "*" wildcard character matches any number of any characters. This is similar to ".*" in regular
* regex context.
*
*
* In the IAM Principal ARN format (arn:partition:iam:::resource-type/resource-path/resource-name), valid
* resource-type values include user/, group/, or role/. The "?" and "*" characters are allowed
* only after the resource-type in the resource-id segment. You can use special characters anywhere within the
* resource-id.
*
*
* The "*" character also matches the "/" character, allowing paths to be formed within the resource-id. For
* example, arn:aws:iam:::role/*/ResourceName_? matches both
* arn:aws:iam:::role/pathA/pathB/ResourceName_1 and arn:aws:iam:::role/pathA/ResourceName_1.
*
*
* @return The ARN of the principal (user, role, or group). If the PrincipalType
is IAM
,
* the supported value is a fully defined IAM
* Amazon Resource Name (ARN). If the PrincipalType
is IAM_PATTERN
, the
* supported value is an IAM
ARN without an AccountID in the following format:
*
* arn:partition:iam:::resource-type/resource-id
*
*
* The ARN resource-id can be either:
*
*
* -
*
* A fully formed resource-id. For example, arn:aws:iam:::role/resource-name or
* arn:aws:iam:::role/resource-path/resource-name
*
*
* -
*
* A wildcard ARN. The wildcard ARN accepts IAM_PATTERN
values with a "*" or "?" in the
* resource-id segment of the ARN. For example
* arn:partition:service:::resource-type/resource-path/resource-name. The new symbols are exclusive
* to the resource-path and resource-name and cannot replace the resource-type or other
* ARN values.
*
*
* The ARN path and principal name allow unlimited wildcard characters.
*
*
*
*
* Examples of an acceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::role/ResourceName_*
*
*
* -
*
* arn:aws:iam:::role/*/ResourceName_?
*
*
*
*
* Examples of an unacceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::*/ResourceName
*
*
*
*
* You can associate multiple IAM_PATTERN
s even if the account has no principal with that name.
*
*
* The "?" wildcard character matches zero or one of any character. This is similar to ".?" in regular regex
* context. The "*" wildcard character matches any number of any characters. This is similar to ".*" in
* regular regex context.
*
*
* In the IAM Principal ARN format (arn:partition:iam:::resource-type/resource-path/resource-name),
* valid resource-type values include user/, group/, or role/. The "?" and "*"
* characters are allowed only after the resource-type in the resource-id segment. You can use special
* characters anywhere within the resource-id.
*
*
* The "*" character also matches the "/" character, allowing paths to be formed within the
* resource-id. For example, arn:aws:iam:::role/*/ResourceName_? matches both
* arn:aws:iam:::role/pathA/pathB/ResourceName_1 and arn:aws:iam:::role/pathA/ResourceName_1.
*/
public String getPrincipalARN() {
return this.principalARN;
}
/**
*
* The ARN of the principal (user, role, or group). If the PrincipalType
is IAM
, the
* supported value is a fully defined IAM Amazon
* Resource Name (ARN). If the PrincipalType
is IAM_PATTERN
, the supported value is an
* IAM
ARN without an AccountID in the following format:
*
*
* arn:partition:iam:::resource-type/resource-id
*
*
* The ARN resource-id can be either:
*
*
* -
*
* A fully formed resource-id. For example, arn:aws:iam:::role/resource-name or
* arn:aws:iam:::role/resource-path/resource-name
*
*
* -
*
* A wildcard ARN. The wildcard ARN accepts IAM_PATTERN
values with a "*" or "?" in the resource-id
* segment of the ARN. For example arn:partition:service:::resource-type/resource-path/resource-name. The new
* symbols are exclusive to the resource-path and resource-name and cannot replace the
* resource-type or other ARN values.
*
*
* The ARN path and principal name allow unlimited wildcard characters.
*
*
*
*
* Examples of an acceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::role/ResourceName_*
*
*
* -
*
* arn:aws:iam:::role/*/ResourceName_?
*
*
*
*
* Examples of an unacceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::*/ResourceName
*
*
*
*
* You can associate multiple IAM_PATTERN
s even if the account has no principal with that name.
*
*
* The "?" wildcard character matches zero or one of any character. This is similar to ".?" in regular regex
* context. The "*" wildcard character matches any number of any characters. This is similar to ".*" in regular
* regex context.
*
*
* In the IAM Principal ARN format (arn:partition:iam:::resource-type/resource-path/resource-name), valid
* resource-type values include user/, group/, or role/. The "?" and "*" characters are allowed
* only after the resource-type in the resource-id segment. You can use special characters anywhere within the
* resource-id.
*
*
* The "*" character also matches the "/" character, allowing paths to be formed within the resource-id. For
* example, arn:aws:iam:::role/*/ResourceName_? matches both
* arn:aws:iam:::role/pathA/pathB/ResourceName_1 and arn:aws:iam:::role/pathA/ResourceName_1.
*
*
* @param principalARN
* The ARN of the principal (user, role, or group). If the PrincipalType
is IAM
,
* the supported value is a fully defined IAM
* Amazon Resource Name (ARN). If the PrincipalType
is IAM_PATTERN
, the
* supported value is an IAM
ARN without an AccountID in the following format:
*
* arn:partition:iam:::resource-type/resource-id
*
*
* The ARN resource-id can be either:
*
*
* -
*
* A fully formed resource-id. For example, arn:aws:iam:::role/resource-name or
* arn:aws:iam:::role/resource-path/resource-name
*
*
* -
*
* A wildcard ARN. The wildcard ARN accepts IAM_PATTERN
values with a "*" or "?" in the
* resource-id segment of the ARN. For example
* arn:partition:service:::resource-type/resource-path/resource-name. The new symbols are exclusive to
* the resource-path and resource-name and cannot replace the resource-type or other ARN
* values.
*
*
* The ARN path and principal name allow unlimited wildcard characters.
*
*
*
*
* Examples of an acceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::role/ResourceName_*
*
*
* -
*
* arn:aws:iam:::role/*/ResourceName_?
*
*
*
*
* Examples of an unacceptable wildcard ARN:
*
*
* -
*
* arn:aws:iam:::*/ResourceName
*
*
*
*
* You can associate multiple IAM_PATTERN
s even if the account has no principal with that name.
*
*
* The "?" wildcard character matches zero or one of any character. This is similar to ".?" in regular regex
* context. The "*" wildcard character matches any number of any characters. This is similar to ".*" in
* regular regex context.
*
*
* In the IAM Principal ARN format (arn:partition:iam:::resource-type/resource-path/resource-name),
* valid resource-type values include user/, group/, or role/. The "?" and "*"
* characters are allowed only after the resource-type in the resource-id segment. You can use special
* characters anywhere within the resource-id.
*
*
* The "*" character also matches the "/" character, allowing paths to be formed within the
* resource-id. For example, arn:aws:iam:::role/*/ResourceName_? matches both
* arn:aws:iam:::role/pathA/pathB/ResourceName_1 and arn:aws:iam:::role/pathA/ResourceName_1.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public AssociatePrincipalWithPortfolioRequest withPrincipalARN(String principalARN) {
setPrincipalARN(principalARN);
return this;
}
/**
*
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource Name
* (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without wildcard
* characters.
*
*
* @param principalType
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource
* Name (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without
* wildcard characters.
* @see PrincipalType
*/
public void setPrincipalType(String principalType) {
this.principalType = principalType;
}
/**
*
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource Name
* (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without wildcard
* characters.
*
*
* @return The principal type. The supported value is IAM
if you use a fully defined Amazon Resource
* Name (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without
* wildcard characters.
* @see PrincipalType
*/
public String getPrincipalType() {
return this.principalType;
}
/**
*
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource Name
* (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without wildcard
* characters.
*
*
* @param principalType
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource
* Name (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without
* wildcard characters.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PrincipalType
*/
public AssociatePrincipalWithPortfolioRequest withPrincipalType(String principalType) {
setPrincipalType(principalType);
return this;
}
/**
*
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource Name
* (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without wildcard
* characters.
*
*
* @param principalType
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource
* Name (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without
* wildcard characters.
* @see PrincipalType
*/
public void setPrincipalType(PrincipalType principalType) {
withPrincipalType(principalType);
}
/**
*
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource Name
* (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without wildcard
* characters.
*
*
* @param principalType
* The principal type. The supported value is IAM
if you use a fully defined Amazon Resource
* Name (ARN), or IAM_PATTERN
if you use an ARN with no accountID
, with or without
* wildcard characters.
* @return Returns a reference to this object so that method calls can be chained together.
* @see PrincipalType
*/
public AssociatePrincipalWithPortfolioRequest withPrincipalType(PrincipalType principalType) {
this.principalType = principalType.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 (getAcceptLanguage() != null)
sb.append("AcceptLanguage: ").append(getAcceptLanguage()).append(",");
if (getPortfolioId() != null)
sb.append("PortfolioId: ").append(getPortfolioId()).append(",");
if (getPrincipalARN() != null)
sb.append("PrincipalARN: ").append(getPrincipalARN()).append(",");
if (getPrincipalType() != null)
sb.append("PrincipalType: ").append(getPrincipalType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof AssociatePrincipalWithPortfolioRequest == false)
return false;
AssociatePrincipalWithPortfolioRequest other = (AssociatePrincipalWithPortfolioRequest) obj;
if (other.getAcceptLanguage() == null ^ this.getAcceptLanguage() == null)
return false;
if (other.getAcceptLanguage() != null && other.getAcceptLanguage().equals(this.getAcceptLanguage()) == false)
return false;
if (other.getPortfolioId() == null ^ this.getPortfolioId() == null)
return false;
if (other.getPortfolioId() != null && other.getPortfolioId().equals(this.getPortfolioId()) == false)
return false;
if (other.getPrincipalARN() == null ^ this.getPrincipalARN() == null)
return false;
if (other.getPrincipalARN() != null && other.getPrincipalARN().equals(this.getPrincipalARN()) == false)
return false;
if (other.getPrincipalType() == null ^ this.getPrincipalType() == null)
return false;
if (other.getPrincipalType() != null && other.getPrincipalType().equals(this.getPrincipalType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAcceptLanguage() == null) ? 0 : getAcceptLanguage().hashCode());
hashCode = prime * hashCode + ((getPortfolioId() == null) ? 0 : getPortfolioId().hashCode());
hashCode = prime * hashCode + ((getPrincipalARN() == null) ? 0 : getPrincipalARN().hashCode());
hashCode = prime * hashCode + ((getPrincipalType() == null) ? 0 : getPrincipalType().hashCode());
return hashCode;
}
@Override
public AssociatePrincipalWithPortfolioRequest clone() {
return (AssociatePrincipalWithPortfolioRequest) super.clone();
}
}