mirror of
https://github.com/LukeHagar/developer.sailpoint.com.git
synced 2025-12-08 12:27:47 +00:00
update go docs to fix imports
This commit is contained in:
@@ -23,7 +23,7 @@ import (
|
||||
"os"
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk"
|
||||
"github.com/sailpoint-oss/golang-sdk/beta"
|
||||
beta "github.com/sailpoint-oss/golang-sdk/v2/api_beta"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -32,7 +32,7 @@ func main() {
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
|
||||
resp, _, err := apiClient.V3.PublicIdentitiesApi.GetPublicIdentities(ctx).Limit(1).Execute()
|
||||
resp, _, err := apiClient.V3.PublicIdentitiesAPI.GetPublicIdentities(ctx).Limit(1).Execute()
|
||||
|
||||
identity := "IDENTITY"
|
||||
workgroupName := "DB Access Governance Group"
|
||||
@@ -48,7 +48,7 @@ func main() {
|
||||
},
|
||||
}
|
||||
|
||||
newWorkgroup, request, errMessage := apiClient.Beta.GovernanceGroupsApi.CreateWorkgroup(ctx).WorkgroupDto(workgroup).Execute()
|
||||
newWorkgroup, request, errMessage := apiClient.Beta.GovernanceGroupsAPI.CreateWorkgroup(ctx).WorkgroupDto(workgroup).Execute()
|
||||
|
||||
if errMessage != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `GovernanceGroupsApi.CreateWorkgroup``: %v\n", err)
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"os"
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk"
|
||||
beta "github.com/sailpoint-oss/golang-sdk/v2/api_beta"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -30,14 +31,14 @@ func main() {
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
|
||||
workgroup, r, err := apiClient.Beta.GovernanceGroupsApi.ListWorkgroups(ctx).Filters(`name eq "DB Access Governance Group"`).Execute()
|
||||
workgroup, r, err := apiClient.Beta.GovernanceGroupsAPI.ListWorkgroups(ctx).Filters(`name eq "DB Access Governance Group"`).Execute()
|
||||
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when retrieving workgroup`: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
}
|
||||
|
||||
response, errorMessage := apiClient.Beta.GovernanceGroupsApi.DeleteWorkgroup(ctx, *workgroup[0].Id).Execute()
|
||||
response, errorMessage := apiClient.Beta.GovernanceGroupsAPI.DeleteWorkgroup(ctx, *workgroup[0].Id).Execute()
|
||||
|
||||
if errorMessage != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when updating workgroup`: %v\n", errorMessage)
|
||||
|
||||
@@ -16,7 +16,7 @@ The SDK returns the response object, request and error object for each method. T
|
||||
You can use an `if` statement to check whether there are any errors with the request and take actions on the results, such as logging the message or performing additional actions before exiting the program:
|
||||
|
||||
```go
|
||||
resp, r, err := apiClient.V3.TransformsApi.ListTransforms(ctx).Filters("This is an incorrect string").Execute()
|
||||
resp, r, err := apiClient.V3.TransformsAPI.ListTransforms(ctx).Filters("This is an incorrect string").Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `TransformsApi.ListTransforms``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -26,7 +26,7 @@ if err != nil {
|
||||
The program will continue running unless you specify to end it. Use `os.Exit(0)` within the error check to stop execution after an error is found.
|
||||
|
||||
```go
|
||||
resp, r, err := apiClient.V3.TransformsApi.ListTransforms(ctx).Filters("This is an incorrect string").Execute()
|
||||
resp, r, err := apiClient.V3.TransformsAPI.ListTransforms(ctx).Filters("This is an incorrect string").Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `TransformsApi.ListTransforms``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
|
||||
@@ -26,6 +26,7 @@ import (
|
||||
"os"
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -34,7 +35,7 @@ func main() {
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
|
||||
resp, r, err := apiClient.V3.TransformsApi.ListTransforms(ctx).Execute()
|
||||
resp, r, err := apiClient.V3.TransformsAPI.ListTransforms(ctx).Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `TransformsApi.ListTransforms``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
|
||||
@@ -24,7 +24,7 @@ import (
|
||||
"os"
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v3"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -33,7 +33,7 @@ func main() {
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
|
||||
resp, r, err := sailpoint.PaginateWithDefaults[v3.Account](apiClient.V3.AccountsApi.ListAccounts(ctx))
|
||||
resp, r, err := sailpoint.PaginateWithDefaults[v3.Account](apiClient.V3.AccountsAPI.ListAccounts(ctx))
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `PaginateWithDefaults[v3.Account]``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -56,7 +56,7 @@ import (
|
||||
"os"
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v3"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -65,7 +65,7 @@ func main() {
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
|
||||
resp, r, err := sailpoint.Paginate[v3.Account](apiClient.V3.AccountsApi.ListAccounts(ctx), 0, 250, 150000)
|
||||
resp, r, err := sailpoint.Paginate[v3.Account](apiClient.V3.AccountsAPI.ListAccounts(ctx), 0, 250, 150000)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `Paginate[v3.Account]``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
"os"
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk"
|
||||
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -35,7 +36,7 @@ func main() {
|
||||
configuration.HTTPClient.RetryMax = 10
|
||||
configuration.HTTPClient.RetryWaitMax = time.Second * 2
|
||||
|
||||
resp, r, err := apiClient.V3.TransformsApi.ListTransforms(ctx).Filters("This is an incorrect string").Execute()
|
||||
resp, r, err := apiClient.V3.TransformsAPI.ListTransforms(ctx).Filters("This is an incorrect string").Execute()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `TransformsApi.ListTransforms``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
|
||||
@@ -31,7 +31,7 @@ func getSearchResults(ctx context.Context, apiClient *sailpoint.APIClient) {
|
||||
}
|
||||
`)
|
||||
search.UnmarshalJSON(searchString)
|
||||
resp, r, err := sailpoint.PaginateSearchApi(ctx, apiClient, *search, 0, 10, 10000)
|
||||
resp, r, err := sailpoint.PaginateSearchAPI(ctx, apiClient, *search, 0, 10, 10000)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when calling `PaginateSearchApi``: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||
@@ -80,7 +80,7 @@ In this example, the `"identities"` string represents an unmarshalled JSON. Chan
|
||||
The search example includes the syntax you can use to paginate search results. Edit this line to configure the search result pagination:
|
||||
|
||||
```go
|
||||
resp, r, err := sailpoint.PaginateSearchApi(ctx, apiClient, *search, 0, 10, 10000)
|
||||
resp, r, err := sailpoint.PaginateSearchAPI(ctx, apiClient, *search, 0, 10, 10000)
|
||||
```
|
||||
|
||||
The first value refers to the `initialOffset`, the starting number for the results, the second refers to the `increment`, the number of records per page, and the third refers to the `limit`, the last record that can be returned.
|
||||
|
||||
@@ -23,7 +23,7 @@ import (
|
||||
"os"
|
||||
|
||||
sailpoint "github.com/sailpoint-oss/golang-sdk"
|
||||
"github.com/sailpoint-oss/golang-sdk/beta"
|
||||
beta "github.com/sailpoint-oss/golang-sdk/v2/api_beta"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -32,7 +32,7 @@ func main() {
|
||||
configuration := sailpoint.NewDefaultConfiguration()
|
||||
apiClient := sailpoint.NewAPIClient(configuration)
|
||||
|
||||
workgroup, r, err := apiClient.Beta.GovernanceGroupsApi.ListWorkgroups(ctx).Filters(`name eq "DB Access Governance Group"`).Execute()
|
||||
workgroup, r, err := apiClient.Beta.GovernanceGroupsAPI.ListWorkgroups(ctx).Filters(`name eq "DB Access Governance Group"`).Execute()
|
||||
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when retrieving workgroup`: %v\n", err)
|
||||
@@ -43,7 +43,7 @@ func main() {
|
||||
newDescriptionValue := beta.JsonPatchOperationValue{String: &updatedDescription}
|
||||
patchArray := []beta.JsonPatchOperation{{Op: "replace", Path: "/description", Value: &newDescriptionValue}}
|
||||
|
||||
updatedWorkgroup, request, errorMessage := apiClient.Beta.GovernanceGroupsApi.PatchWorkgroup(ctx, *workgroup[0].Id).JsonPatchOperation(patchArray).Execute()
|
||||
updatedWorkgroup, request, errorMessage := apiClient.Beta.GovernanceGroupsAPI.PatchWorkgroup(ctx, *workgroup[0].Id).JsonPatchOperation(patchArray).Execute()
|
||||
|
||||
if errorMessage != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error when updating workgroup`: %v\n", errorMessage)
|
||||
|
||||
Reference in New Issue
Block a user