Skip to content

Commit

Permalink
Add field in PrivateLinkConfig (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-aleksandrboldyrev authored Oct 2, 2024
1 parent 6ce11fd commit 0d25516
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions private_link/private_link_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type PrivateLinkConfig struct {
awsAccountId *string
clusterIdentifier *string
subResourceName *string
privateDnsRegions *string
privateConnectionServiceId *string
}

Expand All @@ -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"`
}

Expand All @@ -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"`

}
Expand All @@ -57,6 +60,7 @@ func (plc *PrivateLinkConfig) Request() *privateLinkConfigRequest {
AwsAccountId: plc.awsAccountId,
ClusterIdentifier: plc.clusterIdentifier,
SubResourceName: plc.subResourceName,
PrivateDnsRegions: plc.privateDnsRegions,
PrivateConnectionServiceId: plc.privateConnectionServiceId,
}
}
Expand Down Expand Up @@ -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
Expand Down
19 changes: 17 additions & 2 deletions test_utils/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@ func CleanupDestinations() {
log.Fatal(err)
}
}
if groups.Data.NextCursor != "" {
CleanupDestinations()
}
}

func CleanupGroups() {
Expand All @@ -583,6 +586,9 @@ func CleanupGroups() {
}
}
}
if groups.Data.NextCursor != "" {
CleanupGroups()
}
}

func CleanupConnectors(groupId string) {
Expand All @@ -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() {
Expand All @@ -635,6 +647,9 @@ func CleanupWebhooks() {
log.Fatal(err)
}
}
if list.Data.NextCursor != "" {
CleanupWebhooks()
}
}

func CleanupTeams() {
Expand Down

0 comments on commit 0d25516

Please sign in to comment.