Skip to content

Commit

Permalink
Add LanguageCode to FAQ resource.
Browse files Browse the repository at this point in the history
  • Loading branch information
jregistr committed Jan 16, 2024
1 parent 52e4d9d commit a72d4e0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
10 changes: 10 additions & 0 deletions aws-kendra-faq/aws-kendra-faq.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
"minLength": 1,
"maxLength": 1000
},
"LanguageCode": {
"description": "The code for a language.",
"type": "string",
"minLength": 2,
"maxLength": 10,
"pattern": "[a-zA-Z-]*"
},
"FileFormat": {
"description": "Format of the input file",
"enum": [
Expand Down Expand Up @@ -135,6 +142,9 @@
"Arn": {
"type": "string",
"maxLength": 1000
},
"LanguageCode": {
"$ref": "#/definitions/LanguageCode"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ static CreateFaqRequest translateToCreateRequest(final ResourceModel model) {
.description(model.getDescription())
.name(model.getName())
.roleArn(model.getRoleArn())
.fileFormat(model.getFileFormat());
.fileFormat(model.getFileFormat())
.languageCode(model.getLanguageCode());
if (model.getS3Path() != null) {
builder.s3Path(
S3Path.builder()
Expand Down Expand Up @@ -65,7 +66,8 @@ static ResourceModel translateFromReadResponse(final DescribeFaqResponse describ
.description(describeFaqResponse.description())
.name(describeFaqResponse.name())
.roleArn(describeFaqResponse.roleArn())
.fileFormat(describeFaqResponse.fileFormatAsString());
.fileFormat(describeFaqResponse.fileFormatAsString())
.languageCode(describeFaqResponse.languageCode());
if (describeFaqResponse.s3Path() != null) {
builder.s3Path(software.amazon.kendra.faq.S3Path.builder()
.key(describeFaqResponse.s3Path().key())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void testCreateFaqRequest() {
.s3Path(s3Path)
.roleArn(roleArn)
.tags(Arrays.asList(Tag.builder().key(tagKey).value(tagValue).build()))
.languageCode("de")
.build();

CreateFaqRequest createFaqRequest = CreateFaqRequest
Expand All @@ -56,6 +57,7 @@ void testCreateFaqRequest() {
.bucket(s3Bucket)
.build())
.roleArn(roleArn)
.languageCode("de")
.tags(Arrays.asList(software.amazon.awssdk.services.kendra.model.Tag
.builder().key(tagKey).value(tagValue).build()))
.build();
Expand Down

0 comments on commit a72d4e0

Please sign in to comment.