update go docs and examples

This commit is contained in:
darrell-thobe-sp
2025-05-13 11:12:04 -04:00
parent 43fe2ffd30
commit d89039d220
580 changed files with 62492 additions and 25327 deletions

View File

@@ -68,12 +68,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() {
passwordPolicyV3Dto := fmt.Sprintf(`{
data := []byte(`{
"validateAgainstAccountName" : true,
"minLength" : 8,
"description" : "Information about the Password Policy",
@@ -105,11 +106,20 @@ func main() {
"requireStrongAuthOffNetwork" : true,
"name" : "PasswordPolicy Example",
"maxLength" : 25
}`) # PasswordPolicyV3Dto |
}`) // PasswordPolicyV3Dto |
configuration := NewDefaultConfiguration()
apiClient := NewAPIClient(configuration)
resp, r, err := apiClient.Beta.PasswordPoliciesAPI.CreatePasswordPolicy(context.Background()).PasswordPolicyV3Dto(passwordPolicyV3Dto).Execute()
var passwordPolicyV3Dto beta.PasswordPolicyV3Dto
if err := json.Unmarshal(data, &passwordPolicyV3Dto); err != nil {
fmt.Println("Error:", err)
return
}
configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.Beta.PasswordPoliciesAPI.CreatePasswordPolicy(context.Background()).PasswordPolicyV3Dto(passwordPolicyV3Dto).Execute()
//resp, r, err := apiClient.Beta.PasswordPoliciesAPI.CreatePasswordPolicy(context.Background()).PasswordPolicyV3Dto(passwordPolicyV3Dto).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PasswordPoliciesAPI.CreatePasswordPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
@@ -162,16 +172,20 @@ 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() {
id := ff808081838d9e9d01838da6a03e0002 # string | The ID of password policy to delete. # string | The ID of password policy to delete.
id := `ff808081838d9e9d01838da6a03e0002` // string | The ID of password policy to delete. # string | The ID of password policy to delete.
configuration := NewDefaultConfiguration()
apiClient := NewAPIClient(configuration)
r, err := apiClient.Beta.PasswordPoliciesAPI.DeletePasswordPolicy(context.Background(), id).Execute()
configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
r, err := apiClient.Beta.PasswordPoliciesAPI.DeletePasswordPolicy(context.Background(), id).Execute()
//r, err := apiClient.Beta.PasswordPoliciesAPI.DeletePasswordPolicy(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PasswordPoliciesAPI.DeletePasswordPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
@@ -222,16 +236,20 @@ 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() {
id := ff808081838d9e9d01838da6a03e0005 # string | The ID of password policy to retrieve. # string | The ID of password policy to retrieve.
id := `ff808081838d9e9d01838da6a03e0005` // string | The ID of password policy to retrieve. # string | The ID of password policy to retrieve.
configuration := NewDefaultConfiguration()
apiClient := NewAPIClient(configuration)
resp, r, err := apiClient.Beta.PasswordPoliciesAPI.GetPasswordPolicyById(context.Background(), id).Execute()
configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.Beta.PasswordPoliciesAPI.GetPasswordPolicyById(context.Background(), id).Execute()
//resp, r, err := apiClient.Beta.PasswordPoliciesAPI.GetPasswordPolicyById(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PasswordPoliciesAPI.GetPasswordPolicyById``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
@@ -283,18 +301,22 @@ 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() {
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)
count := true # bool | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to false) # bool | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to false)
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)
count := true // bool | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to false) # bool | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to false)
configuration := NewDefaultConfiguration()
apiClient := NewAPIClient(configuration)
resp, r, err := apiClient.Beta.PasswordPoliciesAPI.ListPasswordPolicies(context.Background()).Limit(limit).Offset(offset).Count(count).Execute()
configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.Beta.PasswordPoliciesAPI.ListPasswordPolicies(context.Background()).Execute()
//resp, r, err := apiClient.Beta.PasswordPoliciesAPI.ListPasswordPolicies(context.Background()).Limit(limit).Offset(offset).Count(count).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PasswordPoliciesAPI.ListPasswordPolicies``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
@@ -348,13 +370,14 @@ 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() {
id := ff808081838d9e9d01838da6a03e0007 # string | The ID of password policy to update. # string | The ID of password policy to update.
passwordPolicyV3Dto := fmt.Sprintf(`{
id := `ff808081838d9e9d01838da6a03e0007` // string | The ID of password policy to update. # string | The ID of password policy to update.
data := []byte(`{
"validateAgainstAccountName" : true,
"minLength" : 8,
"description" : "Information about the Password Policy",
@@ -386,11 +409,20 @@ func main() {
"requireStrongAuthOffNetwork" : true,
"name" : "PasswordPolicy Example",
"maxLength" : 25
}`) # PasswordPolicyV3Dto |
}`) // PasswordPolicyV3Dto |
configuration := NewDefaultConfiguration()
apiClient := NewAPIClient(configuration)
resp, r, err := apiClient.Beta.PasswordPoliciesAPI.SetPasswordPolicy(context.Background(), id).PasswordPolicyV3Dto(passwordPolicyV3Dto).Execute()
var passwordPolicyV3Dto beta.PasswordPolicyV3Dto
if err := json.Unmarshal(data, &passwordPolicyV3Dto); err != nil {
fmt.Println("Error:", err)
return
}
configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
resp, r, err := apiClient.Beta.PasswordPoliciesAPI.SetPasswordPolicy(context.Background(), id).PasswordPolicyV3Dto(passwordPolicyV3Dto).Execute()
//resp, r, err := apiClient.Beta.PasswordPoliciesAPI.SetPasswordPolicy(context.Background(), id).PasswordPolicyV3Dto(passwordPolicyV3Dto).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PasswordPoliciesAPI.SetPasswordPolicy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)