@@ -10,26 +10,26 @@ import (
1010 "github.com/PaloAltoNetworks/pango/xmlapi"
1111)
1212
13- type SDKImportableEntryService [E EntryObject , L EntryLocation , IL ImportLocation ] interface {
13+ type SDKImportableEntryService [E EntryObject , L EntryLocation ] interface {
1414 CreateWithXpath (context.Context , string , E ) error
1515 ReadWithXpath (context.Context , string , string ) (E , error )
1616 List (context.Context , L , string , string , string ) ([]E , error )
1717 UpdateWithXpath (context.Context , string , E , string ) error
18- Delete (context.Context , L , [] IL , ... string ) error
19- ImportToLocations (context.Context , L , [] IL , string ) error
20- UnimportFromLocations (context.Context , L , [] IL , [] string ) error
18+ Delete (context.Context , L , string , ... string ) error
19+ ImportToLocation (context.Context , L , string , string ) error
20+ UnimportFromLocation (context.Context , L , string , string ) error
2121}
2222
23- type ImportableEntryObjectManager [E EntryObject , L EntryLocation , IL ImportLocation , IS SDKImportableEntryService [E , L , IL ]] struct {
23+ type ImportableEntryObjectManager [E EntryObject , L EntryLocation , IS SDKImportableEntryService [E , L ]] struct {
2424 batchSize int
2525 service IS
2626 client SDKClient
2727 specifier func (E ) (any , error )
2828 matcher func (E , E ) bool
2929}
3030
31- func NewImportableEntryObjectManager [E EntryObject , L EntryLocation , IL ImportLocation , IS SDKImportableEntryService [E , L , IL ]](client SDKClient , service IS , batchSize int , specifier func (E ) (any , error ), matcher func (E , E ) bool ) * ImportableEntryObjectManager [E , L , IL , IS ] {
32- return & ImportableEntryObjectManager [E , L , IL , IS ]{
31+ func NewImportableEntryObjectManager [E EntryObject , L EntryLocation , IS SDKImportableEntryService [E , L ]](client SDKClient , service IS , batchSize int , specifier func (E ) (any , error ), matcher func (E , E ) bool ) * ImportableEntryObjectManager [E , L , IS ] {
32+ return & ImportableEntryObjectManager [E , L , IS ]{
3333 batchSize : batchSize ,
3434 service : service ,
3535 client : client ,
@@ -38,11 +38,11 @@ func NewImportableEntryObjectManager[E EntryObject, L EntryLocation, IL ImportLo
3838 }
3939}
4040
41- func (o * ImportableEntryObjectManager [E , L , IL , IS ]) ReadMany (ctx context.Context , location L , entries []E ) ([]E , error ) {
41+ func (o * ImportableEntryObjectManager [E , L , IS ]) ReadMany (ctx context.Context , location L , entries []E ) ([]E , error ) {
4242 return nil , & Error {err : ErrInternal , message : "called ReadMany on an importable singular resource" }
4343}
4444
45- func (o * ImportableEntryObjectManager [E , L , IL , IS ]) Read (ctx context.Context , location L , components []string , name string ) (E , error ) {
45+ func (o * ImportableEntryObjectManager [E , L , IS ]) Read (ctx context.Context , location L , components []string , name string ) (E , error ) {
4646 xpath , err := location .XpathWithComponents (o .client .Versioning (), append (components , util .AsEntryXpath (name ))... )
4747 if err != nil {
4848 return * new (E ), err
@@ -59,7 +59,7 @@ func (o *ImportableEntryObjectManager[E, L, IL, IS]) Read(ctx context.Context, l
5959 return object , nil
6060}
6161
62- func (o * ImportableEntryObjectManager [E , L , IL , IS ]) Create (ctx context.Context , location L , components []string , entry E ) (E , error ) {
62+ func (o * ImportableEntryObjectManager [E , L , IS ]) Create (ctx context.Context , location L , components []string , entry E ) (E , error ) {
6363 name := entry .EntryName ()
6464
6565 _ , err := o .Read (ctx , location , components , name )
@@ -84,7 +84,7 @@ func (o *ImportableEntryObjectManager[E, L, IL, IS]) Create(ctx context.Context,
8484 return o .Read (ctx , location , components , name )
8585}
8686
87- func (o * ImportableEntryObjectManager [E , L , IL , IS ]) Update (ctx context.Context , location L , components []string , entry E , name string ) (E , error ) {
87+ func (o * ImportableEntryObjectManager [E , L , IS ]) Update (ctx context.Context , location L , components []string , entry E , name string ) (E , error ) {
8888 xpath , err := location .XpathWithComponents (o .client .Versioning (), append (components , util .AsEntryXpath (entry .EntryName ()))... )
8989 if err != nil {
9090 return * new (E ), & Error {err : err , message : "error during Update call" }
@@ -98,7 +98,7 @@ func (o *ImportableEntryObjectManager[E, L, IL, IS]) Update(ctx context.Context,
9898 return o .service .ReadWithXpath (ctx , util .AsXpath (xpath ), "get" )
9999}
100100
101- func (o * ImportableEntryObjectManager [E , L , IL , IS ]) Delete (ctx context.Context , location L , importLocations [] IL , components []string , names []string ) error {
101+ func (o * ImportableEntryObjectManager [E , L , IS ]) Delete (ctx context.Context , location L , components []string , names []string ) error {
102102 deletes := xmlapi .NewChunkedMultiConfig (o .batchSize , len (names ))
103103
104104 for _ , elt := range names {
@@ -123,10 +123,10 @@ func (o *ImportableEntryObjectManager[E, L, IL, IS]) Delete(ctx context.Context,
123123 return nil
124124}
125125
126- func (o * ImportableEntryObjectManager [E , L , IL , IS ]) ImportToLocations (ctx context.Context , location L , importLocs [] IL , entry string ) error {
127- return o .service .ImportToLocations (ctx , location , importLocs , entry )
126+ func (o * ImportableEntryObjectManager [E , L , IS ]) ImportToLocation (ctx context.Context , location L , vsys string , entry string ) error {
127+ return o .service .ImportToLocation (ctx , location , vsys , entry )
128128}
129129
130- func (o * ImportableEntryObjectManager [E , L , IL , IS ]) UnimportFromLocations (ctx context.Context , location L , importLocs [] IL , entry string ) error {
131- return o .service .UnimportFromLocations (ctx , location , importLocs , [] string { entry } )
130+ func (o * ImportableEntryObjectManager [E , L , IS ]) UnimportFromLocation (ctx context.Context , location L , vsys string , entry string ) error {
131+ return o .service .UnimportFromLocation (ctx , location , vsys , entry )
132132}
0 commit comments