Added missing attribute value object (#6849)

## Description
Adds a missing type class for
[AdditionalResultAttributeValue](https://docs.aws.amazon.com/kendra/latest/APIReference/API_AdditionalResultAttributeValue.html).
Fixes validation failure for the query API that have
`AdditionalAttributes` in the response.

cc @dev2049 
cc @zhichenggeng
This commit is contained in:
Piyush Jain 2023-06-27 16:30:11 -07:00 committed by GitHub
parent e494b0a09f
commit e53995836a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,16 +32,17 @@ class TextWithHighLights(BaseModel, extra=Extra.allow):
Highlights: Optional[Any]
class AdditionalResultAttributeValue(BaseModel, extra=Extra.allow):
TextWithHighlightsValue: TextWithHighLights
class AdditionalResultAttribute(BaseModel, extra=Extra.allow):
Key: str
ValueType: Literal["TEXT_WITH_HIGHLIGHTS_VALUE"]
Value: Optional[TextWithHighLights]
Value: AdditionalResultAttributeValue
def get_value_text(self) -> str:
if not self.Value:
return ""
else:
return self.Value.Text
return self.Value.TextWithHighlightsValue.Text
class QueryResultItem(BaseModel, extra=Extra.allow):