Lesson 35 - Get Compute Auth Token Working

This commit is contained in:
Norman Lansing
2026-02-28 12:32:28 -05:00
parent 1d477ee42a
commit 4fde462bce
7743 changed files with 1397833 additions and 18 deletions

View File

@@ -0,0 +1,242 @@
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include <aws/cognito-idp/CognitoIdentityProvider_EXPORTS.h>
#include <aws/cognito-idp/CognitoIdentityProviderRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/cognito-idp/model/AnalyticsMetadataType.h>
#include <aws/cognito-idp/model/UserContextDataType.h>
#include <aws/core/utils/memory/stl/AWSMap.h>
#include <aws/cognito-idp/model/AttributeType.h>
#include <utility>
namespace Aws
{
namespace CognitoIdentityProvider
{
namespace Model
{
/**
* <p>Represents the request to register a user.</p><p><h3>See Also:</h3> <a
* href="http://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SignUpRequest">AWS
* API Reference</a></p>
*/
class SignUpRequest : public CognitoIdentityProviderRequest
{
public:
AWS_COGNITOIDENTITYPROVIDER_API SignUpRequest();
// 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 "SignUp"; }
AWS_COGNITOIDENTITYPROVIDER_API Aws::String SerializePayload() const override;
AWS_COGNITOIDENTITYPROVIDER_API Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
///@{
/**
* <p>The ID of the client associated with the user pool.</p>
*/
inline const Aws::String& GetClientId() const{ return m_clientId; }
inline bool ClientIdHasBeenSet() const { return m_clientIdHasBeenSet; }
inline void SetClientId(const Aws::String& value) { m_clientIdHasBeenSet = true; m_clientId = value; }
inline void SetClientId(Aws::String&& value) { m_clientIdHasBeenSet = true; m_clientId = std::move(value); }
inline void SetClientId(const char* value) { m_clientIdHasBeenSet = true; m_clientId.assign(value); }
inline SignUpRequest& WithClientId(const Aws::String& value) { SetClientId(value); return *this;}
inline SignUpRequest& WithClientId(Aws::String&& value) { SetClientId(std::move(value)); return *this;}
inline SignUpRequest& WithClientId(const char* value) { SetClientId(value); return *this;}
///@}
///@{
/**
* <p>A keyed-hash message authentication code (HMAC) calculated using the secret
* key of a user pool client and username plus the client ID in the message.</p>
*/
inline const Aws::String& GetSecretHash() const{ return m_secretHash; }
inline bool SecretHashHasBeenSet() const { return m_secretHashHasBeenSet; }
inline void SetSecretHash(const Aws::String& value) { m_secretHashHasBeenSet = true; m_secretHash = value; }
inline void SetSecretHash(Aws::String&& value) { m_secretHashHasBeenSet = true; m_secretHash = std::move(value); }
inline void SetSecretHash(const char* value) { m_secretHashHasBeenSet = true; m_secretHash.assign(value); }
inline SignUpRequest& WithSecretHash(const Aws::String& value) { SetSecretHash(value); return *this;}
inline SignUpRequest& WithSecretHash(Aws::String&& value) { SetSecretHash(std::move(value)); return *this;}
inline SignUpRequest& WithSecretHash(const char* value) { SetSecretHash(value); return *this;}
///@}
///@{
/**
* <p>The username of the user that you want to sign up. The value of this
* parameter is typically a username, but can be any alias attribute in your user
* pool.</p>
*/
inline const Aws::String& GetUsername() const{ return m_username; }
inline bool UsernameHasBeenSet() const { return m_usernameHasBeenSet; }
inline void SetUsername(const Aws::String& value) { m_usernameHasBeenSet = true; m_username = value; }
inline void SetUsername(Aws::String&& value) { m_usernameHasBeenSet = true; m_username = std::move(value); }
inline void SetUsername(const char* value) { m_usernameHasBeenSet = true; m_username.assign(value); }
inline SignUpRequest& WithUsername(const Aws::String& value) { SetUsername(value); return *this;}
inline SignUpRequest& WithUsername(Aws::String&& value) { SetUsername(std::move(value)); return *this;}
inline SignUpRequest& WithUsername(const char* value) { SetUsername(value); return *this;}
///@}
///@{
/**
* <p>The password of the user you want to register.</p>
*/
inline const Aws::String& GetPassword() const{ return m_password; }
inline bool PasswordHasBeenSet() const { return m_passwordHasBeenSet; }
inline void SetPassword(const Aws::String& value) { m_passwordHasBeenSet = true; m_password = value; }
inline void SetPassword(Aws::String&& value) { m_passwordHasBeenSet = true; m_password = std::move(value); }
inline void SetPassword(const char* value) { m_passwordHasBeenSet = true; m_password.assign(value); }
inline SignUpRequest& WithPassword(const Aws::String& value) { SetPassword(value); return *this;}
inline SignUpRequest& WithPassword(Aws::String&& value) { SetPassword(std::move(value)); return *this;}
inline SignUpRequest& WithPassword(const char* value) { SetPassword(value); return *this;}
///@}
///@{
/**
* <p>An array of name-value pairs representing user attributes.</p> <p>For custom
* attributes, you must prepend the <code>custom:</code> prefix to the attribute
* name.</p>
*/
inline const Aws::Vector<AttributeType>& GetUserAttributes() const{ return m_userAttributes; }
inline bool UserAttributesHasBeenSet() const { return m_userAttributesHasBeenSet; }
inline void SetUserAttributes(const Aws::Vector<AttributeType>& value) { m_userAttributesHasBeenSet = true; m_userAttributes = value; }
inline void SetUserAttributes(Aws::Vector<AttributeType>&& value) { m_userAttributesHasBeenSet = true; m_userAttributes = std::move(value); }
inline SignUpRequest& WithUserAttributes(const Aws::Vector<AttributeType>& value) { SetUserAttributes(value); return *this;}
inline SignUpRequest& WithUserAttributes(Aws::Vector<AttributeType>&& value) { SetUserAttributes(std::move(value)); return *this;}
inline SignUpRequest& AddUserAttributes(const AttributeType& value) { m_userAttributesHasBeenSet = true; m_userAttributes.push_back(value); return *this; }
inline SignUpRequest& AddUserAttributes(AttributeType&& value) { m_userAttributesHasBeenSet = true; m_userAttributes.push_back(std::move(value)); return *this; }
///@}
///@{
/**
* <p>Temporary user attributes that contribute to the outcomes of your pre sign-up
* Lambda trigger. This set of key-value pairs are for custom validation of
* information that you collect from your users but don't need to retain.</p>
* <p>Your Lambda function can analyze this additional data and act on it. Your
* function might perform external API operations like logging user attributes and
* validation data to Amazon CloudWatch Logs. Validation data might also affect the
* response that your function returns to Amazon Cognito, like automatically
* confirming the user if they sign up from within your network.</p> <p>For more
* information about the pre sign-up Lambda trigger, see <a
* href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-lambda-pre-sign-up.html">Pre
* sign-up Lambda trigger</a>.</p>
*/
inline const Aws::Vector<AttributeType>& GetValidationData() const{ return m_validationData; }
inline bool ValidationDataHasBeenSet() const { return m_validationDataHasBeenSet; }
inline void SetValidationData(const Aws::Vector<AttributeType>& value) { m_validationDataHasBeenSet = true; m_validationData = value; }
inline void SetValidationData(Aws::Vector<AttributeType>&& value) { m_validationDataHasBeenSet = true; m_validationData = std::move(value); }
inline SignUpRequest& WithValidationData(const Aws::Vector<AttributeType>& value) { SetValidationData(value); return *this;}
inline SignUpRequest& WithValidationData(Aws::Vector<AttributeType>&& value) { SetValidationData(std::move(value)); return *this;}
inline SignUpRequest& AddValidationData(const AttributeType& value) { m_validationDataHasBeenSet = true; m_validationData.push_back(value); return *this; }
inline SignUpRequest& AddValidationData(AttributeType&& value) { m_validationDataHasBeenSet = true; m_validationData.push_back(std::move(value)); return *this; }
///@}
///@{
/**
* <p>The Amazon Pinpoint analytics metadata that contributes to your metrics for
* <code>SignUp</code> calls.</p>
*/
inline const AnalyticsMetadataType& GetAnalyticsMetadata() const{ return m_analyticsMetadata; }
inline bool AnalyticsMetadataHasBeenSet() const { return m_analyticsMetadataHasBeenSet; }
inline void SetAnalyticsMetadata(const AnalyticsMetadataType& value) { m_analyticsMetadataHasBeenSet = true; m_analyticsMetadata = value; }
inline void SetAnalyticsMetadata(AnalyticsMetadataType&& value) { m_analyticsMetadataHasBeenSet = true; m_analyticsMetadata = std::move(value); }
inline SignUpRequest& WithAnalyticsMetadata(const AnalyticsMetadataType& value) { SetAnalyticsMetadata(value); return *this;}
inline SignUpRequest& WithAnalyticsMetadata(AnalyticsMetadataType&& value) { SetAnalyticsMetadata(std::move(value)); return *this;}
///@}
///@{
/**
* <p>Contextual data about your user session, such as the device fingerprint, IP
* address, or location. Amazon Cognito advanced security evaluates the risk of an
* authentication event based on the context that your app generates and passes to
* Amazon Cognito when it makes API requests.</p>
*/
inline const UserContextDataType& GetUserContextData() const{ return m_userContextData; }
inline bool UserContextDataHasBeenSet() const { return m_userContextDataHasBeenSet; }
inline void SetUserContextData(const UserContextDataType& value) { m_userContextDataHasBeenSet = true; m_userContextData = value; }
inline void SetUserContextData(UserContextDataType&& value) { m_userContextDataHasBeenSet = true; m_userContextData = std::move(value); }
inline SignUpRequest& WithUserContextData(const UserContextDataType& value) { SetUserContextData(value); return *this;}
inline SignUpRequest& WithUserContextData(UserContextDataType&& value) { SetUserContextData(std::move(value)); return *this;}
///@}
///@{
/**
* <p>A map of custom key-value pairs that you can provide as input for any custom
* workflows that this action triggers.</p> <p>You create custom workflows by
* assigning Lambda functions to user pool triggers. When you use the SignUp API
* action, Amazon Cognito invokes any functions that are assigned to the following
* triggers: <i>pre sign-up</i>, <i>custom message</i>, and <i>post
* confirmation</i>. When Amazon Cognito invokes any of these functions, it passes
* a JSON payload, which the function receives as input. This payload contains a
* <code>clientMetadata</code> attribute, which provides the data that you assigned
* to the ClientMetadata parameter in your SignUp request. In your function code in
* Lambda, you can process the <code>clientMetadata</code> value to enhance your
* workflow for your specific needs.</p> <p>For more information, see <a
* href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html">
* Customizing user pool Workflows with Lambda Triggers</a> in the <i>Amazon
* Cognito Developer Guide</i>.</p> <p>When you use the ClientMetadata
* parameter, remember that Amazon Cognito won't do the following:</p> <ul> <li>
* <p>Store the ClientMetadata value. This data is available only to Lambda
* triggers that are assigned to a user pool to support custom workflows. If your
* user pool configuration doesn't include triggers, the ClientMetadata parameter
* serves no purpose.</p> </li> <li> <p>Validate the ClientMetadata value.</p>
* </li> <li> <p>Encrypt the ClientMetadata value. Don't use Amazon Cognito to
* provide sensitive information.</p> </li> </ul>
*/
inline const Aws::Map<Aws::String, Aws::String>& GetClientMetadata() const{ return m_clientMetadata; }
inline bool ClientMetadataHasBeenSet() const { return m_clientMetadataHasBeenSet; }
inline void SetClientMetadata(const Aws::Map<Aws::String, Aws::String>& value) { m_clientMetadataHasBeenSet = true; m_clientMetadata = value; }
inline void SetClientMetadata(Aws::Map<Aws::String, Aws::String>&& value) { m_clientMetadataHasBeenSet = true; m_clientMetadata = std::move(value); }
inline SignUpRequest& WithClientMetadata(const Aws::Map<Aws::String, Aws::String>& value) { SetClientMetadata(value); return *this;}
inline SignUpRequest& WithClientMetadata(Aws::Map<Aws::String, Aws::String>&& value) { SetClientMetadata(std::move(value)); return *this;}
inline SignUpRequest& AddClientMetadata(const Aws::String& key, const Aws::String& value) { m_clientMetadataHasBeenSet = true; m_clientMetadata.emplace(key, value); return *this; }
inline SignUpRequest& AddClientMetadata(Aws::String&& key, const Aws::String& value) { m_clientMetadataHasBeenSet = true; m_clientMetadata.emplace(std::move(key), value); return *this; }
inline SignUpRequest& AddClientMetadata(const Aws::String& key, Aws::String&& value) { m_clientMetadataHasBeenSet = true; m_clientMetadata.emplace(key, std::move(value)); return *this; }
inline SignUpRequest& AddClientMetadata(Aws::String&& key, Aws::String&& value) { m_clientMetadataHasBeenSet = true; m_clientMetadata.emplace(std::move(key), std::move(value)); return *this; }
inline SignUpRequest& AddClientMetadata(const char* key, Aws::String&& value) { m_clientMetadataHasBeenSet = true; m_clientMetadata.emplace(key, std::move(value)); return *this; }
inline SignUpRequest& AddClientMetadata(Aws::String&& key, const char* value) { m_clientMetadataHasBeenSet = true; m_clientMetadata.emplace(std::move(key), value); return *this; }
inline SignUpRequest& AddClientMetadata(const char* key, const char* value) { m_clientMetadataHasBeenSet = true; m_clientMetadata.emplace(key, value); return *this; }
///@}
private:
Aws::String m_clientId;
bool m_clientIdHasBeenSet = false;
Aws::String m_secretHash;
bool m_secretHashHasBeenSet = false;
Aws::String m_username;
bool m_usernameHasBeenSet = false;
Aws::String m_password;
bool m_passwordHasBeenSet = false;
Aws::Vector<AttributeType> m_userAttributes;
bool m_userAttributesHasBeenSet = false;
Aws::Vector<AttributeType> m_validationData;
bool m_validationDataHasBeenSet = false;
AnalyticsMetadataType m_analyticsMetadata;
bool m_analyticsMetadataHasBeenSet = false;
UserContextDataType m_userContextData;
bool m_userContextDataHasBeenSet = false;
Aws::Map<Aws::String, Aws::String> m_clientMetadata;
bool m_clientMetadataHasBeenSet = false;
};
} // namespace Model
} // namespace CognitoIdentityProvider
} // namespace Aws