Skip to content

Commit

Permalink
Add user memberships (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-aleksandrboldyrev authored Dec 20, 2023
1 parent bce7895 commit 5307228
Show file tree
Hide file tree
Showing 283 changed files with 7,544 additions and 9,134 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased](https://github.com/fivetran/go-fivetran/compare/v0.7.13...HEAD)

## [0.8.0](https://github.com/fivetran/go-fivetran/compare/v0.7.11...v0.8.10)

## Added

Supported the following Fivetran API endpoints:
- User Management API Connector memberships: [List all connector memberships](https://fivetran.com/docs/rest-api/users#listallconnectormemberships)
- User Management API Connector memberships: [Retrieve connector membership](https://fivetran.com/docs/rest-api/users#retrieveconnectormembership)
- User Management API Connector memberships: [Add connector membership](https://fivetran.com/docs/rest-api/users#addconnectormembership)
- User Management API Connector memberships: [Update connector membership](https://fivetran.com/docs/rest-api/users#updateconnectormembership)
- User Management API Connector memberships: [Delete connector membership](https://fivetran.com/docs/rest-api/users#deleteconnectormembership)
- User Management API Group memberships: [List all group memberships](https://fivetran.com/docs/rest-api/users#listallgroupmemberships)
- User Management API Group memberships: [Retrieve group membership](https://fivetran.com/docs/rest-api/users#retrievegroupmembership)
- User Management API Group memberships: [Add group membership](https://fivetran.com/docs/rest-api/users#addgroupmembership)
- User Management API Group memberships: [Update group membership](https://fivetran.com/docs/rest-api/users#updategroupmembership)
- User Management API Group memberships: [Delete group membership](https://fivetran.com/docs/rest-api/users#deletegroupmembership)

Added fields to support Google Cloud Logging:
- `ExternalLoggingConfig.projectId`

## [0.7.15](https://github.com/fivetran/go-fivetran/compare/v0.7.14...v0.7.15)

## Added
Expand Down
5 changes: 2 additions & 3 deletions certificates/connector_approve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"

testutils "github.com/fivetran/go-fivetran/test_utils"
"github.com/fivetran/go-fivetran/tests"
"github.com/fivetran/go-fivetran/tests/mock"
)

Expand All @@ -23,11 +22,11 @@ func TestNewCertificateConnectorCertificateApproveMock(t *testing.T) {
testName := "name"
testType := "type"

ftClient, mockClient := tests.CreateTestClient()
ftClient, mockClient := testutils.CreateTestClient()
handler := mockClient.When(http.MethodPost, fmt.Sprintf("/v1/connectors/%v/certificates", testConnectorId)).ThenCall(

func(req *http.Request) (*http.Response, error) {
body := tests.RequestBodyToJson(t, req)
body := testutils.RequestBodyToJson(t, req)

testutils.AssertEqual(t, len(body), 2)
testutils.AssertEqual(t, body["hash"], testHash)
Expand Down
3 changes: 1 addition & 2 deletions certificates/connector_details_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"

testutils "github.com/fivetran/go-fivetran/test_utils"
"github.com/fivetran/go-fivetran/tests"
"github.com/fivetran/go-fivetran/tests/mock"
)

Expand All @@ -22,7 +21,7 @@ func TestNewConnectorCertificateDetailsMock(t *testing.T) {
testName := "name"
testType := "type"

ftClient, mockClient := tests.CreateTestClient()
ftClient, mockClient := testutils.CreateTestClient()
handler := mockClient.When(http.MethodGet, fmt.Sprintf("/v1/connectors/%v/certificates/%v", testConnectorId, testHash)).ThenCall(

func(req *http.Request) (*http.Response, error) {
Expand Down
3 changes: 1 addition & 2 deletions certificates/connector_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"testing"

testutils "github.com/fivetran/go-fivetran/test_utils"
"github.com/fivetran/go-fivetran/tests"
"github.com/fivetran/go-fivetran/tests/mock"
)

Expand All @@ -26,7 +25,7 @@ func TestNewConnectorCertificatesListMock(t *testing.T) {
cursor := "cursor"
limit := 1

ftClient, mockClient := tests.CreateTestClient()
ftClient, mockClient := testutils.CreateTestClient()
handler := mockClient.When(http.MethodGet, fmt.Sprintf("/v1/connectors/%v/certificates", testConnectorId)).ThenCall(

func(req *http.Request) (*http.Response, error) {
Expand Down
4 changes: 2 additions & 2 deletions certificates/connector_revoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

testutils "github.com/fivetran/go-fivetran/test_utils"
"github.com/fivetran/go-fivetran/tests"

"github.com/fivetran/go-fivetran/tests/mock"
)

Expand All @@ -16,7 +16,7 @@ func TestNewCertificateConnectorCertificateRevokeMock(t *testing.T) {
testConnectorId := "connector_id"
testHash := "hash"

ftClient, mockClient := tests.CreateTestClient()
ftClient, mockClient := testutils.CreateTestClient()
handler := mockClient.When(http.MethodDelete, fmt.Sprintf("/v1/connectors/%v/certificates/%v", testConnectorId, testHash)).ThenCall(
func(req *http.Request) (*http.Response, error) {
response := mock.NewResponse(req, http.StatusOK,
Expand Down
5 changes: 2 additions & 3 deletions certificates/destination_approve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"

testutils "github.com/fivetran/go-fivetran/test_utils"
"github.com/fivetran/go-fivetran/tests"
"github.com/fivetran/go-fivetran/tests/mock"
)

Expand All @@ -23,11 +22,11 @@ func TestNewCertificateDestinationCertificateApproveMock(t *testing.T) {
testName := "name"
testType := "type"

ftClient, mockClient := tests.CreateTestClient()
ftClient, mockClient := testutils.CreateTestClient()
handler := mockClient.When(http.MethodPost, fmt.Sprintf("/v1/destinations/%v/certificates", testDestinationId)).ThenCall(

func(req *http.Request) (*http.Response, error) {
body := tests.RequestBodyToJson(t, req)
body := testutils.RequestBodyToJson(t, req)

testutils.AssertEqual(t, len(body), 2)
testutils.AssertEqual(t, body["hash"], testHash)
Expand Down
3 changes: 1 addition & 2 deletions certificates/destination_details_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"

testutils "github.com/fivetran/go-fivetran/test_utils"
"github.com/fivetran/go-fivetran/tests"
"github.com/fivetran/go-fivetran/tests/mock"
)

Expand All @@ -22,7 +21,7 @@ func TestNewDestinationCertificateDetailsMock(t *testing.T) {
testName := "name"
testType := "type"

ftClient, mockClient := tests.CreateTestClient()
ftClient, mockClient := testutils.CreateTestClient()
handler := mockClient.When(http.MethodGet, fmt.Sprintf("/v1/destinations/%v/certificates/%v", testDestinationId, testHash)).ThenCall(

func(req *http.Request) (*http.Response, error) {
Expand Down
4 changes: 2 additions & 2 deletions certificates/destination_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"

testutils "github.com/fivetran/go-fivetran/test_utils"
"github.com/fivetran/go-fivetran/tests"

"github.com/fivetran/go-fivetran/tests/mock"
)

Expand All @@ -26,7 +26,7 @@ func TestNewDestinationCertificatesListMock(t *testing.T) {
cursor := "cursor"
limit := 1

ftClient, mockClient := tests.CreateTestClient()
ftClient, mockClient := testutils.CreateTestClient()
handler := mockClient.When(http.MethodGet, fmt.Sprintf("/v1/destinations/%v/certificates", testDestinationId)).ThenCall(

func(req *http.Request) (*http.Response, error) {
Expand Down
4 changes: 2 additions & 2 deletions certificates/destination_revoke_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"testing"

testutils "github.com/fivetran/go-fivetran/test_utils"
"github.com/fivetran/go-fivetran/tests"

"github.com/fivetran/go-fivetran/tests/mock"
)

Expand All @@ -16,7 +16,7 @@ func TestNewCertificateDestinationCertificateRevokeMock(t *testing.T) {
testDestinationId := "destination_id"
testHash := "hash"

ftClient, mockClient := tests.CreateTestClient()
ftClient, mockClient := testutils.CreateTestClient()
handler := mockClient.When(http.MethodDelete, fmt.Sprintf("/v1/destinations/%v/certificates/%v", testDestinationId, testHash)).ThenCall(
func(req *http.Request) (*http.Response, error) {
response := mock.NewResponse(req, http.StatusOK,
Expand Down
Loading

0 comments on commit 5307228

Please sign in to comment.