Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 5.77 KB

File metadata and controls

61 lines (44 loc) · 5.77 KB

Client.Insights

Overview

Available Operations

Retrieve

Gets the aggregate usage insights data displayed in the Insights Dashboards.

Example Usage

package main

import(
	"context"
	"os"
	apiclientgo "github.com/gleanwork/api-client-go"
	"github.com/gleanwork/api-client-go/models/components"
	"log"
)

func main() {
    ctx := context.Background()

    s := apiclientgo.New(
        apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
    )

    res, err := s.Client.Insights.Retrieve(ctx, components.InsightsRequest{}, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.InsightsResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
insightsRequest components.InsightsRequest ✔️ Includes request parameters for insights requests.
locale *string The client's preferred locale in rfc5646 format (e.g. en, ja, pt-BR). If omitted, the Accept-Language will be used. If not present or not supported, defaults to the closest match or en.
opts []operations.Option The options for this request.

Response

*operations.InsightsResponse, error

Errors

Error Type Status Code Content Type
apierrors.APIError 4XX, 5XX */*