From 0d255160eb8e6b9fd5069697993938b14c174c8b Mon Sep 17 00:00:00 2001 From: Aleksandr Boldyrev <125960514+fivetran-aleksandrboldyrev@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:52:18 +0200 Subject: [PATCH] Add field in PrivateLinkConfig (#116) --- CHANGELOG.md | 7 ++++++- README.md | 1 + private_link/private_link_config.go | 9 +++++++++ test_utils/test_utils.go | 19 +++++++++++++++++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c3f7cd..9b8cbd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/fivetran/go-fivetran/compare/v1.0.0...HEAD) +## [Unreleased](https://github.com/fivetran/go-fivetran/compare/v1.0.1...HEAD) + +## [1.0.1](https://github.com/fivetran/go-fivetran/compare/v1.0.0...v1.0.1) + +## Added +- `PrivateDnsRegions` field in `privatelink.PrivateLinkConfig` ## [1.0.0](https://github.com/fivetran/go-fivetran/compare/v0.9.4...v1.0.0) diff --git a/README.md b/README.md index ef07b15..a52d00e 100644 --- a/README.md +++ b/README.md @@ -274,6 +274,7 @@ REST API Endpoint | REST API Version | SDK Service/Config [Return all connections attached to the proxy agent](/docs/rest-api/proxy-management#returnsallconnectionsattachedtotheproxyagent) | v1 | [ProxyConnectionMembershipsListService](https://pkg.go.dev/github.com/fivetran/go-fivetran#ProxyConnectionMembershipsListService) ### [Hybrid Deployment Agent Management](https://fivetran.com/docs/rest-api/hybrid-deployment-agent-management#hybriddeploymentagentmanagement) + REST API Endpoint | REST API Version | SDK Service/Config --- | --- | --- [Create a Hybrid Deployment Agent](https://fivetran.com/docs/rest-api/hybrid-deployment-agent-management#createahybriddeploymentagent) | v1 | [HybridDeploymentAgentCreateService](https://pkg.go.dev/github.com/fivetran/go-fivetran#HybridDeploymentAgentCreateService) diff --git a/private_link/private_link_config.go b/private_link/private_link_config.go index e6b96d0..a321545 100644 --- a/private_link/private_link_config.go +++ b/private_link/private_link_config.go @@ -13,6 +13,7 @@ type PrivateLinkConfig struct { awsAccountId *string clusterIdentifier *string subResourceName *string + privateDnsRegions *string privateConnectionServiceId *string } @@ -27,6 +28,7 @@ type privateLinkConfigRequest struct { AwsAccountId *string `json:"aws_account_id,omitempty"` ClusterIdentifier *string `json:"cluster_identifier,omitempty"` SubResourceName *string `json:"sub_resource_name,omitempty"` + PrivateDnsRegions *string `json:"private_dns_regions,omitempty"` PrivateConnectionServiceId *string `json:"private_connection_service_id,omitempty"` } @@ -41,6 +43,7 @@ type PrivateLinkConfigResponse struct { AwsAccountId string `json:"aws_account_id"` ClusterIdentifier string `json:"cluster_identifier"` SubResourceName string `json:"sub_resource_name"` + PrivateDnsRegions string `json:"private_dns_regions"` PrivateConnectionServiceId string `json:"private_connection_service_id,omitempty"` } @@ -57,6 +60,7 @@ func (plc *PrivateLinkConfig) Request() *privateLinkConfigRequest { AwsAccountId: plc.awsAccountId, ClusterIdentifier: plc.clusterIdentifier, SubResourceName: plc.subResourceName, + PrivateDnsRegions: plc.privateDnsRegions, PrivateConnectionServiceId: plc.privateConnectionServiceId, } } @@ -111,6 +115,11 @@ func (plc *PrivateLinkConfig) SubResourceName(value string) *PrivateLinkConfig { return plc } +func (plc *PrivateLinkConfig) PrivateDnsRegions(value string) *PrivateLinkConfig { + plc.privateDnsRegions = &value + return plc +} + func (plc *PrivateLinkConfig) PrivateConnectionServiceId(value string) *PrivateLinkConfig { plc.privateConnectionServiceId = &value return plc diff --git a/test_utils/test_utils.go b/test_utils/test_utils.go index a6a1b3e..90f3aa1 100644 --- a/test_utils/test_utils.go +++ b/test_utils/test_utils.go @@ -567,6 +567,9 @@ func CleanupDestinations() { log.Fatal(err) } } + if groups.Data.NextCursor != "" { + CleanupDestinations() + } } func CleanupGroups() { @@ -583,6 +586,9 @@ func CleanupGroups() { } } } + if groups.Data.NextCursor != "" { + CleanupGroups() + } } func CleanupConnectors(groupId string) { @@ -609,19 +615,25 @@ func CleanupExternalLogging() { log.Fatal(err) } } + if groups.Data.NextCursor != "" { + CleanupExternalLogging() + } } func CleanupPrivateLinks() { - links, err := Client.NewPrivateLinkList().Do(context.Background()) + list, err := Client.NewPrivateLinkList().Do(context.Background()) if err != nil { log.Fatal(err) } - for _, link := range links.Data.Items { + for _, link := range list.Data.Items { _, err := Client.NewPrivateLinkDelete().PrivateLinkId(link.Id).Do(context.Background()) if err != nil && err.Error() != "status code: 404; expected: 200" { log.Fatal(err) } } + if list.Data.NextCursor != "" { + CleanupPrivateLinks() + } } func CleanupWebhooks() { @@ -635,6 +647,9 @@ func CleanupWebhooks() { log.Fatal(err) } } + if list.Data.NextCursor != "" { + CleanupWebhooks() + } } func CleanupTeams() {