Skip to content

Commit

Permalink
INTMDB-838: Add FederationSettingsId to org (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaangiolillo committed Jul 3, 2023
1 parent 94c1f7f commit 4745a13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
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

0 comments on commit 4745a13

Please sign in to comment.