Files

23 KiB

\SpaceAPI

All URIs are relative to https://api.hanzo.ai

Method HTTP request Description
DeleteSpaceBySpaceDrivesByDrive Delete /v1/space/{space}/drives/{drive} Removes an EMPTY drive and answers 204.
DeleteSpaceBySpaceDrivesByDriveFilesByWildcard1 Delete /v1/space/{space}/drives/{drive}/files/{wildcard1} Removes one file and answers 204.
GetSpaceBySpaceDrives Get /v1/space/{space}/drives Lists a space's drives.
GetSpaceBySpaceDrivesByDriveFiles Get /v1/space/{space}/drives/{drive}/files Lists one folder level of a drive.
GetSpaceBySpaceDrivesByDriveFilesByWildcard1 Get /v1/space/{space}/drives/{drive}/files/{wildcard1} Mints a URL the caller downloads the file from DIRECTLY.
GetSpaceHealth Get /v1/space/health Reports whether this deployment can serve spaces, drives and files.
GetSpaceSpaces Get /v1/space/spaces Lists the caller org's own spaces.
PostSpaceBySpaceDrives Post /v1/space/{space}/drives Makes a new drive in a space and answers 201 with it.
PostSpaceSpaces Post /v1/space/spaces Makes a new space for the caller's org and answers 201 with it.
PutSpaceBySpaceDrivesByDriveFilesByWildcard1 Put /v1/space/{space}/drives/{drive}/files/{wildcard1} Mints a URL the caller uploads the file to DIRECTLY.

DeleteSpaceBySpaceDrivesByDrive

DeleteSpaceBySpaceDrivesByDrive(ctx, space, drive).Execute()

Removes an EMPTY drive and answers 204.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	space := "space_example" // string | Space is the space's name, from the path.
	drive := "drive_example" // string | Drive is the drive's name, from the path.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
space string Space is the space's name, from the path.
drive string Drive is the drive's name, from the path.

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteSpaceBySpaceDrivesByDriveFilesByWildcard1

DeleteSpaceBySpaceDrivesByDriveFilesByWildcard1(ctx, space, drive, wildcard1).Execute()

Removes one file and answers 204.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	space := "space_example" // string | Space is the space's name, from the path.
	drive := "drive_example" // string | Drive is the drive's name, from the path.
	wildcard1 := "wildcard1_example" // string | File is the file's name within the drive — everything after that drive's /files/. It MAY contain \"/\", because a folder is emergent from the name and this segment is captured whole: \"2019/summer/a.jpg\" is one file in two folders, not three names. It is path-cleaned before use, so \"../\" reaches nothing outside the drive, and a name that is empty, absolute or a bare folder marker is refused 400.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.SpaceAPI.DeleteSpaceBySpaceDrivesByDriveFilesByWildcard1(context.Background(), space, drive, wildcard1).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpaceAPI.DeleteSpaceBySpaceDrivesByDriveFilesByWildcard1``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
space string Space is the space's name, from the path.
drive string Drive is the drive's name, from the path.
wildcard1 string File is the file's name within the drive — everything after that drive's /files/. It MAY contain "/", because a folder is emergent from the name and this segment is captured whole: "2019/summer/a.jpg" is one file in two folders, not three names. It is path-cleaned before use, so "../" reaches nothing outside the drive, and a name that is empty, absolute or a bare folder marker is refused 400.

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSpaceBySpaceDrives

SpaceDriveList GetSpaceBySpaceDrives(ctx, space).Execute()

Lists a space's drives.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	space := "space_example" // string | Space is the space's name, from the path.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
space string Space is the space's name, from the path.

Other Parameters

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

Name Type Description Notes

Return type

SpaceDriveList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSpaceBySpaceDrivesByDriveFiles

SpaceFileList GetSpaceBySpaceDrivesByDriveFiles(ctx, space, drive).Folder(folder).Recursive(recursive).Execute()

