Skip to content

Commit

Permalink
wire up actual client
Browse files Browse the repository at this point in the history
  • Loading branch information
irubnich committed Jan 6, 2025
1 parent 5b03771 commit 62a316b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions datadog/fwprovider/data_source_datadog_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
var _ datasource.DataSource = &connectionDatasource{}

type connectionDatasource struct {
Api *datadogV2.TeamsApi
Api *datadogV2.ActionConnectionApi
Auth context.Context
}

Expand All @@ -22,7 +22,7 @@ func NewDatadogConnectionDataSource() datasource.DataSource {

func (d *connectionDatasource) Configure(_ context.Context, request datasource.ConfigureRequest, response *datasource.ConfigureResponse) {
providerData := request.ProviderData.(*FrameworkProvider)
d.Api = providerData.DatadogApiInstances.GetTeamsApiV2()
d.Api = providerData.DatadogApiInstances.GetActionConnectionApiV2()
d.Auth = providerData.Auth
}

Expand Down
4 changes: 2 additions & 2 deletions datadog/fwprovider/resource_datadog_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
)

type connectionResource struct {
Api *datadogV2.TeamsApi
Api *datadogV2.ActionConnectionApi
Auth context.Context
}

Expand Down Expand Up @@ -81,7 +81,7 @@ func NewConnectionResource() resource.Resource {

func (r *connectionResource) Configure(_ context.Context, request resource.ConfigureRequest, response *resource.ConfigureResponse) {
providerData := request.ProviderData.(*FrameworkProvider)
r.Api = providerData.DatadogApiInstances.GetTeamsApiV2()
r.Api = providerData.DatadogApiInstances.GetActionConnectionApiV2()
r.Auth = providerData.Auth
}

Expand Down
9 changes: 9 additions & 0 deletions datadog/internal/utils/api_instances_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type ApiInstances struct {
webhooksIntegrationApiV1 *datadogV1.WebhooksIntegrationApi

//V2 APIs
actionConnectionApiV2 *datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 47 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi
apiManagementAPIV2 *datadogV2.APIManagementApi
apmRetentionFiltersApiV2 *datadogV2.APMRetentionFiltersApi
auditApiV2 *datadogV2.AuditApi
Expand Down Expand Up @@ -680,3 +681,11 @@ func (i *ApiInstances) GetMicrosoftTeamsIntegrationApiV2() *datadogV2.MicrosoftT
}
return i.microsoftTeamsIntegrationApiV2
}

// GetActionConnectionApiV2 get instance of ActionConnectionApi
func (i *ApiInstances) GetActionConnectionApiV2() *datadogV2.ActionConnectionApi {

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi

Check failure on line 686 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV2.ActionConnectionApi
if i.actionConnectionApiV2 == nil {
i.actionConnectionApiV2 = datadogV2.NewActionConnectionApi(i.HttpClient)

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test-tofu

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / linter-checks

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.14.11, ubuntu-latest)

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (0.15.5, ubuntu-latest)

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.1.2, ubuntu-latest)

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV2.NewActionConnectionApi

Check failure on line 688 in datadog/internal/utils/api_instances_helper.go

View workflow job for this annotation

GitHub Actions / test (1.5.3, ubuntu-latest)

undefined: datadogV2.NewActionConnectionApi
}
return i.actionConnectionApiV2
}

0 comments on commit 62a316b

Please sign in to comment.