Skip to content

Commit

Permalink
Merge branch 'main' into iam-id-activity
Browse files Browse the repository at this point in the history
  • Loading branch information
padamstx authored and pooraniss-ibm committed Apr 6, 2022
2 parents 1c363ea + 8b0dc6d commit d2acb41
Show file tree
Hide file tree
Showing 12 changed files with 363 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.22.11
current_version = 0.23.0
commit = True
message = Update version {current_version} -> {new_version} [skip ci]

Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ go:
- 1.14.x
- 1.16.x
- 1.17.x
- 1.18.x

notifications:
email: true
Expand All @@ -19,8 +20,8 @@ before_install:
- pyenv global 3.8

install:
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.41.1
- curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.1
- curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.45.2
- curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin

script:
- make travis-ci
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [0.23.0](https://github.com/IBM/platform-services-go-sdk/compare/v0.22.11...v0.23.0) (2022-04-04)


### Features

* **IAM Access Groups:** add support for dynamic membership ([#179](https://github.com/IBM/platform-services-go-sdk/issues/179)) ([f2c9d65](https://github.com/IBM/platform-services-go-sdk/commit/f2c9d650c0f2548904f797edc5d8451e45569e15))

## [0.22.11](https://github.com/IBM/platform-services-go-sdk/compare/v0.22.10...v0.22.11) (2022-03-23)


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![CLA assistant](https://cla-assistant.io/readme/badge/IBM/platform-services-go-sdk)](https://cla-assistant.io/IBM/platform-services-go-sdk)


# IBM Cloud Platform Services Go SDK Version 0.22.11
# IBM Cloud Platform Services Go SDK Version 0.23.0

Go client library to interact with various
[IBM Cloud Platform Service APIs](https://cloud.ibm.com/docs?tab=api-docs&category=platform_services).
Expand Down Expand Up @@ -78,7 +78,7 @@ Service Name | Package name
* Go version 1.14 or above.

## Installation
The current version of this SDK: 0.22.11
The current version of this SDK: 0.23.0

### Go modules
If your application uses Go modules for dependency management (recommended), just add an import for each service
Expand Down
2 changes: 1 addition & 1 deletion common/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
package common

// Version of the SDK
const Version = "0.22.11"
const Version = "0.23.0"
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ require (
github.com/onsi/ginkgo v1.14.2
github.com/onsi/gomega v1.10.5
github.com/stretchr/testify v1.7.0
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f // indirect
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f h1:rlezHXNlxYWvBCzNses9Dlc7nGFaNMJeqLolcmQSSZY=
golang.org/x/sys v0.0.0-20220330033206-e17cdc41300f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
65 changes: 55 additions & 10 deletions iamaccessgroupsv2/iam_access_groups_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/*
* IBM OpenAPI SDK Code Generator Version: 3.43.4-432d779b-20220119-173927
* IBM OpenAPI SDK Code Generator Version: 3.46.1-a5569134-20220316-164819
*/

// Package iamaccessgroupsv2 : Operations and models for the IamAccessGroupsV2 service
Expand Down Expand Up @@ -284,6 +284,9 @@ func (iamAccessGroups *IamAccessGroupsV2) ListAccessGroupsWithContext(ctx contex
if listAccessGroupsOptions.IamID != nil {
builder.AddQuery("iam_id", fmt.Sprint(*listAccessGroupsOptions.IamID))
}
if listAccessGroupsOptions.MembershipType != nil {
builder.AddQuery("membership_type", fmt.Sprint(*listAccessGroupsOptions.MembershipType))
}
if listAccessGroupsOptions.Limit != nil {
builder.AddQuery("limit", fmt.Sprint(*listAccessGroupsOptions.Limit))
}
Expand Down Expand Up @@ -528,9 +531,9 @@ func (iamAccessGroups *IamAccessGroupsV2) DeleteAccessGroupWithContext(ctx conte
}

// IsMemberOfAccessGroup : Check membership in an access group
// This HEAD operation determines if a given `iam_id` is present in a group. No response body is returned with this
// request. If the membership exists, a `204 - No Content` status code is returned. If the membership or the group does
// not exist, a `404 - Not Found` status code is returned.
// This HEAD operation determines if a given `iam_id` is present in a group either explicitly or via dynamic rules. No
// response body is returned with this request. If the membership exists, a `204 - No Content` status code is returned.
// If the membership or the group does not exist, a `404 - Not Found` status code is returned.
func (iamAccessGroups *IamAccessGroupsV2) IsMemberOfAccessGroup(isMemberOfAccessGroupOptions *IsMemberOfAccessGroupOptions) (response *core.DetailedResponse, err error) {
return iamAccessGroups.IsMemberOfAccessGroupWithContext(context.Background(), isMemberOfAccessGroupOptions)
}
Expand Down Expand Up @@ -703,6 +706,9 @@ func (iamAccessGroups *IamAccessGroupsV2) ListAccessGroupMembersWithContext(ctx
builder.AddHeader("Transaction-Id", fmt.Sprint(*listAccessGroupMembersOptions.TransactionID))
}

if listAccessGroupMembersOptions.MembershipType != nil {
builder.AddQuery("membership_type", fmt.Sprint(*listAccessGroupMembersOptions.MembershipType))
}
if listAccessGroupMembersOptions.Limit != nil {
builder.AddQuery("limit", fmt.Sprint(*listAccessGroupMembersOptions.Limit))
}
Expand Down Expand Up @@ -742,7 +748,8 @@ func (iamAccessGroups *IamAccessGroupsV2) ListAccessGroupMembersWithContext(ctx

// RemoveMemberFromAccessGroup : Delete member from an access group
// Remove one member from a group using this API. If the operation is successful, only a `204 - No Content` response
// with no body is returned. However, if any error occurs, the standard error format will be returned.
// with no body is returned. However, if any error occurs, the standard error format will be returned. Dynamic member
// cannot be deleted using this API. Dynamic rules needs to be adjusted to delete dynamic members.
func (iamAccessGroups *IamAccessGroupsV2) RemoveMemberFromAccessGroup(removeMemberFromAccessGroupOptions *RemoveMemberFromAccessGroupOptions) (response *core.DetailedResponse, err error) {
return iamAccessGroups.RemoveMemberFromAccessGroupWithContext(context.Background(), removeMemberFromAccessGroupOptions)
}
Expand Down Expand Up @@ -796,7 +803,8 @@ func (iamAccessGroups *IamAccessGroupsV2) RemoveMemberFromAccessGroupWithContext
// RemoveMembersFromAccessGroup : Delete members from an access group
// Remove multiple members from a group using this API. On a successful call, this API will always return 207. It is the
// caller's responsibility to iterate across the body to determine successful deletion of each member. This API request
// payload can delete up to 50 members per call.
// payload can delete up to 50 members per call. This API doesnt delete dynamic members accessing the access group via
// dynamic rules.
func (iamAccessGroups *IamAccessGroupsV2) RemoveMembersFromAccessGroup(removeMembersFromAccessGroupOptions *RemoveMembersFromAccessGroupOptions) (result *DeleteGroupBulkMembersResponse, response *core.DetailedResponse, err error) {
return iamAccessGroups.RemoveMembersFromAccessGroupWithContext(context.Background(), removeMembersFromAccessGroupOptions)
}
Expand Down Expand Up @@ -1622,7 +1630,7 @@ func (options *AddAccessGroupRuleOptions) SetHeaders(param map[string]string) *A

// AddGroupMembersRequestMembersItem : AddGroupMembersRequestMembersItem struct
type AddGroupMembersRequestMembersItem struct {
// The IBMid, Service Id or Profile Id of the member.
// The IBMid, service ID or trusted profile ID of the member.
IamID *string `json:"iam_id" validate:"required"`

// The type of the member, must be either "user", "service" or "trusted profile".
Expand Down Expand Up @@ -2338,6 +2346,9 @@ type Group struct {

// This is set to true if rules exist for the group.
IsFederated *bool `json:"is_federated,omitempty"`

// Type of the membership. `static` or `dynamic`.
MembershipType *string `json:"membership_type,omitempty"`
}

// UnmarshalGroup unmarshals an instance of Group from the specified map of raw messages.
Expand Down Expand Up @@ -2383,6 +2394,10 @@ func UnmarshalGroup(m map[string]json.RawMessage, result interface{}) (err error
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "membership_type", &obj.MembershipType)
if err != nil {
return
}
reflect.ValueOf(result).Elem().Set(reflect.ValueOf(obj))
return
}
Expand Down Expand Up @@ -2629,6 +2644,11 @@ type ListAccessGroupMembersOptions struct {
// choose. If no transaction ID is passed in, then a random ID is generated.
TransactionID *string `json:"Transaction-Id,omitempty"`

// Filters members by membership type. Membership type can be either `static`, `dynamic` or `all`. `static` lists those
// members explicitly added to the access group, `dynamic` lists those members part of access group via dynamic rules
// at the moment. `all` lists both static and dynamic members.
MembershipType *string `json:"membership_type,omitempty"`

// Return up to this limit of results where limit is between 0 and 100.
Limit *int64 `json:"limit,omitempty"`

Expand All @@ -2638,7 +2658,7 @@ type ListAccessGroupMembersOptions struct {
// Filter the results by member type.
Type *string `json:"type,omitempty"`

// Return user's email and name for each user id or the name for each service id or trusted profile.
// Return user's email and name for each user ID or the name for each service ID or trusted profile.
Verbose *bool `json:"verbose,omitempty"`

// If verbose is true, sort the results by id, name, or email.
Expand Down Expand Up @@ -2667,6 +2687,12 @@ func (_options *ListAccessGroupMembersOptions) SetTransactionID(transactionID st
return _options
}

// SetMembershipType : Allow user to set MembershipType
func (_options *ListAccessGroupMembersOptions) SetMembershipType(membershipType string) *ListAccessGroupMembersOptions {
_options.MembershipType = core.StringPtr(membershipType)
return _options
}

// SetLimit : Allow user to set Limit
func (_options *ListAccessGroupMembersOptions) SetLimit(limit int64) *ListAccessGroupMembersOptions {
_options.Limit = core.Int64Ptr(limit)
Expand Down Expand Up @@ -2754,9 +2780,15 @@ type ListAccessGroupsOptions struct {
// choose. If no transaction ID is passed in, then a random ID is generated.
TransactionID *string `json:"Transaction-Id,omitempty"`

// Return groups for member id (IBMid, Service Id or Profile Id).
// Return groups for member ID (IBMid, service ID or trusted profile ID).
IamID *string `json:"iam_id,omitempty"`

// Membership type need to be specified along with iam_id and must be either `static`, `dynamic` or `all`. If
// membership type is `static`, members explicitly added to the group will be shown. If membership type is `dynamic`,
// members accessing the access group at the moment via dynamic rules will be shown. If membership type is `all`, both
// static and dynamic members will be shown.
MembershipType *string `json:"membership_type,omitempty"`

// Return up to this limit of results where limit is between 0 and 100.
Limit *int64 `json:"limit,omitempty"`

Expand Down Expand Up @@ -2802,6 +2834,12 @@ func (_options *ListAccessGroupsOptions) SetIamID(iamID string) *ListAccessGroup
return _options
}

// SetMembershipType : Allow user to set MembershipType
func (_options *ListAccessGroupsOptions) SetMembershipType(membershipType string) *ListAccessGroupsOptions {
_options.MembershipType = core.StringPtr(membershipType)
return _options
}

// SetLimit : Allow user to set Limit
func (_options *ListAccessGroupsOptions) SetLimit(limit int64) *ListAccessGroupsOptions {
_options.Limit = core.Int64Ptr(limit)
Expand Down Expand Up @@ -2843,9 +2881,12 @@ type ListGroupMembersResponseMember struct {
// The IBMid or Service Id of the member.
IamID *string `json:"iam_id,omitempty"`

// The member type - either `user` or `service`.
// The member type - either `user`, `service` or `profile`.
Type *string `json:"type,omitempty"`

// The membership type - either `static` or `dynamic`.
MembershipType *string `json:"membership_type,omitempty"`

// The user's or service id's name.
Name *string `json:"name,omitempty"`

Expand Down Expand Up @@ -2876,6 +2917,10 @@ func UnmarshalListGroupMembersResponseMember(m map[string]json.RawMessage, resul
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "membership_type", &obj.MembershipType)
if err != nil {
return
}
err = core.UnmarshalPrimitive(m, "name", &obj.Name)
if err != nil {
return
Expand Down
Loading

0 comments on commit d2acb41

Please sign in to comment.