Lists one folder level of a drive.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	space := "space_example" // string | Space is the space to list in, from the path.
	drive := "drive_example" // string | Drive is the drive to list, from the path.
	folder := "folder_example" // string |  (optional)
	recursive := "recursive_example" // string |  (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SpaceAPI.GetSpaceBySpaceDrivesByDriveFiles(context.Background(), space, drive).Folder(folder).Recursive(recursive).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpaceAPI.GetSpaceBySpaceDrivesByDriveFiles``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSpaceBySpaceDrivesByDriveFiles`: SpaceFileList
	fmt.Fprintf(os.Stdout, "Response from `SpaceAPI.GetSpaceBySpaceDrivesByDriveFiles`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
space string Space is the space to list in, from the path.
drive string Drive is the drive to list, from the path.

Other Parameters

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

Name Type Description Notes

folder | string | | recursive | string | |

Return type

SpaceFileList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSpaceBySpaceDrivesByDriveFilesByWildcard1

SpaceFileURL GetSpaceBySpaceDrivesByDriveFilesByWildcard1(ctx, space, drive, wildcard1).Execute()

Mints a URL the caller downloads the file from DIRECTLY.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	space := "space_example" // string | Space is the space's name, from the path.
	drive := "drive_example" // string | Drive is the drive's name, from the path.
	wildcard1 := "wildcard1_example" // string | File is the file's name within the drive — everything after that drive's /files/. It MAY contain \"/\", because a folder is emergent from the name and this segment is captured whole: \"2019/summer/a.jpg\" is one file in two folders, not three names. It is path-cleaned before use, so \"../\" reaches nothing outside the drive, and a name that is empty, absolute or a bare folder marker is refused 400.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SpaceAPI.GetSpaceBySpaceDrivesByDriveFilesByWildcard1(context.Background(), space, drive, wildcard1).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpaceAPI.GetSpaceBySpaceDrivesByDriveFilesByWildcard1``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSpaceBySpaceDrivesByDriveFilesByWildcard1`: SpaceFileURL
	fmt.Fprintf(os.Stdout, "Response from `SpaceAPI.GetSpaceBySpaceDrivesByDriveFilesByWildcard1`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
space string Space is the space's name, from the path.
drive string Drive is the drive's name, from the path.
wildcard1 string File is the file's name within the drive — everything after that drive's /files/. It MAY contain "/", because a folder is emergent from the name and this segment is captured whole: "2019/summer/a.jpg" is one file in two folders, not three names. It is path-cleaned before use, so "../" reaches nothing outside the drive, and a name that is empty, absolute or a bare folder marker is refused 400.

Other Parameters

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

Name Type Description Notes

Return type

SpaceFileURL

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSpaceHealth

SpaceSpaceHealth GetSpaceHealth(ctx).Execute()

Reports whether this deployment can serve spaces, drives and files.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

SpaceSpaceHealth

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSpaceSpaces

SpaceSpaceList GetSpaceSpaces(ctx).Execute()

Lists the caller org's own spaces.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

SpaceSpaceList

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostSpaceBySpaceDrives

SpaceDriveItem PostSpaceBySpaceDrives(ctx, space).SpaceDriveIn(spaceDriveIn).Execute()

Makes a new drive in a space and answers 201 with it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	space := "space_example" // string | Space is the space to create the drive in, from the path. It carries NO `url:\"-\"`, unlike the field below it, and the difference is the whole reason both tags are written out: zip's binder skips a field tagged \"-\" for EVERY URL source, path params included, so a path-borne value that carried it would arrive empty and the create would refuse a perfectly good address.
	spaceDriveIn := *openapiclient.NewSpaceDriveIn() // SpaceDriveIn | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SpaceAPI.PostSpaceBySpaceDrives(context.Background(), space).SpaceDriveIn(spaceDriveIn).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpaceAPI.PostSpaceBySpaceDrives``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostSpaceBySpaceDrives`: SpaceDriveItem
	fmt.Fprintf(os.Stdout, "Response from `SpaceAPI.PostSpaceBySpaceDrives`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
space string Space is the space to create the drive in, from the path. It carries NO `url:"-"`, unlike the field below it, and the difference is the whole reason both tags are written out: zip's binder skips a field tagged "-" for EVERY URL source, path params included, so a path-borne value that carried it would arrive empty and the create would refuse a perfectly good address.

Other Parameters

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

Name Type Description Notes

spaceDriveIn | SpaceDriveIn | |

Return type

SpaceDriveItem

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PostSpaceSpaces

SpaceSpaceItem PostSpaceSpaces(ctx).SpaceSpaceIn(spaceSpaceIn).Execute()

Makes a new space for the caller's org and answers 201 with it.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	spaceSpaceIn := *openapiclient.NewSpaceSpaceIn() // SpaceSpaceIn | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SpaceAPI.PostSpaceSpaces(context.Background()).SpaceSpaceIn(spaceSpaceIn).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpaceAPI.PostSpaceSpaces``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PostSpaceSpaces`: SpaceSpaceItem
	fmt.Fprintf(os.Stdout, "Response from `SpaceAPI.PostSpaceSpaces`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
spaceSpaceIn SpaceSpaceIn

Return type

SpaceSpaceItem

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

PutSpaceBySpaceDrivesByDriveFilesByWildcard1

SpaceFileURL PutSpaceBySpaceDrivesByDriveFilesByWildcard1(ctx, space, drive, wildcard1).Execute()

Mints a URL the caller uploads the file to DIRECTLY.

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/hanzoai/go-sdk/v8"
)

func main() {
	space := "space_example" // string | Space is the space's name, from the path.
	drive := "drive_example" // string | Drive is the drive's name, from the path.
	wildcard1 := "wildcard1_example" // string | File is the file's name within the drive — everything after that drive's /files/. It MAY contain \"/\", because a folder is emergent from the name and this segment is captured whole: \"2019/summer/a.jpg\" is one file in two folders, not three names. It is path-cleaned before use, so \"../\" reaches nothing outside the drive, and a name that is empty, absolute or a bare folder marker is refused 400.

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.SpaceAPI.PutSpaceBySpaceDrivesByDriveFilesByWildcard1(context.Background(), space, drive, wildcard1).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SpaceAPI.PutSpaceBySpaceDrivesByDriveFilesByWildcard1``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `PutSpaceBySpaceDrivesByDriveFilesByWildcard1`: SpaceFileURL
	fmt.Fprintf(os.Stdout, "Response from `SpaceAPI.PutSpaceBySpaceDrivesByDriveFilesByWildcard1`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
space string Space is the space's name, from the path.
drive string Drive is the drive's name, from the path.
wildcard1 string File is the file's name within the drive — everything after that drive's /files/. It MAY contain "/", because a folder is emergent from the name and this segment is captured whole: "2019/summer/a.jpg" is one file in two folders, not three names. It is path-cleaned before use, so "../" reaches nothing outside the drive, and a name that is empty, absolute or a bare folder marker is refused 400.

Other Parameters

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

Name Type Description Notes

Return type

SpaceFileURL

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]