Skip to content

Latest commit

 

History

History
191 lines (143 loc) · 10.6 KB

File metadata and controls

191 lines (143 loc) · 10.6 KB

Reports

(Reports)

Overview

REST APIs for managing reports (lint reports, change reports, etc)

Available Operations

GetChangesReportSignedURL

Get the signed access url for the change reports for a particular document.

Example Usage

package main

import(
	"context"
	speakeasyclientsdkgo "github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
	"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
	"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := speakeasyclientsdkgo.New(
        speakeasyclientsdkgo.WithSecurity(shared.Security{
            APIKey: speakeasyclientsdkgo.String("<YOUR_API_KEY_HERE>"),
        }),
    )

    res, err := s.Reports.GetChangesReportSignedURL(ctx, operations.GetChangesReportSignedURLRequest{
        DocumentChecksum: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.SignedAccess != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetChangesReportSignedURLRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetChangesReportSignedURLResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

GetLintingReportSignedURL

Get the signed access url for the linting reports for a particular document.

Example Usage

package main

import(
	"context"
	speakeasyclientsdkgo "github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
	"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
	"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := speakeasyclientsdkgo.New(
        speakeasyclientsdkgo.WithSecurity(shared.Security{
            APIKey: speakeasyclientsdkgo.String("<YOUR_API_KEY_HERE>"),
        }),
    )

    res, err := s.Reports.GetLintingReportSignedURL(ctx, operations.GetLintingReportSignedURLRequest{
        DocumentChecksum: "<value>",
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.SignedAccess != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.GetLintingReportSignedURLRequest ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.GetLintingReportSignedURLResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*

UploadReport

Upload a report.

Example Usage

package main

import(
	"context"
	speakeasyclientsdkgo "github.com/speakeasy-api/speakeasy-client-sdk-go/v3"
	"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared"
	"os"
	"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := speakeasyclientsdkgo.New(
        speakeasyclientsdkgo.WithSecurity(shared.Security{
            APIKey: speakeasyclientsdkgo.String("<YOUR_API_KEY_HERE>"),
        }),
    )

    content, fileErr := os.Open("example.file")
    if fileErr != nil {
        panic(fileErr)
    }


    res, err := s.Reports.UploadReport(ctx, operations.UploadReportRequestBody{
        Data: shared.Report{},
        File: operations.File{
            Content: content,
            FileName: "example.file",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.UploadedReport != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
request operations.UploadReportRequestBody ✔️ The request object to use for the request.
opts []operations.Option The options for this request.

Response

*operations.UploadReportResponse, error

Errors

Error Type Status Code Content Type
sdkerrors.SDKError 4XX, 5XX */*