/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include namespace Aws { namespace Http { class URI; } //namespace Http namespace IoT { namespace Model { /** */ class TestAuthorizationRequest : public IoTRequest { public: AWS_IOT_API TestAuthorizationRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "TestAuthorization"; } AWS_IOT_API Aws::String SerializePayload() const override; AWS_IOT_API void AddQueryStringParameters(Aws::Http::URI& uri) const override; /** *

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).

*/ inline const Aws::String& GetPrincipal() const{ return m_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).

*/ inline bool PrincipalHasBeenSet() const { return m_principalHasBeenSet; } /** *

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).

*/ inline void SetPrincipal(const Aws::String& value) { m_principalHasBeenSet = true; m_principal = value; } /** *

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).

*/ inline void SetPrincipal(Aws::String&& value) { m_principalHasBeenSet = true; m_principal = std::move(value); } /** *

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).

*/ inline void SetPrincipal(const char* value) { m_principalHasBeenSet = true; m_principal.assign(value); } /** *

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).

*/ inline TestAuthorizationRequest& WithPrincipal(const Aws::String& value) { SetPrincipal(value); return *this;} /** *

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).

*/ inline TestAuthorizationRequest& WithPrincipal(Aws::String&& value) { SetPrincipal(std::move(value)); return *this;} /** *

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).

*/ inline TestAuthorizationRequest& WithPrincipal(const char* value) { SetPrincipal(value); return *this;} /** *

The Cognito identity pool ID.

*/ inline const Aws::String& GetCognitoIdentityPoolId() const{ return m_cognitoIdentityPoolId; } /** *

The Cognito identity pool ID.

*/ inline bool CognitoIdentityPoolIdHasBeenSet() const { return m_cognitoIdentityPoolIdHasBeenSet; } /** *

The Cognito identity pool ID.

*/ inline void SetCognitoIdentityPoolId(const Aws::String& value) { m_cognitoIdentityPoolIdHasBeenSet = true; m_cognitoIdentityPoolId = value; } /** *

The Cognito identity pool ID.

*/ inline void SetCognitoIdentityPoolId(Aws::String&& value) { m_cognitoIdentityPoolIdHasBeenSet = true; m_cognitoIdentityPoolId = std::move(value); } /** *

The Cognito identity pool ID.

*/ inline void SetCognitoIdentityPoolId(const char* value) { m_cognitoIdentityPoolIdHasBeenSet = true; m_cognitoIdentityPoolId.assign(value); } /** *

The Cognito identity pool ID.

*/ inline TestAuthorizationRequest& WithCognitoIdentityPoolId(const Aws::String& value) { SetCognitoIdentityPoolId(value); return *this;} /** *

The Cognito identity pool ID.

*/ inline TestAuthorizationRequest& WithCognitoIdentityPoolId(Aws::String&& value) { SetCognitoIdentityPoolId(std::move(value)); return *this;} /** *

The Cognito identity pool ID.

*/ inline TestAuthorizationRequest& WithCognitoIdentityPoolId(const char* value) { SetCognitoIdentityPoolId(value); return *this;} /** *

A list of authorization info objects. Simulating authorization will create a * response for each authInfo object in the list.

*/ inline const Aws::Vector& GetAuthInfos() const{ return m_authInfos; } /** *

A list of authorization info objects. Simulating authorization will create a * response for each authInfo object in the list.

*/ inline bool AuthInfosHasBeenSet() const { return m_authInfosHasBeenSet; } /** *

A list of authorization info objects. Simulating authorization will create a * response for each authInfo object in the list.

*/ inline void SetAuthInfos(const Aws::Vector& value) { m_authInfosHasBeenSet = true; m_authInfos = value; } /** *

A list of authorization info objects. Simulating authorization will create a * response for each authInfo object in the list.

*/ inline void SetAuthInfos(Aws::Vector&& value) { m_authInfosHasBeenSet = true; m_authInfos = std::move(value); } /** *

A list of authorization info objects. Simulating authorization will create a * response for each authInfo object in the list.

*/ inline TestAuthorizationRequest& WithAuthInfos(const Aws::Vector& value) { SetAuthInfos(value); return *this;} /** *

A list of authorization info objects. Simulating authorization will create a * response for each authInfo object in the list.

*/ inline TestAuthorizationRequest& WithAuthInfos(Aws::Vector&& value) { SetAuthInfos(std::move(value)); return *this;} /** *

A list of authorization info objects. Simulating authorization will create a * response for each authInfo object in the list.

*/ inline TestAuthorizationRequest& AddAuthInfos(const AuthInfo& value) { m_authInfosHasBeenSet = true; m_authInfos.push_back(value); return *this; } /** *

A list of authorization info objects. Simulating authorization will create a * response for each authInfo object in the list.

*/ inline TestAuthorizationRequest& AddAuthInfos(AuthInfo&& value) { m_authInfosHasBeenSet = true; m_authInfos.push_back(std::move(value)); return *this; } /** *

The MQTT client ID.

*/ inline const Aws::String& GetClientId() const{ return m_clientId; } /** *

The MQTT client ID.

*/ inline bool ClientIdHasBeenSet() const { return m_clientIdHasBeenSet; } /** *

The MQTT client ID.

*/ inline void SetClientId(const Aws::String& value) { m_clientIdHasBeenSet = true; m_clientId = value; } /** *

The MQTT client ID.

*/ inline void SetClientId(Aws::String&& value) { m_clientIdHasBeenSet = true; m_clientId = std::move(value); } /** *

The MQTT client ID.

*/ inline void SetClientId(const char* value) { m_clientIdHasBeenSet = true; m_clientId.assign(value); } /** *

The MQTT client ID.

*/ inline TestAuthorizationRequest& WithClientId(const Aws::String& value) { SetClientId(value); return *this;} /** *

The MQTT client ID.

*/ inline TestAuthorizationRequest& WithClientId(Aws::String&& value) { SetClientId(std::move(value)); return *this;} /** *

The MQTT client ID.

*/ inline TestAuthorizationRequest& WithClientId(const char* value) { SetClientId(value); return *this;} /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline const Aws::Vector& GetPolicyNamesToAdd() const{ return m_policyNamesToAdd; } /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline bool PolicyNamesToAddHasBeenSet() const { return m_policyNamesToAddHasBeenSet; } /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline void SetPolicyNamesToAdd(const Aws::Vector& value) { m_policyNamesToAddHasBeenSet = true; m_policyNamesToAdd = value; } /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline void SetPolicyNamesToAdd(Aws::Vector&& value) { m_policyNamesToAddHasBeenSet = true; m_policyNamesToAdd = std::move(value); } /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline TestAuthorizationRequest& WithPolicyNamesToAdd(const Aws::Vector& value) { SetPolicyNamesToAdd(value); return *this;} /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline TestAuthorizationRequest& WithPolicyNamesToAdd(Aws::Vector&& value) { SetPolicyNamesToAdd(std::move(value)); return *this;} /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline TestAuthorizationRequest& AddPolicyNamesToAdd(const Aws::String& value) { m_policyNamesToAddHasBeenSet = true; m_policyNamesToAdd.push_back(value); return *this; } /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline TestAuthorizationRequest& AddPolicyNamesToAdd(Aws::String&& value) { m_policyNamesToAddHasBeenSet = true; m_policyNamesToAdd.push_back(std::move(value)); return *this; } /** *

When testing custom authorization, the policies specified here are treated as * if they are attached to the principal being authorized.

*/ inline TestAuthorizationRequest& AddPolicyNamesToAdd(const char* value) { m_policyNamesToAddHasBeenSet = true; m_policyNamesToAdd.push_back(value); return *this; } /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline const Aws::Vector& GetPolicyNamesToSkip() const{ return m_policyNamesToSkip; } /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline bool PolicyNamesToSkipHasBeenSet() const { return m_policyNamesToSkipHasBeenSet; } /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline void SetPolicyNamesToSkip(const Aws::Vector& value) { m_policyNamesToSkipHasBeenSet = true; m_policyNamesToSkip = value; } /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline void SetPolicyNamesToSkip(Aws::Vector&& value) { m_policyNamesToSkipHasBeenSet = true; m_policyNamesToSkip = std::move(value); } /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline TestAuthorizationRequest& WithPolicyNamesToSkip(const Aws::Vector& value) { SetPolicyNamesToSkip(value); return *this;} /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline TestAuthorizationRequest& WithPolicyNamesToSkip(Aws::Vector&& value) { SetPolicyNamesToSkip(std::move(value)); return *this;} /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline TestAuthorizationRequest& AddPolicyNamesToSkip(const Aws::String& value) { m_policyNamesToSkipHasBeenSet = true; m_policyNamesToSkip.push_back(value); return *this; } /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline TestAuthorizationRequest& AddPolicyNamesToSkip(Aws::String&& value) { m_policyNamesToSkipHasBeenSet = true; m_policyNamesToSkip.push_back(std::move(value)); return *this; } /** *

When testing custom authorization, the policies specified here are treated as * if they are not attached to the principal being authorized.

*/ inline TestAuthorizationRequest& AddPolicyNamesToSkip(const char* value) { m_policyNamesToSkipHasBeenSet = true; m_policyNamesToSkip.push_back(value); return *this; } private: Aws::String m_principal; bool m_principalHasBeenSet = false; Aws::String m_cognitoIdentityPoolId; bool m_cognitoIdentityPoolIdHasBeenSet = false; Aws::Vector m_authInfos; bool m_authInfosHasBeenSet = false; Aws::String m_clientId; bool m_clientIdHasBeenSet = false; Aws::Vector m_policyNamesToAdd; bool m_policyNamesToAddHasBeenSet = false; Aws::Vector m_policyNamesToSkip; bool m_policyNamesToSkipHasBeenSet = false; }; } // namespace Model } // namespace IoT } // namespace Aws