bucketapi

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 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 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 AddBucketScopeResponse

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

func ParseAddBucketScopeResponse

func ParseAddBucketScopeResponse(rsp *http.Response) (*AddBucketScopeResponse, error)

ParseAddBucketScopeResponse parses an HTTP response from a AddBucketScopeWithResponse call

func (AddBucketScopeResponse) Status

func (r AddBucketScopeResponse) Status() string

Status returns HTTPResponse.Status

func (AddBucketScopeResponse) StatusCode

func (r AddBucketScopeResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type BucketMetadata

type BucketMetadata struct {
	BillingLogBucket *string   `json:"billing_log_bucket,omitempty"`
	BillingLogPrefix *string   `json:"billing_log_prefix,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) 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)

	// 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)
}

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) (*AddBucketScopeResponse, error)

AddBucketScopeWithBodyWithResponse request with arbitrary body returning *AddBucketScopeResponse

func (*ClientWithResponses) AddBucketScopeWithResponse

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

func (*ClientWithResponses) DeleteBucketWithResponse

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

DeleteBucketWithResponse request returning *DeleteBucketResponse

func (*ClientWithResponses) ListBucketsWithResponse

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

ListBucketsWithResponse request returning *ListBucketsResponse

func (*ClientWithResponses) PutBucketWithBodyWithResponse

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

PutBucketWithBodyWithResponse request with arbitrary body returning *PutBucketResponse

func (*ClientWithResponses) PutBucketWithResponse

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

type ClientWithResponsesInterface

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

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

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

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

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

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

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

type DeleteBucketResponse

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

func ParseDeleteBucketResponse

func ParseDeleteBucketResponse(rsp *http.Response) (*DeleteBucketResponse, error)

ParseDeleteBucketResponse parses an HTTP response from a DeleteBucketWithResponse call

func (DeleteBucketResponse) Status

func (r DeleteBucketResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteBucketResponse) StatusCode

func (r DeleteBucketResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

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

Doer performs HTTP requests.

The standard http.Client implements this interface.

type ListBucketsResponse

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

func ParseListBucketsResponse

func ParseListBucketsResponse(rsp *http.Response) (*ListBucketsResponse, error)

ParseListBucketsResponse parses an HTTP response from a ListBucketsWithResponse call

func (ListBucketsResponse) Status

func (r ListBucketsResponse) Status() string

Status returns HTTPResponse.Status

func (ListBucketsResponse) StatusCode

func (r ListBucketsResponse) 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"`

	// BillingLogBucket Bucket/container where provider access logs are delivered. Required for s3, gcs, and azure.
	BillingLogBucket *string `json:"billing_log_bucket,omitempty"`

	// BillingLogPrefix Prefix under billing_log_bucket where provider access logs are delivered. Required for s3, gcs, and azure.
	BillingLogPrefix *string `json:"billing_log_prefix,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 PutBucketResponse

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

func ParsePutBucketResponse

func ParsePutBucketResponse(rsp *http.Response) (*PutBucketResponse, error)

ParsePutBucketResponse parses an HTTP response from a PutBucketWithResponse call

func (PutBucketResponse) Status

func (r PutBucketResponse) Status() string

Status returns HTTPResponse.Status

func (PutBucketResponse) StatusCode

func (r PutBucketResponse) 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