mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-10 12:27:47 +00:00
update go docs and examples
This commit is contained in:
@@ -57,12 +57,13 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
beta "github.com/sailpoint-oss/golang-sdk/v2/api_beta"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
"encoding/json"
|
||||
beta "github.com/sailpoint-oss/golang-sdk/v2/api_beta"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
recommendationRequestDto := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"prescribeMode" : false,
|
||||
"excludeInterpretations" : false,
|
||||
"requests" : [ {
|
||||
@@ -80,11 +81,20 @@ func main() {
|
||||
} ],
|
||||
"includeTranslationMessages" : false,
|
||||
"includeDebugInformation" : true
|
||||
}`) # RecommendationRequestDto |
|
||||
}`) // RecommendationRequestDto |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.IAIRecommendationsAPI.GetRecommendations(context.Background()).RecommendationRequestDto(recommendationRequestDto).Execute()
|
||||
|
||||
var recommendationRequestDto beta.RecommendationRequestDto
|
||||
if err := json.Unmarshal(data, &recommendationRequestDto); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.IAIRecommendationsAPI.GetRecommendations(context.Background()).RecommendationRequestDto(recommendationRequestDto).Execute()
|
||||
//resp, r, err := apiClient.Beta.IAIRecommendationsAPI.GetRecommendations(context.Background()).RecommendationRequestDto(recommendationRequestDto).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `IAIRecommendationsAPI.GetRecommendations``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -129,15 +139,19 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
beta "github.com/sailpoint-oss/golang-sdk/v2/api_beta"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.IAIRecommendationsAPI.GetRecommendationsConfig(context.Background()).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.IAIRecommendationsAPI.GetRecommendationsConfig(context.Background()).Execute()
|
||||
//resp, r, err := apiClient.Beta.IAIRecommendationsAPI.GetRecommendationsConfig(context.Background()).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `IAIRecommendationsAPI.GetRecommendationsConfig``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -186,21 +200,31 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
beta "github.com/sailpoint-oss/golang-sdk/v2/api_beta"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
"encoding/json"
|
||||
beta "github.com/sailpoint-oss/golang-sdk/v2/api_beta"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
recommendationConfigDto := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"recommenderFeatures" : [ "jobTitle", "location", "peer_group", "department", "active" ],
|
||||
"peerGroupPercentageThreshold" : 0.5,
|
||||
"runAutoSelectOnce" : false,
|
||||
"onlyTuneThreshold" : false
|
||||
}`) # RecommendationConfigDto |
|
||||
}`) // RecommendationConfigDto |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.IAIRecommendationsAPI.UpdateRecommendationsConfig(context.Background()).RecommendationConfigDto(recommendationConfigDto).Execute()
|
||||
|
||||
var recommendationConfigDto beta.RecommendationConfigDto
|
||||
if err := json.Unmarshal(data, &recommendationConfigDto); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.IAIRecommendationsAPI.UpdateRecommendationsConfig(context.Background()).RecommendationConfigDto(recommendationConfigDto).Execute()
|
||||
//resp, r, err := apiClient.Beta.IAIRecommendationsAPI.UpdateRecommendationsConfig(context.Background()).RecommendationConfigDto(recommendationConfigDto).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `IAIRecommendationsAPI.UpdateRecommendationsConfig``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
|
||||
Reference in New Issue
Block a user