bucketapi

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package bucketapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddBucketScopeRequest

func NewAddBucketScopeRequest(server string, bucket string, body AddBucketScopeJSONRequestBody) (*http.Request, error)

NewAddBucketScopeRequest calls the generic AddBucketScope builder with application/json body

func NewAddBucketScopeRequestWithBody

func NewAddBucketScopeRequestWithBody(server string, bucket string, contentType string, body io.Reader) (*http.Request, error)

NewAddBucketScopeRequestWithBody generates requests for AddBucketScope with any type of body

func NewDeleteBucketRequest

func NewDeleteBucketRequest(server string, bucket string) (*http.Request, error)

NewDeleteBucketRequest generates requests for DeleteBucket

func NewDeleteBucketScopeRequest added in v0.2.8

func NewDeleteBucketScopeRequest(server string, bucket string, params *DeleteBucketScopeParams) (*http.Request, error)

NewDeleteBucketScopeRequest generates requests for DeleteBucketScope

func NewDeleteProjectDataRequest added in v0.2.8

func NewDeleteProjectDataRequest(server string, organization string, projectId string) (*http.Request, error)

NewDeleteProjectDataRequest generates requests for DeleteProjectData

func NewListBucketsRequest

func NewListBucketsRequest(server string) (*http.Request, error)

NewListBucketsRequest generates requests for ListBuckets

func NewPutBucketRequest

func NewPutBucketRequest(server string, body PutBucketJSONRequestBody) (*http.Request, error)

NewPutBucketRequest calls the generic PutBucket builder with application/json body

func NewPutBucketRequestWithBody

func NewPutBucketRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)

NewPutBucketRequestWithBody generates requests for PutBucket with any type of body

Types

type AddBucketScopeJSONRequestBody

type AddBucketScopeJSONRequestBody = AddBucketScopeRequest

AddBucketScopeJSONRequestBody defines body for AddBucketScope for application/json ContentType.

type AddBucketScopeRequest

type AddBucketScopeRequest struct {
	Organization string `json:"organization"`

	// Path Optional s3://bucket/prefix path override
	Path      *string `json:"path,omitempty"`
	ProjectId string  `json:"project_id"`
}

AddBucketScopeRequest defines model for AddBucketScopeRequest.

type AddBucketScopeResp added in v0.2.8

type AddBucketScopeResp struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseAddBucketScopeResp added in v0.2.8

func ParseAddBucketScopeResp(rsp *http.Response) (*AddBucketScopeResp, error)

ParseAddBucketScopeResp parses an HTTP response from a AddBucketScopeWithResponse call

func (AddBucketScopeResp) Status added in v0.2.8

func (r AddBucketScopeResp) Status() string

Status returns HTTPResponse.Status

func (AddBucketScopeResp) StatusCode added in v0.2.8

func (r AddBucketScopeResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type BucketMetadata

type BucketMetadata struct {
	Bucket      *string   `json:"bucket,omitempty"`
	EndpointUrl *string   `json:"endpoint_url,omitempty"`
	Programs    *[]string `json:"programs,omitempty"`
	Provider    *string   `json:"provider,omitempty"`
	Region      *string   `json:"region,omitempty"`
}

BucketMetadata defines model for BucketMetadata.

type BucketsResponse

type BucketsResponse struct {
	S3BUCKETS map[string]BucketMetadata `json:"S3_BUCKETS"`
}

BucketsResponse defines model for BucketsResponse.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) AddBucketScope

func (c *Client) AddBucketScope(ctx context.Context, bucket string, body AddBucketScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) AddBucketScopeWithBody

