Skip to content

Commit

Permalink
Drop Plan.ID
Browse files Browse the repository at this point in the history
  • Loading branch information
Khyme committed Jan 24, 2025
1 parent 0e6b852 commit c7ab730
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion docs/data-sources/products.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Read-Only:

Read-Only:

- `id` (String)
- `memory_gb` (Number)
- `milli_cpu` (Number)
- `price` (Number)
Expand Down
3 changes: 1 addition & 2 deletions internal/client/products.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ type Product struct {
}

type Plan struct {
ID string `json:"id"`
ProductID string `json:"productId"`
RegionCode string `json:"regionCode"`
Price float64 `json:"price"`
Expand All @@ -25,7 +24,7 @@ type Plan struct {
}

type ProductsResponse struct {
Products []*Product `json:"products"`
Products []*Product `json:"orbProducts"`
}

func (c *Client) GetProducts(ctx context.Context) ([]*Product, error) {
Expand Down
5 changes: 0 additions & 5 deletions internal/provider/products_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ type productsModel struct {
}

type planModel struct {
ID types.String `tfsdk:"id"`
ProductID types.String `tfsdk:"product_id"`
Price types.Float64 `tfsdk:"price"`
MilliCPU types.Int64 `tfsdk:"milli_cpu"`
Expand Down Expand Up @@ -87,7 +86,6 @@ func (d *productsDataSource) Read(ctx context.Context, _ datasource.ReadRequest,
continue
}
productState.Plans = append(productState.Plans, &planModel{
ID: types.StringValue(plan.ID),
ProductID: types.StringValue(plan.ProductID),
RegionCode: types.StringValue(plan.RegionCode),
Price: types.Float64Value(plan.Price),
Expand Down Expand Up @@ -140,9 +138,6 @@ func (d *productsDataSource) Schema(_ context.Context, _ datasource.SchemaReques
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Computed: true,
},
"product_id": schema.StringAttribute{
Computed: true,
},
Expand Down

0 comments on commit c7ab730

Please sign in to comment.