|
| 1 | +/** |
| 2 | + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * SPDX-License-Identifier: Apache-2.0. |
| 4 | + */ |
| 5 | + |
| 6 | +#pragma once |
| 7 | +#include <aws/bedrock/Bedrock_EXPORTS.h> |
| 8 | +#include <aws/bedrock/BedrockRequest.h> |
| 9 | +#include <aws/core/utils/memory/stl/AWSString.h> |
| 10 | +#include <aws/bedrock/model/ModelDataSource.h> |
| 11 | +#include <aws/core/utils/memory/stl/AWSVector.h> |
| 12 | +#include <aws/bedrock/model/Tag.h> |
| 13 | +#include <utility> |
| 14 | +#include <aws/core/utils/UUID.h> |
| 15 | + |
| 16 | +namespace Aws |
| 17 | +{ |
| 18 | +namespace Bedrock |
| 19 | +{ |
| 20 | +namespace Model |
| 21 | +{ |
| 22 | + |
| 23 | + /** |
| 24 | + */ |
| 25 | + class CreateCustomModelRequest : public BedrockRequest |
| 26 | + { |
| 27 | + public: |
| 28 | + AWS_BEDROCK_API CreateCustomModelRequest() = default; |
| 29 | + |
| 30 | + // Service request name is the Operation name which will send this request out, |
| 31 | + // each operation should has unique request name, so that we can get operation's name from this request. |
| 32 | + // Note: this is not true for response, multiple operations may have the same response name, |
| 33 | + // so we can not get operation's name from response. |
| 34 | + inline virtual const char* GetServiceRequestName() const override { return "CreateCustomModel"; } |
| 35 | + |
| 36 | + AWS_BEDROCK_API Aws::String SerializePayload() const override; |
| 37 | + |
| 38 | + |
| 39 | + ///@{ |
| 40 | + /** |
| 41 | + * <p>A unique name for the custom model.</p> |
| 42 | + */ |
| 43 | + inline const Aws::String& GetModelName() const { return m_modelName; } |
| 44 | + inline bool ModelNameHasBeenSet() const { return m_modelNameHasBeenSet; } |
| 45 | + template<typename ModelNameT = Aws::String> |
| 46 | + void SetModelName(ModelNameT&& value) { m_modelNameHasBeenSet = true; m_modelName = std::forward<ModelNameT>(value); } |
| 47 | + template<typename ModelNameT = Aws::String> |
| 48 | + CreateCustomModelRequest& WithModelName(ModelNameT&& value) { SetModelName(std::forward<ModelNameT>(value)); return *this;} |
| 49 | + ///@} |
| 50 | + |
| 51 | + ///@{ |
| 52 | + /** |
| 53 | + * <p>The data source for the model. The Amazon S3 URI in the model source must be |
| 54 | + * for the Amazon-managed Amazon S3 bucket containing your model artifacts. |
| 55 | + * SageMaker AI creates this bucket when you run your first SageMaker AI training |
| 56 | + * job.</p> |
| 57 | + */ |
| 58 | + inline const ModelDataSource& GetModelSourceConfig() const { return m_modelSourceConfig; } |
| 59 | + inline bool ModelSourceConfigHasBeenSet() const { return m_modelSourceConfigHasBeenSet; } |
| 60 | + template<typename ModelSourceConfigT = ModelDataSource> |
| 61 | + void SetModelSourceConfig(ModelSourceConfigT&& value) { m_modelSourceConfigHasBeenSet = true; m_modelSourceConfig = std::forward<ModelSourceConfigT>(value); } |
| 62 | + template<typename ModelSourceConfigT = ModelDataSource> |
| 63 | + CreateCustomModelRequest& WithModelSourceConfig(ModelSourceConfigT&& value) { SetModelSourceConfig(std::forward<ModelSourceConfigT>(value)); return *this;} |
| 64 | + ///@} |
| 65 | + |
| 66 | + ///@{ |
| 67 | + /** |
| 68 | + * <p>The Amazon Resource Name (ARN) of the customer managed KMS key to encrypt the |
| 69 | + * custom model. If you don't provide a KMS key, Amazon Bedrock uses an Amazon Web |
| 70 | + * Services-managed KMS key to encrypt the model. </p> <p>If you provide a customer |
| 71 | + * managed KMS key, your Amazon Bedrock service role must have permissions to use |
| 72 | + * it. For more information see <a |
| 73 | + * href="https://docs.aws.amazon.com/bedrock/latest/userguide/encryption-import-model.html">Encryption |
| 74 | + * of imported models</a>. </p> |
| 75 | + */ |
| 76 | + inline const Aws::String& GetModelKmsKeyArn() const { return m_modelKmsKeyArn; } |
| 77 | + inline bool ModelKmsKeyArnHasBeenSet() const { return m_modelKmsKeyArnHasBeenSet; } |
| 78 | + template<typename ModelKmsKeyArnT = Aws::String> |
| 79 | + void SetModelKmsKeyArn(ModelKmsKeyArnT&& value) { m_modelKmsKeyArnHasBeenSet = true; m_modelKmsKeyArn = std::forward<ModelKmsKeyArnT>(value); } |
| 80 | + template<typename ModelKmsKeyArnT = Aws::String> |
| 81 | + CreateCustomModelRequest& WithModelKmsKeyArn(ModelKmsKeyArnT&& value) { SetModelKmsKeyArn(std::forward<ModelKmsKeyArnT>(value)); return *this;} |
| 82 | + ///@} |
| 83 | + |
| 84 | + ///@{ |
| 85 | + /** |
| 86 | + * <p>The Amazon Resource Name (ARN) of an IAM service role that Amazon Bedrock |
| 87 | + * assumes to perform tasks on your behalf. This role must have permissions to |
| 88 | + * access the Amazon S3 bucket containing your model artifacts and the KMS key (if |
| 89 | + * specified). For more information, see <a |
| 90 | + * href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-import-iam-role.html">Setting |
| 91 | + * up an IAM service role for importing models</a> in the Amazon Bedrock User |
| 92 | + * Guide.</p> |
| 93 | + */ |
| 94 | + inline const Aws::String& GetRoleArn() const { return m_roleArn; } |
| 95 | + inline bool RoleArnHasBeenSet() const { return m_roleArnHasBeenSet; } |
| 96 | + template<typename RoleArnT = Aws::String> |
| 97 | + void SetRoleArn(RoleArnT&& value) { m_roleArnHasBeenSet = true; m_roleArn = std::forward<RoleArnT>(value); } |
| 98 | + template<typename RoleArnT = Aws::String> |
| 99 | + CreateCustomModelRequest& WithRoleArn(RoleArnT&& value) { SetRoleArn(std::forward<RoleArnT>(value)); return *this;} |
| 100 | + ///@} |
| 101 | + |
| 102 | + ///@{ |
| 103 | + /** |
| 104 | + * <p>A list of key-value pairs to associate with the custom model resource. You |
| 105 | + * can use these tags to organize and identify your resources.</p> <p>For more |
| 106 | + * information, see <a |
| 107 | + * href="https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html">Tagging |
| 108 | + * resources</a> in the <a |
| 109 | + * href="https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-service.html">Amazon |
| 110 | + * Bedrock User Guide</a>.</p> |
| 111 | + */ |
| 112 | + inline const Aws::Vector<Tag>& GetModelTags() const { return m_modelTags; } |
| 113 | + inline bool ModelTagsHasBeenSet() const { return m_modelTagsHasBeenSet; } |
| 114 | + template<typename ModelTagsT = Aws::Vector<Tag>> |
| 115 | + void SetModelTags(ModelTagsT&& value) { m_modelTagsHasBeenSet = true; m_modelTags = std::forward<ModelTagsT>(value); } |
| 116 | + template<typename ModelTagsT = Aws::Vector<Tag>> |
| 117 | + CreateCustomModelRequest& WithModelTags(ModelTagsT&& value) { SetModelTags(std::forward<ModelTagsT>(value)); return *this;} |
| 118 | + template<typename ModelTagsT = Tag> |
| 119 | + CreateCustomModelRequest& AddModelTags(ModelTagsT&& value) { m_modelTagsHasBeenSet = true; m_modelTags.emplace_back(std::forward<ModelTagsT>(value)); return *this; } |
| 120 | + ///@} |
| 121 | + |
| 122 | + ///@{ |
| 123 | + /** |
| 124 | + * <p>A unique, case-sensitive identifier to ensure that the API request completes |
| 125 | + * no more than one time. If this token matches a previous request, Amazon Bedrock |
| 126 | + * ignores the request, but does not return an error. For more information, see <a |
| 127 | + * href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring |
| 128 | + * idempotency</a>.</p> |
| 129 | + */ |
| 130 | + inline const Aws::String& GetClientRequestToken() const { return m_clientRequestToken; } |
| 131 | + inline bool ClientRequestTokenHasBeenSet() const { return m_clientRequestTokenHasBeenSet; } |
| 132 | + template<typename ClientRequestTokenT = Aws::String> |
| 133 | + void SetClientRequestToken(ClientRequestTokenT&& value) { m_clientRequestTokenHasBeenSet = true; m_clientRequestToken = std::forward<ClientRequestTokenT>(value); } |
| 134 | + template<typename ClientRequestTokenT = Aws::String> |
| 135 | + CreateCustomModelRequest& WithClientRequestToken(ClientRequestTokenT&& value) { SetClientRequestToken(std::forward<ClientRequestTokenT>(value)); return *this;} |
| 136 | + ///@} |
| 137 | + private: |
| 138 | + |
| 139 | + Aws::String m_modelName; |
| 140 | + bool m_modelNameHasBeenSet = false; |
| 141 | + |
| 142 | + ModelDataSource m_modelSourceConfig; |
| 143 | + bool m_modelSourceConfigHasBeenSet = false; |
| 144 | + |
| 145 | + Aws::String m_modelKmsKeyArn; |
| 146 | + bool m_modelKmsKeyArnHasBeenSet = false; |
| 147 | + |
| 148 | + Aws::String m_roleArn; |
| 149 | + bool m_roleArnHasBeenSet = false; |
| 150 | + |
| 151 | + Aws::Vector<Tag> m_modelTags; |
| 152 | + bool m_modelTagsHasBeenSet = false; |
| 153 | + |
| 154 | + Aws::String m_clientRequestToken{Aws::Utils::UUID::PseudoRandomUUID()}; |
| 155 | + bool m_clientRequestTokenHasBeenSet = true; |
| 156 | + }; |
| 157 | + |
| 158 | +} // namespace Model |
| 159 | +} // namespace Bedrock |
| 160 | +} // namespace Aws |
0 commit comments