@@ -18,6 +18,7 @@ type SDKImportableEntryService[E EntryObject, L EntryLocation, IL ImportLocation
1818 Delete (context.Context , L , []IL , ... string ) error
1919 ImportToLocations (context.Context , L , []IL , string ) error
2020 UnimportFromLocations (context.Context , L , []IL , []string ) error
21+ ListWithXpath (context.Context , string , string , string , string ) ([]E , error )
2122}
2223
2324type ImportableEntryObjectManager [E EntryObject , L EntryLocation , IL ImportLocation , IS SDKImportableEntryService [E , L , IL ]] struct {
@@ -38,8 +39,22 @@ func NewImportableEntryObjectManager[E EntryObject, L EntryLocation, IL ImportLo
3839 }
3940}
4041
41- func (o * ImportableEntryObjectManager [E , L , IL , IS ]) ReadMany (ctx context.Context , location L , entries []E ) ([]E , error ) {
42- return nil , & Error {err : ErrInternal , message : "called ReadMany on an importable singular resource" }
42+ func (o * ImportableEntryObjectManager [E , L , IL , IS ]) ReadMany (ctx context.Context , location L , components []string ) ([]E , error ) {
43+ xpath , err := location .XpathWithComponents (o .client .Versioning (), append (components , util .AsEntryXpath ("" ))... )
44+ if err != nil {
45+ return nil , err
46+ }
47+
48+ existing , err := o .service .ListWithXpath (ctx , util .AsXpath (xpath ), "get" , "" , "" )
49+ if err != nil {
50+ if sdkerrors .IsObjectNotFound (err ) {
51+ return nil , ErrObjectNotFound
52+ } else {
53+ return nil , & Error {err : err , message : "Failed to read entries from the server" }
54+ }
55+ }
56+
57+ return existing , nil
4358}
4459
4560func (o * ImportableEntryObjectManager [E , L , IL , IS ]) Read (ctx context.Context , location L , components []string , name string ) (E , error ) {
0 commit comments