Skip to content

Commit 1e88b91

Browse files
author
Mathieu Garcia
committed
User catalog_name if defined
1 parent a9c5e84 commit 1e88b91

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ovh/order_cart.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,21 @@ func orderCartGenericProductPlanRead(d *schema.ResourceData, meta interface{}) e
388388
planCode := d.Get("plan_code").(string)
389389
priceCapacity := d.Get("price_capacity").(string)
390390
product := d.Get("product").(string)
391+
catalogName := d.Get("catalog_name").(string)
391392

392393
log.Printf("[DEBUG] Will read order cart %s for cart: %s", product, cartId)
393394

394395
res := []OrderCartGenericProduct{}
395396

397+
if catalogName != "" {
398+
catalogName = fmt.Sprintf("?catalogName=%s", catalogName)
399+
}
400+
396401
endpoint := fmt.Sprintf(
397-
"/order/cart/%s/%s",
402+
"/order/cart/%s/%s%s",
398403
url.PathEscape(cartId),
399404
product,
405+
catalogName,
400406
)
401407

402408
if err := config.OVHClient.Get(endpoint, &res); err != nil {

0 commit comments

Comments
 (0)