22
33namespace AsyncAws \BedrockAgent \Result ;
44
5+ use AsyncAws \BedrockAgent \Enum \ContentDataSourceType ;
6+ use AsyncAws \BedrockAgent \Enum \DocumentStatus ;
57use AsyncAws \BedrockAgent \ValueObject \CustomDocumentIdentifier ;
68use AsyncAws \BedrockAgent \ValueObject \DocumentIdentifier ;
79use AsyncAws \BedrockAgent \ValueObject \KnowledgeBaseDocumentDetail ;
@@ -45,7 +47,7 @@ private function populateResultCustomDocumentIdentifier(array $json): CustomDocu
4547 private function populateResultDocumentIdentifier (array $ json ): DocumentIdentifier
4648 {
4749 return new DocumentIdentifier ([
48- 'dataSourceType ' => (string ) $ json ['dataSourceType ' ],
50+ 'dataSourceType ' => !ContentDataSourceType:: exists (( string ) $ json [ ' dataSourceType ' ]) ? ContentDataSourceType:: UNKNOWN_TO_SDK : (string ) $ json ['dataSourceType ' ],
4951 's3 ' => empty ($ json ['s3 ' ]) ? null : $ this ->populateResultS3Location ($ json ['s3 ' ]),
5052 'custom ' => empty ($ json ['custom ' ]) ? null : $ this ->populateResultCustomDocumentIdentifier ($ json ['custom ' ]),
5153 ]);
@@ -56,7 +58,7 @@ private function populateResultKnowledgeBaseDocumentDetail(array $json): Knowled
5658 return new KnowledgeBaseDocumentDetail ([
5759 'knowledgeBaseId ' => (string ) $ json ['knowledgeBaseId ' ],
5860 'dataSourceId ' => (string ) $ json ['dataSourceId ' ],
59- 'status ' => (string ) $ json ['status ' ],
61+ 'status ' => !DocumentStatus:: exists (( string ) $ json [ ' status ' ]) ? DocumentStatus:: UNKNOWN_TO_SDK : (string ) $ json ['status ' ],
6062 'identifier ' => $ this ->populateResultDocumentIdentifier ($ json ['identifier ' ]),
6163 'statusReason ' => isset ($ json ['statusReason ' ]) ? (string ) $ json ['statusReason ' ] : null ,
6264 'updatedAt ' => isset ($ json ['updatedAt ' ]) && ($ d = \DateTimeImmutable::createFromFormat (\DateTimeInterface::ATOM , $ json ['updatedAt ' ])) ? $ d : null ,
0 commit comments