Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

INTMDB-838: Add FederationSettingsId to org #503

Merged
merged 2 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions mongodbatlas/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 5 additions & 2 deletions mongodbatlas/organizations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@ func TestOrganizationsServiceOp_Create(t *testing.T) {
"roleName": "ORG_OWNER"
}
]
},
},
"federationSettingsId": "1",
"organization": {
"id": "32b6e34b3d91647abb20e7b8",
"name": "test"
Expand All @@ -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)
Expand All @@ -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 {
Expand Down