Skip to content

Commit 544a688

Browse files
Generator: Update SDK /services/mongodbflex (#3107)
* Generate mongodbflex * Region adjustment: adjust examples, waiter and add changelog Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> --------- Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de> Co-authored-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent b255f94 commit 544a688

File tree

117 files changed

+1388
-937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1388
-937
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Release (2025-XX-XX)
2+
- `mongodbflex`: [v1.4.0](services/mongodbflex/CHANGELOG.md#v140)
3+
- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request.
4+
15
## Release (2025-07-07)
26

37
- `ske`: [v1.0.0](services/ske/CHANGELOG.md#v100)

examples/mongodbflex/mongodbflex.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"fmt"
66
"os"
77

8-
"github.com/stackitcloud/stackit-sdk-go/core/config"
98
"github.com/stackitcloud/stackit-sdk-go/core/utils"
109
"github.com/stackitcloud/stackit-sdk-go/services/mongodbflex"
1110
"github.com/stackitcloud/stackit-sdk-go/services/mongodbflex/wait"
@@ -15,17 +14,18 @@ func main() {
1514
// Specify the project ID
1615
projectId := "PROJECT_ID"
1716

17+
// Specify the region
18+
region := "REGION"
19+
1820
// Create a new API client, that uses default authentication and configuration
19-
mongodbflexClient, err := mongodbflex.NewAPIClient(
20-
config.WithRegion("eu01"),
21-
)
21+
mongodbflexClient, err := mongodbflex.NewAPIClient()
2222
if err != nil {
2323
fmt.Fprintf(os.Stderr, "Creating API client: %v\n", err)
2424
os.Exit(1)
2525
}
2626

2727
// Get the MongoDB Flex instances for your project
28-
getInstancesResp, err := mongodbflexClient.ListInstances(context.Background(), projectId).Tag("tag").Execute()
28+
getInstancesResp, err := mongodbflexClient.ListInstances(context.Background(), projectId, region).Tag("tag").Execute()
2929
if err != nil {
3030
fmt.Fprintf(os.Stderr, "Error when calling `ListInstances`: %v\n", err)
3131
os.Exit(1)
@@ -46,7 +46,7 @@ func main() {
4646
Database: utils.Ptr("default"),
4747
Roles: &[]string{"read"},
4848
}
49-
_, err = mongodbflexClient.CreateUser(context.Background(), projectId, instanceId).CreateUserPayload(createUserPayload).Execute()
49+
_, err = mongodbflexClient.CreateUser(context.Background(), projectId, instanceId, region).CreateUserPayload(createUserPayload).Execute()
5050
if err != nil {
5151
fmt.Fprintf(os.Stderr, "Error when calling `CreateUser`: %v\n", err)
5252
os.Exit(1)
@@ -59,15 +59,15 @@ func main() {
5959
BackupId: utils.Ptr("BACKUP_ID"),
6060
InstanceId: &instanceId,
6161
}
62-
_, err = mongodbflexClient.RestoreInstance(context.Background(), projectId, instanceId).RestoreInstancePayload(restoreInstancePayload).Execute()
62+
_, err = mongodbflexClient.RestoreInstance(context.Background(), projectId, instanceId, region).RestoreInstancePayload(restoreInstancePayload).Execute()
6363
if err != nil {
6464
fmt.Fprintf(os.Stderr, "Error when calling `RestoreInstance`: %v\n", err)
6565
os.Exit(1)
6666
}
6767

6868
fmt.Printf("Restoring instance \"%s\" from backup \"%s\".\n", instanceId, "BACKUP_ID")
6969

70-
_, err = wait.RestoreInstanceWaitHandler(context.Background(), mongodbflexClient, projectId, instanceId, "BACKUP_ID").WaitWithContext(context.Background())
70+
_, err = wait.RestoreInstanceWaitHandler(context.Background(), mongodbflexClient, projectId, instanceId, "BACKUP_ID", region).WaitWithContext(context.Background())
7171
if err != nil {
7272
fmt.Fprintf(os.Stderr, "Error when waiting for restore to finish: %v\n", err)
7373
os.Exit(1)

services/mongodbflex/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v1.4.0
2+
- **Breaking Change:** The region is no longer specified within the client configuration. Instead, the region must be passed as a parameter to any region-specific request.
3+
14
## v1.3.0
25
- Add `required:"true"` tags to model structs
36

services/mongodbflex/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.3.0
1+
v1.4.0

0 commit comments

Comments
 (0)