From 47eccea08db48e670c88201f4893cf3d82a2761f Mon Sep 17 00:00:00 2001 From: andreaangiolillo Date: Mon, 3 Jul 2023 13:28:45 +0200 Subject: [PATCH 1/2] INTMDB-838: Add FederationSettingsId to org --- mongodbatlas/organizations.go | 14 ++++++++------ mongodbatlas/organizations_test.go | 7 +++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/mongodbatlas/organizations.go b/mongodbatlas/organizations.go index 5cee3135..fc82b7e8 100644 --- a/mongodbatlas/organizations.go +++ b/mongodbatlas/organizations.go @@ -76,16 +76,18 @@ type Organizations struct { // CreateOrganizationRequest struct for CreateOrganizationRequest. type CreateOrganizationRequest struct { - APIKey *APIKeyInput `json:"apiKey,omitempty"` - Name string `json:"name"` - OrgOwnerID *string `json:"orgOwnerId,omitempty"` + APIKey *APIKeyInput `json:"apiKey,omitempty"` + FederationSettingsId *string `json:"federationSettingsId,omitempty"` + Name string `json:"name"` + OrgOwnerID *string `json:"orgOwnerId,omitempty"` } // CreateOrganizationResponse struct for CreateOrganizationResponse. type CreateOrganizationResponse struct { - APIKey *APIKey `json:"apiKey,omitempty"` - OrgOwnerID *string `json:"orgOwnerId,omitempty"` - Organization *Organization `json:"organization,omitempty"` + APIKey *APIKey `json:"apiKey,omitempty"` + FederationSettingsId *string `json:"federationSettingsId,omitempty"` + OrgOwnerID *string `json:"orgOwnerId,omitempty"` + Organization *Organization `json:"organization,omitempty"` } // List gets all organizations. diff --git a/mongodbatlas/organizations_test.go b/mongodbatlas/organizations_test.go index e7db2719..cfc2f729 100644 --- a/mongodbatlas/organizations_test.go +++ b/mongodbatlas/organizations_test.go @@ -465,7 +465,8 @@ func TestOrganizationsServiceOp_Create(t *testing.T) { "roleName": "ORG_OWNER" } ] - }, + }, + "federationSettingsId": "1", "organization": { "id": "32b6e34b3d91647abb20e7b8", "name": "test" @@ -478,7 +479,8 @@ func TestOrganizationsServiceOp_Create(t *testing.T) { Desc: "string", Roles: []string{"ORG_OWNER"}, }, - Name: "test", + Name: "test", + FederationSettingsId: pointer("1"), } response, _, err := client.Organizations.Create(ctx, body) @@ -500,6 +502,7 @@ func TestOrganizationsServiceOp_Create(t *testing.T) { ID: "32b6e34b3d91647abb20e7b8", Name: "test", }, + FederationSettingsId: pointer("1"), } if diff := deep.Equal(response, expected); diff != nil { From fe197426448e5050d128ffad0d3a48734e8776e6 Mon Sep 17 00:00:00 2001 From: andreaangiolillo Date: Mon, 3 Jul 2023 13:33:02 +0200 Subject: [PATCH 2/2] lint --- mongodbatlas/organizations.go | 4 ++-- mongodbatlas/organizations_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mongodbatlas/organizations.go b/mongodbatlas/organizations.go index fc82b7e8..f415f370 100644 --- a/mongodbatlas/organizations.go +++ b/mongodbatlas/organizations.go @@ -77,7 +77,7 @@ type Organizations struct { // CreateOrganizationRequest struct for CreateOrganizationRequest. type CreateOrganizationRequest struct { APIKey *APIKeyInput `json:"apiKey,omitempty"` - FederationSettingsId *string `json:"federationSettingsId,omitempty"` + FederationSettingsID *string `json:"federationSettingsId,omitempty"` Name string `json:"name"` OrgOwnerID *string `json:"orgOwnerId,omitempty"` } @@ -85,7 +85,7 @@ type CreateOrganizationRequest struct { // CreateOrganizationResponse struct for CreateOrganizationResponse. type CreateOrganizationResponse struct { APIKey *APIKey `json:"apiKey,omitempty"` - FederationSettingsId *string `json:"federationSettingsId,omitempty"` + FederationSettingsID *string `json:"federationSettingsId,omitempty"` OrgOwnerID *string `json:"orgOwnerId,omitempty"` Organization *Organization `json:"organization,omitempty"` } diff --git a/mongodbatlas/organizations_test.go b/mongodbatlas/organizations_test.go index cfc2f729..1e17a67a 100644 --- a/mongodbatlas/organizations_test.go +++ b/mongodbatlas/organizations_test.go @@ -480,7 +480,7 @@ func TestOrganizationsServiceOp_Create(t *testing.T) { Roles: []string{"ORG_OWNER"}, }, Name: "test", - FederationSettingsId: pointer("1"), + FederationSettingsID: pointer("1"), } response, _, err := client.Organizations.Create(ctx, body) @@ -502,7 +502,7 @@ func TestOrganizationsServiceOp_Create(t *testing.T) { ID: "32b6e34b3d91647abb20e7b8", Name: "test", }, - FederationSettingsId: pointer("1"), + FederationSettingsID: pointer("1"), } if diff := deep.Equal(response, expected); diff != nil {