From f6b84d8b810ea28e990ea75563f91296807c9ba6 Mon Sep 17 00:00:00 2001 From: Petr Heinz Date: Tue, 18 Jun 2024 16:35:32 +0200 Subject: [PATCH] Fix Metadata resource to expect IDs in string format (#101) --- Makefile | 2 +- docs/resources/betteruptime_metadata.md | 2 +- internal/provider/resource_metadata.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 161a9d3..27b5c17 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ GOLANGCI_LINT := golangci-lint run --disable-all \ -E staticcheck \ -E typecheck \ -E unused -VERSION := 0.10.1 +VERSION := 0.10.3 .PHONY: test build help: diff --git a/docs/resources/betteruptime_metadata.md b/docs/resources/betteruptime_metadata.md index 67ea8cd..7a63843 100644 --- a/docs/resources/betteruptime_metadata.md +++ b/docs/resources/betteruptime_metadata.md @@ -18,7 +18,7 @@ https://betterstack.com/docs/uptime/api/metadata/ ### Required - **key** (String) The key of this Metadata. -- **owner_id** (Number) The ID of the owner of this Metadata. +- **owner_id** (String) The ID of the owner of this Metadata. - **owner_type** (String) The type of the owner of this Metadata. Valid values: `Monitor`, `Heartbeat`, `Incident`, `WebhookIntegration`, `EmailIntegration`, `IncomingWebhook` - **value** (String) The value of this Metadata. diff --git a/internal/provider/resource_metadata.go b/internal/provider/resource_metadata.go index 90b7993..42b41f9 100644 --- a/internal/provider/resource_metadata.go +++ b/internal/provider/resource_metadata.go @@ -33,7 +33,7 @@ var metadataSchema = map[string]*schema.Schema{ }, "owner_id": { Description: "The ID of the owner of this Metadata.", - Type: schema.TypeInt, + Type: schema.TypeString, Required: true, }, "key": { @@ -75,9 +75,9 @@ func newMetadataResource() *schema.Resource { } type metadata struct { - ID *int `json:"id,omitempty"` + ID *string `json:"id,omitempty"` OwnerType *string `json:"owner_type,omitempty"` - OwnerID *int `json:"owner_id,omitempty"` + OwnerID *string `json:"owner_id,omitempty"` Key *string `json:"key,omitempty"` Value *string `json:"value,omitempty"` CreatedAt *string `json:"created_at,omitempty"`