/* * Copyright 2010-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.iot.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *
* Tests if a specified principal is authorized to perform an IoT action on a * specified resource. Use this to test and debug the authorization behavior of * devices that connect to the IoT device gateway. *
** Requires permission to access the TestAuthorization action. *
*/ public class TestAuthorizationRequest extends AmazonWebServiceRequest implements Serializable { /** ** The principal. Valid principals are CertificateArn * (arn:aws:iot:region:accountId:cert/certificateId), * thingGroupArn * (arn:aws:iot:region:accountId:thinggroup/groupName) * and CognitoId (region:id). *
*/ private String principal; /** ** The Cognito identity pool ID. *
*/ private String cognitoIdentityPoolId; /** *
* A list of authorization info objects. Simulating authorization will
* create a response for each authInfo
object in the list.
*
* The MQTT client ID. *
*/ private String clientId; /** ** When testing custom authorization, the policies specified here are * treated as if they are attached to the principal being authorized. *
*/ private java.util.List* When testing custom authorization, the policies specified here are * treated as if they are not attached to the principal being authorized. *
*/ private java.util.List* The principal. Valid principals are CertificateArn * (arn:aws:iot:region:accountId:cert/certificateId), * thingGroupArn * (arn:aws:iot:region:accountId:thinggroup/groupName) * and CognitoId (region:id). *
* * @return* The principal. Valid principals are CertificateArn * (arn:aws:iot:region:accountId:cert/certificateId), * thingGroupArn * (arn:aws:iot:region:accountId:thinggroup * /groupName) and CognitoId (region:id). *
*/ public String getPrincipal() { return principal; } /** ** The principal. Valid principals are CertificateArn * (arn:aws:iot:region:accountId:cert/certificateId), * thingGroupArn * (arn:aws:iot:region:accountId:thinggroup/groupName) * and CognitoId (region:id). *
* * @param principal* The principal. Valid principals are CertificateArn * (arn:aws:iot * :region:accountId:cert/certificateId), * thingGroupArn * (arn:aws:iot:region:accountId:thinggroup * /groupName) and CognitoId (region:id). *
*/ public void setPrincipal(String principal) { this.principal = principal; } /** ** The principal. Valid principals are CertificateArn * (arn:aws:iot:region:accountId:cert/certificateId), * thingGroupArn * (arn:aws:iot:region:accountId:thinggroup/groupName) * and CognitoId (region:id). *
** Returns a reference to this object so that method calls can be chained * together. * * @param principal
* The principal. Valid principals are CertificateArn * (arn:aws:iot * :region:accountId:cert/certificateId), * thingGroupArn * (arn:aws:iot:region:accountId:thinggroup * /groupName) and CognitoId (region:id). *
* @return A reference to this updated object so that method calls can be * chained together. */ public TestAuthorizationRequest withPrincipal(String principal) { this.principal = principal; return this; } /** ** The Cognito identity pool ID. *
* * @return* The Cognito identity pool ID. *
*/ public String getCognitoIdentityPoolId() { return cognitoIdentityPoolId; } /** ** The Cognito identity pool ID. *
* * @param cognitoIdentityPoolId* The Cognito identity pool ID. *
*/ public void setCognitoIdentityPoolId(String cognitoIdentityPoolId) { this.cognitoIdentityPoolId = cognitoIdentityPoolId; } /** ** The Cognito identity pool ID. *
** Returns a reference to this object so that method calls can be chained * together. * * @param cognitoIdentityPoolId
* The Cognito identity pool ID. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TestAuthorizationRequest withCognitoIdentityPoolId(String cognitoIdentityPoolId) { this.cognitoIdentityPoolId = cognitoIdentityPoolId; return this; } /** *
* A list of authorization info objects. Simulating authorization will
* create a response for each authInfo
object in the list.
*
* A list of authorization info objects. Simulating authorization
* will create a response for each authInfo
object in
* the list.
*
* A list of authorization info objects. Simulating authorization will
* create a response for each authInfo
object in the list.
*
* A list of authorization info objects. Simulating authorization
* will create a response for each authInfo
object
* in the list.
*
* A list of authorization info objects. Simulating authorization will
* create a response for each authInfo
object in the list.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param authInfos
* A list of authorization info objects. Simulating authorization
* will create a response for each authInfo
object
* in the list.
*
* A list of authorization info objects. Simulating authorization will
* create a response for each authInfo
object in the list.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param authInfos
* A list of authorization info objects. Simulating authorization
* will create a response for each authInfo
object
* in the list.
*
* The MQTT client ID. *
* * @return* The MQTT client ID. *
*/ public String getClientId() { return clientId; } /** ** The MQTT client ID. *
* * @param clientId* The MQTT client ID. *
*/ public void setClientId(String clientId) { this.clientId = clientId; } /** ** The MQTT client ID. *
** Returns a reference to this object so that method calls can be chained * together. * * @param clientId
* The MQTT client ID. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TestAuthorizationRequest withClientId(String clientId) { this.clientId = clientId; return this; } /** ** When testing custom authorization, the policies specified here are * treated as if they are attached to the principal being authorized. *
* * @return* When testing custom authorization, the policies specified here * are treated as if they are attached to the principal being * authorized. *
*/ public java.util.List* When testing custom authorization, the policies specified here are * treated as if they are attached to the principal being authorized. *
* * @param policyNamesToAdd* When testing custom authorization, the policies specified here * are treated as if they are attached to the principal being * authorized. *
*/ public void setPolicyNamesToAdd(java.util.Collection* When testing custom authorization, the policies specified here are * treated as if they are attached to the principal being authorized. *
** Returns a reference to this object so that method calls can be chained * together. * * @param policyNamesToAdd
* When testing custom authorization, the policies specified here * are treated as if they are attached to the principal being * authorized. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TestAuthorizationRequest withPolicyNamesToAdd(String... policyNamesToAdd) { if (getPolicyNamesToAdd() == null) { this.policyNamesToAdd = new java.util.ArrayList* When testing custom authorization, the policies specified here are * treated as if they are attached to the principal being authorized. *
** Returns a reference to this object so that method calls can be chained * together. * * @param policyNamesToAdd
* When testing custom authorization, the policies specified here * are treated as if they are attached to the principal being * authorized. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TestAuthorizationRequest withPolicyNamesToAdd( java.util.Collection* When testing custom authorization, the policies specified here are * treated as if they are not attached to the principal being authorized. *
* * @return* When testing custom authorization, the policies specified here * are treated as if they are not attached to the principal being * authorized. *
*/ public java.util.List* When testing custom authorization, the policies specified here are * treated as if they are not attached to the principal being authorized. *
* * @param policyNamesToSkip* When testing custom authorization, the policies specified here * are treated as if they are not attached to the principal being * authorized. *
*/ public void setPolicyNamesToSkip(java.util.Collection* When testing custom authorization, the policies specified here are * treated as if they are not attached to the principal being authorized. *
** Returns a reference to this object so that method calls can be chained * together. * * @param policyNamesToSkip
* When testing custom authorization, the policies specified here * are treated as if they are not attached to the principal being * authorized. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TestAuthorizationRequest withPolicyNamesToSkip(String... policyNamesToSkip) { if (getPolicyNamesToSkip() == null) { this.policyNamesToSkip = new java.util.ArrayList* When testing custom authorization, the policies specified here are * treated as if they are not attached to the principal being authorized. *
** Returns a reference to this object so that method calls can be chained * together. * * @param policyNamesToSkip
* When testing custom authorization, the policies specified here * are treated as if they are not attached to the principal being * authorized. *
* @return A reference to this updated object so that method calls can be * chained together. */ public TestAuthorizationRequest withPolicyNamesToSkip( java.util.Collection