mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-09 12:27:47 +00:00
update go docs and examples
This commit is contained in:
@@ -61,6 +61,9 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
## create-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Create Account
|
||||
Submits an account creation task - the API then returns the task ID.
|
||||
|
||||
@@ -108,12 +111,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() {
|
||||
accountAttributesCreate := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"attributes" : {
|
||||
"sourceId" : "34bfcbe116c9407464af37acbaf7a4dc",
|
||||
"city" : "Austin",
|
||||
@@ -122,11 +126,20 @@ func main() {
|
||||
"sAMAccountName" : "jDoe",
|
||||
"mail" : "john.doe@sailpoint.com"
|
||||
}
|
||||
}`) # AccountAttributesCreate |
|
||||
}`) // AccountAttributesCreate |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.CreateAccount(context.Background()).AccountAttributesCreate(accountAttributesCreate).Execute()
|
||||
|
||||
var accountAttributesCreate beta.AccountAttributesCreate
|
||||
if err := json.Unmarshal(data, &accountAttributesCreate); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.CreateAccount(context.Background()).AccountAttributesCreate(accountAttributesCreate).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.CreateAccount(context.Background()).AccountAttributesCreate(accountAttributesCreate).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.CreateAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -139,6 +152,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## delete-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Delete Account
|
||||
Use this API to delete an account.
|
||||
This endpoint submits an account delete task and returns the task ID.
|
||||
@@ -183,16 +199,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 := ef38f94347e94562b5bb8424a56397d8 # string | Account ID. # string | Account ID.
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | Account ID. # string | Account ID.
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DeleteAccount(context.Background(), id).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DeleteAccount(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.DeleteAccount(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.DeleteAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -251,16 +271,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 := c350d6aa4f104c61b062cb632421ad10 # string | The account id # string | The account id
|
||||
id := `c350d6aa4f104c61b062cb632421ad10` // string | The account id # string | The account id
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DeleteAccountAsync(context.Background(), id).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DeleteAccountAsync(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.DeleteAccountAsync(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.DeleteAccountAsync``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -273,6 +297,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## disable-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Disable Account
|
||||
This API submits a task to disable the account and returns the task ID.
|
||||
A token with ORG_ADMIN, SOURCE_ADMIN, SOURCE_SUBADMIN, or HELPDESK authority is required to call this API.
|
||||
@@ -315,20 +342,30 @@ 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 := ef38f94347e94562b5bb8424a56397d8 # string | The account id # string | The account id
|
||||
accountToggleRequest := fmt.Sprintf(`{
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | The account id # string | The account id
|
||||
data := []byte(`{
|
||||
"forceProvisioning" : false,
|
||||
"externalVerificationId" : "3f9180835d2e5168015d32f890ca1581"
|
||||
}`) # AccountToggleRequest |
|
||||
}`) // AccountToggleRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DisableAccount(context.Background(), id).AccountToggleRequest(accountToggleRequest).Execute()
|
||||
|
||||
var accountToggleRequest beta.AccountToggleRequest
|
||||
if err := json.Unmarshal(data, &accountToggleRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DisableAccount(context.Background(), id).AccountToggleRequest(accountToggleRequest).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.DisableAccount(context.Background(), id).AccountToggleRequest(accountToggleRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.DisableAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -341,6 +378,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## disable-account-for-identity
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Disable IDN Account for Identity
|
||||
This API submits a task to disable IDN account for a single identity.
|
||||
|
||||
@@ -381,16 +421,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 := 2c91808384203c2d018437e631158309 # string | The identity id. # string | The identity id.
|
||||
id := `2c91808384203c2d018437e631158309` // string | The identity id. # string | The identity id.
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DisableAccountForIdentity(context.Background(), id).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DisableAccountForIdentity(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.DisableAccountForIdentity(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.DisableAccountForIdentity``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -403,6 +447,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## disable-accounts-for-identities
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Disable IDN Accounts for Identities
|
||||
This API submits tasks to disable IDN account for each identity provided in the request body.
|
||||
|
||||
@@ -439,18 +486,28 @@ 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() {
|
||||
identitiesAccountsBulkRequest := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"identityIds" : [ "2c91808384203c2d018437e631158308", "2c9180858082150f0180893dbaf553fe" ]
|
||||
}`) # IdentitiesAccountsBulkRequest |
|
||||
}`) // IdentitiesAccountsBulkRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DisableAccountsForIdentities(context.Background()).IdentitiesAccountsBulkRequest(identitiesAccountsBulkRequest).Execute()
|
||||
|
||||
var identitiesAccountsBulkRequest beta.IdentitiesAccountsBulkRequest
|
||||
if err := json.Unmarshal(data, &identitiesAccountsBulkRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.DisableAccountsForIdentities(context.Background()).IdentitiesAccountsBulkRequest(identitiesAccountsBulkRequest).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.DisableAccountsForIdentities(context.Background()).IdentitiesAccountsBulkRequest(identitiesAccountsBulkRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.DisableAccountsForIdentities``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -463,6 +520,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## enable-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Enable Account
|
||||
This API submits a task to enable account and returns the task ID.
|
||||
A token with ORG_ADMIN, SOURCE_ADMIN, SOURCE_SUBADMIN, or HELPDESK authority is required to call this API.
|
||||
@@ -505,20 +565,30 @@ 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 := ef38f94347e94562b5bb8424a56397d8 # string | The account id # string | The account id
|
||||
accountToggleRequest := fmt.Sprintf(`{
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | The account id # string | The account id
|
||||
data := []byte(`{
|
||||
"forceProvisioning" : false,
|
||||
"externalVerificationId" : "3f9180835d2e5168015d32f890ca1581"
|
||||
}`) # AccountToggleRequest |
|
||||
}`) // AccountToggleRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.EnableAccount(context.Background(), id).AccountToggleRequest(accountToggleRequest).Execute()
|
||||
|
||||
var accountToggleRequest beta.AccountToggleRequest
|
||||
if err := json.Unmarshal(data, &accountToggleRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.EnableAccount(context.Background(), id).AccountToggleRequest(accountToggleRequest).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.EnableAccount(context.Background(), id).AccountToggleRequest(accountToggleRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.EnableAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -531,6 +601,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## enable-account-for-identity
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Enable IDN Account for Identity
|
||||
This API submits a task to enable IDN account for a single identity.
|
||||
|
||||
@@ -571,16 +644,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 := 2c91808384203c2d018437e631158309 # string | The identity id. # string | The identity id.
|
||||
id := `2c91808384203c2d018437e631158309` // string | The identity id. # string | The identity id.
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.EnableAccountForIdentity(context.Background(), id).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.EnableAccountForIdentity(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.EnableAccountForIdentity(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.EnableAccountForIdentity``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -593,6 +670,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## enable-accounts-for-identities
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Enable IDN Accounts for Identities
|
||||
This API submits tasks to enable IDN account for each identity provided in the request body.
|
||||
|
||||
@@ -629,18 +709,28 @@ 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() {
|
||||
identitiesAccountsBulkRequest := fmt.Sprintf(`{
|
||||
data := []byte(`{
|
||||
"identityIds" : [ "2c91808384203c2d018437e631158308", "2c9180858082150f0180893dbaf553fe" ]
|
||||
}`) # IdentitiesAccountsBulkRequest |
|
||||
}`) // IdentitiesAccountsBulkRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.EnableAccountsForIdentities(context.Background()).IdentitiesAccountsBulkRequest(identitiesAccountsBulkRequest).Execute()
|
||||
|
||||
var identitiesAccountsBulkRequest beta.IdentitiesAccountsBulkRequest
|
||||
if err := json.Unmarshal(data, &identitiesAccountsBulkRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.EnableAccountsForIdentities(context.Background()).IdentitiesAccountsBulkRequest(identitiesAccountsBulkRequest).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.EnableAccountsForIdentities(context.Background()).IdentitiesAccountsBulkRequest(identitiesAccountsBulkRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.EnableAccountsForIdentities``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -653,6 +743,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## get-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Account Details
|
||||
Use this API to return the details for a single account by its ID.
|
||||
A token with ORG_ADMIN, SOURCE_ADMIN, SOURCE_SUBADMIN, or HELPDESK authority is required to call this API.
|
||||
@@ -694,16 +787,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 := ef38f94347e94562b5bb8424a56397d8 # string | Account ID. # string | Account ID.
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | Account ID. # string | Account ID.
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.GetAccount(context.Background(), id).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.GetAccount(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.GetAccount(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.GetAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -716,6 +813,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## get-account-entitlements
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Account Entitlements
|
||||
This API returns entitlements of the account.
|
||||
A token with ORG_ADMIN, SOURCE_ADMIN, SOURCE_SUBADMIN, or HELPDESK authority is required to call this API.
|
||||
@@ -760,19 +860,23 @@ 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 := ef38f94347e94562b5bb8424a56397d8 # string | The account id # string | The account id
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | The account id # string | The account id
|
||||
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)
|
||||
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)
|
||||
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.AccountsAPI.GetAccountEntitlements(context.Background(), id).Offset(offset).Limit(limit).Count(count).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.GetAccountEntitlements(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.GetAccountEntitlements(context.Background(), id).Offset(offset).Limit(limit).Count(count).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.GetAccountEntitlements``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -785,8 +889,11 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## list-accounts
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Accounts List
|
||||
List accounts.
|
||||
List accounts.
|
||||
|
||||
[API Spec](https://developer.sailpoint.com/docs/api/beta/list-accounts)
|
||||
|
||||
@@ -826,21 +933,25 @@ 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() {
|
||||
detailLevel := FULL # string | This value determines whether the API provides `SLIM` or increased level of detail (`FULL`) for each account in the returned list. `FULL` is the default behavior. (optional) # string | This value determines whether the API provides `SLIM` or increased level of detail (`FULL`) for each account in the returned list. `FULL` is the default behavior. (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)
|
||||
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)
|
||||
filters := identityId eq "2c9180858082150f0180893dbaf44201" # 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: **id**: *eq, in, sw* **identityId**: *eq, in, sw* **name**: *eq, in, sw* **nativeIdentity**: *eq, in, sw* **sourceId**: *eq, in, sw* **uncorrelated**: *eq* **entitlements**: *eq* **origin**: *eq, in* **manuallyCorrelated**: *eq* **hasEntitlements**: *eq* **identity.name**: *eq, in, sw* **identity.correlated**: *eq* **identity.identityState**: *eq, in* **source.displayableName**: *eq, in* **source.authoritative**: *eq* **source.connectionType**: *eq, in* **recommendation.method**: *eq, in, isnull* **created**: *eq, ge, gt, le* **modified**: *eq, ge, gt, le, lt* (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: **id**: *eq, in, sw* **identityId**: *eq, in, sw* **name**: *eq, in, sw* **nativeIdentity**: *eq, in, sw* **sourceId**: *eq, in, sw* **uncorrelated**: *eq* **entitlements**: *eq* **origin**: *eq, in* **manuallyCorrelated**: *eq* **hasEntitlements**: *eq* **identity.name**: *eq, in, sw* **identity.correlated**: *eq* **identity.identityState**: *eq, in* **source.displayableName**: *eq, in* **source.authoritative**: *eq* **source.connectionType**: *eq, in* **recommendation.method**: *eq, in, isnull* **created**: *eq, ge, gt, le* **modified**: *eq, ge, gt, le, lt* (optional)
|
||||
sorters := id,name # 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, created, modified, sourceId, identityId, nativeIdentity, uuid, manuallyCorrelated, hasEntitlements, entitlements, origin, identity.name, identity.identityState, identity.correlated, source.displayableName, source.authoritative, source.connectionType, sourceOwner.name** (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, created, modified, sourceId, identityId, nativeIdentity, uuid, manuallyCorrelated, hasEntitlements, entitlements, origin, identity.name, identity.identityState, identity.correlated, source.displayableName, source.authoritative, source.connectionType, sourceOwner.name** (optional)
|
||||
detailLevel := `FULL` // string | This value determines whether the API provides `SLIM` or increased level of detail (`FULL`) for each account in the returned list. `FULL` is the default behavior. (optional) # string | This value determines whether the API provides `SLIM` or increased level of detail (`FULL`) for each account in the returned list. `FULL` is the default behavior. (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)
|
||||
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)
|
||||
filters := `identityId eq "2c9180858082150f0180893dbaf44201"` // 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: **id**: *eq, in, sw* **identityId**: *eq, in, sw* **name**: *eq, in, sw* **nativeIdentity**: *eq, in, sw* **sourceId**: *eq, in, sw* **uncorrelated**: *eq* **entitlements**: *eq* **origin**: *eq, in* **manuallyCorrelated**: *eq* **hasEntitlements**: *eq* **identity.name**: *eq, in, sw* **identity.correlated**: *eq* **identity.identityState**: *eq, in* **source.displayableName**: *eq, in* **source.authoritative**: *eq* **source.connectionType**: *eq, in* **recommendation.method**: *eq, in, isnull* **created**: *eq, ge, gt, le* **modified**: *eq, ge, gt, le, lt* (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: **id**: *eq, in, sw* **identityId**: *eq, in, sw* **name**: *eq, in, sw* **nativeIdentity**: *eq, in, sw* **sourceId**: *eq, in, sw* **uncorrelated**: *eq* **entitlements**: *eq* **origin**: *eq, in* **manuallyCorrelated**: *eq* **hasEntitlements**: *eq* **identity.name**: *eq, in, sw* **identity.correlated**: *eq* **identity.identityState**: *eq, in* **source.displayableName**: *eq, in* **source.authoritative**: *eq* **source.connectionType**: *eq, in* **recommendation.method**: *eq, in, isnull* **created**: *eq, ge, gt, le* **modified**: *eq, ge, gt, le, lt* (optional)
|
||||
sorters := `id,name` // 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, created, modified, sourceId, identityId, nativeIdentity, uuid, manuallyCorrelated, hasEntitlements, entitlements, origin, identity.name, identity.identityState, identity.correlated, source.displayableName, source.authoritative, source.connectionType, sourceOwner.name** (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, created, modified, sourceId, identityId, nativeIdentity, uuid, manuallyCorrelated, hasEntitlements, entitlements, origin, identity.name, identity.identityState, identity.correlated, source.displayableName, source.authoritative, source.connectionType, sourceOwner.name** (optional)
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.ListAccounts(context.Background()).DetailLevel(detailLevel).Limit(limit).Offset(offset).Count(count).Filters(filters).Sorters(sorters).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.ListAccounts(context.Background()).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.ListAccounts(context.Background()).DetailLevel(detailLevel).Limit(limit).Offset(offset).Count(count).Filters(filters).Sorters(sorters).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.ListAccounts``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -853,6 +964,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## put-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Update Account
|
||||
Use this API to update an account with a PUT request.
|
||||
|
||||
@@ -901,13 +1015,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 := ef38f94347e94562b5bb8424a56397d8 # string | Account ID. # string | Account ID.
|
||||
accountAttributes := fmt.Sprintf(`{
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | Account ID. # string | Account ID.
|
||||
data := []byte(`{
|
||||
"attributes" : {
|
||||
"city" : "Austin",
|
||||
"displayName" : "John Doe",
|
||||
@@ -915,11 +1030,20 @@ func main() {
|
||||
"sAMAccountName" : "jDoe",
|
||||
"mail" : "john.doe@sailpoint.com"
|
||||
}
|
||||
}`) # AccountAttributes |
|
||||
}`) // AccountAttributes |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.PutAccount(context.Background(), id).AccountAttributes(accountAttributes).Execute()
|
||||
|
||||
var accountAttributes beta.AccountAttributes
|
||||
if err := json.Unmarshal(data, &accountAttributes); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.PutAccount(context.Background(), id).AccountAttributes(accountAttributes).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.PutAccount(context.Background(), id).AccountAttributes(accountAttributes).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.PutAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -932,6 +1056,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## submit-reload-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Reload Account
|
||||
This API asynchronously reloads the account directly from the connector and performs a one-time aggregation process.
|
||||
A token with ORG_ADMIN, SOURCE_ADMIN, SOURCE_SUBADMIN, or HELPDESK authority is required to call this API.
|
||||
@@ -973,16 +1100,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 := ef38f94347e94562b5bb8424a56397d8 # string | The account id # string | The account id
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | The account id # string | The account id
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.SubmitReloadAccount(context.Background(), id).Execute()
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.SubmitReloadAccount(context.Background(), id).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.SubmitReloadAccount(context.Background(), id).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.SubmitReloadAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -995,6 +1126,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## unlock-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Unlock Account
|
||||
This API submits a task to unlock an account and returns the task ID.
|
||||
To use this endpoint to unlock an account that has the `forceProvisioning` option set to true, the `idn:accounts-provisioning:manage` scope is required.
|
||||
@@ -1038,21 +1172,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() {
|
||||
id := ef38f94347e94562b5bb8424a56397d8 # string | The account ID. # string | The account ID.
|
||||
accountUnlockRequest := fmt.Sprintf(`{
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | The account ID. # string | The account ID.
|
||||
data := []byte(`{
|
||||
"forceProvisioning" : false,
|
||||
"externalVerificationId" : "3f9180835d2e5168015d32f890ca1581",
|
||||
"unlockIDNAccount" : false
|
||||
}`) # AccountUnlockRequest |
|
||||
}`) // AccountUnlockRequest |
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.UnlockAccount(context.Background(), id).AccountUnlockRequest(accountUnlockRequest).Execute()
|
||||
|
||||
var accountUnlockRequest beta.AccountUnlockRequest
|
||||
if err := json.Unmarshal(data, &accountUnlockRequest); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.UnlockAccount(context.Background(), id).AccountUnlockRequest(accountUnlockRequest).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.UnlockAccount(context.Background(), id).AccountUnlockRequest(accountUnlockRequest).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.UnlockAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -1065,6 +1209,9 @@ func main() {
|
||||
[[Back to top]](#)
|
||||
|
||||
## update-account
|
||||
:::caution deprecated
|
||||
This endpoint has been deprecated and may be replaced or removed in future versions of the API.
|
||||
:::
|
||||
Update Account
|
||||
Use this API to update account details.
|
||||
A token with ORG_ADMIN, SOURCE_ADMIN, or SOURCE_SUBADMIN authority is required to call this API.
|
||||
@@ -1117,17 +1264,27 @@ 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 := ef38f94347e94562b5bb8424a56397d8 # string | Account ID. # string | Account ID.
|
||||
requestBody := fmt.Sprintf(`{Uncorrelate account={description=Remove account from Identity, value=[{op=remove, path=/identityId}]}, Reassign account={description=Move account from one Identity to another Identity, value=[{op=replace, path=/identityId, value=2c9180857725c14301772a93bb77242d}]}, Add account attribute={description=Add flat file account's attribute, value=[{op=add, path=/attributes/familyName, value=Smith}]}, Replace account attribute={description=Replace flat file account's attribute, value=[{op=replace, path=/attributes/familyName, value=Smith}]}, Remove account attribute={description=Remove flat file account's attribute, value=[{op=remove, path=/attributes/familyName}]}}`) # []map[string]interface{} | A list of account update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard.
|
||||
id := `ef38f94347e94562b5bb8424a56397d8` // string | Account ID. # string | Account ID.
|
||||
requestBody := fmt.Sprintf(`{Uncorrelate account={description=Remove account from Identity, value=[{op=remove, path=/identityId}]}, Reassign account={description=Move account from one Identity to another Identity, value=[{op=replace, path=/identityId, value=2c9180857725c14301772a93bb77242d}]}, Add account attribute={description=Add flat file account's attribute, value=[{op=add, path=/attributes/familyName, value=Smith}]}, Replace account attribute={description=Replace flat file account's attribute, value=[{op=replace, path=/attributes/familyName, value=Smith}]}, Remove account attribute={description=Remove flat file account's attribute, value=[{op=remove, path=/attributes/familyName}]}}`) // []map[string]interface{} | A list of account update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard.
|
||||
|
||||
configuration := NewDefaultConfiguration()
|
||||
apiClient := NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.UpdateAccount(context.Background(), id).RequestBody(requestBody).Execute()
|
||||
|
||||
var requestBody beta.RequestBody
|
||||
if err := json.Unmarshal(data, &requestBody); err != nil {
|
||||
fmt.Println("Error:", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
resp, r, err := apiClient.Beta.AccountsAPI.UpdateAccount(context.Background(), id).RequestBody(requestBody).Execute()
|
||||
//resp, r, err := apiClient.Beta.AccountsAPI.UpdateAccount(context.Background(), id).RequestBody(requestBody).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `AccountsAPI.UpdateAccount``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
|
||||
Reference in New Issue
Block a user