Skip to content

Latest commit

 

History

History
73 lines (53 loc) · 3.59 KB

File metadata and controls

73 lines (53 loc) · 3.59 KB

ExternalOrganizations

(ExternalOrganizations)

Overview

Available Operations

  • List - List External Organizations

List

List external organizations.

Example Usage

package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"github.com/polarsource/polar-go/models/operations"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.ExternalOrganizations.List(ctx, operations.ExternalOrganizationsListRequest{})
    if err != nil {
        log.Fatal(err)
    }
    if res.ListResourceExternalOrganization != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}

Parameters

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

Response

*operations.ExternalOrganizationsListResponse, error

Errors

Error Type Status Code Content Type
apierrors.HTTPValidationError 422 application/json
apierrors.APIError 4XX, 5XX */*