Skip to content

heyframe/go-heyframe-admin-api-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDK for the Heyframe 6 Admin API

See example folder

Create a client

Password

ctx := context.Background()

// Create a using password grant
creds := sdk.NewPasswordCredentials("<username>", "<password>", []string{"write"})
client, err := sdk.NewApiClient(ctx, "<url>", creds, nil)

Integration

ctx := context.Background()

// Create a using password grant
creds := sdk.NewIntegrationCredentials("<client-id>", "<client-secret>", []string{"write"})
client, err := sdk.NewApiClient(ctx, "<url>", creds, nil)

Usage of a repository

Search

apiContext := sdk.NewApiContext(ctx)
criteria := sdk.Criteria{}

collection, _, _ := client.Repository.Product.Search(apiContext, criteria)

for _, product := range collection.Data {
    fmt.Println(product.Name)
}

Create/Update

apiContext := sdk.NewApiContext(ctx)
client.Repository.Product.Upsert(apiContext, []sdk.Product{
    {Name: "15%"},
})

Delete

apiContext := sdk.NewApiContext(ctx)
client.Repository.Product.Delete(apiContext, []string{"someid"})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published