b2types

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2017 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package b2types implements internal types common to the B2 API.

Index

Constants

View Source
const (
	V1api = "/b2api/v1/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeAccountResponse

type AuthorizeAccountResponse struct {
	AccountID   string `json:"accountId"`
	AuthToken   string `json:"authorizationToken"`
	URI         string `json:"apiUrl"`
	DownloadURI string `json:"downloadUrl"`
	MinPartSize int    `json:"minimumPartSize"`
}

type CancelLargeFileRequest

type CancelLargeFileRequest struct {
	ID string `json:"fileId"`
}

type CreateBucketRequest

type CreateBucketRequest struct {
	AccountID      string            `json:"accountId"`
	Name           string            `json:"bucketName"`
	Type           string            `json:"bucketType"`
	Info           map[string]string `json:"bucketInfo"`
	LifecycleRules []LifecycleRule   `json:"lifecycleRules"`
}

type CreateBucketResponse

type CreateBucketResponse struct {
	BucketID       string            `json:"bucketId"`
	Name           string            `json:"bucketName"`
	Type           string            `json:"bucketType"`
	Info           map[string]string `json:"bucketInfo"`
	LifecycleRules []LifecycleRule   `json:"lifecycleRules"`
	Revision       int               `json:"revision"`
}

type DeleteBucketRequest

type DeleteBucketRequest struct {
	AccountID string `json:"accountId"`
	BucketID  string `json:"bucketId"`
}

type DeleteFileVersionRequest

type DeleteFileVersionRequest struct {
	Name   string `json:"fileName"`
	FileID string `json:"fileId"`
}

type ErrorMessage

type ErrorMessage struct {
	Status int    `json:"status"`
	Code   string `json:"code"`
	Msg    string `json:"message"`
}

type FinishLargeFileRequest

type FinishLargeFileRequest struct {
	ID     string   `json:"fileId"`
	Hashes []string `json:"partSha1Array"`
}

type FinishLargeFileResponse

type FinishLargeFileResponse struct {
	Name      string `json:"fileName"`
	FileID    string `json:"fileId"`
	Timestamp int64  `json:"uploadTimestamp"`
	Action    string `json:"action"`
}

type GetDownloadAuthorizationRequest

type GetDownloadAuthorizationRequest struct {
	BucketID string `json:"bucketId"`
	Prefix   string `json:"fileNamePrefix"`
	Valid    int    `json:"validDurationInSeconds"`
}

type GetDownloadAuthorizationResponse

type GetDownloadAuthorizationResponse struct {
	BucketID string `json:"bucketId"`
	Prefix   string `json:"fileNamePrefix"`
	Token    string `json:"authorizationToken"`
}

type GetFileInfoRequest

type GetFileInfoRequest struct {
	ID string `json:"fileId"`
}

type GetFileInfoResponse

type GetFileInfoResponse struct {
	FileID      string            `json:"fileId"`
	Name        string            `json:"fileName"`
	SHA1        string            `json:"contentSha1"`
	Size        int64             `json:"contentLength"`
	ContentType string            `json:"contentType"`
	Info        map[string]string `json:"fileInfo"`
	Action      string            `json:"action"`
	Timestamp   int64             `json:"uploadTimestamp"`
}

type GetUploadURLRequest

type GetUploadURLRequest struct {
	BucketID string `json:"bucketId"`
}

type GetUploadURLResponse

type GetUploadURLResponse struct {
	URI   string `json:"uploadUrl"`
	Token string `json:"authorizationToken"`
}

type HideFileRequest

type HideFileRequest struct {
	BucketID string `json:"bucketId"`
	File     string `json:"fileName"`
}

type HideFileResponse

type HideFileResponse struct {
	ID        string `json:"fileId"`
	Timestamp int64  `json:"uploadTimestamp"`
	Action    string `json:"action"`
}

type LifecycleRule

type LifecycleRule struct {
	DaysHiddenUntilDeleted int    `json:"daysFromHidingToDeleting,omitempty"`
	DaysNewUntilHidden     int    `json:"daysFromUploadingToHiding,omitempty"`
	Prefix                 string `json:"fileNamePrefix"`
}

type ListBucketsRequest

type ListBucketsRequest struct {
	AccountID string `json:"accountId"`
}

type ListBucketsResponse

type ListBucketsResponse struct {
	Buckets []CreateBucketResponse `json:"buckets"`
}

type ListFileNamesRequest

type ListFileNamesRequest struct {
	BucketID     string `json:"bucketId"`
	Count        int    `json:"maxFileCount"`
	Continuation string `json:"startFileName,omitempty"`
	Prefix       string `json:"prefix,omitempty"`
	Delimiter    string `json:"delimiter,omitempty"`
}

type ListFileNamesResponse

type ListFileNamesResponse struct {
	Continuation string                `json:"nextFileName"`
	Files        []GetFileInfoResponse `json:"files"`
}

type ListFileVersionsRequest

type ListFileVersionsRequest struct {
	BucketID  string `json:"bucketId"`
	Count     int    `json:"maxFileCount"`
	StartName string `json:"startFileName,omitempty"`
	StartID   string `json:"startFileId,omitempty"`
	Prefix    string `json:"prefix,omitempty"`
	Delimiter string `json:"delimiter,omitempty"`
}

type ListFileVersionsResponse

type ListFileVersionsResponse struct {
	NextName string                `json:"nextFileName"`
	NextID   string                `json:"nextFileId"`
	Files    []GetFileInfoResponse `json:"files"`
}

type ListPartsRequest

type ListPartsRequest struct {
	ID    string `json:"fileId"`
	Start int    `json:"startPartNumber"`
	Count int    `json:"maxPartCount"`
}

type ListPartsResponse

type ListPartsResponse struct {
	Next  int `json:"nextPartNumber"`
	Parts []struct {
		ID     string `json:"fileId"`
		Number int    `json:"partNumber"`
		SHA1   string `json:"contentSha1"`
		Size   int64  `json:"contentLength"`
	} `json:"parts"`
}

type StartLargeFileRequest

type StartLargeFileRequest struct {
	BucketID    string            `json:"bucketId"`
	Name        string            `json:"fileName"`
	ContentType string            `json:"contentType"`
	Info        map[string]string `json:"fileInfo,omitempty"`
}

type StartLargeFileResponse

type StartLargeFileResponse struct {
	ID string `json:"fileId"`
}

type UpdateBucketRequest

type UpdateBucketRequest struct {
	AccountID string `json:"accountId"`
	BucketID  string `json:"bucketId"`
	// bucketName is a required field according to
	// https://www.backblaze.com/b2/docs/b2_update_bucket.html.
	//
	// However, actually setting it returns 400: unknown field in
	// com.backblaze.modules.b2.data.UpdateBucketRequest: bucketName
	//
	//Name           string            `json:"bucketName"`
	Type           string            `json:"bucketType,omitempty"`
	Info           map[string]string `json:"bucketInfo,omitempty"`
	LifecycleRules []LifecycleRule   `json:"lifecycleRules,omitempty"`
	IfRevisionIs   int               `json:"ifRevisionIs,omitempty"`
}

type UpdateBucketResponse

type UpdateBucketResponse CreateBucketResponse

type UploadFileResponse

type UploadFileResponse struct {
	FileID    string `json:"fileId"`
	Timestamp int64  `json:"uploadTimestamp"`
	Action    string `json:"action"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL