Skip to content

Commit

Permalink
fix: support updating cost_centre in mve
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaportPhilipBrowne committed Jun 21, 2024
1 parent 0e5f3a0 commit 94b7528
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mve.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type ModifyMVERequest struct {
MVEID string
Name string
MarketplaceVisibility *bool
CostCentre string

WaitForUpdate bool // Wait until the MCVEupdates before returning
WaitForTime time.Duration // How long to wait for the MVE to update if WaitForUpdate is true (default is 5 minutes)
Expand Down Expand Up @@ -260,10 +261,15 @@ func (svc *MVEServiceOp) ModifyMVE(ctx context.Context, req *ModifyMVERequest) (
modifyProductReq := &ModifyProductRequest{
ProductID: req.MVEID,
ProductType: PRODUCT_MVE,
Name: req.Name,
CostCentre: "",
MarketplaceVisibility: PtrTo(false),
}
if req.Name != "" {
modifyProductReq.Name = req.Name
}
if req.CostCentre != "" {
modifyProductReq.CostCentre = req.CostCentre
}

_, err := svc.Client.ProductService.ModifyProduct(ctx, modifyProductReq)
if err != nil {
return nil, err
Expand Down

0 comments on commit 94b7528

Please sign in to comment.