mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-09 12:27:47 +00:00
Update Go SDK docs: 16300048992
This commit is contained in:
@@ -8038,6 +8038,288 @@
|
||||
// response from `GetCustomPasswordInstructions`: CustomPasswordInstruction
|
||||
fmt.Fprintf(os.Stdout, "Response from `CustomPasswordInstructionsAPI.GetCustomPasswordInstructions`: %v\n", resp)
|
||||
}
|
||||
- path: /authorization/custom-user-levels
|
||||
method: Post
|
||||
xCodeSample:
|
||||
- lang: Go
|
||||
label: SDK_tools/sdk/go/v2025/methods/custom-user-levels#create-custom-user-level
|
||||
source: |
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"encoding/json"
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
|
||||
userlevelrequest := []byte(`{
|
||||
"owner" : {
|
||||
"name" : "William Wilson",
|
||||
"id" : "2c91808568c529c60168cca6f90c1313",
|
||||
"type" : "IDENTITY"
|
||||
},
|
||||
"rightSets" : [ "idn:ui-right-set-list-read-example", "idn:ui-right-set-write-example" ],
|
||||
"name" : "Custom User Level Name",
|
||||
"description" : "This is a description of the custom user level."
|
||||
}`) // UserLevelRequest | Payload containing the details of the user level to be created.
|
||||
|
||||
|
||||
var userLevelRequest v2025.UserLevelRequest
|
||||
if err := json.Unmarshal(userlevelrequest, &userLevelRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.CustomUserLevelsAPI.CreateCustomUserLevel(context.Background()).XSailPointExperimental(xSailPointExperimental).UserLevelRequest(userLevelRequest).Execute()
|
||||
//resp, r, err := apiClient.V2025.CustomUserLevelsAPI.CreateCustomUserLevel(context.Background()).XSailPointExperimental(xSailPointExperimental).UserLevelRequest(userLevelRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `CustomUserLevelsAPI.CreateCustomUserLevel``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `CreateCustomUserLevel`: UserLevelSummaryDTO
|
||||
fmt.Fprintf(os.Stdout, "Response from `CustomUserLevelsAPI.CreateCustomUserLevel`: %v\n", resp)
|
||||
}
|
||||
- path: /authorization/custom-user-levels/{id}
|
||||
method: Delete
|
||||
xCodeSample:
|
||||
- lang: Go
|
||||
label: SDK_tools/sdk/go/v2025/methods/custom-user-levels#delete-user-level
|
||||
source: |
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
|
||||
id := `6e110911-5984-491b-be74-2707980a46a7` // string | The unique identifier of the user level. # string | The unique identifier of the user level.
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
r, err := apiClient.V2025.CustomUserLevelsAPI.DeleteUserLevel(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
|
||||
//r, err := apiClient.V2025.CustomUserLevelsAPI.DeleteUserLevel(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `CustomUserLevelsAPI.DeleteUserLevel``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
}
|
||||
- path: /authorization/custom-user-levels/{id}
|
||||
method: Get
|
||||
xCodeSample:
|
||||
- lang: Go
|
||||
label: SDK_tools/sdk/go/v2025/methods/custom-user-levels#get-user-level
|
||||
source: |
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
|
||||
id := `6e110911-5984-491b-be74-2707980a46a7` // string | The unique identifier of the user level. # string | The unique identifier of the user level.
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.CustomUserLevelsAPI.GetUserLevel(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
|
||||
//resp, r, err := apiClient.V2025.CustomUserLevelsAPI.GetUserLevel(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `CustomUserLevelsAPI.GetUserLevel``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `GetUserLevel`: UserLevelSummaryDTO
|
||||
fmt.Fprintf(os.Stdout, "Response from `CustomUserLevelsAPI.GetUserLevel`: %v\n", resp)
|
||||
}
|
||||
- path: /authorization/authorization-assignable-right-sets
|
||||
method: Get
|
||||
xCodeSample:
|
||||
- lang: Go
|
||||
label: SDK_tools/sdk/go/v2025/methods/custom-user-levels#list-all-authorization-right-sets
|
||||
source: |
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
|
||||
filters := `category eq "identity"` // string | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **category**: *eq* (optional) # string | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **category**: *eq* (optional)
|
||||
sorters := `name, -id, -category` // string | Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results) Sorting is supported for the following fields: **id, name, category** (optional) # string | Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results) Sorting is supported for the following fields: **id, name, category** (optional)
|
||||
limit := 250 // int32 | Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 250) # int32 | Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 250)
|
||||
offset := 0 // int32 | Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 0) # int32 | Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 0)
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.CustomUserLevelsAPI.ListAllAuthorizationRightSets(context.Background()).XSailPointExperimental(xSailPointExperimental).Execute()
|
||||
//resp, r, err := apiClient.V2025.CustomUserLevelsAPI.ListAllAuthorizationRightSets(context.Background()).XSailPointExperimental(xSailPointExperimental).Filters(filters).Sorters(sorters).Limit(limit).Offset(offset).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `CustomUserLevelsAPI.ListAllAuthorizationRightSets``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `ListAllAuthorizationRightSets`: []HierarchicalRightSet
|
||||
fmt.Fprintf(os.Stdout, "Response from `CustomUserLevelsAPI.ListAllAuthorizationRightSets`: %v\n", resp)
|
||||
}
|
||||
- path: /authorization/custom-user-levels
|
||||
method: Get
|
||||
xCodeSample:
|
||||
- lang: Go
|
||||
label: SDK_tools/sdk/go/v2025/methods/custom-user-levels#list-user-levels
|
||||
source: |
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
|
||||
detailLevel := `detailLevel=FULL` // string | Specifies the level of detail for the user levels. (optional) # string | Specifies the level of detail for the user levels. (optional)
|
||||
filters := `name co "identity", owner co "john", status eq "active"` // string | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **name**: *co* **owner**: *co* **status**: *eq* (optional) # string | Filter results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#filtering-results) Filtering is supported for the following fields and operators: **name**: *co* **owner**: *co* **status**: *eq* (optional)
|
||||
sorters := `name, -created` // string | Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results) Sorting is supported for the following fields: **name, created** (optional) # string | Sort results using the standard syntax described in [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters#sorting-results) Sorting is supported for the following fields: **name, created** (optional)
|
||||
limit := 250 // int32 | Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 250) # int32 | Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 250)
|
||||
offset := 0 // int32 | Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 0) # int32 | Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 0)
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.CustomUserLevelsAPI.ListUserLevels(context.Background()).XSailPointExperimental(xSailPointExperimental).Execute()
|
||||
//resp, r, err := apiClient.V2025.CustomUserLevelsAPI.ListUserLevels(context.Background()).XSailPointExperimental(xSailPointExperimental).DetailLevel(detailLevel).Filters(filters).Sorters(sorters).Limit(limit).Offset(offset).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `CustomUserLevelsAPI.ListUserLevels``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `ListUserLevels`: []UserLevelSummaryDTO
|
||||
fmt.Fprintf(os.Stdout, "Response from `CustomUserLevelsAPI.ListUserLevels`: %v\n", resp)
|
||||
}
|
||||
- path: /authorization/custom-user-levels/{id}/publish
|
||||
method: Post
|
||||
xCodeSample:
|
||||
- lang: Go
|
||||
label: SDK_tools/sdk/go/v2025/methods/custom-user-levels#publish-custom-user-level
|
||||
source: |
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
|
||||
id := `6e110911-5984-491b-be74-2707980a46a7` // string | The unique identifier of the user level to publish. # string | The unique identifier of the user level to publish.
|
||||
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.CustomUserLevelsAPI.PublishCustomUserLevel(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
|
||||
//resp, r, err := apiClient.V2025.CustomUserLevelsAPI.PublishCustomUserLevel(context.Background(), id).XSailPointExperimental(xSailPointExperimental).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `CustomUserLevelsAPI.PublishCustomUserLevel``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `PublishCustomUserLevel`: UserLevelPublishSummary
|
||||
fmt.Fprintf(os.Stdout, "Response from `CustomUserLevelsAPI.PublishCustomUserLevel`: %v\n", resp)
|
||||
}
|
||||
- path: /authorization/custom-user-levels/{id}
|
||||
method: Patch
|
||||
xCodeSample:
|
||||
- lang: Go
|
||||
label: SDK_tools/sdk/go/v2025/methods/custom-user-levels#update-user-level
|
||||
source: |
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"encoding/json"
|
||||
v2025 "github.com/sailpoint-oss/golang-sdk/v2/api_v2025"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
xSailPointExperimental := `true` // string | Use this header to enable this experimental API. (default to "true") # string | Use this header to enable this experimental API. (default to "true")
|
||||
id := `6e110911-5984-491b-be74-2707980a46a7` // string | The unique identifier of the user level. # string | The unique identifier of the user level.
|
||||
jsonpatch := []byte(`{
|
||||
"operations" : [ {
|
||||
"op" : "replace",
|
||||
"path" : "/description",
|
||||
"value" : "New description"
|
||||
}, {
|
||||
"op" : "replace",
|
||||
"path" : "/description",
|
||||
"value" : "New description"
|
||||
} ]
|
||||
}`) // JsonPatch | JSON Patch payload for updating the user level.
|
||||
|
||||
|
||||
var jsonPatch v2025.JsonPatch
|
||||
if err := json.Unmarshal(jsonpatch, &jsonPatch); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V2025.CustomUserLevelsAPI.UpdateUserLevel(context.Background(), id).XSailPointExperimental(xSailPointExperimental).JsonPatch(jsonPatch).Execute()
|
||||
//resp, r, err := apiClient.V2025.CustomUserLevelsAPI.UpdateUserLevel(context.Background(), id).XSailPointExperimental(xSailPointExperimental).JsonPatch(jsonPatch).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `CustomUserLevelsAPI.UpdateUserLevel``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
// response from `UpdateUserLevel`: UserLevelSummaryDTO
|
||||
fmt.Fprintf(os.Stdout, "Response from `CustomUserLevelsAPI.UpdateUserLevel`: %v\n", resp)
|
||||
}
|
||||
- path: /data-segments
|
||||
method: Post
|
||||
xCodeSample:
|
||||
|
||||
Reference in New Issue
Block a user