Skip to content

Commit

Permalink
feat: fixed type casting issue (incentro-ecx#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
demeyerthom authored Sep 24, 2024
1 parent 45a5791 commit d681a9c
Show file tree
Hide file tree
Showing 31 changed files with 63 additions and 60 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,6 @@ fabric.properties
/bin/
/dist/
/.env
/token.json
/token.json

/local
4 changes: 2 additions & 2 deletions commercelayer/resource_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func resourceAddressReadFunc(ctx context.Context, d *schema.ResourceData, i inte
return nil
}

d.SetId(address.GetId())
d.SetId(address.GetId().(string))

return nil
}
Expand Down Expand Up @@ -239,7 +239,7 @@ func resourceAddressCreateFunc(ctx context.Context, d *schema.ResourceData, i in
return diagErr(err)
}

d.SetId(*address.Data.Id)
d.SetId(address.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_adyen_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func resourceAdyenGatewayReadFunc(ctx context.Context, d *schema.ResourceData, i
return nil
}

d.SetId(adyenGateway.GetId())
d.SetId(adyenGateway.GetId().(string))

return nil
}
Expand Down Expand Up @@ -162,7 +162,7 @@ func resourceAdyenGatewayCreateFunc(ctx context.Context, d *schema.ResourceData,
return diagErr(err)
}

d.SetId(*adyenGateway.Data.Id)
d.SetId(adyenGateway.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_bing_geocoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func resourceBingGeocodersReadFunc(ctx context.Context, d *schema.ResourceData,
return nil
}

d.SetId(bingGeocoder.GetId())
d.SetId(bingGeocoder.GetId().(string))

return nil
}
Expand Down Expand Up @@ -124,7 +124,7 @@ func resourceBingGeocodersCreateFunc(ctx context.Context, d *schema.ResourceData
return diagErr(err)
}

d.SetId(*bingGeocoders.Data.Id)
d.SetId(bingGeocoders.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_braintree_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func resourceBraintreeGatewayReadFunc(ctx context.Context, d *schema.ResourceDat
return nil
}

d.SetId(braintreeGateway.GetId())
d.SetId(braintreeGateway.GetId().(string))

return nil
}
Expand Down Expand Up @@ -160,7 +160,7 @@ func resourceBraintreeGatewayCreateFunc(ctx context.Context, d *schema.ResourceD
return diagErr(err)
}

d.SetId(*braintreeGateway.Data.Id)
d.SetId(braintreeGateway.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_checkout_com_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func resourceCheckoutComGatewayReadFunc(ctx context.Context, d *schema.ResourceD
return nil
}

d.SetId(checkoutComGateway.GetId())
d.SetId(checkoutComGateway.GetId().(string))

return nil
}
Expand Down Expand Up @@ -130,7 +130,7 @@ func resourceCheckoutComGatewayCreateFunc(ctx context.Context, d *schema.Resourc
return diagErr(err)
}

