Skip to content

Commit 1391925

Browse files
authored
feat(iam): add GetOrganizationScim method (#2854)
1 parent 8c9da27 commit 1391925

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

api/iam/v1alpha1/iam_sdk.go

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,11 @@ type GetOrganizationSamlRequest struct {
19141914
OrganizationID string `json:"-"`
19151915
}
19161916

1917+
// GetOrganizationScimRequest: get organization scim request.
1918+
type GetOrganizationScimRequest struct {
1919+
OrganizationID string `json:"-"`
1920+
}
1921+
19171922
// GetOrganizationSecuritySettingsRequest: get organization security settings request.
19181923
type GetOrganizationSecuritySettingsRequest struct {
19191924
// OrganizationID: ID of the Organization.
@@ -4940,7 +4945,34 @@ func (s *API) DeleteSamlCertificate(req *DeleteSamlCertificateRequest, opts ...s
49404945
return nil
49414946
}
49424947

4943-
// EnableOrganizationScim:
4948+
// GetOrganizationScim: Get SCIM configuration of an Organization.
4949+
func (s *API) GetOrganizationScim(req *GetOrganizationScimRequest, opts ...scw.RequestOption) (*Scim, error) {
4950+
var err error
4951+
4952+
if req.OrganizationID == "" {
4953+
defaultOrganizationID, _ := s.client.GetDefaultOrganizationID()
4954+
req.OrganizationID = defaultOrganizationID
4955+
}
4956+
4957+
if fmt.Sprint(req.OrganizationID) == "" {
4958+
return nil, errors.New("field OrganizationID cannot be empty in request")
4959+
}
4960+
4961+
scwReq := &scw.ScalewayRequest{
4962+
Method: "GET",
4963+
Path: "/iam/v1alpha1/organizations/" + fmt.Sprint(req.OrganizationID) + "/scim",
4964+
}
4965+
4966+
var resp Scim
4967+
4968+
err = s.client.Do(scwReq, &resp, opts...)
4969+
if err != nil {
4970+
return nil, err
4971+
}
4972+
return &resp, nil
4973+
}
4974+
4975+
// EnableOrganizationScim: Enable SCIM for an Organization.
49444976
func (s *API) EnableOrganizationScim(req *EnableOrganizationScimRequest, opts ...scw.RequestOption) (*Scim, error) {
49454977
var err error
49464978

@@ -4972,7 +5004,7 @@ func (s *API) EnableOrganizationScim(req *EnableOrganizationScimRequest, opts ..
49725004
return &resp, nil
49735005
}
49745006

4975-
// DeleteScim:
5007+
// DeleteScim: Disable SCIM for an Organization.
49765008
func (s *API) DeleteScim(req *DeleteScimRequest, opts ...scw.RequestOption) error {
49775009
var err error
49785010

@@ -4992,7 +5024,7 @@ func (s *API) DeleteScim(req *DeleteScimRequest, opts ...scw.RequestOption) erro
49925024
return nil
49935025
}
49945026

4995-
// ListScimTokens:
5027+
// ListScimTokens: List SCIM tokens.
49965028
func (s *API) ListScimTokens(req *ListScimTokensRequest, opts ...scw.RequestOption) (*ListScimTokensResponse, error) {
49975029
var err error
49985030

@@ -5025,7 +5057,7 @@ func (s *API) ListScimTokens(req *ListScimTokensRequest, opts ...scw.RequestOpti
50255057
return &resp, nil
50265058
}
50275059

5028-
// CreateScimToken:
5060+
// CreateScimToken: Create a SCIM token.
50295061
func (s *API) CreateScimToken(req *CreateScimTokenRequest, opts ...scw.RequestOption) (*CreateScimTokenResponse, error) {
50305062
var err error
50315063

@@ -5047,7 +5079,7 @@ func (s *API) CreateScimToken(req *CreateScimTokenRequest, opts ...scw.RequestOp
50475079
return &resp, nil
50485080
}
50495081

5050-
// DeleteScimToken:
5082+
// DeleteScimToken: Delete a SCIM token.
50515083
func (s *API) DeleteScimToken(req *DeleteScimTokenRequest, opts ...scw.RequestOption) error {
50525084
var err error
50535085

0 commit comments

Comments
 (0)