diff --git a/CHANGELOG.md b/CHANGELOG.md index ebe8659..3c3f7cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,26 @@ 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.9.4...HEAD) +## [Unreleased](https://github.com/fivetran/go-fivetran/compare/v1.0.0...HEAD) + +## [1.0.0](https://github.com/fivetran/go-fivetran/compare/v0.9.4...v1.0.0) + +Release version + +Renamed the following service from Local Processing Agent to Hybrid Deployment Agent: +- LocalProcessingAgentCreateService to HybridDeploymentAgentCreateService +- LocalProcessingAgentListService to HybridDeploymentAgentListService +- LocalProcessingAgentDetailsService to HybridDeploymentAgentDetailsService +- LocalProcessingAgentDeleteService to HybridDeploymentAgentDeleteService +- LocalProcessingAgentReAuthService to HybridDeploymentAgentReAuthService + +Rename fields: +- `DestinationCreateService.localProcessingAgentId` to `DestinationCreateService.hybridDeploymentAgentId` +- `DestinationModifyService.localProcessingAgentId` to `DestinationCreateService.hybridDeploymentAgentId` +- `DestinationDetailsService.localProcessingAgentId` to `DestinationCreateService.hybridDeploymentAgentId` +- `ConnectorCreateService.localProcessingAgentId` to `DestinationCreateService.hybridDeploymentAgentId` +- `ConnectorModifyService.localProcessingAgentId` to `DestinationCreateService.hybridDeploymentAgentId` +- `ConnectorDetailsService.localProcessingAgentId` to `DestinationCreateService.hybridDeploymentAgentId` ## [0.9.3](https://github.com/fivetran/go-fivetran/compare/v0.9.2...v0.9.4) diff --git a/README.md b/README.md index 5701d48..ef07b15 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,6 @@ Checkout our [CHANGELOG](CHANGELOG.md) for information about the latest bug fixe Make sure you read the Fivetran REST API [documentation](https://fivetran.com/docs/rest-api) before using the SDK. -**NOTE**: `go-fivetran` is still in [ALPHA](https://en.wikipedia.org/wiki/Software_release_life_cycle#Alpha) development stage. Future versions may introduce breaking changes. - ## Installation ``` @@ -275,14 +273,14 @@ REST API Endpoint | REST API Version | SDK Service/Config [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) -### [Local Processing Agent Management](https://fivetran.com/docs/rest-api/local-processing-agent-management#localprocessingagentmanagement) +### [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 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) +[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) +[List Hybrid Deployment Agents](/docs/rest-api/hybrid-deployment-agent-management#listhybriddeploymentagents) | v1 | [HybridDeploymentAgentListService](https://pkg.go.dev/github.com/fivetran/go-fivetran#HybridDeploymentAgentListService) +[Retrieve Hybrid Deployment Agent Details](/docs/rest-api/hybrid-deployment-agent-management#retrievehybriddeploymentagentdetails) | v1 | [HybridDeploymentAgentDetailsService](https://pkg.go.dev/github.com/fivetran/go-fivetran#HybridDeploymentAgentDetailsService) +[Delete a Hybrid Deployment Agent](/docs/rest-api/lhybrid-deployment-agent-management#deleteahybriddeploymentagent) | v1 | [HybridDeploymentAgentDeleteService](https://pkg.go.dev/github.com/fivetran/go-fivetran#HybridDeploymentAgentDeleteService) +[Regenerate authentication keys for a Hybrid Deployment Agent](/docs/rest-api/hybrid-deployment-agent-management#regeneratekeys) | v1 | [HybridDeploymentAgentReAuthService](https://pkg.go.dev/github.com/fivetran/go-fivetran#HybridDeploymentAgentReAuthService) ## Support diff --git a/client.go b/client.go index 540b3f7..83f23a8 100644 --- a/client.go +++ b/client.go @@ -14,7 +14,7 @@ import ( "github.com/fivetran/go-fivetran/fingerprints" "github.com/fivetran/go-fivetran/groups" httputils "github.com/fivetran/go-fivetran/http_utils" - localprocessingagent "github.com/fivetran/go-fivetran/local_processing_agent" + hybriddeploymentagent "github.com/fivetran/go-fivetran/hybrid_deployment_agent" privatelink "github.com/fivetran/go-fivetran/private_link" "github.com/fivetran/go-fivetran/proxy" "github.com/fivetran/go-fivetran/roles" @@ -633,23 +633,23 @@ func (c *Client) NewProxyConnectionMembershipsList() *proxy.ProxyConnectionMembe return &proxy.ProxyConnectionMembershipsListService{HttpService: c.NewHttpService()} } -/* Local Processing Agent */ -func (c *Client) NewLocalProcessingAgentCreate() *localprocessingagent.LocalProcessingAgentCreateService { - return &localprocessingagent.LocalProcessingAgentCreateService{HttpService: c.NewHttpService()} +/* Hybrid Deployment Agent */ +func (c *Client) NewHybridDeploymentAgentCreate() *hybriddeploymentagent.HybridDeploymentAgentCreateService { + return &hybriddeploymentagent.HybridDeploymentAgentCreateService{HttpService: c.NewHttpService()} } -func (c *Client) NewLocalProcessingAgentDelete() *localprocessingagent.LocalProcessingAgentDeleteService { - return &localprocessingagent.LocalProcessingAgentDeleteService{HttpService: c.NewHttpService()} +func (c *Client) NewHybridDeploymentAgentDelete() *hybriddeploymentagent.HybridDeploymentAgentDeleteService { + return &hybriddeploymentagent.HybridDeploymentAgentDeleteService{HttpService: c.NewHttpService()} } -func (c *Client) NewLocalProcessingAgentDetails() *localprocessingagent.LocalProcessingAgentDetailsService { - return &localprocessingagent.LocalProcessingAgentDetailsService{HttpService: c.NewHttpService()} +func (c *Client) NewHybridDeploymentAgentDetails() *hybriddeploymentagent.HybridDeploymentAgentDetailsService { + return &hybriddeploymentagent.HybridDeploymentAgentDetailsService{HttpService: c.NewHttpService()} } -func (c *Client) NewLocalProcessingAgentList() *localprocessingagent.LocalProcessingAgentListService { - return &localprocessingagent.LocalProcessingAgentListService{HttpService: c.NewHttpService()} +func (c *Client) NewHybridDeploymentAgentList() *hybriddeploymentagent.HybridDeploymentAgentListService { + return &hybriddeploymentagent.HybridDeploymentAgentListService{HttpService: c.NewHttpService()} } -func (c *Client) NewLocalProcessingAgentReAuth() *localprocessingagent.LocalProcessingAgentReAuthService { - return &localprocessingagent.LocalProcessingAgentReAuthService{HttpService: c.NewHttpService()} +func (c *Client) NewHybridDeploymentAgentReAuth() *hybriddeploymentagent.HybridDeploymentAgentReAuthService { + return &hybriddeploymentagent.HybridDeploymentAgentReAuthService{HttpService: c.NewHttpService()} } diff --git a/connectors/common_types.go b/connectors/common_types.go index d4cfc1e..03a49ad 100644 --- a/connectors/common_types.go +++ b/connectors/common_types.go @@ -1,210 +1,210 @@ package connectors import ( - "time" + "time" - "github.com/fivetran/go-fivetran/common" + "github.com/fivetran/go-fivetran/common" ) type DetailsResponseDataCommon struct { - ID string `json:"id"` - GroupID string `json:"group_id"` - Service string `json:"service"` - ServiceVersion *int `json:"service_version"` - Schema string `json:"schema"` - ConnectedBy string `json:"connected_by"` - CreatedAt time.Time `json:"created_at"` - SucceededAt time.Time `json:"succeeded_at"` - FailedAt time.Time `json:"failed_at"` - SyncFrequency *int `json:"sync_frequency"` - ScheduleType string `json:"schedule_type"` - Paused *bool `json:"paused"` - PauseAfterTrial *bool `json:"pause_after_trial"` - DailySyncTime string `json:"daily_sync_time"` - PrivateLinkId string `json:"private_link_id"` - LocalProcessingAgentId string `json:"local_processing_agent_id"` - ProxyAgentId string `json:"proxy_agent_id"` - NetworkingMethod string `json:"networking_method"` - Status StatusResponse `json:"status"` + ID string `json:"id"` + GroupID string `json:"group_id"` + Service string `json:"service"` + ServiceVersion *int `json:"service_version"` + Schema string `json:"schema"` + ConnectedBy string `json:"connected_by"` + CreatedAt time.Time `json:"created_at"` + SucceededAt time.Time `json:"succeeded_at"` + FailedAt time.Time `json:"failed_at"` + SyncFrequency *int `json:"sync_frequency"` + ScheduleType string `json:"schedule_type"` + Paused *bool `json:"paused"` + PauseAfterTrial *bool `json:"pause_after_trial"` + DailySyncTime string `json:"daily_sync_time"` + PrivateLinkId string `json:"private_link_id"` + HybridDeploymentAgentId string `json:"hybrid_deployment_agent_id"` + ProxyAgentId string `json:"proxy_agent_id"` + NetworkingMethod string `json:"networking_method"` + Status StatusResponse `json:"status"` } type DetailsAndSetupTestsResponseDataCommon struct { - DetailsResponseDataCommon - SetupTests []common.SetupTestResponse `json:"setup_tests"` + DetailsResponseDataCommon + SetupTests []common.SetupTestResponse `json:"setup_tests"` } type StatusResponse struct { - SetupState string `json:"setup_state"` - SyncState string `json:"sync_state"` - UpdateState string `json:"update_state"` - IsHistoricalSync *bool `json:"is_historical_sync"` - Tasks []common.CommonResponse `json:"tasks"` - Warnings []common.CommonResponse `json:"warnings"` + SetupState string `json:"setup_state"` + SyncState string `json:"sync_state"` + UpdateState string `json:"update_state"` + IsHistoricalSync *bool `json:"is_historical_sync"` + Tasks []common.CommonResponse `json:"tasks"` + Warnings []common.CommonResponse `json:"warnings"` } type DetailsWithConfigResponse struct { - common.CommonResponse - Data struct { - DetailsAndSetupTestsResponseDataCommon - Config ConnectorConfigResponse `json:"config"` - } `json:"data"` + common.CommonResponse + Data struct { + DetailsAndSetupTestsResponseDataCommon + Config ConnectorConfigResponse `json:"config"` + } `json:"data"` } type DetailsWithCustomConfigResponse struct { - common.CommonResponse - Data struct { - DetailsAndSetupTestsResponseDataCommon - Config map[string]interface{} `json:"config"` - } `json:"data"` + common.CommonResponse + Data struct { + DetailsAndSetupTestsResponseDataCommon + Config map[string]interface{} `json:"config"` + } `json:"data"` } type DetailsWithCustomMergedConfigResponse struct { - common.CommonResponse - Data struct { - DetailsAndSetupTestsResponseDataCommon - CustomConfig map[string]interface{} `json:"config"` - Config ConnectorConfigResponse // no mapping here - } `json:"data"` + common.CommonResponse + Data struct { + DetailsAndSetupTestsResponseDataCommon + CustomConfig map[string]interface{} `json:"config"` + Config ConnectorConfigResponse // no mapping here + } `json:"data"` } type DetailsWithConfigNoTestsResponse struct { - common.CommonResponse - Data struct { - DetailsResponseDataCommon - Config ConnectorConfigResponse `json:"config"` - } `json:"data"` + common.CommonResponse + Data struct { + DetailsResponseDataCommon + Config ConnectorConfigResponse `json:"config"` + } `json:"data"` } type DetailsWithCustomConfigNoTestsResponse struct { - common.CommonResponse - Data struct { - DetailsResponseDataCommon - Config map[string]interface{} `json:"config"` - } `json:"data"` + common.CommonResponse + Data struct { + DetailsResponseDataCommon + Config map[string]interface{} `json:"config"` + } `json:"data"` } type DetailsWithCustomMergedConfigNoTestsResponse struct { - common.CommonResponse - Data struct { - DetailsResponseDataCommon - CustomConfig map[string]interface{} `json:"config"` - Config ConnectorConfigResponse // no mapping here - } `json:"data"` + common.CommonResponse + Data struct { + DetailsResponseDataCommon + CustomConfig map[string]interface{} `json:"config"` + Config ConnectorConfigResponse // no mapping here + } `json:"data"` } type ConnectorSchemaDetailsResponse struct { - common.CommonResponse - Data struct { - SchemaChangeHandling string `json:"schema_change_handling"` - Schemas map[string]*ConnectorSchemaConfigSchemaResponse `json:"schemas"` - } `json:"data"` + common.CommonResponse + Data struct { + SchemaChangeHandling string `json:"schema_change_handling"` + Schemas map[string]*ConnectorSchemaConfigSchemaResponse `json:"schemas"` + } `json:"data"` } type connectorCreateRequestBase struct { - Service *string `json:"service,omitempty"` - GroupID *string `json:"group_id,omitempty"` - TrustCertificates *bool `json:"trust_certificates,omitempty"` - TrustFingerprints *bool `json:"trust_fingerprints,omitempty"` - RunSetupTests *bool `json:"run_setup_tests,omitempty"` - Paused *bool `json:"paused,omitempty"` - SyncFrequency *int `json:"sync_frequency,omitempty"` - DailySyncTime *string `json:"daily_sync_time,omitempty"` - PauseAfterTrial *bool `json:"pause_after_trial,omitempty"` - ProxyAgentId *string `json:"proxy_agent_id,omitempty"` - PrivateLinkId *string `json:"private_link_id,omitempty"` - LocalProcessingAgentId *string `json:"local_processing_agent_id,omitempty"` - NetworkingMethod *string `json:"networking_method,omitempty"` + Service *string `json:"service,omitempty"` + GroupID *string `json:"group_id,omitempty"` + TrustCertificates *bool `json:"trust_certificates,omitempty"` + TrustFingerprints *bool `json:"trust_fingerprints,omitempty"` + RunSetupTests *bool `json:"run_setup_tests,omitempty"` + Paused *bool `json:"paused,omitempty"` + SyncFrequency *int `json:"sync_frequency,omitempty"` + DailySyncTime *string `json:"daily_sync_time,omitempty"` + PauseAfterTrial *bool `json:"pause_after_trial,omitempty"` + ProxyAgentId *string `json:"proxy_agent_id,omitempty"` + PrivateLinkId *string `json:"private_link_id,omitempty"` + HybridDeploymentAgentId *string `json:"hybrid_deployment_agent_id,omitempty"` + NetworkingMethod *string `json:"networking_method,omitempty"` } type connectorCreateRequest struct { - connectorCreateRequestBase - Config any `json:"config,omitempty"` - Auth any `json:"auth,omitempty"` + connectorCreateRequestBase + Config any `json:"config,omitempty"` + Auth any `json:"auth,omitempty"` } type connectorCustomCreateRequest struct { - connectorCreateRequestBase - Config *map[string]interface{} `json:"config,omitempty"` - Auth *map[string]interface{} `json:"auth,omitempty"` + connectorCreateRequestBase + Config *map[string]interface{} `json:"config,omitempty"` + Auth *map[string]interface{} `json:"auth,omitempty"` } type connectorSchemaConfigModifyRequest struct { - Enabled *bool `json:"enabled,omitempty"` - Tables map[string]*ConnectorSchemaConfigTableRequest `json:"tables,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Tables map[string]*ConnectorSchemaConfigTableRequest `json:"tables,omitempty"` } type ConnectorColumnConfigListResponse struct { - common.CommonResponse - Data struct { - Columns map[string]*ConnectorSchemaConfigColumnResponse `json:"columns"` - } `json:"data"` + common.CommonResponse + Data struct { + Columns map[string]*ConnectorSchemaConfigColumnResponse `json:"columns"` + } `json:"data"` } type connectorColumnConfigModifyRequest struct { - Enabled *bool `json:"enabled,omitempty"` - Hashed *bool `json:"hashed,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Hashed *bool `json:"hashed,omitempty"` } type connectorModifyRequestBase struct { - Paused *bool `json:"paused,omitempty"` - SyncFrequency *int `json:"sync_frequency,omitempty"` - DailySyncTime *string `json:"daily_sync_time,omitempty"` - TrustCertificates *bool `json:"trust_certificates,omitempty"` - TrustFingerprints *bool `json:"trust_fingerprints,omitempty"` - IsHistoricalSync *bool `json:"is_historical_sync,omitempty"` - ScheduleType *string `json:"schedule_type,omitempty"` - RunSetupTests *bool `json:"run_setup_tests,omitempty"` - PauseAfterTrial *bool `json:"pause_after_trial,omitempty"` - ProxyAgentId *string `json:"proxy_agent_id,omitempty"` - PrivateLinkId *string `json:"private_link_id,omitempty"` - LocalProcessingAgentId *string `json:"local_processing_agent_id,omitempty"` - NetworkingMethod *string `json:"networking_method,omitempty"` + Paused *bool `json:"paused,omitempty"` + SyncFrequency *int `json:"sync_frequency,omitempty"` + DailySyncTime *string `json:"daily_sync_time,omitempty"` + TrustCertificates *bool `json:"trust_certificates,omitempty"` + TrustFingerprints *bool `json:"trust_fingerprints,omitempty"` + IsHistoricalSync *bool `json:"is_historical_sync,omitempty"` + ScheduleType *string `json:"schedule_type,omitempty"` + RunSetupTests *bool `json:"run_setup_tests,omitempty"` + PauseAfterTrial *bool `json:"pause_after_trial,omitempty"` + ProxyAgentId *string `json:"proxy_agent_id,omitempty"` + PrivateLinkId *string `json:"private_link_id,omitempty"` + HybridDeploymentAgentId *string `json:"hybrid_deployment_agent_id,omitempty"` + NetworkingMethod *string `json:"networking_method,omitempty"` } type connectorModifyRequest struct { - connectorModifyRequestBase - Config any `json:"config,omitempty"` - Auth any `json:"auth,omitempty"` + connectorModifyRequestBase + Config any `json:"config,omitempty"` + Auth any `json:"auth,omitempty"` } type connectorCustomModifyRequest struct { - connectorModifyRequestBase - Config *map[string]interface{} `json:"config,omitempty"` - Auth *map[string]interface{} `json:"auth,omitempty"` + connectorModifyRequestBase + Config *map[string]interface{} `json:"config,omitempty"` + Auth *map[string]interface{} `json:"auth,omitempty"` } type connectorSchemaReloadRequest struct { - ExcludeMode *string `json:"exclude_mode,omitempty"` + ExcludeMode *string `json:"exclude_mode,omitempty"` } type connectorSchemaConfigUpdateRequest struct { - SchemaChangeHandling *string `json:"schema_change_handling,omitempty"` - Schemas map[string]*ConnectorSchemaConfigSchemaRequest `json:"schemas,omitempty"` + SchemaChangeHandling *string `json:"schema_change_handling,omitempty"` + Schemas map[string]*ConnectorSchemaConfigSchemaRequest `json:"schemas,omitempty"` } type connectorSetupTestsRequest struct { - TrustCertificates *bool `json:"trust_certificates,omitempty"` - TrustFingerprints *bool `json:"trust_fingerprints,omitempty"` + TrustCertificates *bool `json:"trust_certificates,omitempty"` + TrustFingerprints *bool `json:"trust_fingerprints,omitempty"` } type connectorTableConfigModifyRequest struct { - Enabled *bool `json:"enabled,omitempty"` - SyncMode *string `json:"sync_mode,omitempty"` - Columns map[string]*ConnectorSchemaConfigColumnRequest `json:"columns,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + SyncMode *string `json:"sync_mode,omitempty"` + Columns map[string]*ConnectorSchemaConfigColumnRequest `json:"columns,omitempty"` } type ConnectorsSourceMetadataResponse struct { - common.CommonResponse - Data struct { - Items []struct { - ID string `json:"id"` - Name string `json:"name"` - Type string `json:"type"` - Description string `json:"description"` - IconURL string `json:"icon_url"` - LinkToDocs string `json:"link_to_docs"` - LinkToErd string `json:"link_to_erd"` - } `json:"items"` - NextCursor string `json:"next_cursor"` - } `json:"data"` + common.CommonResponse + Data struct { + Items []struct { + ID string `json:"id"` + Name string `json:"name"` + Type string `json:"type"` + Description string `json:"description"` + IconURL string `json:"icon_url"` + LinkToDocs string `json:"link_to_docs"` + LinkToErd string `json:"link_to_erd"` + } `json:"items"` + NextCursor string `json:"next_cursor"` + } `json:"data"` } diff --git a/connectors/connector_create.go b/connectors/connector_create.go index 9b0aed2..a330eca 100644 --- a/connectors/connector_create.go +++ b/connectors/connector_create.go @@ -12,23 +12,23 @@ import ( type ConnectorCreateService struct { httputils.HttpService - service *string - groupID *string - trustCertificates *bool - trustFingerprints *bool - runSetupTests *bool - paused *bool - syncFrequency *int - dailySyncTime *string - pauseAfterTrial *bool - localProcessingAgentId *string - networkingMethod *string - privateLinkId *string - proxyAgentId *string - config *ConnectorConfig - auth *ConnectorAuth - configCustom *map[string]interface{} - authCustom *map[string]interface{} + service *string + groupID *string + trustCertificates *bool + trustFingerprints *bool + runSetupTests *bool + paused *bool + syncFrequency *int + dailySyncTime *string + pauseAfterTrial *bool + hybridDeploymentAgentId *string + networkingMethod *string + privateLinkId *string + proxyAgentId *string + config *ConnectorConfig + auth *ConnectorAuth + configCustom *map[string]interface{} + authCustom *map[string]interface{} } func (s *ConnectorCreateService) requestBase() connectorCreateRequestBase { @@ -43,7 +43,7 @@ func (s *ConnectorCreateService) requestBase() connectorCreateRequestBase { DailySyncTime: s.dailySyncTime, PauseAfterTrial: s.pauseAfterTrial, PrivateLinkId: s.privateLinkId, - LocalProcessingAgentId: s.localProcessingAgentId, + HybridDeploymentAgentId: s.hybridDeploymentAgentId, NetworkingMethod: s.networkingMethod, ProxyAgentId: s.proxyAgentId, } @@ -114,8 +114,8 @@ func (s *ConnectorCreateService) GroupID(value string) *ConnectorCreateService { return s } -func (s *ConnectorCreateService) LocalProcessingAgentId(value string) *ConnectorCreateService { - s.localProcessingAgentId = &value +func (s *ConnectorCreateService) HybridDeploymentAgentId(value string) *ConnectorCreateService { + s.hybridDeploymentAgentId = &value return s } diff --git a/connectors/connector_create_test.go b/connectors/connector_create_test.go index 037aa96..a4bcc77 100644 --- a/connectors/connector_create_test.go +++ b/connectors/connector_create_test.go @@ -36,7 +36,7 @@ func TestNewConnectorSecretsListMappingMock(t *testing.T) { Service(CONNECTOR_SERVICE). GroupID("test_id"). SyncFrequency(&syncFrequency). - LocalProcessingAgentId("lpa_id"). + HybridDeploymentAgentId("lpa_id"). ProxyAgentId("proxy_id"). PrivateLinkId("private_link_id"). NetworkingMethod("networking_method"). @@ -76,7 +76,7 @@ func TestNewConnectorCustomSecretsListMappingMock(t *testing.T) { Service(CONNECTOR_SERVICE). GroupID("test_id"). SyncFrequency(&syncFrequency). - LocalProcessingAgentId("lpa_id"). + HybridDeploymentAgentId("lpa_id"). ProxyAgentId("proxy_id"). PrivateLinkId("private_link_id"). NetworkingMethod("networking_method"). @@ -115,7 +115,7 @@ func TestNewConnectorCustomMergedMappingMock(t *testing.T) { Service(CONNECTOR_SERVICE). GroupID("test_id"). SyncFrequency(&syncFrequency). - LocalProcessingAgentId("lpa_id"). + HybridDeploymentAgentId("lpa_id"). ProxyAgentId("proxy_id"). PrivateLinkId("private_link_id"). NetworkingMethod("networking_method"). @@ -154,7 +154,7 @@ func TestNewConnectorWihtNilSyncFrequency(t *testing.T) { Service(CONNECTOR_SERVICE). GroupID("test_id"). SyncFrequency(nil). - LocalProcessingAgentId("lpa_id"). + HybridDeploymentAgentId("lpa_id"). ProxyAgentId("proxy_id"). PrivateLinkId("private_link_id"). NetworkingMethod("networking_method"). @@ -195,7 +195,7 @@ func prepareConnectorCreateResponse() string { "failed_at": null, "sync_frequency": 1440, "daily_sync_time": "03:00", - "local_processing_agent_id": "lpa_id", + "hybrid_deployment_agent_id": "lpa_id", "proxy_agent_id": "proxy_id", "private_link_id": "private_link_id", "networking_method": "networking_method", @@ -242,7 +242,7 @@ func prepareConnectorCustomMergedCreateResponse() string { "failed_at": null, "sync_frequency": 1440, "daily_sync_time": "03:00", - "local_processing_agent_id": "lpa_id", + "hybrid_deployment_agent_id": "lpa_id", "proxy_agent_id": "proxy_id", "private_link_id": "private_link_id", "networking_method": "networking_method", @@ -296,7 +296,7 @@ func prepareConnectorCreateResponseWithNilSyncFrequency() string { "failed_at": null, "sync_frequency": null, "daily_sync_time": "03:00", - "local_processing_agent_id": "lpa_id", + "hybrid_deployment_agent_id": "lpa_id", "proxy_agent_id": "proxy_id", "private_link_id": "private_link_id", "networking_method": "networking_method", @@ -389,7 +389,7 @@ func assertConnectorRequest(t *testing.T, request map[string]interface{}) { testutils.AssertKey(t, "service", request, CONNECTOR_SERVICE) testutils.AssertKey(t, "group_id", request, "test_id") testutils.AssertKey(t, "sync_frequency", request, float64(5)) - testutils.AssertKey(t, "local_processing_agent_id", request, "lpa_id") + testutils.AssertKey(t, "hybrid_deployment_agent_id", request, "lpa_id") testutils.AssertKey(t, "proxy_agent_id", request, "proxy_id") testutils.AssertKey(t, "private_link_id", request, "private_link_id") testutils.AssertKey(t, "networking_method", request, "networking_method") @@ -421,7 +421,7 @@ func assertConnectorRequest(t *testing.T, request map[string]interface{}) { func assertConnectorRequestWithNilSyncFrequency(t *testing.T, request map[string]interface{}) { testutils.AssertKey(t, "service", request, CONNECTOR_SERVICE) testutils.AssertKey(t, "group_id", request, "test_id") - testutils.AssertKey(t, "local_processing_agent_id", request, "lpa_id") + testutils.AssertKey(t, "hybrid_deployment_agent_id", request, "lpa_id") testutils.AssertKey(t, "proxy_agent_id", request, "proxy_id") testutils.AssertKey(t, "private_link_id", request, "private_link_id") testutils.AssertKey(t, "networking_method", request, "networking_method") diff --git a/connectors/connector_details_test.go b/connectors/connector_details_test.go index ba26707..2241f35 100644 --- a/connectors/connector_details_test.go +++ b/connectors/connector_details_test.go @@ -110,7 +110,7 @@ func prepareConnectorDetailsResponse() string { "failed_at": null, "sync_frequency": 1440, "daily_sync_time": "03:00", - "local_processing_agent_id": "lpa_id", + "hybrid_deployment_agent_id": "hybrid_deployment_agent_id", "proxy_agent_id": "proxy_id", "private_link_id": "private_link_id", "networking_method": "networking_method", diff --git a/connectors/connector_modify.go b/connectors/connector_modify.go index cca78d7..80eb437 100644 --- a/connectors/connector_modify.go +++ b/connectors/connector_modify.go @@ -12,24 +12,24 @@ import ( // Ref. https://fivetran.com/docs/rest-api/connectors#modifyaconnector type ConnectorModifyService struct { httputils.HttpService - connectorID *string - paused *bool - syncFrequency *int - dailySyncTime *string - trustCertificates *bool - trustFingerprints *bool - isHistoricalSync *bool - scheduleType *string - runSetupTests *bool - pauseAfterTrial *bool - localProcessingAgentId *string - networkingMethod *string - privateLinkId *string - proxyAgentId *string - config *ConnectorConfig - auth *ConnectorAuth - configCustom *map[string]interface{} - authCustom *map[string]interface{} + connectorID *string + paused *bool + syncFrequency *int + dailySyncTime *string + trustCertificates *bool + trustFingerprints *bool + isHistoricalSync *bool + scheduleType *string + runSetupTests *bool + pauseAfterTrial *bool + hybridDeploymentAgentId *string + networkingMethod *string + privateLinkId *string + proxyAgentId *string + config *ConnectorConfig + auth *ConnectorAuth + configCustom *map[string]interface{} + authCustom *map[string]interface{} } func (s *ConnectorModifyService) requestBase() connectorModifyRequestBase { @@ -44,7 +44,7 @@ func (s *ConnectorModifyService) requestBase() connectorModifyRequestBase { RunSetupTests: s.runSetupTests, PauseAfterTrial: s.pauseAfterTrial, PrivateLinkId: s.privateLinkId, - LocalProcessingAgentId: s.localProcessingAgentId, + HybridDeploymentAgentId: s.hybridDeploymentAgentId, NetworkingMethod: s.networkingMethod, ProxyAgentId: s.proxyAgentId, } @@ -108,8 +108,8 @@ func (s *ConnectorModifyService) ConnectorID(value string) *ConnectorModifyServi return s } -func (s *ConnectorModifyService) LocalProcessingAgentId(value string) *ConnectorModifyService { - s.localProcessingAgentId = &value +func (s *ConnectorModifyService) HybridDeploymentAgentId(value string) *ConnectorModifyService { + s.hybridDeploymentAgentId = &value return s } diff --git a/connectors/connector_modify_test.go b/connectors/connector_modify_test.go index 747d220..4c444fa 100644 --- a/connectors/connector_modify_test.go +++ b/connectors/connector_modify_test.go @@ -28,7 +28,7 @@ func TestConnectorUpdateMock(t *testing.T) { // act response, err := ftClient.NewConnectorModify(). ConnectorID("connector_id"). - LocalProcessingAgentId("lpa_id"). + HybridDeploymentAgentId("hybrid_deployment_agent_id"). ProxyAgentId("proxy_id"). PrivateLinkId("private_link_id"). NetworkingMethod("networking_method"). @@ -66,7 +66,7 @@ func TestCustomConnectorUpdateMock(t *testing.T) { // act response, err := ftClient.NewConnectorModify(). ConnectorID("connector_id"). - LocalProcessingAgentId("lpa_id"). + HybridDeploymentAgentId("hybrid_deployment_agent_id"). ProxyAgentId("proxy_id"). PrivateLinkId("private_link_id"). NetworkingMethod("networking_method"). @@ -118,7 +118,7 @@ func TestCustomMergedConnectorUpdateMock(t *testing.T) { response, err := ftClient.NewConnectorModify(). ConnectorID("connector_id"). Paused(false). - LocalProcessingAgentId("lpa_id"). + HybridDeploymentAgentId("hybrid_deployment_agent_id"). ProxyAgentId("proxy_id"). PrivateLinkId("private_link_id"). NetworkingMethod("networking_method"). @@ -226,7 +226,7 @@ func prepareConnectorUpdateResponse() string { "failed_at": null, "sync_frequency": 1440, "daily_sync_time": "03:00", - "local_processing_agent_id": "lpa_id", + "hybrid_deployment_agent_id": "hybrid_deployment_agent_id", "proxy_agent_id": "proxy_id", "private_link_id": "private_link_id", "networking_method": "networking_method", @@ -269,7 +269,7 @@ func assertConnectorUpdateResponse(t *testing.T, response connectors.DetailsWith testutils.AssertEqual(t, response.Code, "Success") testutils.AssertEqual(t, *response.Data.Paused, false) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, "lpa_id") + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, "hybrid_deployment_agent_id") testutils.AssertEqual(t, response.Data.ProxyAgentId, "proxy_id") testutils.AssertEqual(t, response.Data.PrivateLinkId, "private_link_id") testutils.AssertEqual(t, response.Data.NetworkingMethod, "networking_method") @@ -281,7 +281,7 @@ func assertCustomConnectorUpdateResponse(t *testing.T, response connectors.Detai testutils.AssertEqual(t, response.Code, "Success") testutils.AssertEqual(t, *response.Data.Paused, false) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, "lpa_id") + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, "hybrid_deployment_agent_id") testutils.AssertEqual(t, response.Data.ProxyAgentId, "proxy_id") testutils.AssertEqual(t, response.Data.PrivateLinkId, "private_link_id") testutils.AssertEqual(t, response.Data.NetworkingMethod, "networking_method") @@ -304,7 +304,7 @@ func assertCustomMergedConnectorUpdateResponse(t *testing.T, response connectors testutils.AssertEqual(t, response.Code, "Success") testutils.AssertEqual(t, *response.Data.Paused, false) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, "lpa_id") + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, "hybrid_deployment_agent_id") testutils.AssertEqual(t, response.Data.ProxyAgentId, "proxy_id") testutils.AssertEqual(t, response.Data.PrivateLinkId, "private_link_id") testutils.AssertEqual(t, response.Data.NetworkingMethod, "networking_method") @@ -316,7 +316,7 @@ func assertCustomMergedConnectorUpdateResponse(t *testing.T, response connectors func assertConnectorUpdateRequest(t *testing.T, request map[string]interface{}) { testutils.AssertKeyValue(t, request, "paused", false) - testutils.AssertKeyValue(t, request, "local_processing_agent_id", "lpa_id") + testutils.AssertKeyValue(t, request, "hybrid_deployment_agent_id", "hybrid_deployment_agent_id") testutils.AssertKeyValue(t, request, "proxy_agent_id", "proxy_id") testutils.AssertKeyValue(t, request, "private_link_id", "private_link_id") testutils.AssertKeyValue(t, request, "networking_method", "networking_method") diff --git a/destinations/common_types.go b/destinations/common_types.go index 4664ed1..2471f3e 100644 --- a/destinations/common_types.go +++ b/destinations/common_types.go @@ -10,7 +10,7 @@ type DestinationDetailsBase struct { TimeZoneOffset string `json:"time_zone_offset"` SetupStatus string `json:"setup_status"` PrivateLinkId string `json:"private_link_id"` - LocalProcessingAgentId string `json:"local_processing_agent_id"` + HybridDeploymentAgentId string `json:"hybrid_deployment_agent_id"` NetworkingMethod string `json:"networking_method"` DaylightSavingTimeEnabled bool `json:"daylight_saving_time_enabled"` } @@ -62,7 +62,7 @@ type destinationCreateRequest struct { RunSetupTests *bool `json:"run_setup_tests,omitempty"` DaylightSavingTimeEnabled *bool `json:"daylight_saving_time_enabled,omitempty"` PrivateLinkId *string `json:"private_link_id,omitempty"` - LocalProcessingAgentId *string `json:"local_processing_agent_id,omitempty"` + HybridDeploymentAgentId *string `json:"hybrid_deployment_agent_id,omitempty"` NetworkingMethod *string `json:"networking_method,omitempty"` } @@ -76,7 +76,7 @@ type destinationModifyRequest struct { RunSetupTests *bool `json:"run_setup_tests,omitempty"` DaylightSavingTimeEnabled *bool `json:"daylight_saving_time_enabled,omitempty"` PrivateLinkId *string `json:"private_link_id,omitempty"` - LocalProcessingAgentId *string `json:"local_processing_agent_id,omitempty"` + HybridDeploymentAgentId *string `json:"hybrid_deployment_agent_id,omitempty"` NetworkingMethod *string `json:"networking_method,omitempty"` } diff --git a/destinations/destination_create.go b/destinations/destination_create.go index 8dd7b23..07cffe0 100644 --- a/destinations/destination_create.go +++ b/destinations/destination_create.go @@ -20,7 +20,7 @@ type DestinationCreateService struct { trustFingerprints *bool runSetupTests *bool daylightSavingTimeEnabled *bool - localProcessingAgentId *string + hybridDeploymentAgentId *string networkingMethod *string privateLinkId *string } @@ -75,8 +75,8 @@ func (s *DestinationCreateService) DaylightSavingTimeEnabled(value bool) *Destin return s } -func (s *DestinationCreateService) LocalProcessingAgentId(value string) *DestinationCreateService { - s.localProcessingAgentId = &value +func (s *DestinationCreateService) HybridDeploymentAgentId(value string) *DestinationCreateService { + s.hybridDeploymentAgentId = &value return s } @@ -119,7 +119,7 @@ func (s *DestinationCreateService) request() *destinationCreateRequest { RunSetupTests: s.runSetupTests, DaylightSavingTimeEnabled: s.daylightSavingTimeEnabled, PrivateLinkId: s.privateLinkId, - LocalProcessingAgentId: s.localProcessingAgentId, + HybridDeploymentAgentId: s.hybridDeploymentAgentId, NetworkingMethod: s.networkingMethod, } } @@ -136,7 +136,7 @@ func (s *DestinationCreateService) requestCustom() *destinationCreateRequest { RunSetupTests: s.runSetupTests, DaylightSavingTimeEnabled: s.daylightSavingTimeEnabled, PrivateLinkId: s.privateLinkId, - LocalProcessingAgentId: s.localProcessingAgentId, + HybridDeploymentAgentId: s.hybridDeploymentAgentId, NetworkingMethod: s.networkingMethod, } } diff --git a/destinations/destination_create_test.go b/destinations/destination_create_test.go index 5d73668..41ac123 100644 --- a/destinations/destination_create_test.go +++ b/destinations/destination_create_test.go @@ -68,7 +68,7 @@ const ( SECRET_VALUE = "secret_value" WORKSPACE_NAME = "workspace_name" LAKEHOUSE_NAME = "lakehouse_name" - LOCALPROCESSINGAGENTID = "lpa_id" + HYBRIDDEPLOYMENTAGENTID = "hybrid_deployment_agent_id" PRIVATELINKID = "private_link_id" NETWORKINGMETHOD = "Direct" ) @@ -93,7 +93,7 @@ func TestNewDestinationCreateFullMappingMock(t *testing.T) { TrustFingerprints(TRUST_FINGERPRINTS). RunSetupTests(RUN_SETUP_TESTS). DaylightSavingTimeEnabled(DAYLIGHTSAVINGTIMEENABLED). - LocalProcessingAgentId(LOCALPROCESSINGAGENTID). + HybridDeploymentAgentId(HYBRIDDEPLOYMENTAGENTID). PrivateLinkId(PRIVATELINKID). NetworkingMethod(NETWORKINGMETHOD). GroupID(ID). @@ -133,7 +133,7 @@ func TestNewDestinationCreateCustomFullMappingMock(t *testing.T) { TrustFingerprints(TRUST_FINGERPRINTS). RunSetupTests(RUN_SETUP_TESTS). DaylightSavingTimeEnabled(DAYLIGHTSAVINGTIMEENABLED). - LocalProcessingAgentId(LOCALPROCESSINGAGENTID). + HybridDeploymentAgentId(HYBRIDDEPLOYMENTAGENTID). PrivateLinkId(PRIVATELINKID). NetworkingMethod(NETWORKINGMETHOD). GroupID(ID). @@ -165,7 +165,7 @@ func prepareDestinationResponse() string { "region": "%v", "time_zone_offset": "%v", "daylight_saving_time_enabled": %v, - "local_processing_agent_id": "%v", + "hybrid_deployment_agent_id": "%v", "private_link_id": "%v", "networking_method": "%v", "setup_status": "%v", @@ -226,7 +226,7 @@ func prepareDestinationResponse() string { REGION, TIME_ZONE, // time_zone_offset DAYLIGHTSAVINGTIMEENABLED, - LOCALPROCESSINGAGENTID, + HYBRIDDEPLOYMENTAGENTID, PRIVATELINKID, NETWORKINGMETHOD, SETUP_STATUS, @@ -369,7 +369,7 @@ func assertRequest(t *testing.T, request map[string]interface{}) { testutils.AssertKey(t, "trust_fingerprints", request, TRUST_FINGERPRINTS) testutils.AssertKey(t, "run_setup_tests", request, RUN_SETUP_TESTS) testutils.AssertKey(t, "daylight_saving_time_enabled", request, DAYLIGHTSAVINGTIMEENABLED) - testutils.AssertKey(t, "local_processing_agent_id", request, LOCALPROCESSINGAGENTID) + testutils.AssertKey(t, "hybrid_deployment_agent_id", request, HYBRIDDEPLOYMENTAGENTID) testutils.AssertKey(t, "private_link_id", request, PRIVATELINKID) testutils.AssertKey(t, "networking_method", request, NETWORKINGMETHOD) testutils.AssertKey(t, "group_id", request, ID) @@ -427,7 +427,7 @@ func asserResponseCustom(t *testing.T, response destinations.DestinationDetailsW testutils.AssertEqual(t, response.Data.Region, REGION) testutils.AssertEqual(t, response.Data.Service, SERVICE) testutils.AssertEqual(t, response.Data.DaylightSavingTimeEnabled, DAYLIGHTSAVINGTIMEENABLED) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, LOCALPROCESSINGAGENTID) + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, HYBRIDDEPLOYMENTAGENTID) testutils.AssertEqual(t, response.Data.PrivateLinkId, PRIVATELINKID) testutils.AssertEqual(t, response.Data.NetworkingMethod, NETWORKINGMETHOD) testutils.AssertEqual(t, response.Data.SetupStatus, SETUP_STATUS) @@ -490,7 +490,7 @@ func assertResponse(t *testing.T, response destinations.DestinationDetailsWithSe testutils.AssertEqual(t, response.Data.Region, REGION) testutils.AssertEqual(t, response.Data.Service, SERVICE) testutils.AssertEqual(t, response.Data.DaylightSavingTimeEnabled, DAYLIGHTSAVINGTIMEENABLED) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, LOCALPROCESSINGAGENTID) + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, HYBRIDDEPLOYMENTAGENTID) testutils.AssertEqual(t, response.Data.PrivateLinkId, PRIVATELINKID) testutils.AssertEqual(t, response.Data.NetworkingMethod, NETWORKINGMETHOD) testutils.AssertEqual(t, response.Data.SetupStatus, SETUP_STATUS) diff --git a/destinations/destination_details_test.go b/destinations/destination_details_test.go index 8eafcb9..2351695 100644 --- a/destinations/destination_details_test.go +++ b/destinations/destination_details_test.go @@ -19,7 +19,7 @@ const DESTINATION_DETAILS_REGION = "GCP_US_EAST4" const DESTINATION_DETAILS_TIME_ZONE = "-5" const DESTINATION_DETAILS_SETUP_STATUS = "connected" const DESTINATION_DETAILS_DAYLIGHT = true -const DESTINATION_DETAILS_LOCALPROCESSINGAGENTID = "lpa_id" +const DESTINATION_DETAILS_HYBRIDDEPLOYMENTAGENTID = "hybrid_deployment_agent_id" const DESTINATION_DETAILS_PRIVATELINKID = "private_link_id" const DESTINATION_DETAILS_NETWORKINGMETHOD = "Direct" const DESTINATION_DETAILS_HOST = "your-account.snowflakecomputing.com" @@ -94,7 +94,7 @@ func prepareDestinationDetailsResponse() string { "service": "%s", "region": "%s", "daylight_saving_time_enabled": %v, - "local_processing_agent_id": "%v", + "hybrid_deployment_agent_id": "%v", "private_link_id": "%v", "networking_method": "%v", "time_zone_offset": "%s", @@ -114,7 +114,7 @@ func prepareDestinationDetailsResponse() string { DESTINATION_DETAILS_SERVICE, DESTINATION_DETAILS_REGION, DESTINATION_DETAILS_DAYLIGHT, - DESTINATION_DETAILS_LOCALPROCESSINGAGENTID, + DESTINATION_DETAILS_HYBRIDDEPLOYMENTAGENTID, DESTINATION_DETAILS_PRIVATELINKID, DESTINATION_DETAILS_NETWORKINGMETHOD, DESTINATION_DETAILS_TIME_ZONE, @@ -134,7 +134,7 @@ func assertDestinationDetailsResponse(t *testing.T, response destinations.Destin testutils.AssertEqual(t, response.Data.Service, DESTINATION_DETAILS_SERVICE) testutils.AssertEqual(t, response.Data.Region, DESTINATION_DETAILS_REGION) testutils.AssertEqual(t, response.Data.DaylightSavingTimeEnabled, DESTINATION_DETAILS_DAYLIGHT) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, DESTINATION_DETAILS_LOCALPROCESSINGAGENTID) + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, DESTINATION_DETAILS_HYBRIDDEPLOYMENTAGENTID) testutils.AssertEqual(t, response.Data.PrivateLinkId, DESTINATION_DETAILS_PRIVATELINKID) testutils.AssertEqual(t, response.Data.NetworkingMethod, DESTINATION_DETAILS_NETWORKINGMETHOD) testutils.AssertEqual(t, response.Data.TimeZoneOffset, DESTINATION_DETAILS_TIME_ZONE) @@ -153,7 +153,7 @@ func assertDestinationDetailsCustomResponse(t *testing.T, response destinations. testutils.AssertEqual(t, response.Data.GroupID, DESTINATION_DETAILS_ID) testutils.AssertEqual(t, response.Data.Service, DESTINATION_DETAILS_SERVICE) testutils.AssertEqual(t, response.Data.DaylightSavingTimeEnabled, DESTINATION_DETAILS_DAYLIGHT) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, DESTINATION_DETAILS_LOCALPROCESSINGAGENTID) + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, DESTINATION_DETAILS_HYBRIDDEPLOYMENTAGENTID) testutils.AssertEqual(t, response.Data.PrivateLinkId, DESTINATION_DETAILS_PRIVATELINKID) testutils.AssertEqual(t, response.Data.NetworkingMethod, DESTINATION_DETAILS_NETWORKINGMETHOD) testutils.AssertEqual(t, response.Data.Region, DESTINATION_DETAILS_REGION) diff --git a/destinations/destination_modify.go b/destinations/destination_modify.go index 38d5be4..5aac822 100644 --- a/destinations/destination_modify.go +++ b/destinations/destination_modify.go @@ -20,7 +20,7 @@ type DestinationModifyService struct { trustFingerprints *bool runSetupTests *bool daylightSavingTimeEnabled *bool - localProcessingAgentId *string + hybridDeploymentAgentId *string networkingMethod *string privateLinkId *string } @@ -41,7 +41,7 @@ func (s *DestinationModifyService) request() *destinationModifyRequest { RunSetupTests: s.runSetupTests, DaylightSavingTimeEnabled: s.daylightSavingTimeEnabled, PrivateLinkId: s.privateLinkId, - LocalProcessingAgentId: s.localProcessingAgentId, + HybridDeploymentAgentId: s.hybridDeploymentAgentId, NetworkingMethod: s.networkingMethod, } } @@ -56,7 +56,7 @@ func (s *DestinationModifyService) requestCustom() *destinationModifyRequest { RunSetupTests: s.runSetupTests, DaylightSavingTimeEnabled: s.daylightSavingTimeEnabled, PrivateLinkId: s.privateLinkId, - LocalProcessingAgentId: s.localProcessingAgentId, + HybridDeploymentAgentId: s.hybridDeploymentAgentId, NetworkingMethod: s.networkingMethod, } } @@ -106,8 +106,8 @@ func (s *DestinationModifyService) DaylightSavingTimeEnabled(value bool) *Destin return s } -func (s *DestinationModifyService) LocalProcessingAgentId(value string) *DestinationModifyService { - s.localProcessingAgentId = &value +func (s *DestinationModifyService) HybridDeploymentAgentId(value string) *DestinationModifyService { + s.hybridDeploymentAgentId = &value return s } diff --git a/destinations/destination_modify_test.go b/destinations/destination_modify_test.go index 1108d13..734e756 100644 --- a/destinations/destination_modify_test.go +++ b/destinations/destination_modify_test.go @@ -20,7 +20,7 @@ const ( DESTINATION_MODIFY_REGION = "GCP_AUSTRALIA_SOUTHEAST1" DESTINATION_MODIFY_TIME_ZONE_OFFSET = "+10" DESTINATION_MODIFY_DAYLIGHT = true - DESTINATION_MODIFY_LOCALPROCESSINGAGENTID = "lpa_id" + DESTINATION_MODIFY_HYBRIDDEPLOYMENTAGENTID = "hybrid_deployment_agent_id" DESTINATION_MODIFY_PRIVATELINKID = "private_link_id" DESTINATION_MODIFY_NETWORKINGMETHOD = "Direct" DESTINATION_MODIFY_SETUP_STATUS = "connected" @@ -63,7 +63,7 @@ func TestDestinationModifyService(t *testing.T) { TimeZoneOffset(DESTINATION_MODIFY_TIME_ZONE_OFFSET). Config(destinationConfig). DaylightSavingTimeEnabled(DESTINATION_MODIFY_DAYLIGHT). - LocalProcessingAgentId(DESTINATION_MODIFY_LOCALPROCESSINGAGENTID). + HybridDeploymentAgentId(DESTINATION_MODIFY_HYBRIDDEPLOYMENTAGENTID). PrivateLinkId(DESTINATION_MODIFY_PRIVATELINKID). NetworkingMethod(DESTINATION_MODIFY_NETWORKINGMETHOD). TrustCertificates(TRUST_CERTIFICATES). @@ -102,7 +102,7 @@ func TestDestinationModifyCustomService(t *testing.T) { DestinationID(DESTINATION_MODIFY_ID). Region(DESTINATION_MODIFY_REGION). DaylightSavingTimeEnabled(DESTINATION_MODIFY_DAYLIGHT). - LocalProcessingAgentId(DESTINATION_MODIFY_LOCALPROCESSINGAGENTID). + HybridDeploymentAgentId(DESTINATION_MODIFY_HYBRIDDEPLOYMENTAGENTID). PrivateLinkId(DESTINATION_MODIFY_PRIVATELINKID). NetworkingMethod(DESTINATION_MODIFY_NETWORKINGMETHOD). TimeZoneOffset(DESTINATION_MODIFY_TIME_ZONE_OFFSET). @@ -145,7 +145,7 @@ func prepareDestinationModifyResponse() string { "service": "%s", "region": "%s", "daylight_saving_time_enabled": %v, - "local_processing_agent_id": "%v", + "hybrid_deployment_agent_id": "%v", "private_link_id": "%v", "networking_method": "%v", "time_zone_offset": "%s", @@ -182,7 +182,7 @@ func prepareDestinationModifyResponse() string { DESTINATION_MODIFY_SERVICE, DESTINATION_MODIFY_REGION, DESTINATION_MODIFY_DAYLIGHT, - DESTINATION_MODIFY_LOCALPROCESSINGAGENTID, + DESTINATION_MODIFY_HYBRIDDEPLOYMENTAGENTID, DESTINATION_MODIFY_PRIVATELINKID, DESTINATION_MODIFY_NETWORKINGMETHOD, DESTINATION_MODIFY_TIME_ZONE_OFFSET, @@ -208,7 +208,7 @@ func assertDestinationModifyResponse(t *testing.T, response destinations.Destina testutils.AssertEqual(t, response.Data.GroupID, DESTINATION_MODIFY_ID) testutils.AssertEqual(t, response.Data.Service, DESTINATION_MODIFY_SERVICE) testutils.AssertEqual(t, response.Data.DaylightSavingTimeEnabled, DESTINATION_MODIFY_DAYLIGHT) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, DESTINATION_MODIFY_LOCALPROCESSINGAGENTID) + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, DESTINATION_MODIFY_HYBRIDDEPLOYMENTAGENTID) testutils.AssertEqual(t, response.Data.PrivateLinkId, DESTINATION_MODIFY_PRIVATELINKID) testutils.AssertEqual(t, response.Data.NetworkingMethod, DESTINATION_MODIFY_NETWORKINGMETHOD) testutils.AssertEqual(t, response.Data.Region, DESTINATION_MODIFY_REGION) @@ -240,8 +240,7 @@ func assertDestinationModifyCustomResponse(t *testing.T, response destinations.D testutils.AssertEqual(t, response.Data.GroupID, DESTINATION_MODIFY_ID) testutils.AssertEqual(t, response.Data.Service, DESTINATION_MODIFY_SERVICE) testutils.AssertEqual(t, response.Data.DaylightSavingTimeEnabled, DESTINATION_MODIFY_DAYLIGHT) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, DESTINATION_MODIFY_LOCALPROCESSINGAGENTID) - testutils.AssertEqual(t, response.Data.LocalProcessingAgentId, DESTINATION_MODIFY_LOCALPROCESSINGAGENTID) + testutils.AssertEqual(t, response.Data.HybridDeploymentAgentId, DESTINATION_MODIFY_HYBRIDDEPLOYMENTAGENTID) testutils.AssertEqual(t, response.Data.PrivateLinkId, DESTINATION_MODIFY_PRIVATELINKID) testutils.AssertEqual(t, response.Data.NetworkingMethod, DESTINATION_MODIFY_NETWORKINGMETHOD) testutils.AssertEqual(t, response.Data.Region, DESTINATION_MODIFY_REGION) diff --git a/local_processing_agent/common_types.go b/hybrid_deployment_agent/common_types.go similarity index 56% rename from local_processing_agent/common_types.go rename to hybrid_deployment_agent/common_types.go index e3dbbe7..4eba58f 100644 --- a/local_processing_agent/common_types.go +++ b/hybrid_deployment_agent/common_types.go @@ -1,35 +1,35 @@ -package localprocessingagent +package hybriddeploymentagent -type localProcessingAgentCreateRequest struct { +type hybridDeploymentAgentCreateRequest struct { GroupId *string `json:"group_id,omitempty"` DisplayName *string `json:"display_name,omitempty"` EnvType *string `json:"env_type,omitempty"` AcceptTerms *bool `json:"accept_terms,omitempty"` } -type LocalProcessingAgentDetails struct { +type HybridDeploymentAgentDetails struct { Id string `json:"id"` DisplayName string `json:"display_name"` GroupId string `json:"group_id"` RegisteredAt string `json:"registered_at"` } -type LocalProcessingAgentUsageDetails struct { +type HybridDeploymentAgentUsageDetails struct { ConnectionId string `json:"connection_id"` Schema string `json:"schema"` Service string `json:"service"` } -type LocalProcessingAgentData struct { - LocalProcessingAgentDetails - Usage []LocalProcessingAgentUsageDetails `json:"usage"` +type HybridDeploymentAgentData struct { + HybridDeploymentAgentDetails + Usage []HybridDeploymentAgentUsageDetails `json:"usage"` } -type LocalProcessingAgentCreateResponse struct { +type HybridDeploymentAgentCreateResponse struct { Code string `json:"code"` Message string `json:"message"` Data struct { - LocalProcessingAgentDetails + HybridDeploymentAgentDetails Files struct { ConfigJson string `json:"config_json"` AuthJson string `json:"auth_json"` @@ -38,23 +38,15 @@ type LocalProcessingAgentCreateResponse struct { } `json:"data"` } -type LocalProcessingAgentDetailsResponse struct { +type HybridDeploymentAgentDetailsResponse struct { Code string `json:"code"` - Data LocalProcessingAgentData `json:"data"` + Data HybridDeploymentAgentData `json:"data"` } -type LocalProcessingAgentListResponse struct { +type HybridDeploymentAgentListResponse struct { Code string `json:"code"` Data struct { - Items []LocalProcessingAgentData `json:"items"` + Items []HybridDeploymentAgentData `json:"items"` NextCursor string `json:"next_cursor"` } `json:"data"` -} - - -type externalLoggingCreateRequestBase struct { - Id *string `json:"id,omitempty"` - GroupId *string `json:"group_id,omitempty"` - Service *string `json:"service,omitempty"` - Enabled *bool `json:"enabled,omitempty"` } \ No newline at end of file diff --git a/hybrid_deployment_agent/hybrid_deployment_agents_create.go b/hybrid_deployment_agent/hybrid_deployment_agents_create.go new file mode 100644 index 0000000..09dddff --- /dev/null +++ b/hybrid_deployment_agent/hybrid_deployment_agents_create.go @@ -0,0 +1,52 @@ +package hybriddeploymentagent + +import ( + "context" + + httputils "github.com/fivetran/go-fivetran/http_utils" +) + +// HybridDeploymentAgentCreateService Creates a new local processing agent within your Fivetran account. +// Ref. https://fivetran.com/docs/rest-api/hybrid-deployment-agent-management#createahybriddeploymentagent +type HybridDeploymentAgentCreateService struct { + httputils.HttpService + groupId *string + displayName *string + envType *string + acceptTerms *bool +} + +func (s *HybridDeploymentAgentCreateService) request() hybridDeploymentAgentCreateRequest { + return hybridDeploymentAgentCreateRequest{ + GroupId: s.groupId, + DisplayName: s.displayName, + EnvType: s.envType, + AcceptTerms: s.acceptTerms, + } +} + +func (s *HybridDeploymentAgentCreateService) GroupId(value string) *HybridDeploymentAgentCreateService { + s.groupId = &value + return s +} + +func (s *HybridDeploymentAgentCreateService) DisplayName(value string) *HybridDeploymentAgentCreateService { + s.displayName = &value + return s +} + +func (s *HybridDeploymentAgentCreateService) EnvType(value string) *HybridDeploymentAgentCreateService { + s.envType = &value + return s +} + +func (s *HybridDeploymentAgentCreateService) AcceptTerms(value bool) *HybridDeploymentAgentCreateService { + s.acceptTerms = &value + return s +} + +func (s *HybridDeploymentAgentCreateService) Do(ctx context.Context) (HybridDeploymentAgentCreateResponse, error) { + var response HybridDeploymentAgentCreateResponse + err := s.HttpService.Do(ctx, "POST", "/hybrid-deployment-agents", s.request(), nil, 201, &response) + return response, err +} \ No newline at end of file diff --git a/local_processing_agent/local_processing_agents_create_test.go b/hybrid_deployment_agent/hybrid_deployment_agents_create_test.go similarity index 73% rename from local_processing_agent/local_processing_agents_create_test.go rename to hybrid_deployment_agent/hybrid_deployment_agents_create_test.go index 9d601ee..1e8e56c 100644 --- a/local_processing_agent/local_processing_agents_create_test.go +++ b/hybrid_deployment_agent/hybrid_deployment_agents_create_test.go @@ -1,29 +1,29 @@ -package localprocessingagent_test +package hybriddeploymentagent_test import ( "context" "net/http" "testing" - "github.com/fivetran/go-fivetran/local_processing_agent" + "github.com/fivetran/go-fivetran/hybrid_deployment_agent" "github.com/fivetran/go-fivetran/tests/mock" testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestNewLocalProcessingAgentCreateMappingMock(t *testing.T) { +func TestNewHybridDeploymentAgentCreateMappingMock(t *testing.T) { // arrange ftClient, mockClient := testutils.CreateTestClient() - handler := mockClient.When(http.MethodPost, "/v1/local-processing-agents").ThenCall( + handler := mockClient.When(http.MethodPost, "/v1/hybrid-deployment-agents").ThenCall( func(req *http.Request) (*http.Response, error) { body := testutils.RequestBodyToJson(t, req) - assertLocalProcessingAgentCreateRequest(t, body) - response := mock.NewResponse(req, http.StatusCreated, prepareLocalProcessingAgentCreateResponse()) + assertHybridDeploymentAgentCreateRequest(t, body) + response := mock.NewResponse(req, http.StatusCreated, prepareHybridDeploymentAgentCreateResponse()) return response, nil }) // act - response, err := ftClient.NewLocalProcessingAgentCreate(). + response, err := ftClient.NewHybridDeploymentAgentCreate(). GroupId("group_id"). DisplayName("display_name"). EnvType("DOCKER"). @@ -41,10 +41,10 @@ func TestNewLocalProcessingAgentCreateMappingMock(t *testing.T) { testutils.AssertEqual(t, interactions[0].Handler, handler) testutils.AssertEqual(t, handler.Interactions, 1) - assertLocalProcessingAgentCreateResponse(t, response) + assertHybridDeploymentAgentCreateResponse(t, response) } -func prepareLocalProcessingAgentCreateResponse() string { +func prepareHybridDeploymentAgentCreateResponse() string { return `{ "code": "Success", "message": "Success", @@ -62,14 +62,14 @@ func prepareLocalProcessingAgentCreateResponse() string { }` } -func assertLocalProcessingAgentCreateRequest(t *testing.T, request map[string]interface{}) { +func assertHybridDeploymentAgentCreateRequest(t *testing.T, request map[string]interface{}) { testutils.AssertKey(t, "group_id", request, "group_id") testutils.AssertKey(t, "display_name", request, "display_name") testutils.AssertKey(t, "env_type", request, "DOCKER") testutils.AssertKey(t, "accept_terms", request, true) } -func assertLocalProcessingAgentCreateResponse(t *testing.T, response localprocessingagent.LocalProcessingAgentCreateResponse) { +func assertHybridDeploymentAgentCreateResponse(t *testing.T, response hybriddeploymentagent.HybridDeploymentAgentCreateResponse) { testutils.AssertEqual(t, response.Code, "Success") testutils.AssertNotEmpty(t, response.Message) diff --git a/hybrid_deployment_agent/hybrid_deployment_agents_delete.go b/hybrid_deployment_agent/hybrid_deployment_agents_delete.go new file mode 100644 index 0000000..e28808c --- /dev/null +++ b/hybrid_deployment_agent/hybrid_deployment_agents_delete.go @@ -0,0 +1,33 @@ +package hybriddeploymentagent + +import ( + "context" + "fmt" + + "github.com/fivetran/go-fivetran/common" + httputils "github.com/fivetran/go-fivetran/http_utils" +) + +// HybridDeploymentAgentDeleteService Deletes the specified local processing agent from your Fivetran account. +// Ref. https://fivetran.com/docs/rest-api/hybrid-deployment-agent-management#deleteahybriddeploymentagent +type HybridDeploymentAgentDeleteService struct { + httputils.HttpService + agentId *string +} + +func (s *HybridDeploymentAgentDeleteService) AgentId(value string) *HybridDeploymentAgentDeleteService { + s.agentId = &value + return s +} + +func (s *HybridDeploymentAgentDeleteService) Do(ctx context.Context) (common.CommonResponse, error) { + var response common.CommonResponse + + if s.agentId == nil { + return response, fmt.Errorf("missing required agentId") + } + + url := fmt.Sprintf("/hybrid-deployment-agents/%v", *s.agentId) + err := s.HttpService.Do(ctx, "DELETE", url, nil, nil, 200, &response) + return response, err +} diff --git a/local_processing_agent/local_processing_agents_delete_test.go b/hybrid_deployment_agent/hybrid_deployment_agents_delete_test.go similarity index 68% rename from local_processing_agent/local_processing_agents_delete_test.go rename to hybrid_deployment_agent/hybrid_deployment_agents_delete_test.go index b3a5b45..f1e4322 100644 --- a/local_processing_agent/local_processing_agents_delete_test.go +++ b/hybrid_deployment_agent/hybrid_deployment_agents_delete_test.go @@ -1,4 +1,4 @@ -package localprocessingagent_test +package hybriddeploymentagent_test import ( "context" @@ -13,17 +13,17 @@ import ( testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestLocalProcessingAgentDeleteServiceDo(t *testing.T) { +func TestHybridDeploymentAgentDeleteServiceDo(t *testing.T) { // arrange ftClient, mockClient := testutils.CreateTestClient() - handler := mockClient.When(http.MethodDelete, "/v1/local-processing-agents/agent_id").ThenCall( + handler := mockClient.When(http.MethodDelete, "/v1/hybrid-deployment-agents/agent_id").ThenCall( func(req *http.Request) (*http.Response, error) { response := mock.NewResponse(req, http.StatusOK, `{"code": "Success"}`) return response, nil }, ) - service := ftClient.NewLocalProcessingAgentDelete().AgentId("agent_id") + service := ftClient.NewHybridDeploymentAgentDelete().AgentId("agent_id") // act response, err := service.Do(context.Background()) @@ -33,7 +33,7 @@ func TestLocalProcessingAgentDeleteServiceDo(t *testing.T) { t.Error(err) } - assertLocalProcessingAgentDeleteResponse(t, response, "Success") + assertHybridDeploymentAgentDeleteResponse(t, response, "Success") // Check that the expected interactions with the mock client occurred interactions := mockClient.Interactions() @@ -42,12 +42,12 @@ func TestLocalProcessingAgentDeleteServiceDo(t *testing.T) { testutils.AssertEqual(t, handler.Interactions, 1) } -func TestLocalProcessingAgentsDeleteServiceDoMissingAgentID(t *testing.T) { +func TestHybridDeploymentAgentsDeleteServiceDoMissingAgentID(t *testing.T) { // Create a test client ftClient, _ := testutils.CreateTestClient() // Create the ExternalLoggingDeleteService without setting the Log ID - service := ftClient.NewLocalProcessingAgentDelete() + service := ftClient.NewHybridDeploymentAgentDelete() // Call the Do method to execute the request _, err := service.Do(context.Background()) @@ -57,6 +57,6 @@ func TestLocalProcessingAgentsDeleteServiceDoMissingAgentID(t *testing.T) { testutils.AssertEqual(t, err, expectedError) } -func assertLocalProcessingAgentDeleteResponse(t *testing.T, response common.CommonResponse, code string) { +func assertHybridDeploymentAgentDeleteResponse(t *testing.T, response common.CommonResponse, code string) { testutils.AssertEqual(t, response.Code, code) } diff --git a/hybrid_deployment_agent/hybrid_deployment_agents_details.go b/hybrid_deployment_agent/hybrid_deployment_agents_details.go new file mode 100644 index 0000000..6cc1448 --- /dev/null +++ b/hybrid_deployment_agent/hybrid_deployment_agents_details.go @@ -0,0 +1,32 @@ +package hybriddeploymentagent + +import ( + "context" + "fmt" + + httputils "github.com/fivetran/go-fivetran/http_utils" +) + +// HybridDeploymentAgentDetailsService Retrieves the details of the specified local processing agent. +// Ref. https://fivetran.com/docs/rest-api/hybrid-deployment-agent-management#retrievehybriddeploymentagentdetails +type HybridDeploymentAgentDetailsService struct { + httputils.HttpService + agentId *string +} + +func (s *HybridDeploymentAgentDetailsService) AgentId(value string) *HybridDeploymentAgentDetailsService { + s.agentId = &value + return s +} + +func (s *HybridDeploymentAgentDetailsService) Do(ctx context.Context) (HybridDeploymentAgentDetailsResponse, error) { + var response HybridDeploymentAgentDetailsResponse + + if s.agentId == nil { + return response, fmt.Errorf("missing required agentId") + } + + url := fmt.Sprintf("/hybrid-deployment-agents/%v", *s.agentId) + err := s.HttpService.Do(ctx, "GET", url, nil, nil, 200, &response) + return response, err +} diff --git a/local_processing_agent/local_processing_agents_details_test.go b/hybrid_deployment_agent/hybrid_deployment_agents_details_test.go similarity index 68% rename from local_processing_agent/local_processing_agents_details_test.go rename to hybrid_deployment_agent/hybrid_deployment_agents_details_test.go index 83ecdab..0f6842c 100644 --- a/local_processing_agent/local_processing_agents_details_test.go +++ b/hybrid_deployment_agent/hybrid_deployment_agents_details_test.go @@ -1,27 +1,27 @@ -package localprocessingagent_test +package hybriddeploymentagent_test import ( "context" "net/http" "testing" - "github.com/fivetran/go-fivetran/local_processing_agent" + "github.com/fivetran/go-fivetran/hybrid_deployment_agent" "github.com/fivetran/go-fivetran/tests/mock" testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestLocalProcessingAgentDetailsServiceDo(t *testing.T) { +func TestHybridDeploymentAgentDetailsServiceDo(t *testing.T) { // arrange ftClient, mockClient := testutils.CreateTestClient() - handler := mockClient.When(http.MethodGet, "/v1/local-processing-agents/agent_id"). + handler := mockClient.When(http.MethodGet, "/v1/hybrid-deployment-agents/agent_id"). ThenCall(func(req *http.Request) (*http.Response, error) { - response := mock.NewResponse(req, http.StatusOK, prepareLocalProcessingAgentDetailsResponse()) + response := mock.NewResponse(req, http.StatusOK, prepareHybridDeploymentAgentDetailsResponse()) return response, nil }) // act - response, err := ftClient.NewLocalProcessingAgentDetails(). + response, err := ftClient.NewHybridDeploymentAgentDetails(). AgentId("agent_id"). Do(context.Background()) @@ -34,10 +34,10 @@ func TestLocalProcessingAgentDetailsServiceDo(t *testing.T) { testutils.AssertEqual(t, len(interactions), 1) testutils.AssertEqual(t, interactions[0].Handler, handler) testutils.AssertEqual(t, handler.Interactions, 1) - assertLocalProcessingAgentDetailsResponse(t, response) + assertHybridDeploymentAgentDetailsResponse(t, response) } -func prepareLocalProcessingAgentDetailsResponse() string { +func prepareHybridDeploymentAgentDetailsResponse() string { return `{ "code": "Success", "data": { @@ -56,7 +56,7 @@ func prepareLocalProcessingAgentDetailsResponse() string { }` } -func assertLocalProcessingAgentDetailsResponse(t *testing.T, response localprocessingagent.LocalProcessingAgentDetailsResponse) { +func assertHybridDeploymentAgentDetailsResponse(t *testing.T, response hybriddeploymentagent.HybridDeploymentAgentDetailsResponse) { testutils.AssertEqual(t, response.Data.Id, "id") testutils.AssertEqual(t, response.Data.DisplayName, "display_name") testutils.AssertEqual(t, response.Data.GroupId, "group_id") diff --git a/hybrid_deployment_agent/hybrid_deployment_agents_list.go b/hybrid_deployment_agent/hybrid_deployment_agents_list.go new file mode 100644 index 0000000..6d4bd16 --- /dev/null +++ b/hybrid_deployment_agent/hybrid_deployment_agents_list.go @@ -0,0 +1,43 @@ +package hybriddeploymentagent + +import ( + "context" + "fmt" + + httputils "github.com/fivetran/go-fivetran/http_utils" +) + +// HybridDeploymentAgentListService Returns a list of local processing agents with usage within your Fivetran account. +// Ref. https://fivetran.com/docs/rest-api/hybrid-deployment-agent-management#listhybriddeploymentagents +type HybridDeploymentAgentListService struct { + httputils.HttpService + limit *int + cursor *string +} + +func (s *HybridDeploymentAgentListService) Limit(value int) *HybridDeploymentAgentListService { + s.limit = &value + return s +} + +func (s *HybridDeploymentAgentListService) Cursor(value string) *HybridDeploymentAgentListService { + s.cursor = &value + return s +} + +func (s *HybridDeploymentAgentListService) Do(ctx context.Context) (HybridDeploymentAgentListResponse, error) { + var response HybridDeploymentAgentListResponse + + var queries map[string]string = nil + if s.cursor != nil || s.limit != nil { + queries = make(map[string]string) + if s.cursor != nil { + queries["cursor"] = *s.cursor + } + if s.limit != nil { + queries["limit"] = fmt.Sprintf("%v", *s.limit) + } + } + err := s.HttpService.Do(ctx, "GET", "/hybrid-deployment-agents", nil, queries, 200, &response) + return response, err +} \ No newline at end of file diff --git a/local_processing_agent/local_processing_agents_list_test.go b/hybrid_deployment_agent/hybrid_deployment_agents_list_test.go similarity index 74% rename from local_processing_agent/local_processing_agents_list_test.go rename to hybrid_deployment_agent/hybrid_deployment_agents_list_test.go index 2bb2c68..9f97b93 100644 --- a/local_processing_agent/local_processing_agents_list_test.go +++ b/hybrid_deployment_agent/hybrid_deployment_agents_list_test.go @@ -1,27 +1,27 @@ -package localprocessingagent_test +package hybriddeploymentagent_test import ( "context" "net/http" "testing" - "github.com/fivetran/go-fivetran/local_processing_agent" + "github.com/fivetran/go-fivetran/hybrid_deployment_agent" "github.com/fivetran/go-fivetran/tests/mock" testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestLocalProcessingAgentListServiceDo(t *testing.T) { +func TestHybridDeploymentAgentListServiceDo(t *testing.T) { // arrange ftClient, mockClient := testutils.CreateTestClient() - handler := mockClient.When(http.MethodGet, "/v1/local-processing-agents"). + handler := mockClient.When(http.MethodGet, "/v1/hybrid-deployment-agents"). ThenCall(func(req *http.Request) (*http.Response, error) { - response := mock.NewResponse(req, http.StatusOK, prepareLocalProcessingAgentListResponse()) + response := mock.NewResponse(req, http.StatusOK, prepareHybridDeploymentAgentListResponse()) return response, nil }) // act - response, err := ftClient.NewLocalProcessingAgentList(). + response, err := ftClient.NewHybridDeploymentAgentList(). Do(context.Background()) // assert @@ -33,10 +33,10 @@ func TestLocalProcessingAgentListServiceDo(t *testing.T) { testutils.AssertEqual(t, len(interactions), 1) testutils.AssertEqual(t, interactions[0].Handler, handler) testutils.AssertEqual(t, handler.Interactions, 1) - assertLocalProcessingAgentListResponse(t, response) + assertHybridDeploymentAgentListResponse(t, response) } -func prepareLocalProcessingAgentListResponse() string { +func prepareHybridDeploymentAgentListResponse() string { return `{ "code": "Success", "data": { @@ -60,7 +60,7 @@ func prepareLocalProcessingAgentListResponse() string { }` } -func assertLocalProcessingAgentListResponse(t *testing.T, response localprocessingagent.LocalProcessingAgentListResponse) { +func assertHybridDeploymentAgentListResponse(t *testing.T, response hybriddeploymentagent.HybridDeploymentAgentListResponse) { testutils.AssertEqual(t, response.Code, "Success") testutils.AssertEqual(t, response.Data.Items[0].Id, "id") testutils.AssertEqual(t, response.Data.Items[0].DisplayName, "display_name") diff --git a/hybrid_deployment_agent/hybrid_deployment_agents_reauth.go b/hybrid_deployment_agent/hybrid_deployment_agents_reauth.go new file mode 100644 index 0000000..a8d603e --- /dev/null +++ b/hybrid_deployment_agent/hybrid_deployment_agents_reauth.go @@ -0,0 +1,32 @@ +package hybriddeploymentagent + +import ( + "context" + "fmt" + + httputils "github.com/fivetran/go-fivetran/http_utils" +) + +// HybridDeploymentAgentReAuthService Regenerates authentication keys for the specified local processing agent. +// Ref. https://fivetran.com/docs/rest-api/hybrid-deployment-agent-management#regeneratekeys +type HybridDeploymentAgentReAuthService struct { + httputils.HttpService + agentId *string +} + +func (s *HybridDeploymentAgentReAuthService) AgentId(value string) *HybridDeploymentAgentReAuthService { + s.agentId = &value + return s +} + +func (s *HybridDeploymentAgentReAuthService) Do(ctx context.Context) (HybridDeploymentAgentCreateResponse, error) { + var response HybridDeploymentAgentCreateResponse + + if s.agentId == nil { + return response, fmt.Errorf("missing required agentId") + } + + url := fmt.Sprintf("/hybrid-deployment-agents/%v/re-auth", *s.agentId) + err := s.HttpService.Do(ctx, "POST", url, nil, nil, 200, &response) + return response, err +} \ No newline at end of file diff --git a/local_processing_agent/local_processing_agents_reauth_test.go b/hybrid_deployment_agent/hybrid_deployment_agents_reauth_test.go similarity index 71% rename from local_processing_agent/local_processing_agents_reauth_test.go rename to hybrid_deployment_agent/hybrid_deployment_agents_reauth_test.go index adbb2ad..b55c391 100644 --- a/local_processing_agent/local_processing_agents_reauth_test.go +++ b/hybrid_deployment_agent/hybrid_deployment_agents_reauth_test.go @@ -1,27 +1,27 @@ -package localprocessingagent_test +package hybriddeploymentagent_test import ( "context" "net/http" "testing" - "github.com/fivetran/go-fivetran/local_processing_agent" + "github.com/fivetran/go-fivetran/hybrid_deployment_agent" "github.com/fivetran/go-fivetran/tests/mock" testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestNewLocalProcessingAgentReAuthMappingMock(t *testing.T) { +func TestNewHybridDeploymentAgentReAuthMappingMock(t *testing.T) { // arrange ftClient, mockClient := testutils.CreateTestClient() - handler := mockClient.When(http.MethodPost, "/v1/local-processing-agents/agent_id/re-auth").ThenCall( + handler := mockClient.When(http.MethodPost, "/v1/hybrid-deployment-agents/agent_id/re-auth").ThenCall( func(req *http.Request) (*http.Response, error) { - response := mock.NewResponse(req, http.StatusOK, prepareLocalProcessingAgentResponse()) + response := mock.NewResponse(req, http.StatusOK, prepareHybridDeploymentAgentResponse()) return response, nil }) // act - response, err := ftClient.NewLocalProcessingAgentReAuth(). + response, err := ftClient.NewHybridDeploymentAgentReAuth(). AgentId("agent_id"). Do(context.Background()) @@ -36,10 +36,10 @@ func TestNewLocalProcessingAgentReAuthMappingMock(t *testing.T) { testutils.AssertEqual(t, interactions[0].Handler, handler) testutils.AssertEqual(t, handler.Interactions, 1) - assertLocalProcessingAgentResponse(t, response) + assertHybridDeploymentAgentResponse(t, response) } -func prepareLocalProcessingAgentResponse() string { +func prepareHybridDeploymentAgentResponse() string { return `{ "code": "Success", "message": "Success", @@ -57,7 +57,7 @@ func prepareLocalProcessingAgentResponse() string { }` } -func assertLocalProcessingAgentResponse(t *testing.T, response localprocessingagent.LocalProcessingAgentCreateResponse) { +func assertHybridDeploymentAgentResponse(t *testing.T, response hybriddeploymentagent.HybridDeploymentAgentCreateResponse) { testutils.AssertEqual(t, response.Code, "Success") testutils.AssertEqual(t, response.Data.Id, "id") diff --git a/local_processing_agent/local_processing_agents_create.go b/local_processing_agent/local_processing_agents_create.go deleted file mode 100644 index 5d250a2..0000000 --- a/local_processing_agent/local_processing_agents_create.go +++ /dev/null @@ -1,52 +0,0 @@ -package localprocessingagent - -import ( - "context" - - httputils "github.com/fivetran/go-fivetran/http_utils" -) - -// LocalProcessingAgentCreateService Creates a new local processing agent within your Fivetran account. -// Ref. https://fivetran.com/docs/rest-api/local-processing-agent-management#createalocalprocessingagent -type LocalProcessingAgentCreateService struct { - httputils.HttpService - groupId *string - displayName *string - envType *string - acceptTerms *bool -} - -func (s *LocalProcessingAgentCreateService) request() localProcessingAgentCreateRequest { - return localProcessingAgentCreateRequest{ - GroupId: s.groupId, - DisplayName: s.displayName, - EnvType: s.envType, - AcceptTerms: s.acceptTerms, - } -} - -func (s *LocalProcessingAgentCreateService) GroupId(value string) *LocalProcessingAgentCreateService { - s.groupId = &value - return s -} - -func (s *LocalProcessingAgentCreateService) DisplayName(value string) *LocalProcessingAgentCreateService { - s.displayName = &value - return s -} - -func (s *LocalProcessingAgentCreateService) EnvType(value string) *LocalProcessingAgentCreateService { - s.envType = &value - return s -} - -func (s *LocalProcessingAgentCreateService) AcceptTerms(value bool) *LocalProcessingAgentCreateService { - s.acceptTerms = &value - return s -} - -func (s *LocalProcessingAgentCreateService) Do(ctx context.Context) (LocalProcessingAgentCreateResponse, error) { - var response LocalProcessingAgentCreateResponse - err := s.HttpService.Do(ctx, "POST", "/local-processing-agents", s.request(), nil, 201, &response) - return response, err -} \ No newline at end of file diff --git a/local_processing_agent/local_processing_agents_delete.go b/local_processing_agent/local_processing_agents_delete.go deleted file mode 100644 index 89f96ac..0000000 --- a/local_processing_agent/local_processing_agents_delete.go +++ /dev/null @@ -1,33 +0,0 @@ -package localprocessingagent - -import ( - "context" - "fmt" - - "github.com/fivetran/go-fivetran/common" - httputils "github.com/fivetran/go-fivetran/http_utils" -) - -// LocalProcessingAgentDeleteService Deletes the specified local processing agent from your Fivetran account. -// Ref. https://fivetran.com/docs/rest-api/local-processing-agent-management#deletealocalprocessingagent -type LocalProcessingAgentDeleteService struct { - httputils.HttpService - agentId *string -} - -func (s *LocalProcessingAgentDeleteService) AgentId(value string) *LocalProcessingAgentDeleteService { - s.agentId = &value - return s -} - -func (s *LocalProcessingAgentDeleteService) Do(ctx context.Context) (common.CommonResponse, error) { - var response common.CommonResponse - - if s.agentId == nil { - return response, fmt.Errorf("missing required agentId") - } - - url := fmt.Sprintf("/local-processing-agents/%v", *s.agentId) - err := s.HttpService.Do(ctx, "DELETE", url, nil, nil, 200, &response) - return response, err -} diff --git a/local_processing_agent/local_processing_agents_details.go b/local_processing_agent/local_processing_agents_details.go deleted file mode 100644 index de73585..0000000 --- a/local_processing_agent/local_processing_agents_details.go +++ /dev/null @@ -1,32 +0,0 @@ -package localprocessingagent - -import ( - "context" - "fmt" - - httputils "github.com/fivetran/go-fivetran/http_utils" -) - -// LocalProcessingAgentDetailsService Retrieves the details of the specified local processing agent. -// Ref. https://fivetran.com/docs/rest-api/local-processing-agent-management#retrievelocalprocessingagentdetails -type LocalProcessingAgentDetailsService struct { - httputils.HttpService - agentId *string -} - -func (s *LocalProcessingAgentDetailsService) AgentId(value string) *LocalProcessingAgentDetailsService { - s.agentId = &value - return s -} - -func (s *LocalProcessingAgentDetailsService) Do(ctx context.Context) (LocalProcessingAgentDetailsResponse, error) { - var response LocalProcessingAgentDetailsResponse - - if s.agentId == nil { - return response, fmt.Errorf("missing required agentId") - } - - url := fmt.Sprintf("/local-processing-agents/%v", *s.agentId) - err := s.HttpService.Do(ctx, "GET", url, nil, nil, 200, &response) - return response, err -} diff --git a/local_processing_agent/local_processing_agents_list.go b/local_processing_agent/local_processing_agents_list.go deleted file mode 100644 index b1dac24..0000000 --- a/local_processing_agent/local_processing_agents_list.go +++ /dev/null @@ -1,43 +0,0 @@ -package localprocessingagent - -import ( - "context" - "fmt" - - httputils "github.com/fivetran/go-fivetran/http_utils" -) - -// LocalProcessingAgentListService Returns a list of local processing agents with usage within your Fivetran account. -// Ref. https://fivetran.com/docs/rest-api/local-processing-agent-management#listlocalprocessingagents -type LocalProcessingAgentListService struct { - httputils.HttpService - limit *int - cursor *string -} - -func (s *LocalProcessingAgentListService) Limit(value int) *LocalProcessingAgentListService { - s.limit = &value - return s -} - -func (s *LocalProcessingAgentListService) Cursor(value string) *LocalProcessingAgentListService { - s.cursor = &value - return s -} - -func (s *LocalProcessingAgentListService) Do(ctx context.Context) (LocalProcessingAgentListResponse, error) { - var response LocalProcessingAgentListResponse - - var queries map[string]string = nil - if s.cursor != nil || s.limit != nil { - queries = make(map[string]string) - if s.cursor != nil { - queries["cursor"] = *s.cursor - } - if s.limit != nil { - queries["limit"] = fmt.Sprintf("%v", *s.limit) - } - } - err := s.HttpService.Do(ctx, "GET", "/local-processing-agents", nil, queries, 200, &response) - return response, err -} \ No newline at end of file diff --git a/local_processing_agent/local_processing_agents_reauth.go b/local_processing_agent/local_processing_agents_reauth.go deleted file mode 100644 index a86e47f..0000000 --- a/local_processing_agent/local_processing_agents_reauth.go +++ /dev/null @@ -1,32 +0,0 @@ -package localprocessingagent - -import ( - "context" - "fmt" - - httputils "github.com/fivetran/go-fivetran/http_utils" -) - -// LocalProcessingAgentReAuthService Regenerates authentication keys for the specified local processing agent. -// Ref. https://fivetran.com/docs/rest-api/local-processing-agent-management#regeneratekeys -type LocalProcessingAgentReAuthService struct { - httputils.HttpService - agentId *string -} - -func (s *LocalProcessingAgentReAuthService) AgentId(value string) *LocalProcessingAgentReAuthService { - s.agentId = &value - return s -} - -func (s *LocalProcessingAgentReAuthService) Do(ctx context.Context) (LocalProcessingAgentCreateResponse, error) { - var response LocalProcessingAgentCreateResponse - - if s.agentId == nil { - return response, fmt.Errorf("missing required agentId") - } - - url := fmt.Sprintf("/local-processing-agents/%v/re-auth", *s.agentId) - err := s.HttpService.Do(ctx, "POST", url, nil, nil, 200, &response) - return response, err -} \ No newline at end of file diff --git a/test_utils/test_utils.go b/test_utils/test_utils.go index 79b2975..a6a1b3e 100644 --- a/test_utils/test_utils.go +++ b/test_utils/test_utils.go @@ -522,7 +522,7 @@ func CleanupAccount() { CleanupWebhooks() CleanupTeams() CleanupProxy() - CleanupLocalProcessingAgents() + CleanupHybridDeploymentAgents() } func IsPredefinedUserExist() bool { @@ -673,21 +673,21 @@ func CleanupProxy() { } } -func CleanupLocalProcessingAgents() { - list, err := Client.NewLocalProcessingAgentList().Do(context.Background()) +func CleanupHybridDeploymentAgents() { + list, err := Client.NewHybridDeploymentAgentList().Do(context.Background()) if err != nil { log.Fatal(err) } for _, lpa := range list.Data.Items { - _, err := Client.NewLocalProcessingAgentDelete().AgentId(lpa.Id).Do(context.Background()) + _, err := Client.NewHybridDeploymentAgentDelete().AgentId(lpa.Id).Do(context.Background()) if err != nil && err.Error() != "status code: 404; expected: 200" { log.Fatal(err) } } if list.Data.NextCursor != "" { - CleanupLocalProcessingAgents() + CleanupHybridDeploymentAgents() } } @@ -980,9 +980,9 @@ func DeleteProxy(t *testing.T, id string) { } } -func CreateLocalProcessingAgent(t *testing.T) string { +func CreateHybridDeploymentAgent(t *testing.T) string { t.Helper() - created, err := Client.NewLocalProcessingAgentCreate(). + created, err := Client.NewHybridDeploymentAgentCreate(). DisplayName("go_sdk_lpa_internal"). GroupId(PredefinedGroupId). EnvType("DOCKER"). @@ -996,9 +996,9 @@ func CreateLocalProcessingAgent(t *testing.T) string { return created.Data.Id } -func DeleteLocalProcessingAgent(t *testing.T, id string) { +func DeleteHybridDeploymentAgent(t *testing.T, id string) { t.Helper() - deleted, err := Client.NewLocalProcessingAgentDelete().AgentId(id).Do(context.Background()) + deleted, err := Client.NewHybridDeploymentAgentDelete().AgentId(id).Do(context.Background()) if err != nil { t.Logf("%+v\n", deleted) diff --git a/tests/e2e/connector_create_test.go b/tests/e2e/connector_create_test.go index 25f15a9..b7bf9f7 100644 --- a/tests/e2e/connector_create_test.go +++ b/tests/e2e/connector_create_test.go @@ -41,7 +41,7 @@ func TestNewConnectorCreateE2E(t *testing.T) { testutils.AssertEqual(t, *created.Data.SyncFrequency, 360) testutils.AssertEqual(t, created.Data.ScheduleType, "auto") testutils.AssertEmpty(t, created.Data.PrivateLinkId) - testutils.AssertEmpty(t, created.Data.LocalProcessingAgentId) + testutils.AssertEmpty(t, created.Data.HybridDeploymentAgentId) testutils.AssertEmpty(t, created.Data.ProxyAgentId) testutils.AssertEqual(t, created.Data.NetworkingMethod, "Directly") diff --git a/tests/e2e/connector_modify_test.go b/tests/e2e/connector_modify_test.go index c514f01..1a8b387 100644 --- a/tests/e2e/connector_modify_test.go +++ b/tests/e2e/connector_modify_test.go @@ -44,7 +44,7 @@ func TestNewConnectorModifyE2E(t *testing.T) { testutils.AssertEqual(t, *updated.Data.SyncFrequency, 1440) testutils.AssertEqual(t, updated.Data.ScheduleType, "auto") testutils.AssertEmpty(t, updated.Data.PrivateLinkId) - testutils.AssertEmpty(t, updated.Data.LocalProcessingAgentId) + testutils.AssertEmpty(t, updated.Data.HybridDeploymentAgentId) testutils.AssertEmpty(t, updated.Data.ProxyAgentId) testutils.AssertEqual(t, updated.Data.NetworkingMethod, "Directly") diff --git a/tests/e2e/destination_create_test.go b/tests/e2e/destination_create_test.go index ff6205c..f1f4172 100644 --- a/tests/e2e/destination_create_test.go +++ b/tests/e2e/destination_create_test.go @@ -39,7 +39,7 @@ func TestNewDestinationCreateE2E(t *testing.T) { testutils.AssertEqual(t, created.Data.DaylightSavingTimeEnabled, true) testutils.AssertEqual(t, created.Data.SetupStatus, "incomplete") testutils.AssertEmpty(t, created.Data.PrivateLinkId) - testutils.AssertEmpty(t, created.Data.LocalProcessingAgentId) + testutils.AssertEmpty(t, created.Data.HybridDeploymentAgentId) testutils.AssertEqual(t, created.Data.NetworkingMethod, "Directly") testutils.AssertEqual(t, created.Data.Config.Host, "your-account.snowflakecomputing.com") testutils.AssertEqual(t, created.Data.Config.Port, "443") @@ -81,7 +81,7 @@ func TestNewDestinationCreateCustomE2E(t *testing.T) { testutils.AssertEqual(t, created.Data.TimeZoneOffset, "+10") testutils.AssertEqual(t, created.Data.DaylightSavingTimeEnabled, false) testutils.AssertEmpty(t, created.Data.PrivateLinkId) - testutils.AssertEmpty(t, created.Data.LocalProcessingAgentId) + testutils.AssertEmpty(t, created.Data.HybridDeploymentAgentId) testutils.AssertEqual(t, created.Data.NetworkingMethod, "Directly") testutils.AssertEqual(t, created.Data.SetupStatus, "incomplete") testutils.AssertEqual(t, created.Data.Config["host"], "your-account.snowflakecomputing.com") diff --git a/tests/e2e/destination_details_test.go b/tests/e2e/destination_details_test.go index 1dc520d..1cdfed0 100644 --- a/tests/e2e/destination_details_test.go +++ b/tests/e2e/destination_details_test.go @@ -25,7 +25,7 @@ func TestNewDestinationDetailsE2E(t *testing.T) { testutils.AssertEqual(t, details.Data.TimeZoneOffset, "+10") testutils.AssertEqual(t, details.Data.DaylightSavingTimeEnabled, true) testutils.AssertEmpty(t, details.Data.PrivateLinkId) - testutils.AssertEmpty(t, details.Data.LocalProcessingAgentId) + testutils.AssertEmpty(t, details.Data.HybridDeploymentAgentId) testutils.AssertEqual(t, details.Data.NetworkingMethod, "Directly") testutils.AssertEqual(t, details.Data.SetupStatus, "incomplete") testutils.AssertEqual(t, details.Data.Config.Database, "fivetran") @@ -54,7 +54,7 @@ func TestNewDestinationDetailsCustomE2E(t *testing.T) { testutils.AssertEqual(t, details.Data.DaylightSavingTimeEnabled, true) testutils.AssertEqual(t, details.Data.SetupStatus, "incomplete") testutils.AssertEmpty(t, details.Data.PrivateLinkId) - testutils.AssertEmpty(t, details.Data.LocalProcessingAgentId) + testutils.AssertEmpty(t, details.Data.HybridDeploymentAgentId) testutils.AssertEqual(t, details.Data.NetworkingMethod, "Directly") testutils.AssertEqual(t, details.Data.Config["database"], "fivetran") testutils.AssertEqual(t, details.Data.Config["password"], "******") diff --git a/tests/e2e/destination_modify_test.go b/tests/e2e/destination_modify_test.go index 7f16f33..f38c71e 100644 --- a/tests/e2e/destination_modify_test.go +++ b/tests/e2e/destination_modify_test.go @@ -38,7 +38,7 @@ func TestNewDestinationModifyE2E(t *testing.T) { testutils.AssertEqual(t, details.Data.TimeZoneOffset, "+10") testutils.AssertEqual(t, details.Data.DaylightSavingTimeEnabled, true) testutils.AssertEmpty(t, details.Data.PrivateLinkId) - testutils.AssertEmpty(t, details.Data.LocalProcessingAgentId) + testutils.AssertEmpty(t, details.Data.HybridDeploymentAgentId) testutils.AssertEqual(t, details.Data.NetworkingMethod, "Directly") testutils.AssertEqual(t, details.Data.Config.Host, "updated_host.snowflakecomputing.com") testutils.AssertEqual(t, details.Data.Config.Port, "444") @@ -78,7 +78,7 @@ func TestNewDestinationModifyCustomE2E(t *testing.T) { testutils.AssertEqual(t, details.Data.TimeZoneOffset, "+10") testutils.AssertEqual(t, details.Data.DaylightSavingTimeEnabled, false) testutils.AssertEmpty(t, details.Data.PrivateLinkId) - testutils.AssertEmpty(t, details.Data.LocalProcessingAgentId) + testutils.AssertEmpty(t, details.Data.HybridDeploymentAgentId) testutils.AssertEqual(t, details.Data.NetworkingMethod, "Directly") testutils.AssertEqual(t, details.Data.Config["host"], "updated_host.snowflakecomputing.com") testutils.AssertEqual(t, details.Data.Config["port"], "444") diff --git a/tests/e2e/local_processing_agent_create_test.go b/tests/e2e/hybrid_deployment_agent_create_test.go similarity index 78% rename from tests/e2e/local_processing_agent_create_test.go rename to tests/e2e/hybrid_deployment_agent_create_test.go index 3fa8639..880dc73 100644 --- a/tests/e2e/local_processing_agent_create_test.go +++ b/tests/e2e/hybrid_deployment_agent_create_test.go @@ -7,9 +7,9 @@ import ( testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestNewLocalProcessingAgentCreateE2E(t *testing.T) { +func TestNewHybridDeploymentAgentCreateE2E(t *testing.T) { groupId := testutils.CreateGroup(t) - created, err := testutils.Client.NewLocalProcessingAgentCreate(). + created, err := testutils.Client.NewHybridDeploymentAgentCreate(). DisplayName("go_sdk_test_lpa"). GroupId(groupId). EnvType("DOCKER"). @@ -28,7 +28,7 @@ func TestNewLocalProcessingAgentCreateE2E(t *testing.T) { testutils.AssertEqual(t, created.Data.GroupId, groupId) t.Cleanup(func() { - testutils.DeleteLocalProcessingAgent(t, created.Data.Id) + testutils.DeleteHybridDeploymentAgent(t, created.Data.Id) testutils.DeleteGroup(t, groupId) }) } diff --git a/tests/e2e/local_processing_agent_delete_test.go b/tests/e2e/hybrid_deployment_agent_delete_test.go similarity index 51% rename from tests/e2e/local_processing_agent_delete_test.go rename to tests/e2e/hybrid_deployment_agent_delete_test.go index 1034c6d..bd9b4b7 100644 --- a/tests/e2e/local_processing_agent_delete_test.go +++ b/tests/e2e/hybrid_deployment_agent_delete_test.go @@ -7,10 +7,10 @@ import ( testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestNewLocalProcessingAgentDeleteE2E(t *testing.T) { - agentId := testutils.CreateLocalProcessingAgent(t) +func TestNewHybridDeploymentAgentDeleteE2E(t *testing.T) { + agentId := testutils.CreateHybridDeploymentAgent(t) - deleted, err := testutils.Client.NewLocalProcessingAgentDelete().AgentId(agentId).Do(context.Background()) + deleted, err := testutils.Client.NewHybridDeploymentAgentDelete().AgentId(agentId).Do(context.Background()) if err != nil { t.Logf("%+v\n", deleted) diff --git a/tests/e2e/local_processing_agent_details_test.go b/tests/e2e/hybrid_deployment_agent_details_test.go similarity index 56% rename from tests/e2e/local_processing_agent_details_test.go rename to tests/e2e/hybrid_deployment_agent_details_test.go index 6ce064f..61201e5 100644 --- a/tests/e2e/local_processing_agent_details_test.go +++ b/tests/e2e/hybrid_deployment_agent_details_test.go @@ -7,10 +7,10 @@ import ( testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestLocalProcessingAgentDetailsE2E(t *testing.T) { - agentId := testutils.CreateLocalProcessingAgent(t) +func TestHybridDeploymentAgentDetailsE2E(t *testing.T) { + agentId := testutils.CreateHybridDeploymentAgent(t) - result, err := testutils.Client.NewLocalProcessingAgentDetails().AgentId(agentId).Do(context.Background()) + result, err := testutils.Client.NewHybridDeploymentAgentDetails().AgentId(agentId).Do(context.Background()) if err != nil { t.Logf("%+v\n", result) t.Error(err) @@ -21,5 +21,5 @@ func TestLocalProcessingAgentDetailsE2E(t *testing.T) { testutils.AssertNotEmpty(t, result.Data.DisplayName) testutils.AssertNotEmpty(t, result.Data.GroupId) - t.Cleanup(func() { testutils.DeleteLocalProcessingAgent(t, agentId) }) + t.Cleanup(func() { testutils.DeleteHybridDeploymentAgent(t, agentId) }) } diff --git a/tests/e2e/local_processing_agent_list_test.go b/tests/e2e/hybrid_deployment_agent_list_test.go similarity index 60% rename from tests/e2e/local_processing_agent_list_test.go rename to tests/e2e/hybrid_deployment_agent_list_test.go index b4c3d5e..5ec21fe 100644 --- a/tests/e2e/local_processing_agent_list_test.go +++ b/tests/e2e/hybrid_deployment_agent_list_test.go @@ -7,10 +7,10 @@ import ( testutils "github.com/fivetran/go-fivetran/test_utils" ) -func TestLocalProcessingAgentListE2E(t *testing.T) { - agentId := testutils.CreateLocalProcessingAgent(t) +func TestHybridDeploymentAgentListE2E(t *testing.T) { + agentId := testutils.CreateHybridDeploymentAgent(t) - result, err := testutils.Client.NewLocalProcessingAgentList().Do(context.Background()) + result, err := testutils.Client.NewHybridDeploymentAgentList().Do(context.Background()) if err != nil { t.Logf("%+v\n", result) t.Error(err) @@ -21,5 +21,5 @@ func TestLocalProcessingAgentListE2E(t *testing.T) { testutils.AssertNotEmpty(t, result.Data.Items[0].DisplayName) testutils.AssertNotEmpty(t, result.Data.Items[0].GroupId) - t.Cleanup(func() { testutils.DeleteLocalProcessingAgent(t, agentId) }) + t.Cleanup(func() { testutils.DeleteHybridDeploymentAgent(t, agentId) }) }