d.SetId(*checkoutComGateway.Data.Id)
d.SetId(checkoutComGateway.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_customer_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func resourceCustomerGroupReadFunc(ctx context.Context, d *schema.ResourceData,
return nil
}

d.SetId(customerGroup.GetId())
d.SetId(customerGroup.GetId().(string))

return nil
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func resourceCustomerGroupCreateFunc(ctx context.Context, d *schema.ResourceData
return diagErr(err)
}

d.SetId(*customerGroup.Data.Id)
d.SetId(customerGroup.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_delivery_lead_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func resourceDeliveryLeadTimesReadFunc(ctx context.Context, d *schema.ResourceDa
return nil
}

d.SetId(deliveryLeadTime.GetId())
d.SetId(deliveryLeadTime.GetId().(string))

return nil
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func resourceDeliveryLeadTimesCreateFunc(ctx context.Context, d *schema.Resource
return diagErr(err)
}

d.SetId(*deliveryLeadTimes.Data.Id)
d.SetId(deliveryLeadTimes.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_external_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func resourceExternalGatewayReadFunc(ctx context.Context, d *schema.ResourceData
return nil
}

d.SetId(externalGateway.GetId())
d.SetId(externalGateway.GetId().(string))

return nil
}
Expand Down Expand Up @@ -147,7 +147,7 @@ func resourceExternalGatewayCreateFunc(ctx context.Context, d *schema.ResourceDa
return diagErr(err)
}

d.SetId(*externalGateway.Data.Id)
d.SetId(externalGateway.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_external_tax_calculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func resourceExternalTaxCalculatorReadFunc(ctx context.Context, d *schema.Resour
return nil
}

d.SetId(externalTaxCalculator.GetId())
d.SetId(externalTaxCalculator.GetId().(string))

return nil
}
Expand Down Expand Up @@ -123,7 +123,7 @@ func resourceExternalTaxCalculatorCreateFunc(ctx context.Context, d *schema.Reso
return diagErr(err)
}

d.SetId(*externalTaxCalculator.Data.Id)
d.SetId(externalTaxCalculator.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_google_geocoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func resourceGoogleGeocodersReadFunc(ctx context.Context, d *schema.ResourceData
return nil
}

d.SetId(googleGeocoder.GetId())
d.SetId(googleGeocoder.GetId().(string))

return nil
}
Expand Down Expand Up @@ -124,7 +124,7 @@ func resourceGoogleGeocodersCreateFunc(ctx context.Context, d *schema.ResourceDa
return diagErr(err)
}

d.SetId(*googleGeocoders.Data.Id)
d.SetId(googleGeocoders.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_inventory_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func resourceInventoryModelReadFunc(ctx context.Context, d *schema.ResourceData,
return nil
}

d.SetId(inventoryModel.GetId())
d.SetId(inventoryModel.GetId().(string))

return nil
}
Expand Down Expand Up @@ -132,7 +132,7 @@ func resourceInventoryModelCreateFunc(ctx context.Context, d *schema.ResourceDat
return diagErr(err)
}

d.SetId(*inventoryModel.Data.Id)
d.SetId(inventoryModel.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_inventory_return_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func resourceInventoryReturnLocationReadFunc(ctx context.Context, d *schema.Reso
return nil
}

d.SetId(inventoryModel.GetId())
d.SetId(inventoryModel.GetId().(string))

return nil
}
Expand Down Expand Up @@ -153,7 +153,7 @@ func resourceInventoryReturnLocationCreateFunc(ctx context.Context, d *schema.Re
return diagErr(err)
}

d.SetId(*inventoryModel.Data.Id)
d.SetId(inventoryModel.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_inventory_stock_location.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func resourceInventoryStockLocationReadFunc(ctx context.Context, d *schema.Resou
return nil
}

d.SetId(inventoryModel.GetId())
d.SetId(inventoryModel.GetId().(string))

return nil
}
Expand Down Expand Up @@ -162,7 +162,7 @@ func resourceInventoryStockLocationCreateFunc(ctx context.Context, d *schema.Res
return diagErr(err)
}

d.SetId(*inventoryModel.Data.Id)
d.SetId(inventoryModel.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_klarna_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func resourceKlarnaGatewayReadFunc(ctx context.Context, d *schema.ResourceData,
return nil
}

d.SetId(klarnaGateway.GetId())
d.SetId(klarnaGateway.GetId().(string))

return nil
}
Expand Down Expand Up @@ -136,7 +136,7 @@ func resourceKlarnaGatewayCreateFunc(ctx context.Context, d *schema.ResourceData
return diagErr(err)
}

d.SetId(*klarnaGateway.Data.Id)
d.SetId(klarnaGateway.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_manual_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func resourceManualGatewayReadFunc(ctx context.Context, d *schema.ResourceData,
return nil
}

d.SetId(manualGateway.GetId())
d.SetId(manualGateway.GetId().(string))

return nil
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func resourceManualGatewayCreateFunc(ctx context.Context, d *schema.ResourceData
return diagErr(err)
}

d.SetId(*manualGateway.Data.Id)
d.SetId(manualGateway.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_manual_tax_calculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func resourceManualTaxCalculatorReadFunc(ctx context.Context, d *schema.Resource
return nil
}

d.SetId(manualTaxCalculator.GetId())
d.SetId(manualTaxCalculator.GetId().(string))

return nil
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func resourceManualTaxCalculatorCreateFunc(ctx context.Context, d *schema.Resour
return diagErr(err)
}

d.SetId(*manualTaxCalculator.Data.Id)
d.SetId(manualTaxCalculator.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_market.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func resourceMarketReadFunc(ctx context.Context, d *schema.ResourceData, i inter
return nil
}

d.SetId(Market.GetId())
d.SetId(Market.GetId().(string))

return nil
}
Expand Down Expand Up @@ -215,7 +215,7 @@ func resourceMarketCreateFunc(ctx context.Context, d *schema.ResourceData, i int
return diagErr(err)
}

d.SetId(*market.Data.Id)
d.SetId(market.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_merchant.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func resourceMerchantReadFunc(ctx context.Context, d *schema.ResourceData, i int
return nil
}

d.SetId(merchant.GetId())
d.SetId(merchant.GetId().(string))

return nil
}
Expand Down Expand Up @@ -141,7 +141,7 @@ func resourceMerchantCreateFunc(ctx context.Context, d *schema.ResourceData, i i
return diagErr(err)
}

d.SetId(*merchant.Data.Id)
d.SetId(merchant.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_payment_method.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func resourcePaymentMethodReadFunc(ctx context.Context, d *schema.ResourceData,
return nil
}

d.SetId(address.GetId())
d.SetId(address.GetId().(string))

return nil
}
Expand Down Expand Up @@ -190,7 +190,7 @@ func resourcePaymentMethodCreateFunc(ctx context.Context, d *schema.ResourceData
return diagErr(err)
}

d.SetId(*paymentMethod.Data.Id)
d.SetId(paymentMethod.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_paypal_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func resourcePaypalGatewayReadFunc(ctx context.Context, d *schema.ResourceData,
return nil
}

d.SetId(paypalGateway.GetId())
d.SetId(paypalGateway.GetId().(string))

return nil
}
Expand Down Expand Up @@ -130,7 +130,7 @@ func resourcePaypalGatewayCreateFunc(ctx context.Context, d *schema.ResourceData
return diagErr(err)
}

d.SetId(*paypalGateway.Data.Id)
d.SetId(paypalGateway.Data.GetId().(string))

return nil
}
Expand Down
4 changes: 2 additions & 2 deletions commercelayer/resource_price_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func resourcePriceListReadFunc(ctx context.Context, d *schema.ResourceData, i in
return nil
}

d.SetId(priceList.GetId())
d.SetId(priceList.GetId().(string))

return nil
}
Expand Down Expand Up @@ -131,7 +131,7 @@ func resourcePriceListCreateFunc(ctx context.Context, d *schema.ResourceData, i
return diagErr(err)
}

d.SetId(*priceList.Data.Id)
d.SetId(priceList.Data.GetId().(string))

return nil
}
Expand Down
Loading

0 comments on commit d681a9c

Please sign in to comment.