func (c *Client) AddBucketScopeWithBody(ctx context.Context, bucket string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteBucket

func (c *Client) DeleteBucket(ctx context.Context, bucket string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteBucketScope added in v0.2.8

func (c *Client) DeleteBucketScope(ctx context.Context, bucket string, params *DeleteBucketScopeParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteProjectData added in v0.2.8

func (c *Client) DeleteProjectData(ctx context.Context, organization string, projectId string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListBuckets

func (c *Client) ListBuckets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PutBucket

func (c *Client) PutBucket(ctx context.Context, body PutBucketJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PutBucketWithBody

func (c *Client) PutBucketWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// ListBuckets request
	ListBuckets(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PutBucketWithBody request with any body
	PutBucketWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	PutBucket(ctx context.Context, body PutBucketJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteBucket request
	DeleteBucket(ctx context.Context, bucket string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteBucketScope request
	DeleteBucketScope(ctx context.Context, bucket string, params *DeleteBucketScopeParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddBucketScopeWithBody request with any body
	AddBucketScopeWithBody(ctx context.Context, bucket string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AddBucketScope(ctx context.Context, bucket string, body AddBucketScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteProjectData request
	DeleteProjectData(ctx context.Context, organization string, projectId string, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) AddBucketScopeWithBodyWithResponse

func (c *ClientWithResponses) AddBucketScopeWithBodyWithResponse(ctx context.Context, bucket string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddBucketScopeResp, error)

AddBucketScopeWithBodyWithResponse request with arbitrary body returning *AddBucketScopeResp

func (*ClientWithResponses) AddBucketScopeWithResponse

func (c *ClientWithResponses) AddBucketScopeWithResponse(ctx context.Context, bucket string, body AddBucketScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*AddBucketScopeResp, error)

func (*ClientWithResponses) DeleteBucketScopeWithResponse added in v0.2.8

func (c *ClientWithResponses) DeleteBucketScopeWithResponse(ctx context.Context, bucket string, params *DeleteBucketScopeParams, reqEditors ...RequestEditorFn) (*DeleteBucketScopeResp, error)

DeleteBucketScopeWithResponse request returning *DeleteBucketScopeResp

func (*ClientWithResponses) DeleteBucketWithResponse

func (c *ClientWithResponses) DeleteBucketWithResponse(ctx context.Context, bucket string, reqEditors ...RequestEditorFn) (*DeleteBucketResp, error)

DeleteBucketWithResponse request returning *DeleteBucketResp

func (*ClientWithResponses) DeleteProjectDataWithResponse added in v0.2.8

func (c *ClientWithResponses) DeleteProjectDataWithResponse(ctx context.Context, organization string, projectId string, reqEditors ...RequestEditorFn) (*DeleteProjectDataResp, error)

DeleteProjectDataWithResponse request returning *DeleteProjectDataResp

func (*ClientWithResponses) ListBucketsWithResponse

func (c *ClientWithResponses) ListBucketsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListBucketsResp, error)

ListBucketsWithResponse request returning *ListBucketsResp

func (*ClientWithResponses) PutBucketWithBodyWithResponse

func (c *ClientWithResponses) PutBucketWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutBucketResp, error)

PutBucketWithBodyWithResponse request with arbitrary body returning *PutBucketResp

func (*ClientWithResponses) PutBucketWithResponse

func (c *ClientWithResponses) PutBucketWithResponse(ctx context.Context, body PutBucketJSONRequestBody, reqEditors ...RequestEditorFn) (*PutBucketResp, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// ListBucketsWithResponse request
	ListBucketsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListBucketsResp, error)

	// PutBucketWithBodyWithResponse request with any body
	PutBucketWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutBucketResp, error)

	PutBucketWithResponse(ctx context.Context, body PutBucketJSONRequestBody, reqEditors ...RequestEditorFn) (*PutBucketResp, error)

	// DeleteBucketWithResponse request
	DeleteBucketWithResponse(ctx context.Context, bucket string, reqEditors ...RequestEditorFn) (*DeleteBucketResp, error)

	// DeleteBucketScopeWithResponse request
	DeleteBucketScopeWithResponse(ctx context.Context, bucket string, params *DeleteBucketScopeParams, reqEditors ...RequestEditorFn) (*DeleteBucketScopeResp, error)

	// AddBucketScopeWithBodyWithResponse request with any body
	AddBucketScopeWithBodyWithResponse(ctx context.Context, bucket string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddBucketScopeResp, error)

	AddBucketScopeWithResponse(ctx context.Context, bucket string, body AddBucketScopeJSONRequestBody, reqEditors ...RequestEditorFn) (*AddBucketScopeResp, error)

	// DeleteProjectDataWithResponse request
	DeleteProjectDataWithResponse(ctx context.Context, organization string, projectId string, reqEditors ...RequestEditorFn) (*DeleteProjectDataResp, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type DeleteBucketResp added in v0.2.8

type DeleteBucketResp struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseDeleteBucketResp added in v0.2.8

func ParseDeleteBucketResp(rsp *http.Response) (*DeleteBucketResp, error)

ParseDeleteBucketResp parses an HTTP response from a DeleteBucketWithResponse call

func (DeleteBucketResp) Status added in v0.2.8

func (r DeleteBucketResp) Status() string

Status returns HTTPResponse.Status

func (DeleteBucketResp) StatusCode added in v0.2.8

func (r DeleteBucketResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteBucketScopeParams added in v0.2.8

type DeleteBucketScopeParams struct {
	Organization string `form:"organization" json:"organization"`
	ProjectId    string `form:"project_id" json:"project_id"`
}

DeleteBucketScopeParams defines parameters for DeleteBucketScope.

type DeleteBucketScopeResp added in v0.2.8

type DeleteBucketScopeResp struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseDeleteBucketScopeResp added in v0.2.8

func ParseDeleteBucketScopeResp(rsp *http.Response) (*DeleteBucketScopeResp, error)

ParseDeleteBucketScopeResp parses an HTTP response from a DeleteBucketScopeWithResponse call

func (DeleteBucketScopeResp) Status added in v0.2.8

func (r DeleteBucketScopeResp) Status() string

Status returns HTTPResponse.Status

func (DeleteBucketScopeResp) StatusCode added in v0.2.8

func (r DeleteBucketScopeResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteProjectDataResp added in v0.2.8

type DeleteProjectDataResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *DeleteProjectDataResponse
}

func ParseDeleteProjectDataResp added in v0.2.8

func ParseDeleteProjectDataResp(rsp *http.Response) (*DeleteProjectDataResp, error)

ParseDeleteProjectDataResp parses an HTTP response from a DeleteProjectDataWithResponse call

func (DeleteProjectDataResp) Status added in v0.2.8

func (r DeleteProjectDataResp) Status() string

Status returns HTTPResponse.Status

func (DeleteProjectDataResp) StatusCode added in v0.2.8

func (r DeleteProjectDataResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteProjectDataResponse added in v0.2.8

type DeleteProjectDataResponse struct {
	DeletedBucketScopes int    `json:"deleted_bucket_scopes"`
	DeletedObjects      int    `json:"deleted_objects"`
	Organization        string `json:"organization"`
	ProjectId           string `json:"project_id"`
}

DeleteProjectDataResponse defines model for DeleteProjectDataResponse.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ListBucketsResp added in v0.2.8

type ListBucketsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *BucketsResponse
}

func ParseListBucketsResp added in v0.2.8

func ParseListBucketsResp(rsp *http.Response) (*ListBucketsResp, error)

ParseListBucketsResp parses an HTTP response from a ListBucketsWithResponse call

func (ListBucketsResp) Status added in v0.2.8

func (r ListBucketsResp) Status() string

Status returns HTTPResponse.Status

func (ListBucketsResp) StatusCode added in v0.2.8

func (r ListBucketsResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type PutBucketJSONRequestBody

type PutBucketJSONRequestBody = PutBucketRequest

PutBucketJSONRequestBody defines body for PutBucket for application/json ContentType.

type PutBucketRequest

type PutBucketRequest struct {
	AccessKey    *string `json:"access_key,omitempty"`
	Bucket       string  `json:"bucket"`
	Endpoint     *string `json:"endpoint,omitempty"`
	Organization string  `json:"organization"`

	// Path Optional s3://bucket/prefix path override
	Path      *string `json:"path,omitempty"`
	ProjectId string  `json:"project_id"`

	// Provider Storage backend provider (s3|gcs|azure|file). Defaults to s3.
	Provider  *string `json:"provider,omitempty"`
	Region    *string `json:"region,omitempty"`
	SecretKey *string `json:"secret_key,omitempty"`
}

PutBucketRequest defines model for PutBucketRequest.

type PutBucketResp added in v0.2.8

type PutBucketResp struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParsePutBucketResp added in v0.2.8

func ParsePutBucketResp(rsp *http.Response) (*PutBucketResp, error)

ParsePutBucketResp parses an HTTP response from a PutBucketWithResponse call

func (PutBucketResp) Status added in v0.2.8

func (r PutBucketResp) Status() string

Status returns HTTPResponse.Status

func (PutBucketResp) StatusCode added in v0.2.8

func (r PutBucketResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

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