Skip to content

Commit f619dad

Browse files
feat(serviceaccount): add multi API version support (#5778)
relates to STACKITSDK-357 Co-authored-by: Ruben Hoenle <Ruben.Hoenle@stackit.cloud>
1 parent 555dcf2 commit f619dad

File tree

76 files changed

+13583
-56
lines changed

Some content is hidden

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

76 files changed

+13583
-56
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@
176176
- `v1betaapi`: New package which can be used for communication with the SFS v1 beta API
177177
- **Deprecation:** The contents in the root of this SDK module including the `wait` package are marked as deprecated and will be removed after 2026-09-30. Switch to the new packages for the available API versions instead.
178178
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
179+
- `serviceaccount`: [v0.13.0](services/serviceaccount/CHANGELOG.md#v0130)
180+
- **Feature:** Introduction of multi API version support for the serviceaccount SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
181+
- `v2api`: New package which should be used for communication with the STACKIT serviceaccount API in the future
182+
- **Deprecation:** The contents in the root of this SDK module are marked as deprecated and will be removed after 2026-09-30. Switch to the new `v2api` package instead.
183+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
179184

180185
## Release (2026-02-20)
181186
- `core`: [v0.21.1](core/CHANGELOG.md#v0211)

examples/serviceaccount/go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ module github.com/stackitcloud/stackit-sdk-go/examples/serviceaccount
22

33
go 1.21
44

5-
require (
6-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1
7-
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.12.0
8-
)
5+
// This is not needed in production. This is only here to point the golangci linter to the local version instead of the last release on GitHub.
6+
replace github.com/stackitcloud/stackit-sdk-go/services/serviceaccount => ../../services/serviceaccount
7+
8+
require github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.12.0
99

1010
require (
1111
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
1212
github.com/google/uuid v1.6.0 // indirect
13+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0 // indirect
1314
)

examples/serviceaccount/go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
44
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
55
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
66
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
7-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts=
8-
github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=
9-
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.12.0 h1:l1EDIlXce2C8JcbBDHVa6nZ4SjPTqmnALTgrhms+NKI=
10-
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.12.0/go.mod h1:EXq8/J7t9p8zPmdIq+atuxyAbnQwxrQT18fI+Qpv98k=
7+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c=
8+
github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI=

examples/serviceaccount/serviceaccount.go

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

8-
"github.com/stackitcloud/stackit-sdk-go/core/utils"
9-
"github.com/stackitcloud/stackit-sdk-go/services/serviceaccount"
8+
serviceaccount "github.com/stackitcloud/stackit-sdk-go/services/serviceaccount/v2api"
109
)
1110

1211
func main() {
@@ -20,21 +19,21 @@ func main() {
2019
}
2120

2221
// Get the service accounts for your project
23-
getAccountsResp, err := client.ListServiceAccounts(context.Background(), projectId).Execute()
22+
getAccountsResp, err := client.DefaultAPI.ListServiceAccounts(context.Background(), projectId).Execute()
2423
if err != nil {
2524
fmt.Fprintf(os.Stderr, "Error when calling `GetServiceAccounts`: %v\n", err)
2625
} else {
27-
fmt.Printf("Number of service accounts: %v\n", len(*getAccountsResp.Items))
26+
fmt.Printf("Number of service accounts: %v\n", len(getAccountsResp.Items))
2827
}
2928

3029
// Create a service account
3130
createAccountPayload := serviceaccount.CreateServiceAccountPayload{
32-
Name: utils.Ptr("my-service-account"),
31+
Name: "my-service-account",
3332
}
34-
createAccountResp, err := client.CreateServiceAccount(context.Background(), projectId).CreateServiceAccountPayload(createAccountPayload).Execute()
33+
createAccountResp, err := client.DefaultAPI.CreateServiceAccount(context.Background(), projectId).CreateServiceAccountPayload(createAccountPayload).Execute()
3534
if err != nil {
3635
fmt.Fprintf(os.Stderr, "Error when calling `CreateServiceAccount`: %v\n", err)
3736
} else {
38-
fmt.Printf("Created service account with email \"%s\".\n", *createAccountResp.Email)
37+
fmt.Printf("Created service account with email \"%s\".\n", createAccountResp.Email)
3938
}
4039
}

services/serviceaccount/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.13.0
2+
- **Feature:** Introduction of multi API version support for the serviceaccount SDK module. For more details please see the announcement on GitHub: https://github.com/stackitcloud/stackit-sdk-go/discussions/5062
3+
- `v2api`: New package which should be used for communication with the STACKIT serviceaccount API in the future
4+
- **Deprecation:** The contents in the root of this SDK module are marked as deprecated and will be removed after 2026-09-30. Switch to the new `v2api` package instead.
5+
- **Dependencies:** Bump STACKIT SDK core module from `v0.21.1` to `v0.22.0`
6+
17
## v0.12.0
28
- **Feature:** add support for Federated Identity Providers
39
- new operations: `CreateFederatedIdentityProvider`, `DeleteServiceFederatedIdentityProvider`, `ListFederatedIdentityProviders`, `PartialUpdateServiceAccountFederatedIdentityProvider`

services/serviceaccount/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.12.0
1+
v0.13.0

0 commit comments

Comments
 (0)