diff options
author | Julien Dessaux | 2023-06-18 17:41:38 +0200 |
---|---|---|
committer | Julien Dessaux | 2023-06-18 17:43:53 +0200 |
commit | 6844355a928b60ffb1006e6b1d9f8af7b44647d5 (patch) | |
tree | 57355ad7bf98b870cf96ceec2a2eae64b94d3276 /internal/provider/provider.go | |
parent | Implemented project resource (diff) | |
download | terraform-provider-eventline-6844355a928b60ffb1006e6b1d9f8af7b44647d5.tar.gz terraform-provider-eventline-6844355a928b60ffb1006e6b1d9f8af7b44647d5.tar.bz2 terraform-provider-eventline-6844355a928b60ffb1006e6b1d9f8af7b44647d5.zip |
Imported and modified evcli's api client code
Diffstat (limited to 'internal/provider/provider.go')
-rw-r--r-- | internal/provider/provider.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/internal/provider/provider.go b/internal/provider/provider.go index 3ae769e..635580f 100644 --- a/internal/provider/provider.go +++ b/internal/provider/provider.go @@ -4,7 +4,7 @@ import ( "context" "fmt" - "git.adyxax.org/adyxax/terraform-eventline/internal/evcli" + "git.adyxax.org/adyxax/terraform-eventline/external/evcli" "github.com/hashicorp/terraform-plugin-framework/datasource" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" @@ -57,13 +57,12 @@ func (p *Provider) Configure(ctx context.Context, req provider.ConfigureRequest, if resp.Diagnostics.HasError() { return } - config := evcli.Config{API: evcli.APIConfig{Endpoint: data.Endpoint.ValueString()}} + config := evcli.APIConfig{Endpoint: data.Endpoint.ValueString(), Key: data.ApiKey.ValueString()} client, err := evcli.NewClient(&config) if err != nil { resp.Diagnostics.AddError("new api client", fmt.Sprintf("Unable to instanciate eventline api client, got error: %s", err)) return } - client.APIKey = data.ApiKey.ValueString() resp.DataSourceData = client resp.ResourceData = client |