Skip to content

Commit b35d554

Browse files
Generator: Update SDK /services/sqlserverflex (#1489)
* Generate sqlserverflex * Update tests and waiter with the new region parameter * Update CHANGELOG --------- Co-authored-by: Marcel Jacek <[email protected]> Co-authored-by: Marcel Jacek <[email protected]>
1 parent f72dc31 commit b35d554

File tree

65 files changed

+928
-234
lines changed

Some content is hidden

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

65 files changed

+928
-234
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
- **Feature:** Add payload `ApproveSubscriptionPayload` for `ApiApproveSubscriptionRequest`
77
- `postgresflex`: [v1.0.0](services/postgresflex/CHANGELOG.md#v100-2025-02-24)
88
- **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.
9+
- `sqlserverflex`: [v1.0.0](services/sqlserverflex/CHANGELOG.md#v100-2025-02-25)
10+
- **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.
11+
- **Feature:** Add method to delete all instances for a project: `TerminateProject`
912

1013
## Release (2025-02-21)
1114
> [!WARNING]

examples/sqlserverflex/sqlserverflex.go

Lines changed: 9 additions & 9 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/sqlserverflex"
1110
"github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex/wait"
@@ -15,23 +14,24 @@ func main() {
1514
// Specify the project ID
1615
projectId := "PROJECT_ID"
1716

17+
// Specify the region
18+
region := "REGION"
19+
1820
// Specify instance configuration options
1921
flavorId := "FLAVOR_ID"
2022
version := "VERSION"
2123

2224
ctx := context.Background()
2325

2426
// Create a new API client, that uses default authentication and configuration
25-
sqlserverflexClient, err := sqlserverflex.NewAPIClient(
26-
config.WithRegion("eu01"),
27-
)
27+
sqlserverflexClient, err := sqlserverflex.NewAPIClient()
2828
if err != nil {
2929
fmt.Fprintf(os.Stderr, "Creating API client: %v\n", err)
3030
os.Exit(1)
3131
}
3232

3333
// Get the SQLServer Flex instances for your project
34-
getInstancesResp, err := sqlserverflexClient.ListInstances(ctx, projectId).Execute()
34+
getInstancesResp, err := sqlserverflexClient.ListInstances(ctx, projectId, region).Execute()
3535
if err != nil {
3636
fmt.Fprintf(os.Stderr, "Error when calling `ListInstances`: %v\n", err)
3737
os.Exit(1)
@@ -45,27 +45,27 @@ func main() {
4545
FlavorId: utils.Ptr(flavorId),
4646
Version: utils.Ptr(version),
4747
}
48-
instance, err := sqlserverflexClient.CreateInstance(ctx, projectId).CreateInstancePayload(createInstancePayload).Execute()
48+
instance, err := sqlserverflexClient.CreateInstance(ctx, projectId, region).CreateInstancePayload(createInstancePayload).Execute()
4949
if err != nil {
5050
fmt.Fprintf(os.Stderr, "Error creating SQL Server Flex instance: %v\n", err)
5151
}
5252
instanceId := *instance.Id
5353

54-
_, err = wait.CreateInstanceWaitHandler(ctx, sqlserverflexClient, projectId, instanceId).WaitWithContext(ctx)
54+
_, err = wait.CreateInstanceWaitHandler(ctx, sqlserverflexClient, projectId, instanceId, region).WaitWithContext(ctx)
5555
if err != nil {
5656
fmt.Fprintf(os.Stderr, "Error when waiting for SQL Server Flex instance creation: %v\n", err)
5757
}
5858

5959
fmt.Printf("Created SQL Server Flex instance \"%s\".\n", instanceId)
6060

6161
// Delete an instance
62-
err = sqlserverflexClient.DeleteInstance(ctx, projectId, instanceId).Execute()
62+
err = sqlserverflexClient.DeleteInstance(ctx, projectId, instanceId, region).Execute()
6363

6464
if err != nil {
6565
fmt.Fprintf(os.Stderr, "Error deleting SQL Server Flex instance: %v\n", err)
6666
}
6767

68-
_, err = wait.DeleteInstanceWaitHandler(ctx, sqlserverflexClient, projectId, instanceId).WaitWithContext(ctx)
68+
_, err = wait.DeleteInstanceWaitHandler(ctx, sqlserverflexClient, projectId, instanceId, region).WaitWithContext(ctx)
6969
if err != nil {
7070
fmt.Fprintf(os.Stderr, "Error when waiting for SQL Server Flex instance deletion: %v\n", err)
7171
}

services/sqlserverflex/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v1.0.0 (2025-02-25)
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+
- **Feature:** Add method to delete all instances for a project: `TerminateProject`
4+
15
## v0.10.0 (2025-02-21)
26
- **New:** Minimal go version is now Go 1.21
37

0 commit comments

Comments
 (0)