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:
@@ -60,19 +60,29 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
"encoding/json"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
sendTokenRequest := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"userAlias" : "will.albin",
|
||||
"deliveryType" : "EMAIL_WORK"
|
||||
}`) # SendTokenRequest |
|
||||
}`) // SendTokenRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.CreateSendToken(context.Background()).SendTokenRequest(sendTokenRequest).Execute()
|
||||
|
||||
var sendTokenRequest v3.SendTokenRequest
|
||||
if err := json.Unmarshal(data, &sendTokenRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.CreateSendToken(context.Background()).SendTokenRequest(sendTokenRequest).Execute()
|
||||
//resp, r, err := apiClient.V3.MFAControllerAPI.CreateSendToken(context.Background()).SendTokenRequest(sendTokenRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `MFAControllerAPI.CreateSendToken``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -126,19 +136,29 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
"encoding/json"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
method := okta-verify # string | The name of the MFA method. The currently supported method names are 'okta-verify', 'duo-web', 'kba','token', 'rsa' # string | The name of the MFA method. The currently supported method names are 'okta-verify', 'duo-web', 'kba','token', 'rsa'
|
||||
verificationPollRequest := fmt.Sprintf(`{
|
||||
method := `okta-verify` // string | The name of the MFA method. The currently supported method names are 'okta-verify', 'duo-web', 'kba','token', 'rsa' # string | The name of the MFA method. The currently supported method names are 'okta-verify', 'duo-web', 'kba','token', 'rsa'
|
||||
data := []byte(`{
|
||||
"requestId" : "089899f13a8f4da7824996191587bab9"
|
||||
}`) # VerificationPollRequest |
|
||||
}`) // VerificationPollRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.PingVerificationStatus(context.Background(), method).VerificationPollRequest(verificationPollRequest).Execute()
|
||||
|
||||
var verificationPollRequest v3.VerificationPollRequest
|
||||
if err := json.Unmarshal(data, &verificationPollRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.PingVerificationStatus(context.Background(), method).VerificationPollRequest(verificationPollRequest).Execute()
|
||||
//resp, r, err := apiClient.V3.MFAControllerAPI.PingVerificationStatus(context.Background(), method).VerificationPollRequest(verificationPollRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `MFAControllerAPI.PingVerificationStatus``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -187,19 +207,29 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
"encoding/json"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
duoVerificationRequest := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"signedResponse" : "AUTH|d2lsbC5hbGJpbnxESTZNMFpHSThKQVRWTVpZN0M5VXwxNzAxMjUzMDg5|f1f5f8ced5b340f3d303b05d0efa0e43b6a8f970:APP|d2lsbC5hbGJpbnxESTZNMFpHSThKQVRWTVpZN0M5VXwxNzAxMjU2NjE5|cb44cf44353f5127edcae31b1da0355f87357db2",
|
||||
"userId" : "2c9180947f0ef465017f215cbcfd004b"
|
||||
}`) # DuoVerificationRequest |
|
||||
}`) // DuoVerificationRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.SendDuoVerifyRequest(context.Background()).DuoVerificationRequest(duoVerificationRequest).Execute()
|
||||
|
||||
var duoVerificationRequest v3.DuoVerificationRequest
|
||||
if err := json.Unmarshal(data, &duoVerificationRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.SendDuoVerifyRequest(context.Background()).DuoVerificationRequest(duoVerificationRequest).Execute()
|
||||
//resp, r, err := apiClient.V3.MFAControllerAPI.SendDuoVerifyRequest(context.Background()).DuoVerificationRequest(duoVerificationRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `MFAControllerAPI.SendDuoVerifyRequest``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -248,16 +278,26 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
"encoding/json"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
kbaAnswerRequestItem := fmt.Sprintf(`[{id=173423, answer=822cd15d6c15aa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a0859a2fea34}, {id=c54fee53-2d63-4fc5-9259-3e93b9994135, answer=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08}]`) # []KbaAnswerRequestItem |
|
||||
kbaAnswerRequestItem := fmt.Sprintf(`[{id=173423, answer=822cd15d6c15aa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a0859a2fea34}, {id=c54fee53-2d63-4fc5-9259-3e93b9994135, answer=9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08}]`) // []KbaAnswerRequestItem |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.SendKbaAnswers(context.Background()).KbaAnswerRequestItem(kbaAnswerRequestItem).Execute()
|
||||
|
||||
var kbaAnswerRequestItem v3.KbaAnswerRequestItem
|
||||
if err := json.Unmarshal(data, &kbaAnswerRequestItem); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.SendKbaAnswers(context.Background()).KbaAnswerRequestItem(kbaAnswerRequestItem).Execute()
|
||||
//resp, r, err := apiClient.V3.MFAControllerAPI.SendKbaAnswers(context.Background()).KbaAnswerRequestItem(kbaAnswerRequestItem).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `MFAControllerAPI.SendKbaAnswers``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -306,18 +346,28 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
"encoding/json"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
oktaVerificationRequest := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"userId" : "example@mail.com"
|
||||
}`) # OktaVerificationRequest |
|
||||
}`) // OktaVerificationRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.SendOktaVerifyRequest(context.Background()).OktaVerificationRequest(oktaVerificationRequest).Execute()
|
||||
|
||||
var oktaVerificationRequest v3.OktaVerificationRequest
|
||||
if err := json.Unmarshal(data, &oktaVerificationRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.SendOktaVerifyRequest(context.Background()).OktaVerificationRequest(oktaVerificationRequest).Execute()
|
||||
//resp, r, err := apiClient.V3.MFAControllerAPI.SendOktaVerifyRequest(context.Background()).OktaVerificationRequest(oktaVerificationRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `MFAControllerAPI.SendOktaVerifyRequest``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -366,20 +416,30 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
openapiclient "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
"encoding/json"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
tokenAuthRequest := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"userAlias" : "will.albin",
|
||||
"deliveryType" : "EMAIL_WORK",
|
||||
"token" : "12345"
|
||||
}`) # TokenAuthRequest |
|
||||
}`) // TokenAuthRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.SendTokenAuthRequest(context.Background()).TokenAuthRequest(tokenAuthRequest).Execute()
|
||||
|
||||
var tokenAuthRequest v3.TokenAuthRequest
|
||||
if err := json.Unmarshal(data, &tokenAuthRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.V3.MFAControllerAPI.SendTokenAuthRequest(context.Background()).TokenAuthRequest(tokenAuthRequest).Execute()
|
||||
//resp, r, err := apiClient.V3.MFAControllerAPI.SendTokenAuthRequest(context.Background()).TokenAuthRequest(tokenAuthRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `MFAControllerAPI.SendTokenAuthRequest``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
|
||||
Reference in New Issue
Block a user