Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Local Processing Agents Management #103

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 69 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,79 @@ 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/v0.8.4...HEAD)
## [Unreleased](https://github.com/fivetran/go-fivetran/compare/v0.8.6...HEAD)

## [0.8.4](https://github.com/fivetran/go-fivetran/compare/v0.8.3...v0.8.4)
## [0.8.6](https://github.com/fivetran/go-fivetran/compare/v0.8.5...v0.8.6)

## Added

Supported the following Fivetran API endpoints for Local Processing Agent Management:
- [Create a Local Processing Agent](https://fivetran.com/docs/rest-api/local-processing-agent-management#createalocalprocessingagent)
- [List Local Processing Agents](/docs/rest-api/local-processing-agent-management#listlocalprocessingagents)
- [Retrieve Local Processing Agent Details](/docs/rest-api/local-processing-agent-management#retrievelocalprocessingagentdetails)
- [Delete a Local Processing Agent](/docs/rest-api/local-processing-agent-management#deletealocalprocessingagent)
- [Regenerate authentication keys for a Local Processing Agent](/docs/rest-api/local-processing-agent-management#regeneratekeys)

Supported the following Fivetran API endpoints for Private Links Management::
- [List all Private Links within Account](https://fivetran.com/docs/rest-api/private-links-management#listallprivatelinkswithinaccount)

Added fields to support setting up Local Processing Agent in Destination API:
- `DestinationCreateService.localProcessingAgentId`
- `DestinationModifyService.localProcessingAgentId`
- `DestinationDetailsService.localProcessingAgentId`

Added fields to support setting up Private Link in Destination API:
- `DestinationCreateService.privateLinkId`
- `DestinationModifyService.privateLinkId`
- `DestinationDetailsService.privateLinkId`

Added fields to support setting up Networking Method in Destination API:
- `DestinationCreateService.networkingMethod`
- `DestinationModifyService.networkingMethod`
- `DestinationDetailsService.networkingMethod`

Added fields to support setting up Local Processing Agent in Connector API:
- `ConnectorCreateService.localProcessingAgentId`
- `ConnectorModifyService.localProcessingAgentId`
- `ConnectorDetailsService.localProcessingAgentId`

Added fields to support setting up Proxy Agent in Connector API:
- `ConnectorCreateService.proxyAgentId`
- `ConnectorModifyService.proxyAgentId`
- `ConnectorDetailsService.proxyAgentId`

Added fields to support setting up Private Link in Connector API:
- `ConnectorCreateService.privateLinkId`
- `ConnectorModifyService.privateLinkId`
- `ConnectorDetailsService.privateLinkId`

Added fields to support setting up Networking Method in Connector API:
- `ConnectorCreateService.networkingMethod`
- `ConnectorModifyService.networkingMethod`
- `ConnectorDetailsService.networkingMethod`

## Removed
Removed the following deprecated Fivetran API endpoints for Proxy Agents Management:
- [Attach connection to the proxy agent](https://fivetran.com/docs/rest-api/proxy-management#attachconnectiontotheproxyagent)
- [Detach connection from the proxy agent](https://fivetran.com/docs/rest-api/proxy-management#detachconnectionformtheproxyagent)

Removed the following deprecated Fivetran API endpoints for Private Links Management:
- [List all Private Links within Group](https://fivetran.com/docs/rest-api/private-links-management#listallprivatelinkswithingroup)

## [0.8.5](https://github.com/fivetran/go-fivetran/compare/v0.8.4...v0.8.5)

## Added

Supported the following Fivetran API endpoints for Proxy Agents Management:
- [Create a Proxy Agent](/docs/rest-api/proxy-management#createaproxyagent)
- [List all Proxy Agents](/docs/rest-api/proxy-management#listallproxyagents)
- [Retrieve Proxy Agent Details](/docs/rest-api/proxy-management#retrieveproxyagentdetails)
- [Delete a Proxy Agent](/docs/rest-api/proxy-management#deleteaproxyagent)
- [Return all connections attached to the proxy agent](/docs/rest-api/proxy-management#returnsallconnectionsattachedtotheproxyagent)
- [Attach connection to the proxy agent](/docs/rest-api/proxy-management#attachconnectiontotheproxyagent)
- [Detach connection from the proxy agent](/docs/rest-api/proxy-management#detachconnectionformtheproxyagent)
- [Create a Proxy Agent](https://fivetran.com/docs/rest-api/proxy-management#createaproxyagent)
- [List all Proxy Agents](https://fivetran.com/docs/rest-api/proxy-management#listallproxyagents)
- [Retrieve Proxy Agent Details](https://fivetran.com/docs/rest-api/proxy-management#retrieveproxyagentdetails)
- [Delete a Proxy Agent](https://fivetran.com/docs/rest-api/proxy-management#deleteaproxyagent)
- [Return all connections attached to the proxy agent](https://fivetran.com/docs/rest-api/proxy-management#returnsallconnectionsattachedtotheproxyagent)
- [Attach connection to the proxy agent](https://fivetran.com/docs/rest-api/proxy-management#attachconnectiontotheproxyagent)
- [Detach connection from the proxy agent](https://fivetran.com/docs/rest-api/proxy-management#detachconnectionformtheproxyagent)

## [0.8.3](https://github.com/fivetran/go-fivetran/compare/v0.8.2...v0.8.3)
## [0.8.4](https://github.com/fivetran/go-fivetran/compare/v0.8.3...v0.8.4)

## Added
Added fields to support Shift my UTC offset with daylight savings time (US Only) in Destination API:
Expand All @@ -30,15 +87,15 @@ Added fields to support Shift my UTC offset with daylight savings time (US Only)

Removed unneccessary field `service` from Private Links API `PrivateLinksCreateService`

## [0.8.2](https://github.com/fivetran/go-fivetran/compare/v0.8.1...v0.8.2)
## [0.8.3](https://github.com/fivetran/go-fivetran/compare/v0.8.2...v0.8.3)

## Added
Support for custom config (`map[string]interface{}`) for destinations:
- `DestinationCreateService.ConfigCustom` and `DestinationCreateService.DoCustom` methods
- `DestinationModifyService.ConfigCustom` and `DestinationModifyService.DoCustom` methods
- `DestinationDetailsService.DoCustom` method

## [0.8.1](https://github.com/fivetran/go-fivetran/compare/v0.8.0...v0.8.1)
## [0.8.2](https://github.com/fivetran/go-fivetran/compare/v0.8.0...v0.8.2)

## Added

Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ REST API Endpoint | REST API Version | SDK Service/Config
REST API Endpoint | REST API Version | SDK Service/Config
--- | --- | ---
[Create a Private Link](https://fivetran.com/docs/rest-api/private-links-management#createaprivatelink) | v1 | [PrivateLinksCreateService](https://pkg.go.dev/github.com/fivetran/go-fivetran#PrivateLinksCreateService)
[List all Private Links within Group](https://fivetran.com/docs/rest-api/private-links-management#listallprivatelinkswithingroup) | v1 | [GroupListPrivateLinksService](https://pkg.go.dev/github.com/fivetran/go-fivetran#GroupListPrivateLinksService)
[List all Private Links within Account](https://fivetran.com/docs/rest-api/private-links-management#listallprivatelinkswithinaccount) | v1 | [PrivateLinkListService](https://pkg.go.dev/github.com/fivetran/go-fivetran#PrivateLinkListService)
[Retrieve Private Link Details](https://fivetran.com/docs/rest-api/private-links-management#retrieveprivatelinkdetails) | v1 | [PrivateLinksDetailsService](https://pkg.go.dev/github.com/fivetran/go-fivetran#PrivateLinksDetailsService)
[Update a Private Link](https://fivetran.com/docs/rest-api/private-links-management#updateaprivatelink) | v1 | [PrivateLinksModifyService](https://pkg.go.dev/github.com/fivetran/go-fivetran#PrivateLinksModifyService)
[Delete a Private Link](https://fivetran.com/docs/rest-api/private-links-management#deleteaprivatelink) | v1 | [PrivateLinksDeleteService](https://pkg.go.dev/github.com/fivetran/go-fivetran#PrivateLinksDeleteService)
Expand All @@ -272,8 +272,15 @@ REST API Endpoint | REST API Version | SDK Service/Config
[Retrieve Proxy Agent Details](/docs/rest-api/proxy-management#retrieveproxyagentdetails) | v1 | [ProxyDetailsService](https://pkg.go.dev/github.com/fivetran/go-fivetran#ProxyDetailsService)
[Delete a Proxy Agent](/docs/rest-api/proxy-management#deleteaproxyagent) | v1 | [ProxyDeleteService](https://pkg.go.dev/github.com/fivetran/go-fivetran#ProxyDeleteService)
[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)
[Attach connection to the proxy agent](/docs/rest-api/proxy-management#attachconnectiontotheproxyagent) | v1 | [ProxyConnectionMembershipCreateService](https://pkg.go.dev/github.com/fivetran/go-fivetran#ProxyConnectionMembershipCreateService)
[Detach connection from the proxy agent](/docs/rest-api/proxy-management#detachconnectionformtheproxyagent) | v1 | [ProxyConnectionMembershipDeleteService](https://pkg.go.dev/github.com/fivetran/go-fivetran#ProxyConnectionMembershipDeleteService)

### [Local Processing Agent Management](https://fivetran.com/docs/rest-api/local-processing-agent-management#localprocessingagentmanagement)
REST API Endpoint | REST API Version | SDK Service/Config
--- | --- | ---
[Create a Local Processing Agent](https://fivetran.com/docs/rest-api/local-processing-agent-management#createalocalprocessingagent) | v1 | [LocalProcessingAgentCreateService](https://pkg.go.dev/github.com/fivetran/go-fivetran#LocalProcessingAgentCreateService)
[List Local Processing Agents](/docs/rest-api/local-processing-agent-management#listlocalprocessingagents) | v1 | [LocalProcessingAgentListService](https://pkg.go.dev/github.com/fivetran/go-fivetran#LocalProcessingAgentListService)
[Retrieve Local Processing Agent Details](/docs/rest-api/local-processing-agent-management#retrievelocalprocessingagentdetails) | v1 | [LocalProcessingAgentDetailsService](https://pkg.go.dev/github.com/fivetran/go-fivetran#LocalProcessingAgentDetailsService)
[Delete a Local Processing Agent](/docs/rest-api/local-processing-agent-management#deletealocalprocessingagent) | v1 | [LocalProcessingAgentDeleteService](https://pkg.go.dev/github.com/fivetran/go-fivetran#LocalProcessingAgentDeleteService)
[Regenerate authentication keys for a Local Processing Agent](/docs/rest-api/local-processing-agent-management#regeneratekeys) | v1 | [LocalProcessingAgentReAuthService](https://pkg.go.dev/github.com/fivetran/go-fivetran#LocalProcessingAgentReAuthService)

## Support

Expand Down
54 changes: 34 additions & 20 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import (
"github.com/fivetran/go-fivetran/fingerprints"
"github.com/fivetran/go-fivetran/groups"
httputils "github.com/fivetran/go-fivetran/http_utils"
privatelinks "github.com/fivetran/go-fivetran/private_links"
privatelink "github.com/fivetran/go-fivetran/private_link"
localprocessingagent "github.com/fivetran/go-fivetran/local_processing_agent"
"github.com/fivetran/go-fivetran/roles"
"github.com/fivetran/go-fivetran/teams"
"github.com/fivetran/go-fivetran/users"
Expand All @@ -36,7 +37,7 @@ const defaultBaseURL = "https://api.fivetran.com/v1"
const restAPIv2 = "application/json;version=2"

// WARNING: Update Agent version on each release!
const defaultUserAgent = "Go-Fivetran/0.8.4"
const defaultUserAgent = "Go-Fivetran/0.8.6"

// New receives API Key and API Secret, and returns a new Client with the
// default HTTP client
Expand Down Expand Up @@ -233,10 +234,6 @@ func (c *Client) NewGroupListUsers() *groups.GroupListUsersService {
return &groups.GroupListUsersService{HttpService: c.NewHttpService()}
}

func (c *Client) NewGroupListPrivateLinks() *groups.GroupListPrivateLinksService {
return &groups.GroupListPrivateLinksService{HttpService: c.NewHttpService()}
}

func (c *Client) NewGroupsList() *groups.GroupsListService {
return &groups.GroupsListService{HttpService: c.NewHttpService()}
}
Expand Down Expand Up @@ -587,20 +584,24 @@ func (c *Client) NewConnectorsSourceMetadata() *connectors.ConnectorsSourceMetad
}

/* Private Links */
func (c *Client) NewPrivateLinksCreate() *privatelinks.PrivateLinksCreateService {
return &privatelinks.PrivateLinksCreateService{HttpService: c.NewHttpService()}
func (c *Client) NewPrivateLinkCreate() *privatelink.PrivateLinkCreateService {
return &privatelink.PrivateLinkCreateService{HttpService: c.NewHttpService()}
}

func (c *Client) NewPrivateLinkDelete() *privatelink.PrivateLinkDeleteService {
return &privatelink.PrivateLinkDeleteService{HttpService: c.NewHttpService()}
}

func (c *Client) NewPrivateLinksDelete() *privatelinks.PrivateLinksDeleteService {
return &privatelinks.PrivateLinksDeleteService{HttpService: c.NewHttpService()}
func (c *Client) NewPrivateLinkList() *privatelink.PrivateLinkListService {
return &privatelink.PrivateLinkListService{HttpService: c.NewHttpService()}
}

func (c *Client) NewPrivateLinksDetails() *privatelinks.PrivateLinksDetailsService {
return &privatelinks.PrivateLinksDetailsService{HttpService: c.NewHttpService()}
func (c *Client) NewPrivateLinkDetails() *privatelink.PrivateLinkDetailsService {
return &privatelink.PrivateLinkDetailsService{HttpService: c.NewHttpService()}
}

func (c *Client) NewPrivateLinksModify() *privatelinks.PrivateLinksModifyService {
return &privatelinks.PrivateLinksModifyService{HttpService: c.NewHttpService()}
func (c *Client) NewPrivateLinkModify() *privatelink.PrivateLinkModifyService {
return &privatelink.PrivateLinkModifyService{HttpService: c.NewHttpService()}
}

/* Proxy */
Expand All @@ -620,14 +621,27 @@ func (c *Client) NewProxyDelete() *proxy.ProxyDeleteService {
return &proxy.ProxyDeleteService{HttpService: c.NewHttpService()}
}

func (c *Client) NewProxyConnectionMembershipCreate() *proxy.ProxyConnectionMembershipCreateService {
return &proxy.ProxyConnectionMembershipCreateService{HttpService: c.NewHttpService()}
}

func (c *Client) NewProxyConnectionMembershipsList() *proxy.ProxyConnectionMembershipsListService {
return &proxy.ProxyConnectionMembershipsListService{HttpService: c.NewHttpService()}
}

func (c *Client) NewProxyConnectionMembershipDelete() *proxy.ProxyConnectionMembershipDeleteService {
return &proxy.ProxyConnectionMembershipDeleteService{HttpService: c.NewHttpService()}
/* Local Processing Agent */
func (c *Client) NewLocalProcessingAgentCreate() *localprocessingagent.LocalProcessingAgentCreateService {
return &localprocessingagent.LocalProcessingAgentCreateService{HttpService: c.NewHttpService()}
}

func (c *Client) NewLocalProcessingAgentDelete() *localprocessingagent.LocalProcessingAgentDeleteService {
return &localprocessingagent.LocalProcessingAgentDeleteService{HttpService: c.NewHttpService()}
}

func (c *Client) NewLocalProcessingAgentDetails() *localprocessingagent.LocalProcessingAgentDetailsService {
return &localprocessingagent.LocalProcessingAgentDetailsService{HttpService: c.NewHttpService()}
}

func (c *Client) NewLocalProcessingAgentList() *localprocessingagent.LocalProcessingAgentListService {
return &localprocessingagent.LocalProcessingAgentListService{HttpService: c.NewHttpService()}
}

func (c *Client) NewLocalProcessingAgentReAuth() *localprocessingagent.LocalProcessingAgentReAuthService {
return &localprocessingagent.LocalProcessingAgentReAuthService{HttpService: c.NewHttpService()}
}
Loading
Loading