Skip to content
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
>
> **This module will receive no further updates.** Use `github.com/stackitcloud/stackit-sdk-go/services/authorization` instead.

## Highlights
### Highlights

- `authorization`: [v0.1.0](services/authorization/CHANGELOG.md#v010-2024-02-07)
- First release. This module offers the same functionalities as `membership` (release v0.4.0).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"

"github.com/stackitcloud/stackit-sdk-go/core/utils"
"github.com/stackitcloud/stackit-sdk-go/services/membership"
"github.com/stackitcloud/stackit-sdk-go/services/authorization"
)

func main() {
Expand All @@ -16,7 +16,7 @@ func main() {
emailToBeAdded := "[email protected]"

// Create a new API client, that uses default authentication and configuration
client, err := membership.NewAPIClient()
client, err := authorization.NewAPIClient()
if err != nil {
fmt.Fprintf(os.Stderr, "Creating API client: %v\n", err)
os.Exit(1)
Expand All @@ -36,7 +36,7 @@ func main() {
// Get the memberships of your user
getMembershipsResp, err := client.ListUserMemberships(context.Background(), yourEmail).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GetMemberships`: %v\n", err)
fmt.Fprintf(os.Stderr, "Error when calling `ListUserMemberships`: %v\n", err)
} else {
userMemberships := *getMembershipsResp.Items
fmt.Printf("Number of memberships: %v\n", len(userMemberships))
Expand All @@ -60,8 +60,8 @@ func main() {
}

// Add a member to your project or add an additional role to an existing member
updateMemberPayload := membership.AddMembersPayload{
Members: &[]membership.Member{
updateMemberPayload := authorization.AddMembersPayload{
Members: &[]authorization.Member{
{
Role: utils.Ptr("project.member"),
Subject: utils.Ptr(emailToBeAdded),
Expand All @@ -77,8 +77,8 @@ func main() {
}

// Remove a role from a member of your project
deleteMemberPayload := membership.RemoveMembersPayload{
Members: &[]membership.Member{
deleteMemberPayload := authorization.RemoveMembersPayload{
Members: &[]authorization.Member{
{
Role: utils.Ptr("project.member"),
Subject: utils.Ptr(emailToBeAdded),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/stackitcloud/stackit-sdk-go/examples/membership
module github.com/stackitcloud/stackit-sdk-go/examples/authorization

go 1.18

require (
github.com/stackitcloud/stackit-sdk-go/core v0.7.7
github.com/stackitcloud/stackit-sdk-go/services/membership v0.3.5
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.1.0
)

require (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/stackitcloud/stackit-sdk-go/core v0.7.7 h1:w1T8I2ERT5xPHXS+UV9maSseK8tyUJQjzS21hhRSWjU=
github.com/stackitcloud/stackit-sdk-go/core v0.7.7/go.mod h1:nfC2Tbjd73Ivn8wEp3lvG/dmiXHgl6QX+HY2Ih3aGgw=
github.com/stackitcloud/stackit-sdk-go/services/membership v0.3.5 h1:10uLQ28A/GpnLRVHJRA3eAFFpSFVYX59kpcAL5SQFSM=
github.com/stackitcloud/stackit-sdk-go/services/membership v0.3.5/go.mod h1:2bLrUstAsD/t0OtuVm88O2vaNvJM/vJq/o3ZCv0j1kQ=
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.1.0 h1:FkOaz7ZutvteismzVHsabddg5GLWvRCA9jEzWH1/V9Y=
github.com/stackitcloud/stackit-sdk-go/services/authorization v0.1.0/go.mod h1:n2iI0NZdawwkGt3nqm09l8kSJ3MGgLCCOWdVzanEPzA=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo=
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use (
./core
./examples/argus
./examples/authentication
./examples/authorization
./examples/configuration
./examples/dns
./examples/errorhandling
./examples/httpresponse
./examples/loadbalancer
./examples/logme
./examples/mariadb
./examples/membership
./examples/mongodbflex
./examples/objectstorage
./examples/opensearch
Expand Down