GoodMem
ReferenceClient SDKsGo SDK

Spaces API

Spaces API documentation for Go SDK

All URIs are relative to http://localhost:8080

MethodHTTP requestDescription
CreateSpacePost /v1/spacesCreate a new Space
DeleteSpaceDelete /v1/spaces/{id}Delete a space
GetSpaceGet /v1/spaces/{id}Get a space by ID
ListSpacesGet /v1/spacesList spaces
UpdateSpacePut /v1/spaces/{id}Update a space

CreateSpace

Space CreateSpace(ctx).SpaceCreationRequest(spaceCreationRequest).Execute()

Create a new Space

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	spaceCreationRequest := *goodmem_client.NewSpaceCreationRequest("My Research Space") // SpaceCreationRequest | Space configuration details

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.SpacesAPI.CreateSpace(context.Background()).SpaceCreationRequest(spaceCreationRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpacesAPI.CreateSpace``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateSpace`: Space
	fmt.Fprintf(os.Stdout, "Response from `SpacesAPI.CreateSpace`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateSpaceRequest struct via the builder pattern

NameTypeDescriptionNotes
spaceCreationRequestSpaceCreationRequestSpace configuration details

Return type

Space

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

DeleteSpace

DeleteSpace(ctx, id).Execute()

Delete a space

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the space to delete

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	r, err := apiClient.SpacesAPI.DeleteSpace(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpacesAPI.DeleteSpace``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the space to delete

Other Parameters

Other parameters are passed through a pointer to a apiDeleteSpaceRequest struct via the builder pattern

NameTypeDescriptionNotes

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

GetSpace

Space GetSpace(ctx, id).Execute()

Get a space by ID

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the space to retrieve

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.SpacesAPI.GetSpace(context.Background(), id).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpacesAPI.GetSpace``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSpace`: Space
	fmt.Fprintf(os.Stdout, "Response from `SpacesAPI.GetSpace`: %v\n", resp)
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the space to retrieve

Other Parameters

Other parameters are passed through a pointer to a apiGetSpaceRequest struct via the builder pattern

NameTypeDescriptionNotes

Return type

Space

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

ListSpaces

ListSpacesResponse ListSpaces(ctx).OwnerId(ownerId).NameFilter(nameFilter).MaxResults(maxResults).NextToken(nextToken).SortBy(sortBy).SortOrder(sortOrder).Label(label).Execute()

List spaces

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	ownerId := "550e8400-e29b-41d4-a716-446655440000" // string | Filter spaces by owner ID. With LIST_SPACE_ANY permission and owner_id omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying owner_id without LIST_SPACE_ANY returns PERMISSION_DENIED. (optional)
	nameFilter := "Research*" // string | Filter spaces by name using glob pattern matching (optional)
	maxResults := int32(20) // int32 | Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000]) (optional)
	nextToken := "eyJzdGFydCI6MjAsIm93bmVySWQiOiJiMzMwM2QwYS0..." // string | Pagination token for retrieving the next set of results (optional)
	sortBy := "name" // string | Field to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT. (optional)
	sortOrder := "ASCENDING" // string | Sort order (ASCENDING or DESCENDING, default: DESCENDING) (optional)
	label := "?label.project=AI&label.team=NLP" // string | Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP) (optional)

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.SpacesAPI.ListSpaces(context.Background()).OwnerId(ownerId).NameFilter(nameFilter).MaxResults(maxResults).NextToken(nextToken).SortBy(sortBy).SortOrder(sortOrder).Label(label).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpacesAPI.ListSpaces``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListSpaces`: ListSpacesResponse
	fmt.Fprintf(os.Stdout, "Response from `SpacesAPI.ListSpaces`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListSpacesRequest struct via the builder pattern

NameTypeDescriptionNotes
ownerIdstringFilter spaces by owner ID. With LIST_SPACE_ANY permission and owner_id omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying owner_id without LIST_SPACE_ANY returns PERMISSION_DENIED.
nameFilterstringFilter spaces by name using glob pattern matching
maxResultsint32Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])
nextTokenstringPagination token for retrieving the next set of results
sortBystringField to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT.
sortOrderstringSort order (ASCENDING or DESCENDING, default: DESCENDING)
labelstringFilter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP)

Return type

ListSpacesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK

UpdateSpace

Space UpdateSpace(ctx, id).UpdateSpaceRequest(updateSpaceRequest).Execute()

Update a space

Example

package main

import (
	"context"
	"fmt"
	"os"
	goodmem_client "github.com/PAIR-Systems-Inc/goodmem/clients/go"
)

func main() {
	id := "550e8400-e29b-41d4-a716-446655440000" // string | The unique identifier of the space to update
	updateSpaceRequest := *goodmem_client.NewUpdateSpaceRequest() // UpdateSpaceRequest | Space update details

	configuration := goodmem_client.NewConfiguration()
	apiClient := goodmem_client.NewAPIClient(configuration)
	resp, r, err := apiClient.SpacesAPI.UpdateSpace(context.Background(), id).UpdateSpaceRequest(updateSpaceRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpacesAPI.UpdateSpace``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateSpace`: Space
	fmt.Fprintf(os.Stdout, "Response from `SpacesAPI.UpdateSpace`: %v\n", resp)
}

Path Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
idstringThe unique identifier of the space to update

Other Parameters

Other parameters are passed through a pointer to a apiUpdateSpaceRequest struct via the builder pattern

NameTypeDescriptionNotes

updateSpaceRequest | UpdateSpaceRequest | Space update details |

Return type

Space

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

↑ Back to Go SDK ↑ Back to Go SDK ↑ Back to Go SDK