Getting started with the Go SDK
Once your SDK is installed and configured, you can start accessing the SDK's different functionalities. This guide will walk through some examples of this functionality. To learn how to install and configure the Golang SDK, refer to Installation and Configuration.
List transforms
Create a file in your project called sdk.go with the following content:
package main
import (
"context"
"fmt"
"os"
sailpoint "github.com/sailpoint-oss/golang-sdk"
v3 "github.com/sailpoint-oss/golang-sdk/v2/api_v3"
)
func main() {
ctx := context.TODO()
configuration := sailpoint.NewDefaultConfiguration()
apiClient := sailpoint.NewAPIClient(configuration)
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)
}
fmt.Fprintf(os.Stdout, "All Transforms from `TransformsApi.ListTransforms`: %v\n", resp)
}
To run the code, run this command:
go run sdk.go
You can make changes to the API you are calling by changing this line:
resp, r, err := apiClient.V3.TransformsApi.ListTransforms(ctx).Execute()
- To call a different version of the APIs, change
V3toBeta,V2, orCC. - To call a different API collection, change
TransformsApito another collection, likeSourcesApi, for example. - To call a different endpoint, change
ListTransformsto another endpoint, likeGetTransform, for example.