Add a Golang package

This commit is contained in:
Quentin 2022-11-12 23:34:18 +01:00
parent 83a5cadfd4
commit aef4d8f158
Signed by: quentin
GPG key ID: E9602264D639FF68
83 changed files with 15887 additions and 0 deletions

View file

@ -18,3 +18,12 @@ task buildPythonClient(type: org.openapitools.generator.gradle.plugin.tasks.Gene
] ]
} }
task buildGoClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
generatorName = "go"
inputSpec = "./garage/doc/api/garage-admin-v0.yml"
outputDir = "$rootDir/golang"
configOptions = [
packageName: "garage",
packageVersion: "0.8.0",
]
}

24
golang/.gitignore vendored Normal file
View file

@ -0,0 +1,24 @@
# Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o
*.a
*.so
# Folders
_obj
_test
# Architecture specific extensions/prefixes
*.[568vq]
[568vq].out
*.cgo1.go
*.cgo2.c
_cgo_defun.c
_cgo_gotypes.go
_cgo_export.*
_testmain.go
*.exe
*.test
*.prof

View file

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View file

@ -0,0 +1,80 @@
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
api/openapi.yaml
api_bucket.go
api_key.go
api_layout.go
api_nodes.go
client.go
configuration.go
docs/AddKeyRequest.md
docs/AddNode200ResponseInner.md
docs/AllowBucketKeyRequest.md
docs/AllowBucketKeyRequestPermissions.md
docs/BucketApi.md
docs/BucketInfo.md
docs/BucketInfoQuotas.md
docs/BucketInfoWebsiteConfig.md
docs/BucketKeyInfo.md
docs/ClusterLayout.md
docs/CreateBucketRequest.md
docs/CreateBucketRequestLocalAlias.md
docs/CreateBucketRequestLocalAliasAllow.md
docs/GetNodes200Response.md
docs/ImportKeyRequest.md
docs/KeyApi.md
docs/KeyInfo.md
docs/KeyInfoBucketsInner.md
docs/KeyInfoBucketsInnerPermissions.md
docs/KeyInfoPermissions.md
docs/LayoutApi.md
docs/LayoutVersion.md
docs/ListBuckets200ResponseInner.md
docs/ListBuckets200ResponseInnerLocalAliasesInner.md
docs/ListKeys200ResponseInner.md
docs/NodeClusterInfo.md
docs/NodeNetworkInfo.md
docs/NodesApi.md
docs/UpdateBucketRequest.md
docs/UpdateBucketRequestQuotas.md
docs/UpdateBucketRequestWebsiteAccess.md
docs/UpdateKeyRequest.md
docs/UpdateKeyRequestAllow.md
docs/UpdateKeyRequestDeny.md
git_push.sh
go.mod
go.sum
model_add_key_request.go
model_add_node_200_response_inner.go
model_allow_bucket_key_request.go
model_allow_bucket_key_request_permissions.go
model_bucket_info.go
model_bucket_info_quotas.go
model_bucket_info_website_config.go
model_bucket_key_info.go
model_cluster_layout.go
model_create_bucket_request.go
model_create_bucket_request_local_alias.go
model_create_bucket_request_local_alias_allow.go
model_get_nodes_200_response.go
model_import_key_request.go
model_key_info.go
model_key_info_buckets_inner.go
model_key_info_buckets_inner_permissions.go
model_key_info_permissions.go
model_layout_version.go
model_list_buckets_200_response_inner.go
model_list_buckets_200_response_inner_local_aliases_inner.go
model_list_keys_200_response_inner.go
model_node_cluster_info.go
model_node_network_info.go
model_update_bucket_request.go
model_update_bucket_request_quotas.go
model_update_bucket_request_website_access.go
model_update_key_request.go
model_update_key_request_allow.go
model_update_key_request_deny.go
response.go
utils.go

View file

@ -0,0 +1 @@
6.1.0

8
golang/.travis.yml Normal file
View file

@ -0,0 +1,8 @@
language: go
install:
- go get -d -v .
script:
- go build -v ./

180
golang/README.md Normal file
View file

@ -0,0 +1,180 @@
# Go API client for garage
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks.
*Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
- API version: v0.8.0
- Package version: 0.8.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
## Installation
Install the following dependencies:
```shell
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
```
Put the package under your project folder and add the following in import:
```golang
import garage "github.com/GIT_USER_ID/GIT_REPO_ID"
```
To use a proxy, set the environment variable `HTTP_PROXY`:
```golang
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```
## Configuration of Server URL
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.
### Select Server Configuration
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.
```golang
ctx := context.WithValue(context.Background(), garage.ContextServerIndex, 1)
```
### Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`.
```golang
ctx := context.WithValue(context.Background(), garage.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```
Note, enum values are always validated and all unused variables are silently ignored.
### URLs Configuration per Operation
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.
```golang
ctx := context.WithValue(context.Background(), garage.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), garage.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
```
## Documentation for API Endpoints
All URIs are relative to *http://localhost:3903/v0*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BucketApi* | [**AllowBucketKey**](docs/BucketApi.md#allowbucketkey) | **Post** /bucket/allow | Allow key
*BucketApi* | [**CreateBucket**](docs/BucketApi.md#createbucket) | **Post** /bucket | Create a bucket
*BucketApi* | [**DeleteBucket**](docs/BucketApi.md#deletebucket) | **Delete** /bucket?id={bucket_id} | Delete a bucket
*BucketApi* | [**DeleteBucketGlobalAlias**](docs/BucketApi.md#deletebucketglobalalias) | **Delete** /bucket/alias/global | Delete a global alias
*BucketApi* | [**DeleteBucketLocalAlias**](docs/BucketApi.md#deletebucketlocalalias) | **Delete** /bucket/alias/local | Delete a local alias
*BucketApi* | [**DenyBucketKey**](docs/BucketApi.md#denybucketkey) | **Post** /bucket/deny | Deny key
*BucketApi* | [**FindBucketInfo**](docs/BucketApi.md#findbucketinfo) | **Get** /bucket?globalAlias={alias} | Find a bucket
*BucketApi* | [**GetBucketInfo**](docs/BucketApi.md#getbucketinfo) | **Get** /bucket?id={bucket_id} | Get a bucket
*BucketApi* | [**ListBuckets**](docs/BucketApi.md#listbuckets) | **Get** /bucket | List all buckets
*BucketApi* | [**PutBucketGlobalAlias**](docs/BucketApi.md#putbucketglobalalias) | **Put** /bucket/alias/global | Add a global alias
*BucketApi* | [**PutBucketLocalAlias**](docs/BucketApi.md#putbucketlocalalias) | **Put** /bucket/alias/local | Add a local alias
*BucketApi* | [**UpdateBucket**](docs/BucketApi.md#updatebucket) | **Put** /bucket?id={bucket_id} | Update a bucket
*KeyApi* | [**AddKey**](docs/KeyApi.md#addkey) | **Post** /key | Create a new API key
*KeyApi* | [**DeleteKey**](docs/KeyApi.md#deletekey) | **Delete** /key?id={access_key} | Delete a key
*KeyApi* | [**GetKey**](docs/KeyApi.md#getkey) | **Get** /key?id={access_key} | Get key information
*KeyApi* | [**ImportKey**](docs/KeyApi.md#importkey) | **Post** /key/import | Import an existing key
*KeyApi* | [**ListKeys**](docs/KeyApi.md#listkeys) | **Get** /key | List all keys
*KeyApi* | [**SearchKey**](docs/KeyApi.md#searchkey) | **Get** /key?search={pattern} | Select key by pattern
*KeyApi* | [**UpdateKey**](docs/KeyApi.md#updatekey) | **Post** /key?id={access_key} | Update a key
*LayoutApi* | [**AddLayout**](docs/LayoutApi.md#addlayout) | **Post** /layout | Send modifications to the cluster layout
*LayoutApi* | [**ApplyLayout**](docs/LayoutApi.md#applylayout) | **Post** /layout/apply | Apply staged layout
*LayoutApi* | [**GetLayout**](docs/LayoutApi.md#getlayout) | **Get** /layout | Details on the current and staged layout
*LayoutApi* | [**RevertLayout**](docs/LayoutApi.md#revertlayout) | **Post** /layout/revert | Clear staged layout
*NodesApi* | [**AddNode**](docs/NodesApi.md#addnode) | **Post** /connect | Connect target node to other Garage nodes
*NodesApi* | [**GetNodes**](docs/NodesApi.md#getnodes) | **Get** /status | Status of this node and other nodes in the cluster
## Documentation For Models
- [AddKeyRequest](docs/AddKeyRequest.md)
- [AddNode200ResponseInner](docs/AddNode200ResponseInner.md)
- [AllowBucketKeyRequest](docs/AllowBucketKeyRequest.md)
- [AllowBucketKeyRequestPermissions](docs/AllowBucketKeyRequestPermissions.md)
- [BucketInfo](docs/BucketInfo.md)
- [BucketInfoQuotas](docs/BucketInfoQuotas.md)
- [BucketInfoWebsiteConfig](docs/BucketInfoWebsiteConfig.md)
- [BucketKeyInfo](docs/BucketKeyInfo.md)
- [ClusterLayout](docs/ClusterLayout.md)
- [CreateBucketRequest](docs/CreateBucketRequest.md)
- [CreateBucketRequestLocalAlias](docs/CreateBucketRequestLocalAlias.md)
- [CreateBucketRequestLocalAliasAllow](docs/CreateBucketRequestLocalAliasAllow.md)
- [GetNodes200Response](docs/GetNodes200Response.md)
- [ImportKeyRequest](docs/ImportKeyRequest.md)
- [KeyInfo](docs/KeyInfo.md)
- [KeyInfoBucketsInner](docs/KeyInfoBucketsInner.md)
- [KeyInfoBucketsInnerPermissions](docs/KeyInfoBucketsInnerPermissions.md)
- [KeyInfoPermissions](docs/KeyInfoPermissions.md)
- [LayoutVersion](docs/LayoutVersion.md)
- [ListBuckets200ResponseInner](docs/ListBuckets200ResponseInner.md)
- [ListBuckets200ResponseInnerLocalAliasesInner](docs/ListBuckets200ResponseInnerLocalAliasesInner.md)
- [ListKeys200ResponseInner](docs/ListKeys200ResponseInner.md)
- [NodeClusterInfo](docs/NodeClusterInfo.md)
- [NodeNetworkInfo](docs/NodeNetworkInfo.md)
- [UpdateBucketRequest](docs/UpdateBucketRequest.md)
- [UpdateBucketRequestQuotas](docs/UpdateBucketRequestQuotas.md)
- [UpdateBucketRequestWebsiteAccess](docs/UpdateBucketRequestWebsiteAccess.md)
- [UpdateKeyRequest](docs/UpdateKeyRequest.md)
- [UpdateKeyRequestAllow](docs/UpdateKeyRequestAllow.md)
- [UpdateKeyRequestDeny](docs/UpdateKeyRequestDeny.md)
## Documentation For Authorization
### bearerAuth
- **Type**: HTTP Bearer token authentication
Example
```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)
```
## Documentation for Utility Methods
Due to the fact that model structure members are all pointers, this package contains
a number of utility functions to easily obtain pointers to values of basic types.
Each of these functions takes a value of the given basic type and returns a pointer to it:
* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`
## Author

1439
golang/api/openapi.yaml Normal file

File diff suppressed because it is too large Load diff

1409
golang/api_bucket.go Normal file

File diff suppressed because it is too large Load diff

767
golang/api_key.go Normal file
View file

@ -0,0 +1,767 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"bytes"
"context"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// KeyApiService KeyApi service
type KeyApiService service
type ApiAddKeyRequest struct {
ctx context.Context
ApiService *KeyApiService
addKeyRequest *AddKeyRequest
}
// \"You can set a friendly name for this key, send an empty string instead\"
func (r ApiAddKeyRequest) AddKeyRequest(addKeyRequest AddKeyRequest) ApiAddKeyRequest {
r.addKeyRequest = &addKeyRequest
return r
}
func (r ApiAddKeyRequest) Execute() (*KeyInfo, *http.Response, error) {
return r.ApiService.AddKeyExecute(r)
}
/*
AddKey Create a new API key
Creates a new API access key.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiAddKeyRequest
*/
func (a *KeyApiService) AddKey(ctx context.Context) ApiAddKeyRequest {
return ApiAddKeyRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return KeyInfo
func (a *KeyApiService) AddKeyExecute(r ApiAddKeyRequest) (*KeyInfo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *KeyInfo
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KeyApiService.AddKey")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/key"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.addKeyRequest == nil {
return localVarReturnValue, nil, reportError("addKeyRequest is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.addKeyRequest
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiDeleteKeyRequest struct {
ctx context.Context
ApiService *KeyApiService
accessKey string
}
func (r ApiDeleteKeyRequest) Execute() (*http.Response, error) {
return r.ApiService.DeleteKeyExecute(r)
}
/*
DeleteKey Delete a key
Delete a key from the cluster. Its access will be removed from all the buckets. Buckets are not automatically deleted and can be dangling. You should manually delete them before.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param accessKey The exact API access key generated by Garage
@return ApiDeleteKeyRequest
*/
func (a *KeyApiService) DeleteKey(ctx context.Context, accessKey string) ApiDeleteKeyRequest {
return ApiDeleteKeyRequest{
ApiService: a,
ctx: ctx,
accessKey: accessKey,
}
}
// Execute executes the request
func (a *KeyApiService) DeleteKeyExecute(r ApiDeleteKeyRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KeyApiService.DeleteKey")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/key?id={access_key}"
localVarPath = strings.Replace(localVarPath, "{"+"access_key"+"}", url.PathEscape(parameterToString(r.accessKey, "")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type ApiGetKeyRequest struct {
ctx context.Context
ApiService *KeyApiService
accessKey string
}
func (r ApiGetKeyRequest) Execute() (*KeyInfo, *http.Response, error) {
return r.ApiService.GetKeyExecute(r)
}
/*
GetKey Get key information
Return information about a specific key and return its information
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param accessKey The exact API access key generated by Garage
@return ApiGetKeyRequest
*/
func (a *KeyApiService) GetKey(ctx context.Context, accessKey string) ApiGetKeyRequest {
return ApiGetKeyRequest{
ApiService: a,
ctx: ctx,
accessKey: accessKey,
}
}
// Execute executes the request
// @return KeyInfo
func (a *KeyApiService) GetKeyExecute(r ApiGetKeyRequest) (*KeyInfo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *KeyInfo
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KeyApiService.GetKey")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/key?id={access_key}"
localVarPath = strings.Replace(localVarPath, "{"+"access_key"+"}", url.PathEscape(parameterToString(r.accessKey, "")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiImportKeyRequest struct {
ctx context.Context
ApiService *KeyApiService
importKeyRequest *ImportKeyRequest
}
// Information on the key to import
func (r ApiImportKeyRequest) ImportKeyRequest(importKeyRequest ImportKeyRequest) ApiImportKeyRequest {
r.importKeyRequest = &importKeyRequest
return r
}
func (r ApiImportKeyRequest) Execute() (*KeyInfo, *http.Response, error) {
return r.ApiService.ImportKeyExecute(r)
}
/*
ImportKey Import an existing key
Imports an existing API key. This feature must only be used for migrations and backup restore.
**Do not use it to generate custom key identifiers or you will break your Garage cluster.**
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiImportKeyRequest
*/
func (a *KeyApiService) ImportKey(ctx context.Context) ApiImportKeyRequest {
return ApiImportKeyRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return KeyInfo
func (a *KeyApiService) ImportKeyExecute(r ApiImportKeyRequest) (*KeyInfo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *KeyInfo
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KeyApiService.ImportKey")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/key/import"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.importKeyRequest == nil {
return localVarReturnValue, nil, reportError("importKeyRequest is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.importKeyRequest
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiListKeysRequest struct {
ctx context.Context
ApiService *KeyApiService
}
func (r ApiListKeysRequest) Execute() ([]ListKeys200ResponseInner, *http.Response, error) {
return r.ApiService.ListKeysExecute(r)
}
/*
ListKeys List all keys
Returns all API access keys in the cluster.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListKeysRequest
*/
func (a *KeyApiService) ListKeys(ctx context.Context) ApiListKeysRequest {
return ApiListKeysRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return []ListKeys200ResponseInner
func (a *KeyApiService) ListKeysExecute(r ApiListKeysRequest) ([]ListKeys200ResponseInner, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []ListKeys200ResponseInner
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KeyApiService.ListKeys")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/key"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiSearchKeyRequest struct {
ctx context.Context
ApiService *KeyApiService
pattern string
}
func (r ApiSearchKeyRequest) Execute() (*KeyInfo, *http.Response, error) {
return r.ApiService.SearchKeyExecute(r)
}
/*
SearchKey Select key by pattern
Find the first key matching the given pattern based on its identifier aor friendly name and return its information.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param pattern A pattern (beginning or full string) corresponding to a key identifier or friendly name
@return ApiSearchKeyRequest
*/
func (a *KeyApiService) SearchKey(ctx context.Context, pattern string) ApiSearchKeyRequest {
return ApiSearchKeyRequest{
ApiService: a,
ctx: ctx,
pattern: pattern,
}
}
// Execute executes the request
// @return KeyInfo
func (a *KeyApiService) SearchKeyExecute(r ApiSearchKeyRequest) (*KeyInfo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *KeyInfo
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KeyApiService.SearchKey")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/key?search={pattern}"
localVarPath = strings.Replace(localVarPath, "{"+"pattern"+"}", url.PathEscape(parameterToString(r.pattern, "")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateKeyRequest struct {
ctx context.Context
ApiService *KeyApiService
accessKey string
updateKeyRequest *UpdateKeyRequest
}
// For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove
func (r ApiUpdateKeyRequest) UpdateKeyRequest(updateKeyRequest UpdateKeyRequest) ApiUpdateKeyRequest {
r.updateKeyRequest = &updateKeyRequest
return r
}
func (r ApiUpdateKeyRequest) Execute() (*KeyInfo, *http.Response, error) {
return r.ApiService.UpdateKeyExecute(r)
}
/*
UpdateKey Update a key
Updates information about the specified API access key.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param accessKey The exact API access key generated by Garage
@return ApiUpdateKeyRequest
*/
func (a *KeyApiService) UpdateKey(ctx context.Context, accessKey string) ApiUpdateKeyRequest {
return ApiUpdateKeyRequest{
ApiService: a,
ctx: ctx,
accessKey: accessKey,
}
}
// Execute executes the request
// @return KeyInfo
func (a *KeyApiService) UpdateKeyExecute(r ApiUpdateKeyRequest) (*KeyInfo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *KeyInfo
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "KeyApiService.UpdateKey")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/key?id={access_key}"
localVarPath = strings.Replace(localVarPath, "{"+"access_key"+"}", url.PathEscape(parameterToString(r.accessKey, "")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.updateKeyRequest == nil {
return localVarReturnValue, nil, reportError("updateKeyRequest is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.updateKeyRequest
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}

431
golang/api_layout.go Normal file
View file

@ -0,0 +1,431 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"bytes"
"context"
"io/ioutil"
"net/http"
"net/url"
)
// LayoutApiService LayoutApi service
type LayoutApiService service
type ApiAddLayoutRequest struct {
ctx context.Context
ApiService *LayoutApiService
requestBody *map[string]NodeClusterInfo
}
// To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to `null` instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified.
func (r ApiAddLayoutRequest) RequestBody(requestBody map[string]NodeClusterInfo) ApiAddLayoutRequest {
r.requestBody = &requestBody
return r
}
func (r ApiAddLayoutRequest) Execute() (*http.Response, error) {
return r.ApiService.AddLayoutExecute(r)
}
/*
AddLayout Send modifications to the cluster layout
Send modifications to the cluster layout. These modifications will be included in the staged role changes, visible in subsequent calls of `GET /layout`. Once the set of staged changes is satisfactory, the user may call `POST /layout/apply` to apply the changed changes, or `POST /layout/revert` to clear all of the staged changes in the layout.
Note that setting the capacity to `null` will configure the node as a gateway.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiAddLayoutRequest
*/
func (a *LayoutApiService) AddLayout(ctx context.Context) ApiAddLayoutRequest {
return ApiAddLayoutRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
func (a *LayoutApiService) AddLayoutExecute(r ApiAddLayoutRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LayoutApiService.AddLayout")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/layout"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.requestBody == nil {
return nil, reportError("requestBody is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.requestBody
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type ApiApplyLayoutRequest struct {
ctx context.Context
ApiService *LayoutApiService
layoutVersion *LayoutVersion
}
// Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster.
func (r ApiApplyLayoutRequest) LayoutVersion(layoutVersion LayoutVersion) ApiApplyLayoutRequest {
r.layoutVersion = &layoutVersion
return r
}
func (r ApiApplyLayoutRequest) Execute() (*http.Response, error) {
return r.ApiService.ApplyLayoutExecute(r)
}
/*
ApplyLayout Apply staged layout
Applies to the cluster the layout changes currently registered as staged layout changes.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiApplyLayoutRequest
*/
func (a *LayoutApiService) ApplyLayout(ctx context.Context) ApiApplyLayoutRequest {
return ApiApplyLayoutRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
func (a *LayoutApiService) ApplyLayoutExecute(r ApiApplyLayoutRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LayoutApiService.ApplyLayout")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/layout/apply"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.layoutVersion == nil {
return nil, reportError("layoutVersion is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.layoutVersion
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type ApiGetLayoutRequest struct {
ctx context.Context
ApiService *LayoutApiService
}
func (r ApiGetLayoutRequest) Execute() (*ClusterLayout, *http.Response, error) {
return r.ApiService.GetLayoutExecute(r)
}
/*
GetLayout Details on the current and staged layout
Returns the cluster's current layout, including:
- Currently configured cluster layout
- Staged changes to the cluster layout
*The info returned by this endpoint is a subset of the info returned by `GET /status`.*
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetLayoutRequest
*/
func (a *LayoutApiService) GetLayout(ctx context.Context) ApiGetLayoutRequest {
return ApiGetLayoutRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return ClusterLayout
func (a *LayoutApiService) GetLayoutExecute(r ApiGetLayoutRequest) (*ClusterLayout, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *ClusterLayout
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LayoutApiService.GetLayout")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/layout"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiRevertLayoutRequest struct {
ctx context.Context
ApiService *LayoutApiService
layoutVersion *LayoutVersion
}
// Reverting the staged changes is done by incrementing the version number and clearing the contents of the staged change list. Similarly to the CLI, the body must include the incremented version number, which MUST be 1 + the value of the currently existing layout in the cluster.
func (r ApiRevertLayoutRequest) LayoutVersion(layoutVersion LayoutVersion) ApiRevertLayoutRequest {
r.layoutVersion = &layoutVersion
return r
}
func (r ApiRevertLayoutRequest) Execute() (*http.Response, error) {
return r.ApiService.RevertLayoutExecute(r)
}
/*
RevertLayout Clear staged layout
Clears all of the staged layout changes.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiRevertLayoutRequest
*/
func (a *LayoutApiService) RevertLayout(ctx context.Context) ApiRevertLayoutRequest {
return ApiRevertLayoutRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
func (a *LayoutApiService) RevertLayoutExecute(r ApiRevertLayoutRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LayoutApiService.RevertLayout")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/layout/revert"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.layoutVersion == nil {
return nil, reportError("layoutVersion is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.layoutVersion
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}

238
golang/api_nodes.go Normal file
View file

@ -0,0 +1,238 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"bytes"
"context"
"io/ioutil"
"net/http"
"net/url"
)
// NodesApiService NodesApi service
type NodesApiService service
type ApiAddNodeRequest struct {
ctx context.Context
ApiService *NodesApiService
requestBody *[]string
}
func (r ApiAddNodeRequest) RequestBody(requestBody []string) ApiAddNodeRequest {
r.requestBody = &requestBody
return r
}
func (r ApiAddNodeRequest) Execute() ([]AddNode200ResponseInner, *http.Response, error) {
return r.ApiService.AddNodeExecute(r)
}
/*
AddNode Connect target node to other Garage nodes
Instructs this Garage node to connect to other Garage nodes at specified `<node_id>@<net_address>`. `node_id` is generated automatically on node start.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiAddNodeRequest
*/
func (a *NodesApiService) AddNode(ctx context.Context) ApiAddNodeRequest {
return ApiAddNodeRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return []AddNode200ResponseInner
func (a *NodesApiService) AddNodeExecute(r ApiAddNodeRequest) ([]AddNode200ResponseInner, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []AddNode200ResponseInner
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.AddNode")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/connect"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.requestBody == nil {
return localVarReturnValue, nil, reportError("requestBody is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.requestBody
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetNodesRequest struct {
ctx context.Context
ApiService *NodesApiService
}
func (r ApiGetNodesRequest) Execute() (*GetNodes200Response, *http.Response, error) {
return r.ApiService.GetNodesExecute(r)
}
/*
GetNodes Status of this node and other nodes in the cluster
Returns the cluster's current status, including:
- ID of the node being queried and its version of the Garage daemon
- Live nodes
- Currently configured cluster layout
- Staged changes to the cluster layout
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiGetNodesRequest
*/
func (a *NodesApiService) GetNodes(ctx context.Context) ApiGetNodesRequest {
return ApiGetNodesRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return GetNodes200Response
func (a *NodesApiService) GetNodesExecute(r ApiGetNodesRequest) (*GetNodes200Response, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *GetNodes200Response
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodesApiService.GetNodes")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/status"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}

572
golang/client.go Normal file
View file

@ -0,0 +1,572 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"bytes"
"context"
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"
"net/http/httputil"
"net/url"
"os"
"path/filepath"
"reflect"
"regexp"
"strconv"
"strings"
"time"
"unicode/utf8"
"golang.org/x/oauth2"
)
var (
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
)
// APIClient manages communication with the Garage Administration API v0+garage-v0.8.0 API vv0.8.0
// In most cases there should be only one, shared, APIClient.
type APIClient struct {
cfg *Configuration
common service // Reuse a single struct instead of allocating one for each service on the heap.
// API Services
BucketApi *BucketApiService
KeyApi *KeyApiService
LayoutApi *LayoutApiService
NodesApi *NodesApiService
}
type service struct {
client *APIClient
}
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
// optionally a custom http.Client to allow for advanced features such as caching.
func NewAPIClient(cfg *Configuration) *APIClient {
if cfg.HTTPClient == nil {
cfg.HTTPClient = http.DefaultClient
}
c := &APIClient{}
c.cfg = cfg
c.common.client = c
// API Services
c.BucketApi = (*BucketApiService)(&c.common)
c.KeyApi = (*KeyApiService)(&c.common)
c.LayoutApi = (*LayoutApiService)(&c.common)
c.NodesApi = (*NodesApiService)(&c.common)
return c
}
func atoi(in string) (int, error) {
return strconv.Atoi(in)
}
// selectHeaderContentType select a content type from the available list.
func selectHeaderContentType(contentTypes []string) string {
if len(contentTypes) == 0 {
return ""
}
if contains(contentTypes, "application/json") {
return "application/json"
}
return contentTypes[0] // use the first content type specified in 'consumes'
}
// selectHeaderAccept join all accept types and return
func selectHeaderAccept(accepts []string) string {
if len(accepts) == 0 {
return ""
}
if contains(accepts, "application/json") {
return "application/json"
}
return strings.Join(accepts, ",")
}
// contains is a case insensitive match, finding needle in a haystack
func contains(haystack []string, needle string) bool {
for _, a := range haystack {
if strings.EqualFold(a, needle) {
return true
}
}
return false
}
// Verify optional parameters are of the correct type.
func typeCheckParameter(obj interface{}, expected string, name string) error {
// Make sure there is an object.
if obj == nil {
return nil
}
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
func parameterToString(obj interface{}, collectionFormat string) string {
var delimiter string
switch collectionFormat {
case "pipes":
delimiter = "|"
case "ssv":
delimiter = " "
case "tsv":
delimiter = "\t"
case "csv":
delimiter = ","
}
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
} else if t, ok := obj.(time.Time); ok {
return t.Format(time.RFC3339)
}
return fmt.Sprintf("%v", obj)
}
// helper for converting interface{} parameters to json strings
func parameterToJson(obj interface{}) (string, error) {
jsonBuf, err := json.Marshal(obj)
if err != nil {
return "", err
}
return string(jsonBuf), err
}
// callAPI do the request.
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
if c.cfg.Debug {
dump, err := httputil.DumpRequestOut(request, true)
if err != nil {
return nil, err
}
log.Printf("\n%s\n", string(dump))
}
resp, err := c.cfg.HTTPClient.Do(request)
if err != nil {
return resp, err
}
if c.cfg.Debug {
dump, err := httputil.DumpResponse(resp, true)
if err != nil {
return resp, err
}
log.Printf("\n%s\n", string(dump))
}
return resp, err
}
// Allow modification of underlying config for alternate implementations and testing
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
func (c *APIClient) GetConfig() *Configuration {
return c.cfg
}
type formFile struct {
fileBytes []byte
fileName string
formFileName string
}
// prepareRequest build the request
func (c *APIClient) prepareRequest(
ctx context.Context,
path string, method string,
postBody interface{},
headerParams map[string]string,
queryParams url.Values,
formParams url.Values,
formFiles []formFile) (localVarRequest *http.Request, err error) {
var body *bytes.Buffer
// Detect postBody type and post.
if postBody != nil {
contentType := headerParams["Content-Type"]
if contentType == "" {
contentType = detectContentType(postBody)
headerParams["Content-Type"] = contentType
}
body, err = setBody(postBody, contentType)
if err != nil {
return nil, err
}
}
// add form parameters and file if available.
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) {
if body != nil {
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
}
body = &bytes.Buffer{}
w := multipart.NewWriter(body)
for k, v := range formParams {
for _, iv := range v {
if strings.HasPrefix(k, "@") { // file
err = addFile(w, k[1:], iv)
if err != nil {
return nil, err
}
} else { // form value
w.WriteField(k, iv)
}
}
}
for _, formFile := range formFiles {
if len(formFile.fileBytes) > 0 && formFile.fileName != "" {
w.Boundary()
part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName))
if err != nil {
return nil, err
}
_, err = part.Write(formFile.fileBytes)
if err != nil {
return nil, err
}
}
}
// Set the Boundary in the Content-Type
headerParams["Content-Type"] = w.FormDataContentType()
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
w.Close()
}
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
if body != nil {
return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
}
body = &bytes.Buffer{}
body.WriteString(formParams.Encode())
// Set Content-Length
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
}
// Setup path and query parameters
url, err := url.Parse(path)
if err != nil {
return nil, err
}
// Override request host, if applicable
if c.cfg.Host != "" {
url.Host = c.cfg.Host
}
// Override request scheme, if applicable
if c.cfg.Scheme != "" {
url.Scheme = c.cfg.Scheme
}
// Adding Query Param
query := url.Query()
for k, v := range queryParams {
for _, iv := range v {
query.Add(k, iv)
}
}
// Encode the parameters.
url.RawQuery = query.Encode()
// Generate a new request
if body != nil {
localVarRequest, err = http.NewRequest(method, url.String(), body)
} else {
localVarRequest, err = http.NewRequest(method, url.String(), nil)
}
if err != nil {
return nil, err
}
// add header parameters, if any
if len(headerParams) > 0 {
headers := http.Header{}
for h, v := range headerParams {
headers[h] = []string{v}
}
localVarRequest.Header = headers
}
// Add the user agent to the request.
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
if ctx != nil {
// add context to the request
localVarRequest = localVarRequest.WithContext(ctx)
// Walk through any authentication.
// OAuth2 authentication
if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok {
// We were able to grab an oauth2 token from the context
var latestToken *oauth2.Token
if latestToken, err = tok.Token(); err != nil {
return nil, err
}
latestToken.SetAuthHeader(localVarRequest)
}
// Basic HTTP Authentication
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
}
// AccessToken Authentication
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
localVarRequest.Header.Add("Authorization", "Bearer "+auth)
}
}
for header, value := range c.cfg.DefaultHeader {
localVarRequest.Header.Add(header, value)
}
return localVarRequest, nil
}
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
if len(b) == 0 {
return nil
}
if s, ok := v.(*string); ok {
*s = string(b)
return nil
}
if f, ok := v.(**os.File); ok {
*f, err = ioutil.TempFile("", "HttpClientFile")
if err != nil {
return
}
_, err = (*f).Write(b)
if err != nil {
return
}
_, err = (*f).Seek(0, io.SeekStart)
return
}
if xmlCheck.MatchString(contentType) {
if err = xml.Unmarshal(b, v); err != nil {
return err
}
return nil
}
if jsonCheck.MatchString(contentType) {
if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined
if err = unmarshalObj.UnmarshalJSON(b); err != nil {
return err
}
} else {
return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined")
}
} else if err = json.Unmarshal(b, v); err != nil { // simple model
return err
}
return nil
}
return errors.New("undefined response type")
}
// Add a file to the multipart request
func addFile(w *multipart.Writer, fieldName, path string) error {
file, err := os.Open(filepath.Clean(path))
if err != nil {
return err
}
err = file.Close()
if err != nil {
return err
}
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {
return err
}
_, err = io.Copy(part, file)
return err
}
// Prevent trying to import "fmt"
func reportError(format string, a ...interface{}) error {
return fmt.Errorf(format, a...)
}
// A wrapper for strict JSON decoding
func newStrictDecoder(data []byte) *json.Decoder {
dec := json.NewDecoder(bytes.NewBuffer(data))
dec.DisallowUnknownFields()
return dec
}
// Set request body from an interface{}
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
if bodyBuf == nil {
bodyBuf = &bytes.Buffer{}
}
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if fp, ok := body.(**os.File); ok {
_, err = bodyBuf.ReadFrom(*fp)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
_, err = bodyBuf.WriteString(s)
} else if s, ok := body.(*string); ok {
_, err = bodyBuf.WriteString(*s)
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
err = xml.NewEncoder(bodyBuf).Encode(body)
}
if err != nil {
return nil, err
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("Invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
}
// detectContentType method is used to figure out `Request.Body` content type for request header
func detectContentType(body interface{}) string {
contentType := "text/plain; charset=utf-8"
kind := reflect.TypeOf(body).Kind()
switch kind {
case reflect.Struct, reflect.Map, reflect.Ptr:
contentType = "application/json; charset=utf-8"
case reflect.String:
contentType = "text/plain; charset=utf-8"
default:
if b, ok := body.([]byte); ok {
contentType = http.DetectContentType(b)
} else if kind == reflect.Slice {
contentType = "application/json; charset=utf-8"
}
}
return contentType
}
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
type cacheControl map[string]string
func parseCacheControl(headers http.Header) cacheControl {
cc := cacheControl{}
ccHeader := headers.Get("Cache-Control")
for _, part := range strings.Split(ccHeader, ",") {
part = strings.Trim(part, " ")
if part == "" {
continue
}
if strings.ContainsRune(part, '=') {
keyval := strings.Split(part, "=")
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
} else {
cc[part] = ""
}
}
return cc
}
// CacheExpires helper function to determine remaining time before repeating a request.
func CacheExpires(r *http.Response) time.Time {
// Figure out when the cache expires.
var expires time.Time
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
if err != nil {
return time.Now()
}
respCacheControl := parseCacheControl(r.Header)
if maxAge, ok := respCacheControl["max-age"]; ok {
lifetime, err := time.ParseDuration(maxAge + "s")
if err != nil {
expires = now
} else {
expires = now.Add(lifetime)
}
} else {
expiresHeader := r.Header.Get("Expires")
if expiresHeader != "" {
expires, err = time.Parse(time.RFC1123, expiresHeader)
if err != nil {
expires = now
}
}
}
return expires
}
func strlen(s string) int {
return utf8.RuneCountInString(s)
}
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
type GenericOpenAPIError struct {
body []byte
error string
model interface{}
}
// Error returns non-empty string if there was an error.
func (e GenericOpenAPIError) Error() string {
return e.error
}
// Body returns the raw bytes of the response
func (e GenericOpenAPIError) Body() []byte {
return e.body
}
// Model returns the unpacked model of the error
func (e GenericOpenAPIError) Model() interface{} {
return e.model
}

230
golang/configuration.go Normal file
View file

@ -0,0 +1,230 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"context"
"fmt"
"net/http"
"strings"
)
// contextKeys are used to identify the type of value in the context.
// Since these are string, it is possible to get a short description of the
// context key for logging and debugging using key.String().
type contextKey string
func (c contextKey) String() string {
return "auth " + string(c)
}
var (
// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOAuth2 = contextKey("token")
// ContextBasicAuth takes BasicAuth as authentication for the request.
ContextBasicAuth = contextKey("basic")
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAccessToken = contextKey("accesstoken")
// ContextAPIKeys takes a string apikey as authentication for the request
ContextAPIKeys = contextKey("apiKeys")
// ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
ContextHttpSignatureAuth = contextKey("httpsignature")
// ContextServerIndex uses a server configuration from the index.
ContextServerIndex = contextKey("serverIndex")
// ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerIndices = contextKey("serverOperationIndices")
// ContextServerVariables overrides a server configuration variables.
ContextServerVariables = contextKey("serverVariables")
// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextOperationServerVariables = contextKey("serverOperationVariables")
)
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
type BasicAuth struct {
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
}
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
type APIKey struct {
Key string
Prefix string
}
// ServerVariable stores the information about a server variable
type ServerVariable struct {
Description string
DefaultValue string
EnumValues []string
}
// ServerConfiguration stores the information about a server
type ServerConfiguration struct {
URL string
Description string
Variables map[string]ServerVariable
}
// ServerConfigurations stores multiple ServerConfiguration items
type ServerConfigurations []ServerConfiguration
// Configuration stores the configuration of the API client
type Configuration struct {
Host string `json:"host,omitempty"`
Scheme string `json:"scheme,omitempty"`
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
UserAgent string `json:"userAgent,omitempty"`
Debug bool `json:"debug,omitempty"`
Servers ServerConfigurations
OperationServers map[string]ServerConfigurations
HTTPClient *http.Client
}
// NewConfiguration returns a new Configuration object
func NewConfiguration() *Configuration {
cfg := &Configuration{
DefaultHeader: make(map[string]string),
UserAgent: "OpenAPI-Generator/0.8.0/go",
Debug: false,
Servers: ServerConfigurations{
{
URL: "http://localhost:3903/v0",
Description: "A local server",
},
},
OperationServers: map[string]ServerConfigurations{
},
}
return cfg
}
// AddDefaultHeader adds a new HTTP header to the default header in the request
func (c *Configuration) AddDefaultHeader(key string, value string) {
c.DefaultHeader[key] = value
}
// URL formats template on a index using given variables
func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) {
if index < 0 || len(sc) <= index {
return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1)
}
server := sc[index]
url := server.URL
// go through variables and replace placeholders
for name, variable := range server.Variables {
if value, ok := variables[name]; ok {
found := bool(len(variable.EnumValues) == 0)
for _, enumValue := range variable.EnumValues {
if value == enumValue {
found = true
}
}
if !found {
return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
}
url = strings.Replace(url, "{"+name+"}", value, -1)
} else {
url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1)
}
}
return url, nil
}
// ServerURL returns URL based on server settings
func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) {
return c.Servers.URL(index, variables)
}
func getServerIndex(ctx context.Context) (int, error) {
si := ctx.Value(ContextServerIndex)
if si != nil {
if index, ok := si.(int); ok {
return index, nil
}
return 0, reportError("Invalid type %T should be int", si)
}
return 0, nil
}
func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) {
osi := ctx.Value(ContextOperationServerIndices)
if osi != nil {
if operationIndices, ok := osi.(map[string]int); !ok {
return 0, reportError("Invalid type %T should be map[string]int", osi)
} else {
index, ok := operationIndices[endpoint]
if ok {
return index, nil
}
}
}
return getServerIndex(ctx)
}
func getServerVariables(ctx context.Context) (map[string]string, error) {
sv := ctx.Value(ContextServerVariables)
if sv != nil {
if variables, ok := sv.(map[string]string); ok {
return variables, nil
}
return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv)
}
return nil, nil
}
func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) {
osv := ctx.Value(ContextOperationServerVariables)
if osv != nil {
if operationVariables, ok := osv.(map[string]map[string]string); !ok {
return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv)
} else {
variables, ok := operationVariables[endpoint]
if ok {
return variables, nil
}
}
}
return getServerVariables(ctx)
}
// ServerURLWithContext returns a new server URL given an endpoint
func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) {
sc, ok := c.OperationServers[endpoint]
if !ok {
sc = c.Servers
}
if ctx == nil {
return sc.URL(0, nil)
}
index, err := getServerOperationIndex(ctx, endpoint)
if err != nil {
return "", err
}
variables, err := getServerOperationVariables(ctx, endpoint)
if err != nil {
return "", err
}
return sc.URL(index, variables)
}

View file

@ -0,0 +1,56 @@
# AddKeyRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | Pointer to **string** | | [optional]
## Methods
### NewAddKeyRequest
`func NewAddKeyRequest() *AddKeyRequest`
NewAddKeyRequest instantiates a new AddKeyRequest object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewAddKeyRequestWithDefaults
`func NewAddKeyRequestWithDefaults() *AddKeyRequest`
NewAddKeyRequestWithDefaults instantiates a new AddKeyRequest object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetName
`func (o *AddKeyRequest) GetName() string`
GetName returns the Name field if non-nil, zero value otherwise.
### GetNameOk
`func (o *AddKeyRequest) GetNameOk() (*string, bool)`
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetName
`func (o *AddKeyRequest) SetName(v string)`
SetName sets Name field to given value.
### HasName
`func (o *AddKeyRequest) HasName() bool`
HasName returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,92 @@
# AddNode200ResponseInner
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Success** | Pointer to **bool** | | [optional]
**Error** | Pointer to **NullableString** | | [optional]
## Methods
### NewAddNode200ResponseInner
`func NewAddNode200ResponseInner() *AddNode200ResponseInner`
NewAddNode200ResponseInner instantiates a new AddNode200ResponseInner object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewAddNode200ResponseInnerWithDefaults
`func NewAddNode200ResponseInnerWithDefaults() *AddNode200ResponseInner`
NewAddNode200ResponseInnerWithDefaults instantiates a new AddNode200ResponseInner object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetSuccess
`func (o *AddNode200ResponseInner) GetSuccess() bool`
GetSuccess returns the Success field if non-nil, zero value otherwise.
### GetSuccessOk
`func (o *AddNode200ResponseInner) GetSuccessOk() (*bool, bool)`
GetSuccessOk returns a tuple with the Success field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSuccess
`func (o *AddNode200ResponseInner) SetSuccess(v bool)`
SetSuccess sets Success field to given value.
### HasSuccess
`func (o *AddNode200ResponseInner) HasSuccess() bool`
HasSuccess returns a boolean if a field has been set.
### GetError
`func (o *AddNode200ResponseInner) GetError() string`
GetError returns the Error field if non-nil, zero value otherwise.
### GetErrorOk
`func (o *AddNode200ResponseInner) GetErrorOk() (*string, bool)`
GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetError
`func (o *AddNode200ResponseInner) SetError(v string)`
SetError sets Error field to given value.
### HasError
`func (o *AddNode200ResponseInner) HasError() bool`
HasError returns a boolean if a field has been set.
### SetErrorNil
`func (o *AddNode200ResponseInner) SetErrorNil(b bool)`
SetErrorNil sets the value for Error to be an explicit nil
### UnsetError
`func (o *AddNode200ResponseInner) UnsetError()`
UnsetError ensures that no value is present for Error, not even an explicit nil
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,93 @@
# AllowBucketKeyRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**BucketId** | **string** | |
**AccessKeyId** | **string** | |
**Permissions** | [**AllowBucketKeyRequestPermissions**](AllowBucketKeyRequestPermissions.md) | |
## Methods
### NewAllowBucketKeyRequest
`func NewAllowBucketKeyRequest(bucketId string, accessKeyId string, permissions AllowBucketKeyRequestPermissions, ) *AllowBucketKeyRequest`
NewAllowBucketKeyRequest instantiates a new AllowBucketKeyRequest object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewAllowBucketKeyRequestWithDefaults
`func NewAllowBucketKeyRequestWithDefaults() *AllowBucketKeyRequest`
NewAllowBucketKeyRequestWithDefaults instantiates a new AllowBucketKeyRequest object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetBucketId
`func (o *AllowBucketKeyRequest) GetBucketId() string`
GetBucketId returns the BucketId field if non-nil, zero value otherwise.
### GetBucketIdOk
`func (o *AllowBucketKeyRequest) GetBucketIdOk() (*string, bool)`
GetBucketIdOk returns a tuple with the BucketId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetBucketId
`func (o *AllowBucketKeyRequest) SetBucketId(v string)`
SetBucketId sets BucketId field to given value.
### GetAccessKeyId
`func (o *AllowBucketKeyRequest) GetAccessKeyId() string`
GetAccessKeyId returns the AccessKeyId field if non-nil, zero value otherwise.
### GetAccessKeyIdOk
`func (o *AllowBucketKeyRequest) GetAccessKeyIdOk() (*string, bool)`
GetAccessKeyIdOk returns a tuple with the AccessKeyId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAccessKeyId
`func (o *AllowBucketKeyRequest) SetAccessKeyId(v string)`
SetAccessKeyId sets AccessKeyId field to given value.
### GetPermissions
`func (o *AllowBucketKeyRequest) GetPermissions() AllowBucketKeyRequestPermissions`
GetPermissions returns the Permissions field if non-nil, zero value otherwise.
### GetPermissionsOk
`func (o *AllowBucketKeyRequest) GetPermissionsOk() (*AllowBucketKeyRequestPermissions, bool)`
GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPermissions
`func (o *AllowBucketKeyRequest) SetPermissions(v AllowBucketKeyRequestPermissions)`
SetPermissions sets Permissions field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,93 @@
# AllowBucketKeyRequestPermissions
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Read** | **bool** | |
**Write** | **bool** | |
**Owner** | **bool** | |
## Methods
### NewAllowBucketKeyRequestPermissions
`func NewAllowBucketKeyRequestPermissions(read bool, write bool, owner bool, ) *AllowBucketKeyRequestPermissions`
NewAllowBucketKeyRequestPermissions instantiates a new AllowBucketKeyRequestPermissions object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewAllowBucketKeyRequestPermissionsWithDefaults
`func NewAllowBucketKeyRequestPermissionsWithDefaults() *AllowBucketKeyRequestPermissions`
NewAllowBucketKeyRequestPermissionsWithDefaults instantiates a new AllowBucketKeyRequestPermissions object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetRead
`func (o *AllowBucketKeyRequestPermissions) GetRead() bool`
GetRead returns the Read field if non-nil, zero value otherwise.
### GetReadOk
`func (o *AllowBucketKeyRequestPermissions) GetReadOk() (*bool, bool)`
GetReadOk returns a tuple with the Read field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRead
`func (o *AllowBucketKeyRequestPermissions) SetRead(v bool)`
SetRead sets Read field to given value.
### GetWrite
`func (o *AllowBucketKeyRequestPermissions) GetWrite() bool`
GetWrite returns the Write field if non-nil, zero value otherwise.
### GetWriteOk
`func (o *AllowBucketKeyRequestPermissions) GetWriteOk() (*bool, bool)`
GetWriteOk returns a tuple with the Write field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetWrite
`func (o *AllowBucketKeyRequestPermissions) SetWrite(v bool)`
SetWrite sets Write field to given value.
### GetOwner
`func (o *AllowBucketKeyRequestPermissions) GetOwner() bool`
GetOwner returns the Owner field if non-nil, zero value otherwise.
### GetOwnerOk
`func (o *AllowBucketKeyRequestPermissions) GetOwnerOk() (*bool, bool)`
GetOwnerOk returns a tuple with the Owner field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetOwner
`func (o *AllowBucketKeyRequestPermissions) SetOwner(v bool)`
SetOwner sets Owner field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

835
golang/docs/BucketApi.md Normal file
View file

@ -0,0 +1,835 @@
# \BucketApi
All URIs are relative to *http://localhost:3903/v0*
Method | HTTP request | Description
------------- | ------------- | -------------
[**AllowBucketKey**](BucketApi.md#AllowBucketKey) | **Post** /bucket/allow | Allow key
[**CreateBucket**](BucketApi.md#CreateBucket) | **Post** /bucket | Create a bucket
[**DeleteBucket**](BucketApi.md#DeleteBucket) | **Delete** /bucket?id&#x3D;{bucket_id} | Delete a bucket
[**DeleteBucketGlobalAlias**](BucketApi.md#DeleteBucketGlobalAlias) | **Delete** /bucket/alias/global | Delete a global alias
[**DeleteBucketLocalAlias**](BucketApi.md#DeleteBucketLocalAlias) | **Delete** /bucket/alias/local | Delete a local alias
[**DenyBucketKey**](BucketApi.md#DenyBucketKey) | **Post** /bucket/deny | Deny key
[**FindBucketInfo**](BucketApi.md#FindBucketInfo) | **Get** /bucket?globalAlias&#x3D;{alias} | Find a bucket
[**GetBucketInfo**](BucketApi.md#GetBucketInfo) | **Get** /bucket?id&#x3D;{bucket_id} | Get a bucket
[**ListBuckets**](BucketApi.md#ListBuckets) | **Get** /bucket | List all buckets
[**PutBucketGlobalAlias**](BucketApi.md#PutBucketGlobalAlias) | **Put** /bucket/alias/global | Add a global alias
[**PutBucketLocalAlias**](BucketApi.md#PutBucketLocalAlias) | **Put** /bucket/alias/local | Add a local alias
[**UpdateBucket**](BucketApi.md#UpdateBucket) | **Put** /bucket?id&#x3D;{bucket_id} | Update a bucket
## AllowBucketKey
> BucketInfo AllowBucketKey(ctx).AllowBucketKeyRequest(allowBucketKeyRequest).Execute()
Allow key
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
allowBucketKeyRequest := *openapiclient.NewAllowBucketKeyRequest("e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b", "GK31c2f218a2e44f485b94239e", *openapiclient.NewAllowBucketKeyRequestPermissions(true, true, true)) // AllowBucketKeyRequest | Aliases to put on the new bucket
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.AllowBucketKey(context.Background()).AllowBucketKeyRequest(allowBucketKeyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.AllowBucketKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AllowBucketKey`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.AllowBucketKey`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiAllowBucketKeyRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**allowBucketKeyRequest** | [**AllowBucketKeyRequest**](AllowBucketKeyRequest.md) | Aliases to put on the new bucket |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## CreateBucket
> BucketInfo CreateBucket(ctx).CreateBucketRequest(createBucketRequest).Execute()
Create a bucket
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
createBucketRequest := *openapiclient.NewCreateBucketRequest() // CreateBucketRequest | Aliases to put on the new bucket
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.CreateBucket(context.Background()).CreateBucketRequest(createBucketRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.CreateBucket``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateBucket`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.CreateBucket`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiCreateBucketRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**createBucketRequest** | [**CreateBucketRequest**](CreateBucketRequest.md) | Aliases to put on the new bucket |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## DeleteBucket
> DeleteBucket(ctx, bucketId).Execute()
Delete a bucket
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
bucketId := "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" // string | The exact bucket identifier, a 32 bytes hexadecimal string
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.DeleteBucket(context.Background(), bucketId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.DeleteBucket``: %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.
**bucketId** | **string** | The exact bucket identifier, a 32 bytes hexadecimal string |
### Other Parameters
Other parameters are passed through a pointer to a apiDeleteBucketRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
### Return type
(empty response body)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## DeleteBucketGlobalAlias
> BucketInfo DeleteBucketGlobalAlias(ctx).Id(id).Alias(alias).Execute()
Delete a global alias
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b" // string |
alias := "my_documents" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.DeleteBucketGlobalAlias(context.Background()).Id(id).Alias(alias).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.DeleteBucketGlobalAlias``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteBucketGlobalAlias`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.DeleteBucketGlobalAlias`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiDeleteBucketGlobalAliasRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **string** | |
**alias** | **string** | |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## DeleteBucketLocalAlias
> BucketInfo DeleteBucketLocalAlias(ctx).Id(id).AccessKeyId(accessKeyId).Alias(alias).Execute()
Delete a local alias
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b" // string |
accessKeyId := "GK31c2f218a2e44f485b94239e" // string |
alias := "my_documents" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.DeleteBucketLocalAlias(context.Background()).Id(id).AccessKeyId(accessKeyId).Alias(alias).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.DeleteBucketLocalAlias``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteBucketLocalAlias`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.DeleteBucketLocalAlias`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiDeleteBucketLocalAliasRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **string** | |
**accessKeyId** | **string** | |
**alias** | **string** | |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## DenyBucketKey
> BucketInfo DenyBucketKey(ctx).AllowBucketKeyRequest(allowBucketKeyRequest).Execute()
Deny key
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
allowBucketKeyRequest := *openapiclient.NewAllowBucketKeyRequest("e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b", "GK31c2f218a2e44f485b94239e", *openapiclient.NewAllowBucketKeyRequestPermissions(true, true, true)) // AllowBucketKeyRequest | Aliases to put on the new bucket
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.DenyBucketKey(context.Background()).AllowBucketKeyRequest(allowBucketKeyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.DenyBucketKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DenyBucketKey`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.DenyBucketKey`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiDenyBucketKeyRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**allowBucketKeyRequest** | [**AllowBucketKeyRequest**](AllowBucketKeyRequest.md) | Aliases to put on the new bucket |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## FindBucketInfo
> BucketInfo FindBucketInfo(ctx, alias).Execute()
Find a bucket
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
alias := "my_documents" // string | The exact global alias of one of the existing buckets
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.FindBucketInfo(context.Background(), alias).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.FindBucketInfo``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `FindBucketInfo`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.FindBucketInfo`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**alias** | **string** | The exact global alias of one of the existing buckets |
### Other Parameters
Other parameters are passed through a pointer to a apiFindBucketInfoRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## GetBucketInfo
> BucketInfo GetBucketInfo(ctx, bucketId).Execute()
Get a bucket
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
bucketId := "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" // string | The exact bucket identifier, a 32 bytes hexadecimal string
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.GetBucketInfo(context.Background(), bucketId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.GetBucketInfo``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetBucketInfo`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.GetBucketInfo`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**bucketId** | **string** | The exact bucket identifier, a 32 bytes hexadecimal string |
### Other Parameters
Other parameters are passed through a pointer to a apiGetBucketInfoRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## ListBuckets
> []ListBuckets200ResponseInner ListBuckets(ctx).Execute()
List all buckets
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.ListBuckets(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.ListBuckets``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListBuckets`: []ListBuckets200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `BucketApi.ListBuckets`: %v\n", resp)
}
```
### Path Parameters
This endpoint does not need any parameter.
### Other Parameters
Other parameters are passed through a pointer to a apiListBucketsRequest struct via the builder pattern
### Return type
[**[]ListBuckets200ResponseInner**](ListBuckets200ResponseInner.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## PutBucketGlobalAlias
> BucketInfo PutBucketGlobalAlias(ctx).Id(id).Alias(alias).Execute()
Add a global alias
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b" // string |
alias := "my_documents" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.PutBucketGlobalAlias(context.Background()).Id(id).Alias(alias).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.PutBucketGlobalAlias``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PutBucketGlobalAlias`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.PutBucketGlobalAlias`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiPutBucketGlobalAliasRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **string** | |
**alias** | **string** | |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## PutBucketLocalAlias
> BucketInfo PutBucketLocalAlias(ctx).Id(id).AccessKeyId(accessKeyId).Alias(alias).Execute()
Add a local alias
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
id := "e6a14cd6a27f48684579ec6b381c078ab11697e6bc8513b72b2f5307e25fff9b" // string |
accessKeyId := "GK31c2f218a2e44f485b94239e" // string |
alias := "my_documents" // string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.PutBucketLocalAlias(context.Background()).Id(id).AccessKeyId(accessKeyId).Alias(alias).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.PutBucketLocalAlias``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PutBucketLocalAlias`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.PutBucketLocalAlias`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiPutBucketLocalAliasRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **string** | |
**accessKeyId** | **string** | |
**alias** | **string** | |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## UpdateBucket
> BucketInfo UpdateBucket(ctx, bucketId).UpdateBucketRequest(updateBucketRequest).Execute()
Update a bucket
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
bucketId := "b4018dc61b27ccb5c64ec1b24f53454bbbd180697c758c4d47a22a8921864a87" // string | The exact bucket identifier, a 32 bytes hexadecimal string
updateBucketRequest := *openapiclient.NewUpdateBucketRequest() // UpdateBucketRequest | Requested changes on the bucket. Both root fields are optionals.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.BucketApi.UpdateBucket(context.Background(), bucketId).UpdateBucketRequest(updateBucketRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BucketApi.UpdateBucket``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateBucket`: BucketInfo
fmt.Fprintf(os.Stdout, "Response from `BucketApi.UpdateBucket`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**bucketId** | **string** | The exact bucket identifier, a 32 bytes hexadecimal string |
### Other Parameters
Other parameters are passed through a pointer to a apiUpdateBucketRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**updateBucketRequest** | [**UpdateBucketRequest**](UpdateBucketRequest.md) | Requested changes on the bucket. Both root fields are optionals. |
### Return type
[**BucketInfo**](BucketInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

274
golang/docs/BucketInfo.md Normal file
View file

@ -0,0 +1,274 @@
# BucketInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | Pointer to **string** | | [optional]
**GlobalAliases** | Pointer to **[]string** | | [optional]
**WebsiteAccess** | Pointer to **bool** | | [optional]
**WebsiteConfig** | Pointer to [**NullableBucketInfoWebsiteConfig**](BucketInfoWebsiteConfig.md) | | [optional]
**Keys** | Pointer to [**[]BucketKeyInfo**](BucketKeyInfo.md) | | [optional]
**Objects** | Pointer to **int32** | | [optional]
**Bytes** | Pointer to **int32** | | [optional]
**UnfinishedUploads** | Pointer to **int32** | | [optional]
**Quotas** | Pointer to [**BucketInfoQuotas**](BucketInfoQuotas.md) | | [optional]
## Methods
### NewBucketInfo
`func NewBucketInfo() *BucketInfo`
NewBucketInfo instantiates a new BucketInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewBucketInfoWithDefaults
`func NewBucketInfoWithDefaults() *BucketInfo`
NewBucketInfoWithDefaults instantiates a new BucketInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *BucketInfo) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *BucketInfo) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *BucketInfo) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *BucketInfo) HasId() bool`
HasId returns a boolean if a field has been set.
### GetGlobalAliases
`func (o *BucketInfo) GetGlobalAliases() []string`
GetGlobalAliases returns the GlobalAliases field if non-nil, zero value otherwise.
### GetGlobalAliasesOk
`func (o *BucketInfo) GetGlobalAliasesOk() (*[]string, bool)`
GetGlobalAliasesOk returns a tuple with the GlobalAliases field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetGlobalAliases
`func (o *BucketInfo) SetGlobalAliases(v []string)`
SetGlobalAliases sets GlobalAliases field to given value.
### HasGlobalAliases
`func (o *BucketInfo) HasGlobalAliases() bool`
HasGlobalAliases returns a boolean if a field has been set.
### GetWebsiteAccess
`func (o *BucketInfo) GetWebsiteAccess() bool`
GetWebsiteAccess returns the WebsiteAccess field if non-nil, zero value otherwise.
### GetWebsiteAccessOk
`func (o *BucketInfo) GetWebsiteAccessOk() (*bool, bool)`
GetWebsiteAccessOk returns a tuple with the WebsiteAccess field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetWebsiteAccess
`func (o *BucketInfo) SetWebsiteAccess(v bool)`
SetWebsiteAccess sets WebsiteAccess field to given value.
### HasWebsiteAccess
`func (o *BucketInfo) HasWebsiteAccess() bool`
HasWebsiteAccess returns a boolean if a field has been set.
### GetWebsiteConfig
`func (o *BucketInfo) GetWebsiteConfig() BucketInfoWebsiteConfig`
GetWebsiteConfig returns the WebsiteConfig field if non-nil, zero value otherwise.
### GetWebsiteConfigOk
`func (o *BucketInfo) GetWebsiteConfigOk() (*BucketInfoWebsiteConfig, bool)`
GetWebsiteConfigOk returns a tuple with the WebsiteConfig field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetWebsiteConfig
`func (o *BucketInfo) SetWebsiteConfig(v BucketInfoWebsiteConfig)`
SetWebsiteConfig sets WebsiteConfig field to given value.
### HasWebsiteConfig
`func (o *BucketInfo) HasWebsiteConfig() bool`
HasWebsiteConfig returns a boolean if a field has been set.
### SetWebsiteConfigNil
`func (o *BucketInfo) SetWebsiteConfigNil(b bool)`
SetWebsiteConfigNil sets the value for WebsiteConfig to be an explicit nil
### UnsetWebsiteConfig
`func (o *BucketInfo) UnsetWebsiteConfig()`
UnsetWebsiteConfig ensures that no value is present for WebsiteConfig, not even an explicit nil
### GetKeys
`func (o *BucketInfo) GetKeys() []BucketKeyInfo`
GetKeys returns the Keys field if non-nil, zero value otherwise.
### GetKeysOk
`func (o *BucketInfo) GetKeysOk() (*[]BucketKeyInfo, bool)`
GetKeysOk returns a tuple with the Keys field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetKeys
`func (o *BucketInfo) SetKeys(v []BucketKeyInfo)`
SetKeys sets Keys field to given value.
### HasKeys
`func (o *BucketInfo) HasKeys() bool`
HasKeys returns a boolean if a field has been set.
### GetObjects
`func (o *BucketInfo) GetObjects() int32`
GetObjects returns the Objects field if non-nil, zero value otherwise.
### GetObjectsOk
`func (o *BucketInfo) GetObjectsOk() (*int32, bool)`
GetObjectsOk returns a tuple with the Objects field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetObjects
`func (o *BucketInfo) SetObjects(v int32)`
SetObjects sets Objects field to given value.
### HasObjects
`func (o *BucketInfo) HasObjects() bool`
HasObjects returns a boolean if a field has been set.
### GetBytes
`func (o *BucketInfo) GetBytes() int32`
GetBytes returns the Bytes field if non-nil, zero value otherwise.
### GetBytesOk
`func (o *BucketInfo) GetBytesOk() (*int32, bool)`
GetBytesOk returns a tuple with the Bytes field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetBytes
`func (o *BucketInfo) SetBytes(v int32)`
SetBytes sets Bytes field to given value.
### HasBytes
`func (o *BucketInfo) HasBytes() bool`
HasBytes returns a boolean if a field has been set.
### GetUnfinishedUploads
`func (o *BucketInfo) GetUnfinishedUploads() int32`
GetUnfinishedUploads returns the UnfinishedUploads field if non-nil, zero value otherwise.
### GetUnfinishedUploadsOk
`func (o *BucketInfo) GetUnfinishedUploadsOk() (*int32, bool)`
GetUnfinishedUploadsOk returns a tuple with the UnfinishedUploads field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetUnfinishedUploads
`func (o *BucketInfo) SetUnfinishedUploads(v int32)`
SetUnfinishedUploads sets UnfinishedUploads field to given value.
### HasUnfinishedUploads
`func (o *BucketInfo) HasUnfinishedUploads() bool`
HasUnfinishedUploads returns a boolean if a field has been set.
### GetQuotas
`func (o *BucketInfo) GetQuotas() BucketInfoQuotas`
GetQuotas returns the Quotas field if non-nil, zero value otherwise.
### GetQuotasOk
`func (o *BucketInfo) GetQuotasOk() (*BucketInfoQuotas, bool)`
GetQuotasOk returns a tuple with the Quotas field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetQuotas
`func (o *BucketInfo) SetQuotas(v BucketInfoQuotas)`
SetQuotas sets Quotas field to given value.
### HasQuotas
`func (o *BucketInfo) HasQuotas() bool`
HasQuotas returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,102 @@
# BucketInfoQuotas
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MaxSize** | Pointer to **NullableInt32** | | [optional]
**MaxObjects** | Pointer to **NullableInt32** | | [optional]
## Methods
### NewBucketInfoQuotas
`func NewBucketInfoQuotas() *BucketInfoQuotas`
NewBucketInfoQuotas instantiates a new BucketInfoQuotas object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewBucketInfoQuotasWithDefaults
`func NewBucketInfoQuotasWithDefaults() *BucketInfoQuotas`
NewBucketInfoQuotasWithDefaults instantiates a new BucketInfoQuotas object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetMaxSize
`func (o *BucketInfoQuotas) GetMaxSize() int32`
GetMaxSize returns the MaxSize field if non-nil, zero value otherwise.
### GetMaxSizeOk
`func (o *BucketInfoQuotas) GetMaxSizeOk() (*int32, bool)`
GetMaxSizeOk returns a tuple with the MaxSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMaxSize
`func (o *BucketInfoQuotas) SetMaxSize(v int32)`
SetMaxSize sets MaxSize field to given value.
### HasMaxSize
`func (o *BucketInfoQuotas) HasMaxSize() bool`
HasMaxSize returns a boolean if a field has been set.
### SetMaxSizeNil
`func (o *BucketInfoQuotas) SetMaxSizeNil(b bool)`
SetMaxSizeNil sets the value for MaxSize to be an explicit nil
### UnsetMaxSize
`func (o *BucketInfoQuotas) UnsetMaxSize()`
UnsetMaxSize ensures that no value is present for MaxSize, not even an explicit nil
### GetMaxObjects
`func (o *BucketInfoQuotas) GetMaxObjects() int32`
GetMaxObjects returns the MaxObjects field if non-nil, zero value otherwise.
### GetMaxObjectsOk
`func (o *BucketInfoQuotas) GetMaxObjectsOk() (*int32, bool)`
GetMaxObjectsOk returns a tuple with the MaxObjects field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMaxObjects
`func (o *BucketInfoQuotas) SetMaxObjects(v int32)`
SetMaxObjects sets MaxObjects field to given value.
### HasMaxObjects
`func (o *BucketInfoQuotas) HasMaxObjects() bool`
HasMaxObjects returns a boolean if a field has been set.
### SetMaxObjectsNil
`func (o *BucketInfoQuotas) SetMaxObjectsNil(b bool)`
SetMaxObjectsNil sets the value for MaxObjects to be an explicit nil
### UnsetMaxObjects
`func (o *BucketInfoQuotas) UnsetMaxObjects()`
UnsetMaxObjects ensures that no value is present for MaxObjects, not even an explicit nil
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,82 @@
# BucketInfoWebsiteConfig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**IndexDocument** | Pointer to **string** | | [optional]
**ErrorDocument** | Pointer to **string** | | [optional]
## Methods
### NewBucketInfoWebsiteConfig
`func NewBucketInfoWebsiteConfig() *BucketInfoWebsiteConfig`
NewBucketInfoWebsiteConfig instantiates a new BucketInfoWebsiteConfig object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewBucketInfoWebsiteConfigWithDefaults
`func NewBucketInfoWebsiteConfigWithDefaults() *BucketInfoWebsiteConfig`
NewBucketInfoWebsiteConfigWithDefaults instantiates a new BucketInfoWebsiteConfig object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetIndexDocument
`func (o *BucketInfoWebsiteConfig) GetIndexDocument() string`
GetIndexDocument returns the IndexDocument field if non-nil, zero value otherwise.
### GetIndexDocumentOk
`func (o *BucketInfoWebsiteConfig) GetIndexDocumentOk() (*string, bool)`
GetIndexDocumentOk returns a tuple with the IndexDocument field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIndexDocument
`func (o *BucketInfoWebsiteConfig) SetIndexDocument(v string)`
SetIndexDocument sets IndexDocument field to given value.
### HasIndexDocument
`func (o *BucketInfoWebsiteConfig) HasIndexDocument() bool`
HasIndexDocument returns a boolean if a field has been set.
### GetErrorDocument
`func (o *BucketInfoWebsiteConfig) GetErrorDocument() string`
GetErrorDocument returns the ErrorDocument field if non-nil, zero value otherwise.
### GetErrorDocumentOk
`func (o *BucketInfoWebsiteConfig) GetErrorDocumentOk() (*string, bool)`
GetErrorDocumentOk returns a tuple with the ErrorDocument field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetErrorDocument
`func (o *BucketInfoWebsiteConfig) SetErrorDocument(v string)`
SetErrorDocument sets ErrorDocument field to given value.
### HasErrorDocument
`func (o *BucketInfoWebsiteConfig) HasErrorDocument() bool`
HasErrorDocument returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,134 @@
# BucketKeyInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessKeyId** | Pointer to **string** | | [optional]
**Name** | Pointer to **string** | | [optional]
**Permissions** | Pointer to [**CreateBucketRequestLocalAliasAllow**](CreateBucketRequestLocalAliasAllow.md) | | [optional]
**BucketLocalAliases** | Pointer to **[]string** | | [optional]
## Methods
### NewBucketKeyInfo
`func NewBucketKeyInfo() *BucketKeyInfo`
NewBucketKeyInfo instantiates a new BucketKeyInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewBucketKeyInfoWithDefaults
`func NewBucketKeyInfoWithDefaults() *BucketKeyInfo`
NewBucketKeyInfoWithDefaults instantiates a new BucketKeyInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetAccessKeyId
`func (o *BucketKeyInfo) GetAccessKeyId() string`
GetAccessKeyId returns the AccessKeyId field if non-nil, zero value otherwise.
### GetAccessKeyIdOk
`func (o *BucketKeyInfo) GetAccessKeyIdOk() (*string, bool)`
GetAccessKeyIdOk returns a tuple with the AccessKeyId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAccessKeyId
`func (o *BucketKeyInfo) SetAccessKeyId(v string)`
SetAccessKeyId sets AccessKeyId field to given value.
### HasAccessKeyId
`func (o *BucketKeyInfo) HasAccessKeyId() bool`
HasAccessKeyId returns a boolean if a field has been set.
### GetName
`func (o *BucketKeyInfo) GetName() string`
GetName returns the Name field if non-nil, zero value otherwise.
### GetNameOk
`func (o *BucketKeyInfo) GetNameOk() (*string, bool)`
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetName
`func (o *BucketKeyInfo) SetName(v string)`
SetName sets Name field to given value.
### HasName
`func (o *BucketKeyInfo) HasName() bool`
HasName returns a boolean if a field has been set.
### GetPermissions
`func (o *BucketKeyInfo) GetPermissions() CreateBucketRequestLocalAliasAllow`
GetPermissions returns the Permissions field if non-nil, zero value otherwise.
### GetPermissionsOk
`func (o *BucketKeyInfo) GetPermissionsOk() (*CreateBucketRequestLocalAliasAllow, bool)`
GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPermissions
`func (o *BucketKeyInfo) SetPermissions(v CreateBucketRequestLocalAliasAllow)`
SetPermissions sets Permissions field to given value.
### HasPermissions
`func (o *BucketKeyInfo) HasPermissions() bool`
HasPermissions returns a boolean if a field has been set.
### GetBucketLocalAliases
`func (o *BucketKeyInfo) GetBucketLocalAliases() []string`
GetBucketLocalAliases returns the BucketLocalAliases field if non-nil, zero value otherwise.
### GetBucketLocalAliasesOk
`func (o *BucketKeyInfo) GetBucketLocalAliasesOk() (*[]string, bool)`
GetBucketLocalAliasesOk returns a tuple with the BucketLocalAliases field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetBucketLocalAliases
`func (o *BucketKeyInfo) SetBucketLocalAliases(v []string)`
SetBucketLocalAliases sets BucketLocalAliases field to given value.
### HasBucketLocalAliases
`func (o *BucketKeyInfo) HasBucketLocalAliases() bool`
HasBucketLocalAliases returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,93 @@
# ClusterLayout
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Version** | **int32** | |
**Roles** | [**map[string]NodeClusterInfo**](NodeClusterInfo.md) | |
**StagedRoleChanges** | [**map[string]NodeClusterInfo**](NodeClusterInfo.md) | |
## Methods
### NewClusterLayout
`func NewClusterLayout(version int32, roles map[string]NodeClusterInfo, stagedRoleChanges map[string]NodeClusterInfo, ) *ClusterLayout`
NewClusterLayout instantiates a new ClusterLayout object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewClusterLayoutWithDefaults
`func NewClusterLayoutWithDefaults() *ClusterLayout`
NewClusterLayoutWithDefaults instantiates a new ClusterLayout object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetVersion
`func (o *ClusterLayout) GetVersion() int32`
GetVersion returns the Version field if non-nil, zero value otherwise.
### GetVersionOk
`func (o *ClusterLayout) GetVersionOk() (*int32, bool)`
GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVersion
`func (o *ClusterLayout) SetVersion(v int32)`
SetVersion sets Version field to given value.
### GetRoles
`func (o *ClusterLayout) GetRoles() map[string]NodeClusterInfo`
GetRoles returns the Roles field if non-nil, zero value otherwise.
### GetRolesOk
`func (o *ClusterLayout) GetRolesOk() (*map[string]NodeClusterInfo, bool)`
GetRolesOk returns a tuple with the Roles field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRoles
`func (o *ClusterLayout) SetRoles(v map[string]NodeClusterInfo)`
SetRoles sets Roles field to given value.
### GetStagedRoleChanges
`func (o *ClusterLayout) GetStagedRoleChanges() map[string]NodeClusterInfo`
GetStagedRoleChanges returns the StagedRoleChanges field if non-nil, zero value otherwise.
### GetStagedRoleChangesOk
`func (o *ClusterLayout) GetStagedRoleChangesOk() (*map[string]NodeClusterInfo, bool)`
GetStagedRoleChangesOk returns a tuple with the StagedRoleChanges field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetStagedRoleChanges
`func (o *ClusterLayout) SetStagedRoleChanges(v map[string]NodeClusterInfo)`
SetStagedRoleChanges sets StagedRoleChanges field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,82 @@
# CreateBucketRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**GlobalAlias** | Pointer to **string** | | [optional]
**LocalAlias** | Pointer to [**CreateBucketRequestLocalAlias**](CreateBucketRequestLocalAlias.md) | | [optional]
## Methods
### NewCreateBucketRequest
`func NewCreateBucketRequest() *CreateBucketRequest`
NewCreateBucketRequest instantiates a new CreateBucketRequest object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewCreateBucketRequestWithDefaults
`func NewCreateBucketRequestWithDefaults() *CreateBucketRequest`
NewCreateBucketRequestWithDefaults instantiates a new CreateBucketRequest object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetGlobalAlias
`func (o *CreateBucketRequest) GetGlobalAlias() string`
GetGlobalAlias returns the GlobalAlias field if non-nil, zero value otherwise.
### GetGlobalAliasOk
`func (o *CreateBucketRequest) GetGlobalAliasOk() (*string, bool)`
GetGlobalAliasOk returns a tuple with the GlobalAlias field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetGlobalAlias
`func (o *CreateBucketRequest) SetGlobalAlias(v string)`
SetGlobalAlias sets GlobalAlias field to given value.
### HasGlobalAlias
`func (o *CreateBucketRequest) HasGlobalAlias() bool`
HasGlobalAlias returns a boolean if a field has been set.
### GetLocalAlias
`func (o *CreateBucketRequest) GetLocalAlias() CreateBucketRequestLocalAlias`
GetLocalAlias returns the LocalAlias field if non-nil, zero value otherwise.
### GetLocalAliasOk
`func (o *CreateBucketRequest) GetLocalAliasOk() (*CreateBucketRequestLocalAlias, bool)`
GetLocalAliasOk returns a tuple with the LocalAlias field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetLocalAlias
`func (o *CreateBucketRequest) SetLocalAlias(v CreateBucketRequestLocalAlias)`
SetLocalAlias sets LocalAlias field to given value.
### HasLocalAlias
`func (o *CreateBucketRequest) HasLocalAlias() bool`
HasLocalAlias returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,108 @@
# CreateBucketRequestLocalAlias
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccessKeyId** | Pointer to **string** | | [optional]
**Alias** | Pointer to **string** | | [optional]
**Allow** | Pointer to [**CreateBucketRequestLocalAliasAllow**](CreateBucketRequestLocalAliasAllow.md) | | [optional]
## Methods
### NewCreateBucketRequestLocalAlias
`func NewCreateBucketRequestLocalAlias() *CreateBucketRequestLocalAlias`
NewCreateBucketRequestLocalAlias instantiates a new CreateBucketRequestLocalAlias object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewCreateBucketRequestLocalAliasWithDefaults
`func NewCreateBucketRequestLocalAliasWithDefaults() *CreateBucketRequestLocalAlias`
NewCreateBucketRequestLocalAliasWithDefaults instantiates a new CreateBucketRequestLocalAlias object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetAccessKeyId
`func (o *CreateBucketRequestLocalAlias) GetAccessKeyId() string`
GetAccessKeyId returns the AccessKeyId field if non-nil, zero value otherwise.
### GetAccessKeyIdOk
`func (o *CreateBucketRequestLocalAlias) GetAccessKeyIdOk() (*string, bool)`
GetAccessKeyIdOk returns a tuple with the AccessKeyId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAccessKeyId
`func (o *CreateBucketRequestLocalAlias) SetAccessKeyId(v string)`
SetAccessKeyId sets AccessKeyId field to given value.
### HasAccessKeyId
`func (o *CreateBucketRequestLocalAlias) HasAccessKeyId() bool`
HasAccessKeyId returns a boolean if a field has been set.
### GetAlias
`func (o *CreateBucketRequestLocalAlias) GetAlias() string`
GetAlias returns the Alias field if non-nil, zero value otherwise.
### GetAliasOk
`func (o *CreateBucketRequestLocalAlias) GetAliasOk() (*string, bool)`
GetAliasOk returns a tuple with the Alias field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAlias
`func (o *CreateBucketRequestLocalAlias) SetAlias(v string)`
SetAlias sets Alias field to given value.
### HasAlias
`func (o *CreateBucketRequestLocalAlias) HasAlias() bool`
HasAlias returns a boolean if a field has been set.
### GetAllow
`func (o *CreateBucketRequestLocalAlias) GetAllow() CreateBucketRequestLocalAliasAllow`
GetAllow returns the Allow field if non-nil, zero value otherwise.
### GetAllowOk
`func (o *CreateBucketRequestLocalAlias) GetAllowOk() (*CreateBucketRequestLocalAliasAllow, bool)`
GetAllowOk returns a tuple with the Allow field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAllow
`func (o *CreateBucketRequestLocalAlias) SetAllow(v CreateBucketRequestLocalAliasAllow)`
SetAllow sets Allow field to given value.
### HasAllow
`func (o *CreateBucketRequestLocalAlias) HasAllow() bool`
HasAllow returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,108 @@
# CreateBucketRequestLocalAliasAllow
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Read** | Pointer to **bool** | | [optional]
**Write** | Pointer to **bool** | | [optional]
**Owner** | Pointer to **bool** | | [optional]
## Methods
### NewCreateBucketRequestLocalAliasAllow
`func NewCreateBucketRequestLocalAliasAllow() *CreateBucketRequestLocalAliasAllow`
NewCreateBucketRequestLocalAliasAllow instantiates a new CreateBucketRequestLocalAliasAllow object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewCreateBucketRequestLocalAliasAllowWithDefaults
`func NewCreateBucketRequestLocalAliasAllowWithDefaults() *CreateBucketRequestLocalAliasAllow`
NewCreateBucketRequestLocalAliasAllowWithDefaults instantiates a new CreateBucketRequestLocalAliasAllow object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetRead
`func (o *CreateBucketRequestLocalAliasAllow) GetRead() bool`
GetRead returns the Read field if non-nil, zero value otherwise.
### GetReadOk
`func (o *CreateBucketRequestLocalAliasAllow) GetReadOk() (*bool, bool)`
GetReadOk returns a tuple with the Read field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRead
`func (o *CreateBucketRequestLocalAliasAllow) SetRead(v bool)`
SetRead sets Read field to given value.
### HasRead
`func (o *CreateBucketRequestLocalAliasAllow) HasRead() bool`
HasRead returns a boolean if a field has been set.
### GetWrite
`func (o *CreateBucketRequestLocalAliasAllow) GetWrite() bool`
GetWrite returns the Write field if non-nil, zero value otherwise.
### GetWriteOk
`func (o *CreateBucketRequestLocalAliasAllow) GetWriteOk() (*bool, bool)`
GetWriteOk returns a tuple with the Write field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetWrite
`func (o *CreateBucketRequestLocalAliasAllow) SetWrite(v bool)`
SetWrite sets Write field to given value.
### HasWrite
`func (o *CreateBucketRequestLocalAliasAllow) HasWrite() bool`
HasWrite returns a boolean if a field has been set.
### GetOwner
`func (o *CreateBucketRequestLocalAliasAllow) GetOwner() bool`
GetOwner returns the Owner field if non-nil, zero value otherwise.
### GetOwnerOk
`func (o *CreateBucketRequestLocalAliasAllow) GetOwnerOk() (*bool, bool)`
GetOwnerOk returns a tuple with the Owner field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetOwner
`func (o *CreateBucketRequestLocalAliasAllow) SetOwner(v bool)`
SetOwner sets Owner field to given value.
### HasOwner
`func (o *CreateBucketRequestLocalAliasAllow) HasOwner() bool`
HasOwner returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,114 @@
# GetNodes200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Node** | **string** | |
**GarageVersion** | **string** | |
**KnownNodes** | [**map[string]NodeNetworkInfo**](NodeNetworkInfo.md) | |
**Layout** | [**ClusterLayout**](ClusterLayout.md) | |
## Methods
### NewGetNodes200Response
`func NewGetNodes200Response(node string, garageVersion string, knownNodes map[string]NodeNetworkInfo, layout ClusterLayout, ) *GetNodes200Response`
NewGetNodes200Response instantiates a new GetNodes200Response object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewGetNodes200ResponseWithDefaults
`func NewGetNodes200ResponseWithDefaults() *GetNodes200Response`
NewGetNodes200ResponseWithDefaults instantiates a new GetNodes200Response object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetNode
`func (o *GetNodes200Response) GetNode() string`
GetNode returns the Node field if non-nil, zero value otherwise.
### GetNodeOk
`func (o *GetNodes200Response) GetNodeOk() (*string, bool)`
GetNodeOk returns a tuple with the Node field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetNode
`func (o *GetNodes200Response) SetNode(v string)`
SetNode sets Node field to given value.
### GetGarageVersion
`func (o *GetNodes200Response) GetGarageVersion() string`
GetGarageVersion returns the GarageVersion field if non-nil, zero value otherwise.
### GetGarageVersionOk
`func (o *GetNodes200Response) GetGarageVersionOk() (*string, bool)`
GetGarageVersionOk returns a tuple with the GarageVersion field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetGarageVersion
`func (o *GetNodes200Response) SetGarageVersion(v string)`
SetGarageVersion sets GarageVersion field to given value.
### GetKnownNodes
`func (o *GetNodes200Response) GetKnownNodes() map[string]NodeNetworkInfo`
GetKnownNodes returns the KnownNodes field if non-nil, zero value otherwise.
### GetKnownNodesOk
`func (o *GetNodes200Response) GetKnownNodesOk() (*map[string]NodeNetworkInfo, bool)`
GetKnownNodesOk returns a tuple with the KnownNodes field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetKnownNodes
`func (o *GetNodes200Response) SetKnownNodes(v map[string]NodeNetworkInfo)`
SetKnownNodes sets KnownNodes field to given value.
### GetLayout
`func (o *GetNodes200Response) GetLayout() ClusterLayout`
GetLayout returns the Layout field if non-nil, zero value otherwise.
### GetLayoutOk
`func (o *GetNodes200Response) GetLayoutOk() (*ClusterLayout, bool)`
GetLayoutOk returns a tuple with the Layout field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetLayout
`func (o *GetNodes200Response) SetLayout(v ClusterLayout)`
SetLayout sets Layout field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,93 @@
# ImportKeyRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | |
**AccessKeyId** | **string** | |
**SecretAccessKey** | **string** | |
## Methods
### NewImportKeyRequest
`func NewImportKeyRequest(name string, accessKeyId string, secretAccessKey string, ) *ImportKeyRequest`
NewImportKeyRequest instantiates a new ImportKeyRequest object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewImportKeyRequestWithDefaults
`func NewImportKeyRequestWithDefaults() *ImportKeyRequest`
NewImportKeyRequestWithDefaults instantiates a new ImportKeyRequest object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetName
`func (o *ImportKeyRequest) GetName() string`
GetName returns the Name field if non-nil, zero value otherwise.
### GetNameOk
`func (o *ImportKeyRequest) GetNameOk() (*string, bool)`
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetName
`func (o *ImportKeyRequest) SetName(v string)`
SetName sets Name field to given value.
### GetAccessKeyId
`func (o *ImportKeyRequest) GetAccessKeyId() string`
GetAccessKeyId returns the AccessKeyId field if non-nil, zero value otherwise.
### GetAccessKeyIdOk
`func (o *ImportKeyRequest) GetAccessKeyIdOk() (*string, bool)`
GetAccessKeyIdOk returns a tuple with the AccessKeyId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAccessKeyId
`func (o *ImportKeyRequest) SetAccessKeyId(v string)`
SetAccessKeyId sets AccessKeyId field to given value.
### GetSecretAccessKey
`func (o *ImportKeyRequest) GetSecretAccessKey() string`
GetSecretAccessKey returns the SecretAccessKey field if non-nil, zero value otherwise.
### GetSecretAccessKeyOk
`func (o *ImportKeyRequest) GetSecretAccessKeyOk() (*string, bool)`
GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSecretAccessKey
`func (o *ImportKeyRequest) SetSecretAccessKey(v string)`
SetSecretAccessKey sets SecretAccessKey field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

488
golang/docs/KeyApi.md Normal file
View file

@ -0,0 +1,488 @@
# \KeyApi
All URIs are relative to *http://localhost:3903/v0*
Method | HTTP request | Description
------------- | ------------- | -------------
[**AddKey**](KeyApi.md#AddKey) | **Post** /key | Create a new API key
[**DeleteKey**](KeyApi.md#DeleteKey) | **Delete** /key?id&#x3D;{access_key} | Delete a key
[**GetKey**](KeyApi.md#GetKey) | **Get** /key?id&#x3D;{access_key} | Get key information
[**ImportKey**](KeyApi.md#ImportKey) | **Post** /key/import | Import an existing key
[**ListKeys**](KeyApi.md#ListKeys) | **Get** /key | List all keys
[**SearchKey**](KeyApi.md#SearchKey) | **Get** /key?search&#x3D;{pattern} | Select key by pattern
[**UpdateKey**](KeyApi.md#UpdateKey) | **Post** /key?id&#x3D;{access_key} | Update a key
## AddKey
> KeyInfo AddKey(ctx).AddKeyRequest(addKeyRequest).Execute()
Create a new API key
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
addKeyRequest := *openapiclient.NewAddKeyRequest() // AddKeyRequest | \"You can set a friendly name for this key, send an empty string instead\"
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.KeyApi.AddKey(context.Background()).AddKeyRequest(addKeyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KeyApi.AddKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AddKey`: KeyInfo
fmt.Fprintf(os.Stdout, "Response from `KeyApi.AddKey`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiAddKeyRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**addKeyRequest** | [**AddKeyRequest**](AddKeyRequest.md) | \&quot;You can set a friendly name for this key, send an empty string instead\&quot; |
### Return type
[**KeyInfo**](KeyInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## DeleteKey
> DeleteKey(ctx, accessKey).Execute()
Delete a key
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
accessKey := "GK31c2f218a2e44f485b94239e" // string | The exact API access key generated by Garage
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.KeyApi.DeleteKey(context.Background(), accessKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KeyApi.DeleteKey``: %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.
**accessKey** | **string** | The exact API access key generated by Garage |
### Other Parameters
Other parameters are passed through a pointer to a apiDeleteKeyRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
### Return type
(empty response body)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## GetKey
> KeyInfo GetKey(ctx, accessKey).Execute()
Get key information
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
accessKey := "GK31c2f218a2e44f485b94239e" // string | The exact API access key generated by Garage
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.KeyApi.GetKey(context.Background(), accessKey).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KeyApi.GetKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetKey`: KeyInfo
fmt.Fprintf(os.Stdout, "Response from `KeyApi.GetKey`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**accessKey** | **string** | The exact API access key generated by Garage |
### Other Parameters
Other parameters are passed through a pointer to a apiGetKeyRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
### Return type
[**KeyInfo**](KeyInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## ImportKey
> KeyInfo ImportKey(ctx).ImportKeyRequest(importKeyRequest).Execute()
Import an existing key
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
importKeyRequest := *openapiclient.NewImportKeyRequest("test-key", "GK31c2f218a2e44f485b94239e", "b892c0665f0ada8a4755dae98baa3b133590e11dae3bcc1f9d769d67f16c3835") // ImportKeyRequest | Information on the key to import
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.KeyApi.ImportKey(context.Background()).ImportKeyRequest(importKeyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KeyApi.ImportKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ImportKey`: KeyInfo
fmt.Fprintf(os.Stdout, "Response from `KeyApi.ImportKey`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiImportKeyRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**importKeyRequest** | [**ImportKeyRequest**](ImportKeyRequest.md) | Information on the key to import |
### Return type
[**KeyInfo**](KeyInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## ListKeys
> []ListKeys200ResponseInner ListKeys(ctx).Execute()
List all keys
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.KeyApi.ListKeys(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KeyApi.ListKeys``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListKeys`: []ListKeys200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `KeyApi.ListKeys`: %v\n", resp)
}
```
### Path Parameters
This endpoint does not need any parameter.
### Other Parameters
Other parameters are passed through a pointer to a apiListKeysRequest struct via the builder pattern
### Return type
[**[]ListKeys200ResponseInner**](ListKeys200ResponseInner.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## SearchKey
> KeyInfo SearchKey(ctx, pattern).Execute()
Select key by pattern
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
pattern := "test-k" // string | A pattern (beginning or full string) corresponding to a key identifier or friendly name
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.KeyApi.SearchKey(context.Background(), pattern).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KeyApi.SearchKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SearchKey`: KeyInfo
fmt.Fprintf(os.Stdout, "Response from `KeyApi.SearchKey`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**pattern** | **string** | A pattern (beginning or full string) corresponding to a key identifier or friendly name |
### Other Parameters
Other parameters are passed through a pointer to a apiSearchKeyRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
### Return type
[**KeyInfo**](KeyInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## UpdateKey
> KeyInfo UpdateKey(ctx, accessKey).UpdateKeyRequest(updateKeyRequest).Execute()
Update a key
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
accessKey := "GK31c2f218a2e44f485b94239e" // string | The exact API access key generated by Garage
updateKeyRequest := *openapiclient.NewUpdateKeyRequest() // UpdateKeyRequest | For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.KeyApi.UpdateKey(context.Background(), accessKey).UpdateKeyRequest(updateKeyRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `KeyApi.UpdateKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateKey`: KeyInfo
fmt.Fprintf(os.Stdout, "Response from `KeyApi.UpdateKey`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**accessKey** | **string** | The exact API access key generated by Garage |
### Other Parameters
Other parameters are passed through a pointer to a apiUpdateKeyRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**updateKeyRequest** | [**UpdateKeyRequest**](UpdateKeyRequest.md) | For a given key, provide a first set with the permissions to grant, and a second set with the permissions to remove |
### Return type
[**KeyInfo**](KeyInfo.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

160
golang/docs/KeyInfo.md Normal file
View file

@ -0,0 +1,160 @@
# KeyInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | Pointer to **string** | | [optional]
**AccessKeyId** | Pointer to **string** | | [optional]
**SecretAccessKey** | Pointer to **string** | | [optional]
**Permissions** | Pointer to [**KeyInfoPermissions**](KeyInfoPermissions.md) | | [optional]
**Buckets** | Pointer to [**[]KeyInfoBucketsInner**](KeyInfoBucketsInner.md) | | [optional]
## Methods
### NewKeyInfo
`func NewKeyInfo() *KeyInfo`
NewKeyInfo instantiates a new KeyInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewKeyInfoWithDefaults
`func NewKeyInfoWithDefaults() *KeyInfo`
NewKeyInfoWithDefaults instantiates a new KeyInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetName
`func (o *KeyInfo) GetName() string`
GetName returns the Name field if non-nil, zero value otherwise.
### GetNameOk
`func (o *KeyInfo) GetNameOk() (*string, bool)`
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetName
`func (o *KeyInfo) SetName(v string)`
SetName sets Name field to given value.
### HasName
`func (o *KeyInfo) HasName() bool`
HasName returns a boolean if a field has been set.
### GetAccessKeyId
`func (o *KeyInfo) GetAccessKeyId() string`
GetAccessKeyId returns the AccessKeyId field if non-nil, zero value otherwise.
### GetAccessKeyIdOk
`func (o *KeyInfo) GetAccessKeyIdOk() (*string, bool)`
GetAccessKeyIdOk returns a tuple with the AccessKeyId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAccessKeyId
`func (o *KeyInfo) SetAccessKeyId(v string)`
SetAccessKeyId sets AccessKeyId field to given value.
### HasAccessKeyId
`func (o *KeyInfo) HasAccessKeyId() bool`
HasAccessKeyId returns a boolean if a field has been set.
### GetSecretAccessKey
`func (o *KeyInfo) GetSecretAccessKey() string`
GetSecretAccessKey returns the SecretAccessKey field if non-nil, zero value otherwise.
### GetSecretAccessKeyOk
`func (o *KeyInfo) GetSecretAccessKeyOk() (*string, bool)`
GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetSecretAccessKey
`func (o *KeyInfo) SetSecretAccessKey(v string)`
SetSecretAccessKey sets SecretAccessKey field to given value.
### HasSecretAccessKey
`func (o *KeyInfo) HasSecretAccessKey() bool`
HasSecretAccessKey returns a boolean if a field has been set.
### GetPermissions
`func (o *KeyInfo) GetPermissions() KeyInfoPermissions`
GetPermissions returns the Permissions field if non-nil, zero value otherwise.
### GetPermissionsOk
`func (o *KeyInfo) GetPermissionsOk() (*KeyInfoPermissions, bool)`
GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPermissions
`func (o *KeyInfo) SetPermissions(v KeyInfoPermissions)`
SetPermissions sets Permissions field to given value.
### HasPermissions
`func (o *KeyInfo) HasPermissions() bool`
HasPermissions returns a boolean if a field has been set.
### GetBuckets
`func (o *KeyInfo) GetBuckets() []KeyInfoBucketsInner`
GetBuckets returns the Buckets field if non-nil, zero value otherwise.
### GetBucketsOk
`func (o *KeyInfo) GetBucketsOk() (*[]KeyInfoBucketsInner, bool)`
GetBucketsOk returns a tuple with the Buckets field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetBuckets
`func (o *KeyInfo) SetBuckets(v []KeyInfoBucketsInner)`
SetBuckets sets Buckets field to given value.
### HasBuckets
`func (o *KeyInfo) HasBuckets() bool`
HasBuckets returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,134 @@
# KeyInfoBucketsInner
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | Pointer to **string** | | [optional]
**GlobalAliases** | Pointer to **[]string** | | [optional]
**LocalAliases** | Pointer to **[]string** | | [optional]
**Permissions** | Pointer to [**KeyInfoBucketsInnerPermissions**](KeyInfoBucketsInnerPermissions.md) | | [optional]
## Methods
### NewKeyInfoBucketsInner
`func NewKeyInfoBucketsInner() *KeyInfoBucketsInner`
NewKeyInfoBucketsInner instantiates a new KeyInfoBucketsInner object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewKeyInfoBucketsInnerWithDefaults
`func NewKeyInfoBucketsInnerWithDefaults() *KeyInfoBucketsInner`
NewKeyInfoBucketsInnerWithDefaults instantiates a new KeyInfoBucketsInner object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *KeyInfoBucketsInner) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *KeyInfoBucketsInner) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *KeyInfoBucketsInner) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *KeyInfoBucketsInner) HasId() bool`
HasId returns a boolean if a field has been set.
### GetGlobalAliases
`func (o *KeyInfoBucketsInner) GetGlobalAliases() []string`
GetGlobalAliases returns the GlobalAliases field if non-nil, zero value otherwise.
### GetGlobalAliasesOk
`func (o *KeyInfoBucketsInner) GetGlobalAliasesOk() (*[]string, bool)`
GetGlobalAliasesOk returns a tuple with the GlobalAliases field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetGlobalAliases
`func (o *KeyInfoBucketsInner) SetGlobalAliases(v []string)`
SetGlobalAliases sets GlobalAliases field to given value.
### HasGlobalAliases
`func (o *KeyInfoBucketsInner) HasGlobalAliases() bool`
HasGlobalAliases returns a boolean if a field has been set.
### GetLocalAliases
`func (o *KeyInfoBucketsInner) GetLocalAliases() []string`
GetLocalAliases returns the LocalAliases field if non-nil, zero value otherwise.
### GetLocalAliasesOk
`func (o *KeyInfoBucketsInner) GetLocalAliasesOk() (*[]string, bool)`
GetLocalAliasesOk returns a tuple with the LocalAliases field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetLocalAliases
`func (o *KeyInfoBucketsInner) SetLocalAliases(v []string)`
SetLocalAliases sets LocalAliases field to given value.
### HasLocalAliases
`func (o *KeyInfoBucketsInner) HasLocalAliases() bool`
HasLocalAliases returns a boolean if a field has been set.
### GetPermissions
`func (o *KeyInfoBucketsInner) GetPermissions() KeyInfoBucketsInnerPermissions`
GetPermissions returns the Permissions field if non-nil, zero value otherwise.
### GetPermissionsOk
`func (o *KeyInfoBucketsInner) GetPermissionsOk() (*KeyInfoBucketsInnerPermissions, bool)`
GetPermissionsOk returns a tuple with the Permissions field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPermissions
`func (o *KeyInfoBucketsInner) SetPermissions(v KeyInfoBucketsInnerPermissions)`
SetPermissions sets Permissions field to given value.
### HasPermissions
`func (o *KeyInfoBucketsInner) HasPermissions() bool`
HasPermissions returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,108 @@
# KeyInfoBucketsInnerPermissions
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Read** | Pointer to **bool** | | [optional]
**Write** | Pointer to **bool** | | [optional]
**Owner** | Pointer to **bool** | | [optional]
## Methods
### NewKeyInfoBucketsInnerPermissions
`func NewKeyInfoBucketsInnerPermissions() *KeyInfoBucketsInnerPermissions`
NewKeyInfoBucketsInnerPermissions instantiates a new KeyInfoBucketsInnerPermissions object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewKeyInfoBucketsInnerPermissionsWithDefaults
`func NewKeyInfoBucketsInnerPermissionsWithDefaults() *KeyInfoBucketsInnerPermissions`
NewKeyInfoBucketsInnerPermissionsWithDefaults instantiates a new KeyInfoBucketsInnerPermissions object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetRead
`func (o *KeyInfoBucketsInnerPermissions) GetRead() bool`
GetRead returns the Read field if non-nil, zero value otherwise.
### GetReadOk
`func (o *KeyInfoBucketsInnerPermissions) GetReadOk() (*bool, bool)`
GetReadOk returns a tuple with the Read field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRead
`func (o *KeyInfoBucketsInnerPermissions) SetRead(v bool)`
SetRead sets Read field to given value.
### HasRead
`func (o *KeyInfoBucketsInnerPermissions) HasRead() bool`
HasRead returns a boolean if a field has been set.
### GetWrite
`func (o *KeyInfoBucketsInnerPermissions) GetWrite() bool`
GetWrite returns the Write field if non-nil, zero value otherwise.
### GetWriteOk
`func (o *KeyInfoBucketsInnerPermissions) GetWriteOk() (*bool, bool)`
GetWriteOk returns a tuple with the Write field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetWrite
`func (o *KeyInfoBucketsInnerPermissions) SetWrite(v bool)`
SetWrite sets Write field to given value.
### HasWrite
`func (o *KeyInfoBucketsInnerPermissions) HasWrite() bool`
HasWrite returns a boolean if a field has been set.
### GetOwner
`func (o *KeyInfoBucketsInnerPermissions) GetOwner() bool`
GetOwner returns the Owner field if non-nil, zero value otherwise.
### GetOwnerOk
`func (o *KeyInfoBucketsInnerPermissions) GetOwnerOk() (*bool, bool)`
GetOwnerOk returns a tuple with the Owner field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetOwner
`func (o *KeyInfoBucketsInnerPermissions) SetOwner(v bool)`
SetOwner sets Owner field to given value.
### HasOwner
`func (o *KeyInfoBucketsInnerPermissions) HasOwner() bool`
HasOwner returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,56 @@
# KeyInfoPermissions
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CreateBucket** | Pointer to **bool** | | [optional]
## Methods
### NewKeyInfoPermissions
`func NewKeyInfoPermissions() *KeyInfoPermissions`
NewKeyInfoPermissions instantiates a new KeyInfoPermissions object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewKeyInfoPermissionsWithDefaults
`func NewKeyInfoPermissionsWithDefaults() *KeyInfoPermissions`
NewKeyInfoPermissionsWithDefaults instantiates a new KeyInfoPermissions object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetCreateBucket
`func (o *KeyInfoPermissions) GetCreateBucket() bool`
GetCreateBucket returns the CreateBucket field if non-nil, zero value otherwise.
### GetCreateBucketOk
`func (o *KeyInfoPermissions) GetCreateBucketOk() (*bool, bool)`
GetCreateBucketOk returns a tuple with the CreateBucket field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCreateBucket
`func (o *KeyInfoPermissions) SetCreateBucket(v bool)`
SetCreateBucket sets CreateBucket field to given value.
### HasCreateBucket
`func (o *KeyInfoPermissions) HasCreateBucket() bool`
HasCreateBucket returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

265
golang/docs/LayoutApi.md Normal file
View file

@ -0,0 +1,265 @@
# \LayoutApi
All URIs are relative to *http://localhost:3903/v0*
Method | HTTP request | Description
------------- | ------------- | -------------
[**AddLayout**](LayoutApi.md#AddLayout) | **Post** /layout | Send modifications to the cluster layout
[**ApplyLayout**](LayoutApi.md#ApplyLayout) | **Post** /layout/apply | Apply staged layout
[**GetLayout**](LayoutApi.md#GetLayout) | **Get** /layout | Details on the current and staged layout
[**RevertLayout**](LayoutApi.md#RevertLayout) | **Post** /layout/revert | Clear staged layout
## AddLayout
> AddLayout(ctx).RequestBody(requestBody).Execute()
Send modifications to the cluster layout
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
requestBody := map[string]NodeClusterInfo{"key": *openapiclient.NewNodeClusterInfo("dc1", NullableInt32(4), []string{"Tags_example"})} // map[string]NodeClusterInfo | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to `null` instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LayoutApi.AddLayout(context.Background()).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LayoutApi.AddLayout``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiAddLayoutRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | [**map[string]NodeClusterInfo**](NodeClusterInfo.md) | To add a new node to the layout or to change the configuration of an existing node, simply set the values you want. To remove a node, set it to &#x60;null&#x60; instead of passing a configuration object. Contrary to the CLI that may update only a subset of the fields capacity, zone and tags, when calling this API all of these values must be specified. |
### Return type
(empty response body)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## ApplyLayout
> ApplyLayout(ctx).LayoutVersion(layoutVersion).Execute()
Apply staged layout
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
layoutVersion := *openapiclient.NewLayoutVersion() // LayoutVersion | Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LayoutApi.ApplyLayout(context.Background()).LayoutVersion(layoutVersion).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LayoutApi.ApplyLayout``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiApplyLayoutRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**layoutVersion** | [**LayoutVersion**](LayoutVersion.md) | Similarly to the CLI, the body must include the version of the new layout that will be created, which MUST be 1 + the value of the currently existing layout in the cluster. |
### Return type
(empty response body)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## GetLayout
> ClusterLayout GetLayout(ctx).Execute()
Details on the current and staged layout
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LayoutApi.GetLayout(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LayoutApi.GetLayout``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetLayout`: ClusterLayout
fmt.Fprintf(os.Stdout, "Response from `LayoutApi.GetLayout`: %v\n", resp)
}
```
### Path Parameters
This endpoint does not need any parameter.
### Other Parameters
Other parameters are passed through a pointer to a apiGetLayoutRequest struct via the builder pattern
### Return type
[**ClusterLayout**](ClusterLayout.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## RevertLayout
> RevertLayout(ctx).LayoutVersion(layoutVersion).Execute()
Clear staged layout
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
layoutVersion := *openapiclient.NewLayoutVersion() // LayoutVersion | Reverting the staged changes is done by incrementing the version number and clearing the contents of the staged change list. Similarly to the CLI, the body must include the incremented version number, which MUST be 1 + the value of the currently existing layout in the cluster.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LayoutApi.RevertLayout(context.Background()).LayoutVersion(layoutVersion).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LayoutApi.RevertLayout``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiRevertLayoutRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**layoutVersion** | [**LayoutVersion**](LayoutVersion.md) | Reverting the staged changes is done by incrementing the version number and clearing the contents of the staged change list. Similarly to the CLI, the body must include the incremented version number, which MUST be 1 + the value of the currently existing layout in the cluster. |
### Return type
(empty response body)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

View file

@ -0,0 +1,56 @@
# LayoutVersion
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Version** | Pointer to **int32** | | [optional]
## Methods
### NewLayoutVersion
`func NewLayoutVersion() *LayoutVersion`
NewLayoutVersion instantiates a new LayoutVersion object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewLayoutVersionWithDefaults
`func NewLayoutVersionWithDefaults() *LayoutVersion`
NewLayoutVersionWithDefaults instantiates a new LayoutVersion object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetVersion
`func (o *LayoutVersion) GetVersion() int32`
GetVersion returns the Version field if non-nil, zero value otherwise.
### GetVersionOk
`func (o *LayoutVersion) GetVersionOk() (*int32, bool)`
GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetVersion
`func (o *LayoutVersion) SetVersion(v int32)`
SetVersion sets Version field to given value.
### HasVersion
`func (o *LayoutVersion) HasVersion() bool`
HasVersion returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,103 @@
# ListBuckets200ResponseInner
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | |
**GlobalAliases** | Pointer to **[]string** | | [optional]
**LocalAliases** | Pointer to [**[]ListBuckets200ResponseInnerLocalAliasesInner**](ListBuckets200ResponseInnerLocalAliasesInner.md) | | [optional]
## Methods
### NewListBuckets200ResponseInner
`func NewListBuckets200ResponseInner(id string, ) *ListBuckets200ResponseInner`
NewListBuckets200ResponseInner instantiates a new ListBuckets200ResponseInner object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewListBuckets200ResponseInnerWithDefaults
`func NewListBuckets200ResponseInnerWithDefaults() *ListBuckets200ResponseInner`
NewListBuckets200ResponseInnerWithDefaults instantiates a new ListBuckets200ResponseInner object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *ListBuckets200ResponseInner) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *ListBuckets200ResponseInner) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *ListBuckets200ResponseInner) SetId(v string)`
SetId sets Id field to given value.
### GetGlobalAliases
`func (o *ListBuckets200ResponseInner) GetGlobalAliases() []string`
GetGlobalAliases returns the GlobalAliases field if non-nil, zero value otherwise.
### GetGlobalAliasesOk
`func (o *ListBuckets200ResponseInner) GetGlobalAliasesOk() (*[]string, bool)`
GetGlobalAliasesOk returns a tuple with the GlobalAliases field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetGlobalAliases
`func (o *ListBuckets200ResponseInner) SetGlobalAliases(v []string)`
SetGlobalAliases sets GlobalAliases field to given value.
### HasGlobalAliases
`func (o *ListBuckets200ResponseInner) HasGlobalAliases() bool`
HasGlobalAliases returns a boolean if a field has been set.
### GetLocalAliases
`func (o *ListBuckets200ResponseInner) GetLocalAliases() []ListBuckets200ResponseInnerLocalAliasesInner`
GetLocalAliases returns the LocalAliases field if non-nil, zero value otherwise.
### GetLocalAliasesOk
`func (o *ListBuckets200ResponseInner) GetLocalAliasesOk() (*[]ListBuckets200ResponseInnerLocalAliasesInner, bool)`
GetLocalAliasesOk returns a tuple with the LocalAliases field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetLocalAliases
`func (o *ListBuckets200ResponseInner) SetLocalAliases(v []ListBuckets200ResponseInnerLocalAliasesInner)`
SetLocalAliases sets LocalAliases field to given value.
### HasLocalAliases
`func (o *ListBuckets200ResponseInner) HasLocalAliases() bool`
HasLocalAliases returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,72 @@
# ListBuckets200ResponseInnerLocalAliasesInner
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Alias** | **string** | |
**AccessKeyId** | **string** | |
## Methods
### NewListBuckets200ResponseInnerLocalAliasesInner
`func NewListBuckets200ResponseInnerLocalAliasesInner(alias string, accessKeyId string, ) *ListBuckets200ResponseInnerLocalAliasesInner`
NewListBuckets200ResponseInnerLocalAliasesInner instantiates a new ListBuckets200ResponseInnerLocalAliasesInner object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewListBuckets200ResponseInnerLocalAliasesInnerWithDefaults
`func NewListBuckets200ResponseInnerLocalAliasesInnerWithDefaults() *ListBuckets200ResponseInnerLocalAliasesInner`
NewListBuckets200ResponseInnerLocalAliasesInnerWithDefaults instantiates a new ListBuckets200ResponseInnerLocalAliasesInner object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetAlias
`func (o *ListBuckets200ResponseInnerLocalAliasesInner) GetAlias() string`
GetAlias returns the Alias field if non-nil, zero value otherwise.
### GetAliasOk
`func (o *ListBuckets200ResponseInnerLocalAliasesInner) GetAliasOk() (*string, bool)`
GetAliasOk returns a tuple with the Alias field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAlias
`func (o *ListBuckets200ResponseInnerLocalAliasesInner) SetAlias(v string)`
SetAlias sets Alias field to given value.
### GetAccessKeyId
`func (o *ListBuckets200ResponseInnerLocalAliasesInner) GetAccessKeyId() string`
GetAccessKeyId returns the AccessKeyId field if non-nil, zero value otherwise.
### GetAccessKeyIdOk
`func (o *ListBuckets200ResponseInnerLocalAliasesInner) GetAccessKeyIdOk() (*string, bool)`
GetAccessKeyIdOk returns a tuple with the AccessKeyId field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAccessKeyId
`func (o *ListBuckets200ResponseInnerLocalAliasesInner) SetAccessKeyId(v string)`
SetAccessKeyId sets AccessKeyId field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,77 @@
# ListKeys200ResponseInner
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **string** | |
**Name** | Pointer to **string** | | [optional]
## Methods
### NewListKeys200ResponseInner
`func NewListKeys200ResponseInner(id string, ) *ListKeys200ResponseInner`
NewListKeys200ResponseInner instantiates a new ListKeys200ResponseInner object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewListKeys200ResponseInnerWithDefaults
`func NewListKeys200ResponseInnerWithDefaults() *ListKeys200ResponseInner`
NewListKeys200ResponseInnerWithDefaults instantiates a new ListKeys200ResponseInner object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetId
`func (o *ListKeys200ResponseInner) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *ListKeys200ResponseInner) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *ListKeys200ResponseInner) SetId(v string)`
SetId sets Id field to given value.
### GetName
`func (o *ListKeys200ResponseInner) GetName() string`
GetName returns the Name field if non-nil, zero value otherwise.
### GetNameOk
`func (o *ListKeys200ResponseInner) GetNameOk() (*string, bool)`
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetName
`func (o *ListKeys200ResponseInner) SetName(v string)`
SetName sets Name field to given value.
### HasName
`func (o *ListKeys200ResponseInner) HasName() bool`
HasName returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,103 @@
# NodeClusterInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Zone** | **string** | |
**Capacity** | **NullableInt32** | |
**Tags** | **[]string** | User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage |
## Methods
### NewNodeClusterInfo
`func NewNodeClusterInfo(zone string, capacity NullableInt32, tags []string, ) *NodeClusterInfo`
NewNodeClusterInfo instantiates a new NodeClusterInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewNodeClusterInfoWithDefaults
`func NewNodeClusterInfoWithDefaults() *NodeClusterInfo`
NewNodeClusterInfoWithDefaults instantiates a new NodeClusterInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetZone
`func (o *NodeClusterInfo) GetZone() string`
GetZone returns the Zone field if non-nil, zero value otherwise.
### GetZoneOk
`func (o *NodeClusterInfo) GetZoneOk() (*string, bool)`
GetZoneOk returns a tuple with the Zone field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetZone
`func (o *NodeClusterInfo) SetZone(v string)`
SetZone sets Zone field to given value.
### GetCapacity
`func (o *NodeClusterInfo) GetCapacity() int32`
GetCapacity returns the Capacity field if non-nil, zero value otherwise.
### GetCapacityOk
`func (o *NodeClusterInfo) GetCapacityOk() (*int32, bool)`
GetCapacityOk returns a tuple with the Capacity field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCapacity
`func (o *NodeClusterInfo) SetCapacity(v int32)`
SetCapacity sets Capacity field to given value.
### SetCapacityNil
`func (o *NodeClusterInfo) SetCapacityNil(b bool)`
SetCapacityNil sets the value for Capacity to be an explicit nil
### UnsetCapacity
`func (o *NodeClusterInfo) UnsetCapacity()`
UnsetCapacity ensures that no value is present for Capacity, not even an explicit nil
### GetTags
`func (o *NodeClusterInfo) GetTags() []string`
GetTags returns the Tags field if non-nil, zero value otherwise.
### GetTagsOk
`func (o *NodeClusterInfo) GetTagsOk() (*[]string, bool)`
GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetTags
`func (o *NodeClusterInfo) SetTags(v []string)`
SetTags sets Tags field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,124 @@
# NodeNetworkInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Addr** | **string** | |
**IsUp** | **bool** | |
**LastSeenSecsAgo** | **NullableInt32** | |
**Hostname** | **string** | |
## Methods
### NewNodeNetworkInfo
`func NewNodeNetworkInfo(addr string, isUp bool, lastSeenSecsAgo NullableInt32, hostname string, ) *NodeNetworkInfo`
NewNodeNetworkInfo instantiates a new NodeNetworkInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewNodeNetworkInfoWithDefaults
`func NewNodeNetworkInfoWithDefaults() *NodeNetworkInfo`
NewNodeNetworkInfoWithDefaults instantiates a new NodeNetworkInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetAddr
`func (o *NodeNetworkInfo) GetAddr() string`
GetAddr returns the Addr field if non-nil, zero value otherwise.
### GetAddrOk
`func (o *NodeNetworkInfo) GetAddrOk() (*string, bool)`
GetAddrOk returns a tuple with the Addr field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAddr
`func (o *NodeNetworkInfo) SetAddr(v string)`
SetAddr sets Addr field to given value.
### GetIsUp
`func (o *NodeNetworkInfo) GetIsUp() bool`
GetIsUp returns the IsUp field if non-nil, zero value otherwise.
### GetIsUpOk
`func (o *NodeNetworkInfo) GetIsUpOk() (*bool, bool)`
GetIsUpOk returns a tuple with the IsUp field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIsUp
`func (o *NodeNetworkInfo) SetIsUp(v bool)`
SetIsUp sets IsUp field to given value.
### GetLastSeenSecsAgo
`func (o *NodeNetworkInfo) GetLastSeenSecsAgo() int32`
GetLastSeenSecsAgo returns the LastSeenSecsAgo field if non-nil, zero value otherwise.
### GetLastSeenSecsAgoOk
`func (o *NodeNetworkInfo) GetLastSeenSecsAgoOk() (*int32, bool)`
GetLastSeenSecsAgoOk returns a tuple with the LastSeenSecsAgo field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetLastSeenSecsAgo
`func (o *NodeNetworkInfo) SetLastSeenSecsAgo(v int32)`
SetLastSeenSecsAgo sets LastSeenSecsAgo field to given value.
### SetLastSeenSecsAgoNil
`func (o *NodeNetworkInfo) SetLastSeenSecsAgoNil(b bool)`
SetLastSeenSecsAgoNil sets the value for LastSeenSecsAgo to be an explicit nil
### UnsetLastSeenSecsAgo
`func (o *NodeNetworkInfo) UnsetLastSeenSecsAgo()`
UnsetLastSeenSecsAgo ensures that no value is present for LastSeenSecsAgo, not even an explicit nil
### GetHostname
`func (o *NodeNetworkInfo) GetHostname() string`
GetHostname returns the Hostname field if non-nil, zero value otherwise.
### GetHostnameOk
`func (o *NodeNetworkInfo) GetHostnameOk() (*string, bool)`
GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetHostname
`func (o *NodeNetworkInfo) SetHostname(v string)`
SetHostname sets Hostname field to given value.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

137
golang/docs/NodesApi.md Normal file
View file

@ -0,0 +1,137 @@
# \NodesApi
All URIs are relative to *http://localhost:3903/v0*
Method | HTTP request | Description
------------- | ------------- | -------------
[**AddNode**](NodesApi.md#AddNode) | **Post** /connect | Connect target node to other Garage nodes
[**GetNodes**](NodesApi.md#GetNodes) | **Get** /status | Status of this node and other nodes in the cluster
## AddNode
> []AddNode200ResponseInner AddNode(ctx).RequestBody(requestBody).Execute()
Connect target node to other Garage nodes
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
requestBody := []string{"Property_example"} // []string |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.NodesApi.AddNode(context.Background()).RequestBody(requestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.AddNode``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AddNode`: []AddNode200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `NodesApi.AddNode`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiAddNodeRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**requestBody** | **[]string** | |
### Return type
[**[]AddNode200ResponseInner**](AddNode200ResponseInner.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## GetNodes
> GetNodes200Response GetNodes(ctx).Execute()
Status of this node and other nodes in the cluster
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.NodesApi.GetNodes(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `NodesApi.GetNodes``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetNodes`: GetNodes200Response
fmt.Fprintf(os.Stdout, "Response from `NodesApi.GetNodes`: %v\n", resp)
}
```
### Path Parameters
This endpoint does not need any parameter.
### Other Parameters
Other parameters are passed through a pointer to a apiGetNodesRequest struct via the builder pattern
### Return type
[**GetNodes200Response**](GetNodes200Response.md)
### Authorization
[bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

View file

@ -0,0 +1,82 @@
# UpdateBucketRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**WebsiteAccess** | Pointer to [**UpdateBucketRequestWebsiteAccess**](UpdateBucketRequestWebsiteAccess.md) | | [optional]
**Quotas** | Pointer to [**UpdateBucketRequestQuotas**](UpdateBucketRequestQuotas.md) | | [optional]
## Methods
### NewUpdateBucketRequest
`func NewUpdateBucketRequest() *UpdateBucketRequest`
NewUpdateBucketRequest instantiates a new UpdateBucketRequest object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewUpdateBucketRequestWithDefaults
`func NewUpdateBucketRequestWithDefaults() *UpdateBucketRequest`
NewUpdateBucketRequestWithDefaults instantiates a new UpdateBucketRequest object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetWebsiteAccess
`func (o *UpdateBucketRequest) GetWebsiteAccess() UpdateBucketRequestWebsiteAccess`
GetWebsiteAccess returns the WebsiteAccess field if non-nil, zero value otherwise.
### GetWebsiteAccessOk
`func (o *UpdateBucketRequest) GetWebsiteAccessOk() (*UpdateBucketRequestWebsiteAccess, bool)`
GetWebsiteAccessOk returns a tuple with the WebsiteAccess field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetWebsiteAccess
`func (o *UpdateBucketRequest) SetWebsiteAccess(v UpdateBucketRequestWebsiteAccess)`
SetWebsiteAccess sets WebsiteAccess field to given value.
### HasWebsiteAccess
`func (o *UpdateBucketRequest) HasWebsiteAccess() bool`
HasWebsiteAccess returns a boolean if a field has been set.
### GetQuotas
`func (o *UpdateBucketRequest) GetQuotas() UpdateBucketRequestQuotas`
GetQuotas returns the Quotas field if non-nil, zero value otherwise.
### GetQuotasOk
`func (o *UpdateBucketRequest) GetQuotasOk() (*UpdateBucketRequestQuotas, bool)`
GetQuotasOk returns a tuple with the Quotas field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetQuotas
`func (o *UpdateBucketRequest) SetQuotas(v UpdateBucketRequestQuotas)`
SetQuotas sets Quotas field to given value.
### HasQuotas
`func (o *UpdateBucketRequest) HasQuotas() bool`
HasQuotas returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,102 @@
# UpdateBucketRequestQuotas
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MaxSize** | Pointer to **NullableInt32** | | [optional]
**MaxObjects** | Pointer to **NullableInt32** | | [optional]
## Methods
### NewUpdateBucketRequestQuotas
`func NewUpdateBucketRequestQuotas() *UpdateBucketRequestQuotas`
NewUpdateBucketRequestQuotas instantiates a new UpdateBucketRequestQuotas object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewUpdateBucketRequestQuotasWithDefaults
`func NewUpdateBucketRequestQuotasWithDefaults() *UpdateBucketRequestQuotas`
NewUpdateBucketRequestQuotasWithDefaults instantiates a new UpdateBucketRequestQuotas object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetMaxSize
`func (o *UpdateBucketRequestQuotas) GetMaxSize() int32`
GetMaxSize returns the MaxSize field if non-nil, zero value otherwise.
### GetMaxSizeOk
`func (o *UpdateBucketRequestQuotas) GetMaxSizeOk() (*int32, bool)`
GetMaxSizeOk returns a tuple with the MaxSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMaxSize
`func (o *UpdateBucketRequestQuotas) SetMaxSize(v int32)`
SetMaxSize sets MaxSize field to given value.
### HasMaxSize
`func (o *UpdateBucketRequestQuotas) HasMaxSize() bool`
HasMaxSize returns a boolean if a field has been set.
### SetMaxSizeNil
`func (o *UpdateBucketRequestQuotas) SetMaxSizeNil(b bool)`
SetMaxSizeNil sets the value for MaxSize to be an explicit nil
### UnsetMaxSize
`func (o *UpdateBucketRequestQuotas) UnsetMaxSize()`
UnsetMaxSize ensures that no value is present for MaxSize, not even an explicit nil
### GetMaxObjects
`func (o *UpdateBucketRequestQuotas) GetMaxObjects() int32`
GetMaxObjects returns the MaxObjects field if non-nil, zero value otherwise.
### GetMaxObjectsOk
`func (o *UpdateBucketRequestQuotas) GetMaxObjectsOk() (*int32, bool)`
GetMaxObjectsOk returns a tuple with the MaxObjects field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMaxObjects
`func (o *UpdateBucketRequestQuotas) SetMaxObjects(v int32)`
SetMaxObjects sets MaxObjects field to given value.
### HasMaxObjects
`func (o *UpdateBucketRequestQuotas) HasMaxObjects() bool`
HasMaxObjects returns a boolean if a field has been set.
### SetMaxObjectsNil
`func (o *UpdateBucketRequestQuotas) SetMaxObjectsNil(b bool)`
SetMaxObjectsNil sets the value for MaxObjects to be an explicit nil
### UnsetMaxObjects
`func (o *UpdateBucketRequestQuotas) UnsetMaxObjects()`
UnsetMaxObjects ensures that no value is present for MaxObjects, not even an explicit nil
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,108 @@
# UpdateBucketRequestWebsiteAccess
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Enabled** | Pointer to **bool** | | [optional]
**IndexDocument** | Pointer to **string** | | [optional]
**ErrorDocument** | Pointer to **string** | | [optional]
## Methods
### NewUpdateBucketRequestWebsiteAccess
`func NewUpdateBucketRequestWebsiteAccess() *UpdateBucketRequestWebsiteAccess`
NewUpdateBucketRequestWebsiteAccess instantiates a new UpdateBucketRequestWebsiteAccess object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewUpdateBucketRequestWebsiteAccessWithDefaults
`func NewUpdateBucketRequestWebsiteAccessWithDefaults() *UpdateBucketRequestWebsiteAccess`
NewUpdateBucketRequestWebsiteAccessWithDefaults instantiates a new UpdateBucketRequestWebsiteAccess object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetEnabled
`func (o *UpdateBucketRequestWebsiteAccess) GetEnabled() bool`
GetEnabled returns the Enabled field if non-nil, zero value otherwise.
### GetEnabledOk
`func (o *UpdateBucketRequestWebsiteAccess) GetEnabledOk() (*bool, bool)`
GetEnabledOk returns a tuple with the Enabled field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetEnabled
`func (o *UpdateBucketRequestWebsiteAccess) SetEnabled(v bool)`
SetEnabled sets Enabled field to given value.
### HasEnabled
`func (o *UpdateBucketRequestWebsiteAccess) HasEnabled() bool`
HasEnabled returns a boolean if a field has been set.
### GetIndexDocument
`func (o *UpdateBucketRequestWebsiteAccess) GetIndexDocument() string`
GetIndexDocument returns the IndexDocument field if non-nil, zero value otherwise.
### GetIndexDocumentOk
`func (o *UpdateBucketRequestWebsiteAccess) GetIndexDocumentOk() (*string, bool)`
GetIndexDocumentOk returns a tuple with the IndexDocument field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIndexDocument
`func (o *UpdateBucketRequestWebsiteAccess) SetIndexDocument(v string)`
SetIndexDocument sets IndexDocument field to given value.
### HasIndexDocument
`func (o *UpdateBucketRequestWebsiteAccess) HasIndexDocument() bool`
HasIndexDocument returns a boolean if a field has been set.
### GetErrorDocument
`func (o *UpdateBucketRequestWebsiteAccess) GetErrorDocument() string`
GetErrorDocument returns the ErrorDocument field if non-nil, zero value otherwise.
### GetErrorDocumentOk
`func (o *UpdateBucketRequestWebsiteAccess) GetErrorDocumentOk() (*string, bool)`
GetErrorDocumentOk returns a tuple with the ErrorDocument field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetErrorDocument
`func (o *UpdateBucketRequestWebsiteAccess) SetErrorDocument(v string)`
SetErrorDocument sets ErrorDocument field to given value.
### HasErrorDocument
`func (o *UpdateBucketRequestWebsiteAccess) HasErrorDocument() bool`
HasErrorDocument returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,108 @@
# UpdateKeyRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | Pointer to **string** | | [optional]
**Allow** | Pointer to [**UpdateKeyRequestAllow**](UpdateKeyRequestAllow.md) | | [optional]
**Deny** | Pointer to [**UpdateKeyRequestDeny**](UpdateKeyRequestDeny.md) | | [optional]
## Methods
### NewUpdateKeyRequest
`func NewUpdateKeyRequest() *UpdateKeyRequest`
NewUpdateKeyRequest instantiates a new UpdateKeyRequest object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewUpdateKeyRequestWithDefaults
`func NewUpdateKeyRequestWithDefaults() *UpdateKeyRequest`
NewUpdateKeyRequestWithDefaults instantiates a new UpdateKeyRequest object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetName
`func (o *UpdateKeyRequest) GetName() string`
GetName returns the Name field if non-nil, zero value otherwise.
### GetNameOk
`func (o *UpdateKeyRequest) GetNameOk() (*string, bool)`
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetName
`func (o *UpdateKeyRequest) SetName(v string)`
SetName sets Name field to given value.
### HasName
`func (o *UpdateKeyRequest) HasName() bool`
HasName returns a boolean if a field has been set.
### GetAllow
`func (o *UpdateKeyRequest) GetAllow() UpdateKeyRequestAllow`
GetAllow returns the Allow field if non-nil, zero value otherwise.
### GetAllowOk
`func (o *UpdateKeyRequest) GetAllowOk() (*UpdateKeyRequestAllow, bool)`
GetAllowOk returns a tuple with the Allow field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAllow
`func (o *UpdateKeyRequest) SetAllow(v UpdateKeyRequestAllow)`
SetAllow sets Allow field to given value.
### HasAllow
`func (o *UpdateKeyRequest) HasAllow() bool`
HasAllow returns a boolean if a field has been set.
### GetDeny
`func (o *UpdateKeyRequest) GetDeny() UpdateKeyRequestDeny`
GetDeny returns the Deny field if non-nil, zero value otherwise.
### GetDenyOk
`func (o *UpdateKeyRequest) GetDenyOk() (*UpdateKeyRequestDeny, bool)`
GetDenyOk returns a tuple with the Deny field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetDeny
`func (o *UpdateKeyRequest) SetDeny(v UpdateKeyRequestDeny)`
SetDeny sets Deny field to given value.
### HasDeny
`func (o *UpdateKeyRequest) HasDeny() bool`
HasDeny returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,56 @@
# UpdateKeyRequestAllow
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CreateBucket** | Pointer to **bool** | | [optional]
## Methods
### NewUpdateKeyRequestAllow
`func NewUpdateKeyRequestAllow() *UpdateKeyRequestAllow`
NewUpdateKeyRequestAllow instantiates a new UpdateKeyRequestAllow object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewUpdateKeyRequestAllowWithDefaults
`func NewUpdateKeyRequestAllowWithDefaults() *UpdateKeyRequestAllow`
NewUpdateKeyRequestAllowWithDefaults instantiates a new UpdateKeyRequestAllow object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetCreateBucket
`func (o *UpdateKeyRequestAllow) GetCreateBucket() bool`
GetCreateBucket returns the CreateBucket field if non-nil, zero value otherwise.
### GetCreateBucketOk
`func (o *UpdateKeyRequestAllow) GetCreateBucketOk() (*bool, bool)`
GetCreateBucketOk returns a tuple with the CreateBucket field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCreateBucket
`func (o *UpdateKeyRequestAllow) SetCreateBucket(v bool)`
SetCreateBucket sets CreateBucket field to given value.
### HasCreateBucket
`func (o *UpdateKeyRequestAllow) HasCreateBucket() bool`
HasCreateBucket returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View file

@ -0,0 +1,56 @@
# UpdateKeyRequestDeny
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CreateBucket** | Pointer to **bool** | | [optional]
## Methods
### NewUpdateKeyRequestDeny
`func NewUpdateKeyRequestDeny() *UpdateKeyRequestDeny`
NewUpdateKeyRequestDeny instantiates a new UpdateKeyRequestDeny object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewUpdateKeyRequestDenyWithDefaults
`func NewUpdateKeyRequestDenyWithDefaults() *UpdateKeyRequestDeny`
NewUpdateKeyRequestDenyWithDefaults instantiates a new UpdateKeyRequestDeny object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetCreateBucket
`func (o *UpdateKeyRequestDeny) GetCreateBucket() bool`
GetCreateBucket returns the CreateBucket field if non-nil, zero value otherwise.
### GetCreateBucketOk
`func (o *UpdateKeyRequestDeny) GetCreateBucketOk() (*bool, bool)`
GetCreateBucketOk returns a tuple with the CreateBucket field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCreateBucket
`func (o *UpdateKeyRequestDeny) SetCreateBucket(v bool)`
SetCreateBucket sets CreateBucket field to given value.
### HasCreateBucket
`func (o *UpdateKeyRequestDeny) HasCreateBucket() bool`
HasCreateBucket returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

57
golang/git_push.sh Normal file
View file

@ -0,0 +1,57 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

7
golang/go.mod Normal file
View file

@ -0,0 +1,7 @@
module github.com/GIT_USER_ID/GIT_REPO_ID
go 1.13
require (
golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558
)

13
golang/go.sum Normal file
View file

@ -0,0 +1,13 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=

View file

@ -0,0 +1,115 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// AddKeyRequest struct for AddKeyRequest
type AddKeyRequest struct {
Name *string `json:"name,omitempty"`
}
// NewAddKeyRequest instantiates a new AddKeyRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewAddKeyRequest() *AddKeyRequest {
this := AddKeyRequest{}
return &this
}
// NewAddKeyRequestWithDefaults instantiates a new AddKeyRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewAddKeyRequestWithDefaults() *AddKeyRequest {
this := AddKeyRequest{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *AddKeyRequest) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AddKeyRequest) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *AddKeyRequest) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *AddKeyRequest) SetName(v string) {
o.Name = &v
}
func (o AddKeyRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Name != nil {
toSerialize["name"] = o.Name
}
return json.Marshal(toSerialize)
}
type NullableAddKeyRequest struct {
value *AddKeyRequest
isSet bool
}
func (v NullableAddKeyRequest) Get() *AddKeyRequest {
return v.value
}
func (v *NullableAddKeyRequest) Set(val *AddKeyRequest) {
v.value = val
v.isSet = true
}
func (v NullableAddKeyRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAddKeyRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAddKeyRequest(val *AddKeyRequest) *NullableAddKeyRequest {
return &NullableAddKeyRequest{value: val, isSet: true}
}
func (v NullableAddKeyRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAddKeyRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,161 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// AddNode200ResponseInner struct for AddNode200ResponseInner
type AddNode200ResponseInner struct {
Success *bool `json:"success,omitempty"`
Error NullableString `json:"error,omitempty"`
}
// NewAddNode200ResponseInner instantiates a new AddNode200ResponseInner object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewAddNode200ResponseInner() *AddNode200ResponseInner {
this := AddNode200ResponseInner{}
return &this
}
// NewAddNode200ResponseInnerWithDefaults instantiates a new AddNode200ResponseInner object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewAddNode200ResponseInnerWithDefaults() *AddNode200ResponseInner {
this := AddNode200ResponseInner{}
return &this
}
// GetSuccess returns the Success field value if set, zero value otherwise.
func (o *AddNode200ResponseInner) GetSuccess() bool {
if o == nil || o.Success == nil {
var ret bool
return ret
}
return *o.Success
}
// GetSuccessOk returns a tuple with the Success field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AddNode200ResponseInner) GetSuccessOk() (*bool, bool) {
if o == nil || o.Success == nil {
return nil, false
}
return o.Success, true
}
// HasSuccess returns a boolean if a field has been set.
func (o *AddNode200ResponseInner) HasSuccess() bool {
if o != nil && o.Success != nil {
return true
}
return false
}
// SetSuccess gets a reference to the given bool and assigns it to the Success field.
func (o *AddNode200ResponseInner) SetSuccess(v bool) {
o.Success = &v
}
// GetError returns the Error field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AddNode200ResponseInner) GetError() string {
if o == nil || o.Error.Get() == nil {
var ret string
return ret
}
return *o.Error.Get()
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *AddNode200ResponseInner) GetErrorOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Error.Get(), o.Error.IsSet()
}
// HasError returns a boolean if a field has been set.
func (o *AddNode200ResponseInner) HasError() bool {
if o != nil && o.Error.IsSet() {
return true
}
return false
}
// SetError gets a reference to the given NullableString and assigns it to the Error field.
func (o *AddNode200ResponseInner) SetError(v string) {
o.Error.Set(&v)
}
// SetErrorNil sets the value for Error to be an explicit nil
func (o *AddNode200ResponseInner) SetErrorNil() {
o.Error.Set(nil)
}
// UnsetError ensures that no value is present for Error, not even an explicit nil
func (o *AddNode200ResponseInner) UnsetError() {
o.Error.Unset()
}
func (o AddNode200ResponseInner) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Success != nil {
toSerialize["success"] = o.Success
}
if o.Error.IsSet() {
toSerialize["error"] = o.Error.Get()
}
return json.Marshal(toSerialize)
}
type NullableAddNode200ResponseInner struct {
value *AddNode200ResponseInner
isSet bool
}
func (v NullableAddNode200ResponseInner) Get() *AddNode200ResponseInner {
return v.value
}
func (v *NullableAddNode200ResponseInner) Set(val *AddNode200ResponseInner) {
v.value = val
v.isSet = true
}
func (v NullableAddNode200ResponseInner) IsSet() bool {
return v.isSet
}
func (v *NullableAddNode200ResponseInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAddNode200ResponseInner(val *AddNode200ResponseInner) *NullableAddNode200ResponseInner {
return &NullableAddNode200ResponseInner{value: val, isSet: true}
}
func (v NullableAddNode200ResponseInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAddNode200ResponseInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,166 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// AllowBucketKeyRequest struct for AllowBucketKeyRequest
type AllowBucketKeyRequest struct {
BucketId string `json:"bucketId"`
AccessKeyId string `json:"accessKeyId"`
Permissions AllowBucketKeyRequestPermissions `json:"permissions"`
}
// NewAllowBucketKeyRequest instantiates a new AllowBucketKeyRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewAllowBucketKeyRequest(bucketId string, accessKeyId string, permissions AllowBucketKeyRequestPermissions) *AllowBucketKeyRequest {
this := AllowBucketKeyRequest{}
this.BucketId = bucketId
this.AccessKeyId = accessKeyId
this.Permissions = permissions
return &this
}
// NewAllowBucketKeyRequestWithDefaults instantiates a new AllowBucketKeyRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewAllowBucketKeyRequestWithDefaults() *AllowBucketKeyRequest {
this := AllowBucketKeyRequest{}
return &this
}
// GetBucketId returns the BucketId field value
func (o *AllowBucketKeyRequest) GetBucketId() string {
if o == nil {
var ret string
return ret
}
return o.BucketId
}
// GetBucketIdOk returns a tuple with the BucketId field value
// and a boolean to check if the value has been set.
func (o *AllowBucketKeyRequest) GetBucketIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.BucketId, true
}
// SetBucketId sets field value
func (o *AllowBucketKeyRequest) SetBucketId(v string) {
o.BucketId = v
}
// GetAccessKeyId returns the AccessKeyId field value
func (o *AllowBucketKeyRequest) GetAccessKeyId() string {
if o == nil {
var ret string
return ret
}
return o.AccessKeyId
}
// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value
// and a boolean to check if the value has been set.
func (o *AllowBucketKeyRequest) GetAccessKeyIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.AccessKeyId, true
}
// SetAccessKeyId sets field value
func (o *AllowBucketKeyRequest) SetAccessKeyId(v string) {
o.AccessKeyId = v
}
// GetPermissions returns the Permissions field value
func (o *AllowBucketKeyRequest) GetPermissions() AllowBucketKeyRequestPermissions {
if o == nil {
var ret AllowBucketKeyRequestPermissions
return ret
}
return o.Permissions
}
// GetPermissionsOk returns a tuple with the Permissions field value
// and a boolean to check if the value has been set.
func (o *AllowBucketKeyRequest) GetPermissionsOk() (*AllowBucketKeyRequestPermissions, bool) {
if o == nil {
return nil, false
}
return &o.Permissions, true
}
// SetPermissions sets field value
func (o *AllowBucketKeyRequest) SetPermissions(v AllowBucketKeyRequestPermissions) {
o.Permissions = v
}
func (o AllowBucketKeyRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["bucketId"] = o.BucketId
}
if true {
toSerialize["accessKeyId"] = o.AccessKeyId
}
if true {
toSerialize["permissions"] = o.Permissions
}
return json.Marshal(toSerialize)
}
type NullableAllowBucketKeyRequest struct {
value *AllowBucketKeyRequest
isSet bool
}
func (v NullableAllowBucketKeyRequest) Get() *AllowBucketKeyRequest {
return v.value
}
func (v *NullableAllowBucketKeyRequest) Set(val *AllowBucketKeyRequest) {
v.value = val
v.isSet = true
}
func (v NullableAllowBucketKeyRequest) IsSet() bool {
return v.isSet
}
func (v *NullableAllowBucketKeyRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAllowBucketKeyRequest(val *AllowBucketKeyRequest) *NullableAllowBucketKeyRequest {
return &NullableAllowBucketKeyRequest{value: val, isSet: true}
}
func (v NullableAllowBucketKeyRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAllowBucketKeyRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,166 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// AllowBucketKeyRequestPermissions struct for AllowBucketKeyRequestPermissions
type AllowBucketKeyRequestPermissions struct {
Read bool `json:"read"`
Write bool `json:"write"`
Owner bool `json:"owner"`
}
// NewAllowBucketKeyRequestPermissions instantiates a new AllowBucketKeyRequestPermissions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewAllowBucketKeyRequestPermissions(read bool, write bool, owner bool) *AllowBucketKeyRequestPermissions {
this := AllowBucketKeyRequestPermissions{}
this.Read = read
this.Write = write
this.Owner = owner
return &this
}
// NewAllowBucketKeyRequestPermissionsWithDefaults instantiates a new AllowBucketKeyRequestPermissions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewAllowBucketKeyRequestPermissionsWithDefaults() *AllowBucketKeyRequestPermissions {
this := AllowBucketKeyRequestPermissions{}
return &this
}
// GetRead returns the Read field value
func (o *AllowBucketKeyRequestPermissions) GetRead() bool {
if o == nil {
var ret bool
return ret
}
return o.Read
}
// GetReadOk returns a tuple with the Read field value
// and a boolean to check if the value has been set.
func (o *AllowBucketKeyRequestPermissions) GetReadOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Read, true
}
// SetRead sets field value
func (o *AllowBucketKeyRequestPermissions) SetRead(v bool) {
o.Read = v
}
// GetWrite returns the Write field value
func (o *AllowBucketKeyRequestPermissions) GetWrite() bool {
if o == nil {
var ret bool
return ret
}
return o.Write
}
// GetWriteOk returns a tuple with the Write field value
// and a boolean to check if the value has been set.
func (o *AllowBucketKeyRequestPermissions) GetWriteOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Write, true
}
// SetWrite sets field value
func (o *AllowBucketKeyRequestPermissions) SetWrite(v bool) {
o.Write = v
}
// GetOwner returns the Owner field value
func (o *AllowBucketKeyRequestPermissions) GetOwner() bool {
if o == nil {
var ret bool
return ret
}
return o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value
// and a boolean to check if the value has been set.
func (o *AllowBucketKeyRequestPermissions) GetOwnerOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Owner, true
}
// SetOwner sets field value
func (o *AllowBucketKeyRequestPermissions) SetOwner(v bool) {
o.Owner = v
}
func (o AllowBucketKeyRequestPermissions) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["read"] = o.Read
}
if true {
toSerialize["write"] = o.Write
}
if true {
toSerialize["owner"] = o.Owner
}
return json.Marshal(toSerialize)
}
type NullableAllowBucketKeyRequestPermissions struct {
value *AllowBucketKeyRequestPermissions
isSet bool
}
func (v NullableAllowBucketKeyRequestPermissions) Get() *AllowBucketKeyRequestPermissions {
return v.value
}
func (v *NullableAllowBucketKeyRequestPermissions) Set(val *AllowBucketKeyRequestPermissions) {
v.value = val
v.isSet = true
}
func (v NullableAllowBucketKeyRequestPermissions) IsSet() bool {
return v.isSet
}
func (v *NullableAllowBucketKeyRequestPermissions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAllowBucketKeyRequestPermissions(val *AllowBucketKeyRequestPermissions) *NullableAllowBucketKeyRequestPermissions {
return &NullableAllowBucketKeyRequestPermissions{value: val, isSet: true}
}
func (v NullableAllowBucketKeyRequestPermissions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAllowBucketKeyRequestPermissions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

413
golang/model_bucket_info.go Normal file
View file

@ -0,0 +1,413 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// BucketInfo struct for BucketInfo
type BucketInfo struct {
Id *string `json:"id,omitempty"`
GlobalAliases []string `json:"globalAliases,omitempty"`
WebsiteAccess *bool `json:"websiteAccess,omitempty"`
WebsiteConfig NullableBucketInfoWebsiteConfig `json:"websiteConfig,omitempty"`
Keys []BucketKeyInfo `json:"keys,omitempty"`
Objects *int32 `json:"objects,omitempty"`
Bytes *int32 `json:"bytes,omitempty"`
UnfinishedUploads *int32 `json:"unfinishedUploads,omitempty"`
Quotas *BucketInfoQuotas `json:"quotas,omitempty"`
}
// NewBucketInfo instantiates a new BucketInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBucketInfo() *BucketInfo {
this := BucketInfo{}
return &this
}
// NewBucketInfoWithDefaults instantiates a new BucketInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBucketInfoWithDefaults() *BucketInfo {
this := BucketInfo{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BucketInfo) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *BucketInfo) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *BucketInfo) SetId(v string) {
o.Id = &v
}
// GetGlobalAliases returns the GlobalAliases field value if set, zero value otherwise.
func (o *BucketInfo) GetGlobalAliases() []string {
if o == nil || o.GlobalAliases == nil {
var ret []string
return ret
}
return o.GlobalAliases
}
// GetGlobalAliasesOk returns a tuple with the GlobalAliases field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetGlobalAliasesOk() ([]string, bool) {
if o == nil || o.GlobalAliases == nil {
return nil, false
}
return o.GlobalAliases, true
}
// HasGlobalAliases returns a boolean if a field has been set.
func (o *BucketInfo) HasGlobalAliases() bool {
if o != nil && o.GlobalAliases != nil {
return true
}
return false
}
// SetGlobalAliases gets a reference to the given []string and assigns it to the GlobalAliases field.
func (o *BucketInfo) SetGlobalAliases(v []string) {
o.GlobalAliases = v
}
// GetWebsiteAccess returns the WebsiteAccess field value if set, zero value otherwise.
func (o *BucketInfo) GetWebsiteAccess() bool {
if o == nil || o.WebsiteAccess == nil {
var ret bool
return ret
}
return *o.WebsiteAccess
}
// GetWebsiteAccessOk returns a tuple with the WebsiteAccess field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetWebsiteAccessOk() (*bool, bool) {
if o == nil || o.WebsiteAccess == nil {
return nil, false
}
return o.WebsiteAccess, true
}
// HasWebsiteAccess returns a boolean if a field has been set.
func (o *BucketInfo) HasWebsiteAccess() bool {
if o != nil && o.WebsiteAccess != nil {
return true
}
return false
}
// SetWebsiteAccess gets a reference to the given bool and assigns it to the WebsiteAccess field.
func (o *BucketInfo) SetWebsiteAccess(v bool) {
o.WebsiteAccess = &v
}
// GetWebsiteConfig returns the WebsiteConfig field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BucketInfo) GetWebsiteConfig() BucketInfoWebsiteConfig {
if o == nil || o.WebsiteConfig.Get() == nil {
var ret BucketInfoWebsiteConfig
return ret
}
return *o.WebsiteConfig.Get()
}
// GetWebsiteConfigOk returns a tuple with the WebsiteConfig field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BucketInfo) GetWebsiteConfigOk() (*BucketInfoWebsiteConfig, bool) {
if o == nil {
return nil, false
}
return o.WebsiteConfig.Get(), o.WebsiteConfig.IsSet()
}
// HasWebsiteConfig returns a boolean if a field has been set.
func (o *BucketInfo) HasWebsiteConfig() bool {
if o != nil && o.WebsiteConfig.IsSet() {
return true
}
return false
}
// SetWebsiteConfig gets a reference to the given NullableBucketInfoWebsiteConfig and assigns it to the WebsiteConfig field.
func (o *BucketInfo) SetWebsiteConfig(v BucketInfoWebsiteConfig) {
o.WebsiteConfig.Set(&v)
}
// SetWebsiteConfigNil sets the value for WebsiteConfig to be an explicit nil
func (o *BucketInfo) SetWebsiteConfigNil() {
o.WebsiteConfig.Set(nil)
}
// UnsetWebsiteConfig ensures that no value is present for WebsiteConfig, not even an explicit nil
func (o *BucketInfo) UnsetWebsiteConfig() {
o.WebsiteConfig.Unset()
}
// GetKeys returns the Keys field value if set, zero value otherwise.
func (o *BucketInfo) GetKeys() []BucketKeyInfo {
if o == nil || o.Keys == nil {
var ret []BucketKeyInfo
return ret
}
return o.Keys
}
// GetKeysOk returns a tuple with the Keys field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetKeysOk() ([]BucketKeyInfo, bool) {
if o == nil || o.Keys == nil {
return nil, false
}
return o.Keys, true
}
// HasKeys returns a boolean if a field has been set.
func (o *BucketInfo) HasKeys() bool {
if o != nil && o.Keys != nil {
return true
}
return false
}
// SetKeys gets a reference to the given []BucketKeyInfo and assigns it to the Keys field.
func (o *BucketInfo) SetKeys(v []BucketKeyInfo) {
o.Keys = v
}
// GetObjects returns the Objects field value if set, zero value otherwise.
func (o *BucketInfo) GetObjects() int32 {
if o == nil || o.Objects == nil {
var ret int32
return ret
}
return *o.Objects
}
// GetObjectsOk returns a tuple with the Objects field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetObjectsOk() (*int32, bool) {
if o == nil || o.Objects == nil {
return nil, false
}
return o.Objects, true
}
// HasObjects returns a boolean if a field has been set.
func (o *BucketInfo) HasObjects() bool {
if o != nil && o.Objects != nil {
return true
}
return false
}
// SetObjects gets a reference to the given int32 and assigns it to the Objects field.
func (o *BucketInfo) SetObjects(v int32) {
o.Objects = &v
}
// GetBytes returns the Bytes field value if set, zero value otherwise.
func (o *BucketInfo) GetBytes() int32 {
if o == nil || o.Bytes == nil {
var ret int32
return ret
}
return *o.Bytes
}
// GetBytesOk returns a tuple with the Bytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetBytesOk() (*int32, bool) {
if o == nil || o.Bytes == nil {
return nil, false
}
return o.Bytes, true
}
// HasBytes returns a boolean if a field has been set.
func (o *BucketInfo) HasBytes() bool {
if o != nil && o.Bytes != nil {
return true
}
return false
}
// SetBytes gets a reference to the given int32 and assigns it to the Bytes field.
func (o *BucketInfo) SetBytes(v int32) {
o.Bytes = &v
}
// GetUnfinishedUploads returns the UnfinishedUploads field value if set, zero value otherwise.
func (o *BucketInfo) GetUnfinishedUploads() int32 {
if o == nil || o.UnfinishedUploads == nil {
var ret int32
return ret
}
return *o.UnfinishedUploads
}
// GetUnfinishedUploadsOk returns a tuple with the UnfinishedUploads field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetUnfinishedUploadsOk() (*int32, bool) {
if o == nil || o.UnfinishedUploads == nil {
return nil, false
}
return o.UnfinishedUploads, true
}
// HasUnfinishedUploads returns a boolean if a field has been set.
func (o *BucketInfo) HasUnfinishedUploads() bool {
if o != nil && o.UnfinishedUploads != nil {
return true
}
return false
}
// SetUnfinishedUploads gets a reference to the given int32 and assigns it to the UnfinishedUploads field.
func (o *BucketInfo) SetUnfinishedUploads(v int32) {
o.UnfinishedUploads = &v
}
// GetQuotas returns the Quotas field value if set, zero value otherwise.
func (o *BucketInfo) GetQuotas() BucketInfoQuotas {
if o == nil || o.Quotas == nil {
var ret BucketInfoQuotas
return ret
}
return *o.Quotas
}
// GetQuotasOk returns a tuple with the Quotas field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetQuotasOk() (*BucketInfoQuotas, bool) {
if o == nil || o.Quotas == nil {
return nil, false
}
return o.Quotas, true
}
// HasQuotas returns a boolean if a field has been set.
func (o *BucketInfo) HasQuotas() bool {
if o != nil && o.Quotas != nil {
return true
}
return false
}
// SetQuotas gets a reference to the given BucketInfoQuotas and assigns it to the Quotas field.
func (o *BucketInfo) SetQuotas(v BucketInfoQuotas) {
o.Quotas = &v
}
func (o BucketInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.GlobalAliases != nil {
toSerialize["globalAliases"] = o.GlobalAliases
}
if o.WebsiteAccess != nil {
toSerialize["websiteAccess"] = o.WebsiteAccess
}
if o.WebsiteConfig.IsSet() {
toSerialize["websiteConfig"] = o.WebsiteConfig.Get()
}
if o.Keys != nil {
toSerialize["keys"] = o.Keys
}
if o.Objects != nil {
toSerialize["objects"] = o.Objects
}
if o.Bytes != nil {
toSerialize["bytes"] = o.Bytes
}
if o.UnfinishedUploads != nil {
toSerialize["unfinishedUploads"] = o.UnfinishedUploads
}
if o.Quotas != nil {
toSerialize["quotas"] = o.Quotas
}
return json.Marshal(toSerialize)
}
type NullableBucketInfo struct {
value *BucketInfo
isSet bool
}
func (v NullableBucketInfo) Get() *BucketInfo {
return v.value
}
func (v *NullableBucketInfo) Set(val *BucketInfo) {
v.value = val
v.isSet = true
}
func (v NullableBucketInfo) IsSet() bool {
return v.isSet
}
func (v *NullableBucketInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBucketInfo(val *BucketInfo) *NullableBucketInfo {
return &NullableBucketInfo{value: val, isSet: true}
}
func (v NullableBucketInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBucketInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,171 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// BucketInfoQuotas struct for BucketInfoQuotas
type BucketInfoQuotas struct {
MaxSize NullableInt32 `json:"maxSize,omitempty"`
MaxObjects NullableInt32 `json:"maxObjects,omitempty"`
}
// NewBucketInfoQuotas instantiates a new BucketInfoQuotas object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBucketInfoQuotas() *BucketInfoQuotas {
this := BucketInfoQuotas{}
return &this
}
// NewBucketInfoQuotasWithDefaults instantiates a new BucketInfoQuotas object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBucketInfoQuotasWithDefaults() *BucketInfoQuotas {
this := BucketInfoQuotas{}
return &this
}
// GetMaxSize returns the MaxSize field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BucketInfoQuotas) GetMaxSize() int32 {
if o == nil || o.MaxSize.Get() == nil {
var ret int32
return ret
}
return *o.MaxSize.Get()
}
// GetMaxSizeOk returns a tuple with the MaxSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BucketInfoQuotas) GetMaxSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.MaxSize.Get(), o.MaxSize.IsSet()
}
// HasMaxSize returns a boolean if a field has been set.
func (o *BucketInfoQuotas) HasMaxSize() bool {
if o != nil && o.MaxSize.IsSet() {
return true
}
return false
}
// SetMaxSize gets a reference to the given NullableInt32 and assigns it to the MaxSize field.
func (o *BucketInfoQuotas) SetMaxSize(v int32) {
o.MaxSize.Set(&v)
}
// SetMaxSizeNil sets the value for MaxSize to be an explicit nil
func (o *BucketInfoQuotas) SetMaxSizeNil() {
o.MaxSize.Set(nil)
}
// UnsetMaxSize ensures that no value is present for MaxSize, not even an explicit nil
func (o *BucketInfoQuotas) UnsetMaxSize() {
o.MaxSize.Unset()
}
// GetMaxObjects returns the MaxObjects field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BucketInfoQuotas) GetMaxObjects() int32 {
if o == nil || o.MaxObjects.Get() == nil {
var ret int32
return ret
}
return *o.MaxObjects.Get()
}
// GetMaxObjectsOk returns a tuple with the MaxObjects field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *BucketInfoQuotas) GetMaxObjectsOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.MaxObjects.Get(), o.MaxObjects.IsSet()
}
// HasMaxObjects returns a boolean if a field has been set.
func (o *BucketInfoQuotas) HasMaxObjects() bool {
if o != nil && o.MaxObjects.IsSet() {
return true
}
return false
}
// SetMaxObjects gets a reference to the given NullableInt32 and assigns it to the MaxObjects field.
func (o *BucketInfoQuotas) SetMaxObjects(v int32) {
o.MaxObjects.Set(&v)
}
// SetMaxObjectsNil sets the value for MaxObjects to be an explicit nil
func (o *BucketInfoQuotas) SetMaxObjectsNil() {
o.MaxObjects.Set(nil)
}
// UnsetMaxObjects ensures that no value is present for MaxObjects, not even an explicit nil
func (o *BucketInfoQuotas) UnsetMaxObjects() {
o.MaxObjects.Unset()
}
func (o BucketInfoQuotas) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.MaxSize.IsSet() {
toSerialize["maxSize"] = o.MaxSize.Get()
}
if o.MaxObjects.IsSet() {
toSerialize["maxObjects"] = o.MaxObjects.Get()
}
return json.Marshal(toSerialize)
}
type NullableBucketInfoQuotas struct {
value *BucketInfoQuotas
isSet bool
}
func (v NullableBucketInfoQuotas) Get() *BucketInfoQuotas {
return v.value
}
func (v *NullableBucketInfoQuotas) Set(val *BucketInfoQuotas) {
v.value = val
v.isSet = true
}
func (v NullableBucketInfoQuotas) IsSet() bool {
return v.isSet
}
func (v *NullableBucketInfoQuotas) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBucketInfoQuotas(val *BucketInfoQuotas) *NullableBucketInfoQuotas {
return &NullableBucketInfoQuotas{value: val, isSet: true}
}
func (v NullableBucketInfoQuotas) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBucketInfoQuotas) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,151 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// BucketInfoWebsiteConfig struct for BucketInfoWebsiteConfig
type BucketInfoWebsiteConfig struct {
IndexDocument *string `json:"indexDocument,omitempty"`
ErrorDocument *string `json:"errorDocument,omitempty"`
}
// NewBucketInfoWebsiteConfig instantiates a new BucketInfoWebsiteConfig object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBucketInfoWebsiteConfig() *BucketInfoWebsiteConfig {
this := BucketInfoWebsiteConfig{}
return &this
}
// NewBucketInfoWebsiteConfigWithDefaults instantiates a new BucketInfoWebsiteConfig object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBucketInfoWebsiteConfigWithDefaults() *BucketInfoWebsiteConfig {
this := BucketInfoWebsiteConfig{}
return &this
}
// GetIndexDocument returns the IndexDocument field value if set, zero value otherwise.
func (o *BucketInfoWebsiteConfig) GetIndexDocument() string {
if o == nil || o.IndexDocument == nil {
var ret string
return ret
}
return *o.IndexDocument
}
// GetIndexDocumentOk returns a tuple with the IndexDocument field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfoWebsiteConfig) GetIndexDocumentOk() (*string, bool) {
if o == nil || o.IndexDocument == nil {
return nil, false
}
return o.IndexDocument, true
}
// HasIndexDocument returns a boolean if a field has been set.
func (o *BucketInfoWebsiteConfig) HasIndexDocument() bool {
if o != nil && o.IndexDocument != nil {
return true
}
return false
}
// SetIndexDocument gets a reference to the given string and assigns it to the IndexDocument field.
func (o *BucketInfoWebsiteConfig) SetIndexDocument(v string) {
o.IndexDocument = &v
}
// GetErrorDocument returns the ErrorDocument field value if set, zero value otherwise.
func (o *BucketInfoWebsiteConfig) GetErrorDocument() string {
if o == nil || o.ErrorDocument == nil {
var ret string
return ret
}
return *o.ErrorDocument
}
// GetErrorDocumentOk returns a tuple with the ErrorDocument field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfoWebsiteConfig) GetErrorDocumentOk() (*string, bool) {
if o == nil || o.ErrorDocument == nil {
return nil, false
}
return o.ErrorDocument, true
}
// HasErrorDocument returns a boolean if a field has been set.
func (o *BucketInfoWebsiteConfig) HasErrorDocument() bool {
if o != nil && o.ErrorDocument != nil {
return true
}
return false
}
// SetErrorDocument gets a reference to the given string and assigns it to the ErrorDocument field.
func (o *BucketInfoWebsiteConfig) SetErrorDocument(v string) {
o.ErrorDocument = &v
}
func (o BucketInfoWebsiteConfig) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.IndexDocument != nil {
toSerialize["indexDocument"] = o.IndexDocument
}
if o.ErrorDocument != nil {
toSerialize["errorDocument"] = o.ErrorDocument
}
return json.Marshal(toSerialize)
}
type NullableBucketInfoWebsiteConfig struct {
value *BucketInfoWebsiteConfig
isSet bool
}
func (v NullableBucketInfoWebsiteConfig) Get() *BucketInfoWebsiteConfig {
return v.value
}
func (v *NullableBucketInfoWebsiteConfig) Set(val *BucketInfoWebsiteConfig) {
v.value = val
v.isSet = true
}
func (v NullableBucketInfoWebsiteConfig) IsSet() bool {
return v.isSet
}
func (v *NullableBucketInfoWebsiteConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBucketInfoWebsiteConfig(val *BucketInfoWebsiteConfig) *NullableBucketInfoWebsiteConfig {
return &NullableBucketInfoWebsiteConfig{value: val, isSet: true}
}
func (v NullableBucketInfoWebsiteConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBucketInfoWebsiteConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,223 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// BucketKeyInfo struct for BucketKeyInfo
type BucketKeyInfo struct {
AccessKeyId *string `json:"accessKeyId,omitempty"`
Name *string `json:"name,omitempty"`
Permissions *CreateBucketRequestLocalAliasAllow `json:"permissions,omitempty"`
BucketLocalAliases []string `json:"bucketLocalAliases,omitempty"`
}
// NewBucketKeyInfo instantiates a new BucketKeyInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBucketKeyInfo() *BucketKeyInfo {
this := BucketKeyInfo{}
return &this
}
// NewBucketKeyInfoWithDefaults instantiates a new BucketKeyInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBucketKeyInfoWithDefaults() *BucketKeyInfo {
this := BucketKeyInfo{}
return &this
}
// GetAccessKeyId returns the AccessKeyId field value if set, zero value otherwise.
func (o *BucketKeyInfo) GetAccessKeyId() string {
if o == nil || o.AccessKeyId == nil {
var ret string
return ret
}
return *o.AccessKeyId
}
// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketKeyInfo) GetAccessKeyIdOk() (*string, bool) {
if o == nil || o.AccessKeyId == nil {
return nil, false
}
return o.AccessKeyId, true
}
// HasAccessKeyId returns a boolean if a field has been set.
func (o *BucketKeyInfo) HasAccessKeyId() bool {
if o != nil && o.AccessKeyId != nil {
return true
}
return false
}
// SetAccessKeyId gets a reference to the given string and assigns it to the AccessKeyId field.
func (o *BucketKeyInfo) SetAccessKeyId(v string) {
o.AccessKeyId = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *BucketKeyInfo) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketKeyInfo) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *BucketKeyInfo) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *BucketKeyInfo) SetName(v string) {
o.Name = &v
}
// GetPermissions returns the Permissions field value if set, zero value otherwise.
func (o *BucketKeyInfo) GetPermissions() CreateBucketRequestLocalAliasAllow {
if o == nil || o.Permissions == nil {
var ret CreateBucketRequestLocalAliasAllow
return ret
}
return *o.Permissions
}
// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketKeyInfo) GetPermissionsOk() (*CreateBucketRequestLocalAliasAllow, bool) {
if o == nil || o.Permissions == nil {
return nil, false
}
return o.Permissions, true
}
// HasPermissions returns a boolean if a field has been set.
func (o *BucketKeyInfo) HasPermissions() bool {
if o != nil && o.Permissions != nil {
return true
}
return false
}
// SetPermissions gets a reference to the given CreateBucketRequestLocalAliasAllow and assigns it to the Permissions field.
func (o *BucketKeyInfo) SetPermissions(v CreateBucketRequestLocalAliasAllow) {
o.Permissions = &v
}
// GetBucketLocalAliases returns the BucketLocalAliases field value if set, zero value otherwise.
func (o *BucketKeyInfo) GetBucketLocalAliases() []string {
if o == nil || o.BucketLocalAliases == nil {
var ret []string
return ret
}
return o.BucketLocalAliases
}
// GetBucketLocalAliasesOk returns a tuple with the BucketLocalAliases field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketKeyInfo) GetBucketLocalAliasesOk() ([]string, bool) {
if o == nil || o.BucketLocalAliases == nil {
return nil, false
}
return o.BucketLocalAliases, true
}
// HasBucketLocalAliases returns a boolean if a field has been set.
func (o *BucketKeyInfo) HasBucketLocalAliases() bool {
if o != nil && o.BucketLocalAliases != nil {
return true
}
return false
}
// SetBucketLocalAliases gets a reference to the given []string and assigns it to the BucketLocalAliases field.
func (o *BucketKeyInfo) SetBucketLocalAliases(v []string) {
o.BucketLocalAliases = v
}
func (o BucketKeyInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.AccessKeyId != nil {
toSerialize["accessKeyId"] = o.AccessKeyId
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.Permissions != nil {
toSerialize["permissions"] = o.Permissions
}
if o.BucketLocalAliases != nil {
toSerialize["bucketLocalAliases"] = o.BucketLocalAliases
}
return json.Marshal(toSerialize)
}
type NullableBucketKeyInfo struct {
value *BucketKeyInfo
isSet bool
}
func (v NullableBucketKeyInfo) Get() *BucketKeyInfo {
return v.value
}
func (v *NullableBucketKeyInfo) Set(val *BucketKeyInfo) {
v.value = val
v.isSet = true
}
func (v NullableBucketKeyInfo) IsSet() bool {
return v.isSet
}
func (v *NullableBucketKeyInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBucketKeyInfo(val *BucketKeyInfo) *NullableBucketKeyInfo {
return &NullableBucketKeyInfo{value: val, isSet: true}
}
func (v NullableBucketKeyInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBucketKeyInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,166 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// ClusterLayout struct for ClusterLayout
type ClusterLayout struct {
Version int32 `json:"version"`
Roles map[string]NodeClusterInfo `json:"roles"`
StagedRoleChanges map[string]NodeClusterInfo `json:"stagedRoleChanges"`
}
// NewClusterLayout instantiates a new ClusterLayout object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewClusterLayout(version int32, roles map[string]NodeClusterInfo, stagedRoleChanges map[string]NodeClusterInfo) *ClusterLayout {
this := ClusterLayout{}
this.Version = version
this.Roles = roles
this.StagedRoleChanges = stagedRoleChanges
return &this
}
// NewClusterLayoutWithDefaults instantiates a new ClusterLayout object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewClusterLayoutWithDefaults() *ClusterLayout {
this := ClusterLayout{}
return &this
}
// GetVersion returns the Version field value
func (o *ClusterLayout) GetVersion() int32 {
if o == nil {
var ret int32
return ret
}
return o.Version
}
// GetVersionOk returns a tuple with the Version field value
// and a boolean to check if the value has been set.
func (o *ClusterLayout) GetVersionOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Version, true
}
// SetVersion sets field value
func (o *ClusterLayout) SetVersion(v int32) {
o.Version = v
}
// GetRoles returns the Roles field value
func (o *ClusterLayout) GetRoles() map[string]NodeClusterInfo {
if o == nil {
var ret map[string]NodeClusterInfo
return ret
}
return o.Roles
}
// GetRolesOk returns a tuple with the Roles field value
// and a boolean to check if the value has been set.
func (o *ClusterLayout) GetRolesOk() (*map[string]NodeClusterInfo, bool) {
if o == nil {
return nil, false
}
return &o.Roles, true
}
// SetRoles sets field value
func (o *ClusterLayout) SetRoles(v map[string]NodeClusterInfo) {
o.Roles = v
}
// GetStagedRoleChanges returns the StagedRoleChanges field value
func (o *ClusterLayout) GetStagedRoleChanges() map[string]NodeClusterInfo {
if o == nil {
var ret map[string]NodeClusterInfo
return ret
}
return o.StagedRoleChanges
}
// GetStagedRoleChangesOk returns a tuple with the StagedRoleChanges field value
// and a boolean to check if the value has been set.
func (o *ClusterLayout) GetStagedRoleChangesOk() (*map[string]NodeClusterInfo, bool) {
if o == nil {
return nil, false
}
return &o.StagedRoleChanges, true
}
// SetStagedRoleChanges sets field value
func (o *ClusterLayout) SetStagedRoleChanges(v map[string]NodeClusterInfo) {
o.StagedRoleChanges = v
}
func (o ClusterLayout) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["version"] = o.Version
}
if true {
toSerialize["roles"] = o.Roles
}
if true {
toSerialize["stagedRoleChanges"] = o.StagedRoleChanges
}
return json.Marshal(toSerialize)
}
type NullableClusterLayout struct {
value *ClusterLayout
isSet bool
}
func (v NullableClusterLayout) Get() *ClusterLayout {
return v.value
}
func (v *NullableClusterLayout) Set(val *ClusterLayout) {
v.value = val
v.isSet = true
}
func (v NullableClusterLayout) IsSet() bool {
return v.isSet
}
func (v *NullableClusterLayout) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableClusterLayout(val *ClusterLayout) *NullableClusterLayout {
return &NullableClusterLayout{value: val, isSet: true}
}
func (v NullableClusterLayout) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableClusterLayout) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,151 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// CreateBucketRequest struct for CreateBucketRequest
type CreateBucketRequest struct {
GlobalAlias *string `json:"globalAlias,omitempty"`
LocalAlias *CreateBucketRequestLocalAlias `json:"localAlias,omitempty"`
}
// NewCreateBucketRequest instantiates a new CreateBucketRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateBucketRequest() *CreateBucketRequest {
this := CreateBucketRequest{}
return &this
}
// NewCreateBucketRequestWithDefaults instantiates a new CreateBucketRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateBucketRequestWithDefaults() *CreateBucketRequest {
this := CreateBucketRequest{}
return &this
}
// GetGlobalAlias returns the GlobalAlias field value if set, zero value otherwise.
func (o *CreateBucketRequest) GetGlobalAlias() string {
if o == nil || o.GlobalAlias == nil {
var ret string
return ret
}
return *o.GlobalAlias
}
// GetGlobalAliasOk returns a tuple with the GlobalAlias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateBucketRequest) GetGlobalAliasOk() (*string, bool) {
if o == nil || o.GlobalAlias == nil {
return nil, false
}
return o.GlobalAlias, true
}
// HasGlobalAlias returns a boolean if a field has been set.
func (o *CreateBucketRequest) HasGlobalAlias() bool {
if o != nil && o.GlobalAlias != nil {
return true
}
return false
}
// SetGlobalAlias gets a reference to the given string and assigns it to the GlobalAlias field.
func (o *CreateBucketRequest) SetGlobalAlias(v string) {
o.GlobalAlias = &v
}
// GetLocalAlias returns the LocalAlias field value if set, zero value otherwise.
func (o *CreateBucketRequest) GetLocalAlias() CreateBucketRequestLocalAlias {
if o == nil || o.LocalAlias == nil {
var ret CreateBucketRequestLocalAlias
return ret
}
return *o.LocalAlias
}
// GetLocalAliasOk returns a tuple with the LocalAlias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateBucketRequest) GetLocalAliasOk() (*CreateBucketRequestLocalAlias, bool) {
if o == nil || o.LocalAlias == nil {
return nil, false
}
return o.LocalAlias, true
}
// HasLocalAlias returns a boolean if a field has been set.
func (o *CreateBucketRequest) HasLocalAlias() bool {
if o != nil && o.LocalAlias != nil {
return true
}
return false
}
// SetLocalAlias gets a reference to the given CreateBucketRequestLocalAlias and assigns it to the LocalAlias field.
func (o *CreateBucketRequest) SetLocalAlias(v CreateBucketRequestLocalAlias) {
o.LocalAlias = &v
}
func (o CreateBucketRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.GlobalAlias != nil {
toSerialize["globalAlias"] = o.GlobalAlias
}
if o.LocalAlias != nil {
toSerialize["localAlias"] = o.LocalAlias
}
return json.Marshal(toSerialize)
}
type NullableCreateBucketRequest struct {
value *CreateBucketRequest
isSet bool
}
func (v NullableCreateBucketRequest) Get() *CreateBucketRequest {
return v.value
}
func (v *NullableCreateBucketRequest) Set(val *CreateBucketRequest) {
v.value = val
v.isSet = true
}
func (v NullableCreateBucketRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCreateBucketRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateBucketRequest(val *CreateBucketRequest) *NullableCreateBucketRequest {
return &NullableCreateBucketRequest{value: val, isSet: true}
}
func (v NullableCreateBucketRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateBucketRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,187 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// CreateBucketRequestLocalAlias struct for CreateBucketRequestLocalAlias
type CreateBucketRequestLocalAlias struct {
AccessKeyId *string `json:"accessKeyId,omitempty"`
Alias *string `json:"alias,omitempty"`
Allow *CreateBucketRequestLocalAliasAllow `json:"allow,omitempty"`
}
// NewCreateBucketRequestLocalAlias instantiates a new CreateBucketRequestLocalAlias object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateBucketRequestLocalAlias() *CreateBucketRequestLocalAlias {
this := CreateBucketRequestLocalAlias{}
return &this
}
// NewCreateBucketRequestLocalAliasWithDefaults instantiates a new CreateBucketRequestLocalAlias object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateBucketRequestLocalAliasWithDefaults() *CreateBucketRequestLocalAlias {
this := CreateBucketRequestLocalAlias{}
return &this
}
// GetAccessKeyId returns the AccessKeyId field value if set, zero value otherwise.
func (o *CreateBucketRequestLocalAlias) GetAccessKeyId() string {
if o == nil || o.AccessKeyId == nil {
var ret string
return ret
}
return *o.AccessKeyId
}
// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateBucketRequestLocalAlias) GetAccessKeyIdOk() (*string, bool) {
if o == nil || o.AccessKeyId == nil {
return nil, false
}
return o.AccessKeyId, true
}
// HasAccessKeyId returns a boolean if a field has been set.
func (o *CreateBucketRequestLocalAlias) HasAccessKeyId() bool {
if o != nil && o.AccessKeyId != nil {
return true
}
return false
}
// SetAccessKeyId gets a reference to the given string and assigns it to the AccessKeyId field.
func (o *CreateBucketRequestLocalAlias) SetAccessKeyId(v string) {
o.AccessKeyId = &v
}
// GetAlias returns the Alias field value if set, zero value otherwise.
func (o *CreateBucketRequestLocalAlias) GetAlias() string {
if o == nil || o.Alias == nil {
var ret string
return ret
}
return *o.Alias
}
// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateBucketRequestLocalAlias) GetAliasOk() (*string, bool) {
if o == nil || o.Alias == nil {
return nil, false
}
return o.Alias, true
}
// HasAlias returns a boolean if a field has been set.
func (o *CreateBucketRequestLocalAlias) HasAlias() bool {
if o != nil && o.Alias != nil {
return true
}
return false
}
// SetAlias gets a reference to the given string and assigns it to the Alias field.
func (o *CreateBucketRequestLocalAlias) SetAlias(v string) {
o.Alias = &v
}
// GetAllow returns the Allow field value if set, zero value otherwise.
func (o *CreateBucketRequestLocalAlias) GetAllow() CreateBucketRequestLocalAliasAllow {
if o == nil || o.Allow == nil {
var ret CreateBucketRequestLocalAliasAllow
return ret
}
return *o.Allow
}
// GetAllowOk returns a tuple with the Allow field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateBucketRequestLocalAlias) GetAllowOk() (*CreateBucketRequestLocalAliasAllow, bool) {
if o == nil || o.Allow == nil {
return nil, false
}
return o.Allow, true
}
// HasAllow returns a boolean if a field has been set.
func (o *CreateBucketRequestLocalAlias) HasAllow() bool {
if o != nil && o.Allow != nil {
return true
}
return false
}
// SetAllow gets a reference to the given CreateBucketRequestLocalAliasAllow and assigns it to the Allow field.
func (o *CreateBucketRequestLocalAlias) SetAllow(v CreateBucketRequestLocalAliasAllow) {
o.Allow = &v
}
func (o CreateBucketRequestLocalAlias) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.AccessKeyId != nil {
toSerialize["accessKeyId"] = o.AccessKeyId
}
if o.Alias != nil {
toSerialize["alias"] = o.Alias
}
if o.Allow != nil {
toSerialize["allow"] = o.Allow
}
return json.Marshal(toSerialize)
}
type NullableCreateBucketRequestLocalAlias struct {
value *CreateBucketRequestLocalAlias
isSet bool
}
func (v NullableCreateBucketRequestLocalAlias) Get() *CreateBucketRequestLocalAlias {
return v.value
}
func (v *NullableCreateBucketRequestLocalAlias) Set(val *CreateBucketRequestLocalAlias) {
v.value = val
v.isSet = true
}
func (v NullableCreateBucketRequestLocalAlias) IsSet() bool {
return v.isSet
}
func (v *NullableCreateBucketRequestLocalAlias) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateBucketRequestLocalAlias(val *CreateBucketRequestLocalAlias) *NullableCreateBucketRequestLocalAlias {
return &NullableCreateBucketRequestLocalAlias{value: val, isSet: true}
}
func (v NullableCreateBucketRequestLocalAlias) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateBucketRequestLocalAlias) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,187 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// CreateBucketRequestLocalAliasAllow struct for CreateBucketRequestLocalAliasAllow
type CreateBucketRequestLocalAliasAllow struct {
Read *bool `json:"read,omitempty"`
Write *bool `json:"write,omitempty"`
Owner *bool `json:"owner,omitempty"`
}
// NewCreateBucketRequestLocalAliasAllow instantiates a new CreateBucketRequestLocalAliasAllow object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewCreateBucketRequestLocalAliasAllow() *CreateBucketRequestLocalAliasAllow {
this := CreateBucketRequestLocalAliasAllow{}
return &this
}
// NewCreateBucketRequestLocalAliasAllowWithDefaults instantiates a new CreateBucketRequestLocalAliasAllow object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewCreateBucketRequestLocalAliasAllowWithDefaults() *CreateBucketRequestLocalAliasAllow {
this := CreateBucketRequestLocalAliasAllow{}
return &this
}
// GetRead returns the Read field value if set, zero value otherwise.
func (o *CreateBucketRequestLocalAliasAllow) GetRead() bool {
if o == nil || o.Read == nil {
var ret bool
return ret
}
return *o.Read
}
// GetReadOk returns a tuple with the Read field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateBucketRequestLocalAliasAllow) GetReadOk() (*bool, bool) {
if o == nil || o.Read == nil {
return nil, false
}
return o.Read, true
}
// HasRead returns a boolean if a field has been set.
func (o *CreateBucketRequestLocalAliasAllow) HasRead() bool {
if o != nil && o.Read != nil {
return true
}
return false
}
// SetRead gets a reference to the given bool and assigns it to the Read field.
func (o *CreateBucketRequestLocalAliasAllow) SetRead(v bool) {
o.Read = &v
}
// GetWrite returns the Write field value if set, zero value otherwise.
func (o *CreateBucketRequestLocalAliasAllow) GetWrite() bool {
if o == nil || o.Write == nil {
var ret bool
return ret
}
return *o.Write
}
// GetWriteOk returns a tuple with the Write field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateBucketRequestLocalAliasAllow) GetWriteOk() (*bool, bool) {
if o == nil || o.Write == nil {
return nil, false
}
return o.Write, true
}
// HasWrite returns a boolean if a field has been set.
func (o *CreateBucketRequestLocalAliasAllow) HasWrite() bool {
if o != nil && o.Write != nil {
return true
}
return false
}
// SetWrite gets a reference to the given bool and assigns it to the Write field.
func (o *CreateBucketRequestLocalAliasAllow) SetWrite(v bool) {
o.Write = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *CreateBucketRequestLocalAliasAllow) GetOwner() bool {
if o == nil || o.Owner == nil {
var ret bool
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateBucketRequestLocalAliasAllow) GetOwnerOk() (*bool, bool) {
if o == nil || o.Owner == nil {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *CreateBucketRequestLocalAliasAllow) HasOwner() bool {
if o != nil && o.Owner != nil {
return true
}
return false
}
// SetOwner gets a reference to the given bool and assigns it to the Owner field.
func (o *CreateBucketRequestLocalAliasAllow) SetOwner(v bool) {
o.Owner = &v
}
func (o CreateBucketRequestLocalAliasAllow) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Read != nil {
toSerialize["read"] = o.Read
}
if o.Write != nil {
toSerialize["write"] = o.Write
}
if o.Owner != nil {
toSerialize["owner"] = o.Owner
}
return json.Marshal(toSerialize)
}
type NullableCreateBucketRequestLocalAliasAllow struct {
value *CreateBucketRequestLocalAliasAllow
isSet bool
}
func (v NullableCreateBucketRequestLocalAliasAllow) Get() *CreateBucketRequestLocalAliasAllow {
return v.value
}
func (v *NullableCreateBucketRequestLocalAliasAllow) Set(val *CreateBucketRequestLocalAliasAllow) {
v.value = val
v.isSet = true
}
func (v NullableCreateBucketRequestLocalAliasAllow) IsSet() bool {
return v.isSet
}
func (v *NullableCreateBucketRequestLocalAliasAllow) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateBucketRequestLocalAliasAllow(val *CreateBucketRequestLocalAliasAllow) *NullableCreateBucketRequestLocalAliasAllow {
return &NullableCreateBucketRequestLocalAliasAllow{value: val, isSet: true}
}
func (v NullableCreateBucketRequestLocalAliasAllow) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateBucketRequestLocalAliasAllow) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,195 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// GetNodes200Response struct for GetNodes200Response
type GetNodes200Response struct {
Node string `json:"node"`
GarageVersion string `json:"garageVersion"`
KnownNodes map[string]NodeNetworkInfo `json:"knownNodes"`
Layout ClusterLayout `json:"layout"`
}
// NewGetNodes200Response instantiates a new GetNodes200Response object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewGetNodes200Response(node string, garageVersion string, knownNodes map[string]NodeNetworkInfo, layout ClusterLayout) *GetNodes200Response {
this := GetNodes200Response{}
this.Node = node
this.GarageVersion = garageVersion
this.KnownNodes = knownNodes
this.Layout = layout
return &this
}
// NewGetNodes200ResponseWithDefaults instantiates a new GetNodes200Response object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewGetNodes200ResponseWithDefaults() *GetNodes200Response {
this := GetNodes200Response{}
return &this
}
// GetNode returns the Node field value
func (o *GetNodes200Response) GetNode() string {
if o == nil {
var ret string
return ret
}
return o.Node
}
// GetNodeOk returns a tuple with the Node field value
// and a boolean to check if the value has been set.
func (o *GetNodes200Response) GetNodeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Node, true
}
// SetNode sets field value
func (o *GetNodes200Response) SetNode(v string) {
o.Node = v
}
// GetGarageVersion returns the GarageVersion field value
func (o *GetNodes200Response) GetGarageVersion() string {
if o == nil {
var ret string
return ret
}
return o.GarageVersion
}
// GetGarageVersionOk returns a tuple with the GarageVersion field value
// and a boolean to check if the value has been set.
func (o *GetNodes200Response) GetGarageVersionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.GarageVersion, true
}
// SetGarageVersion sets field value
func (o *GetNodes200Response) SetGarageVersion(v string) {
o.GarageVersion = v
}
// GetKnownNodes returns the KnownNodes field value
func (o *GetNodes200Response) GetKnownNodes() map[string]NodeNetworkInfo {
if o == nil {
var ret map[string]NodeNetworkInfo
return ret
}
return o.KnownNodes
}
// GetKnownNodesOk returns a tuple with the KnownNodes field value
// and a boolean to check if the value has been set.
func (o *GetNodes200Response) GetKnownNodesOk() (*map[string]NodeNetworkInfo, bool) {
if o == nil {
return nil, false
}
return &o.KnownNodes, true
}
// SetKnownNodes sets field value
func (o *GetNodes200Response) SetKnownNodes(v map[string]NodeNetworkInfo) {
o.KnownNodes = v
}
// GetLayout returns the Layout field value
func (o *GetNodes200Response) GetLayout() ClusterLayout {
if o == nil {
var ret ClusterLayout
return ret
}
return o.Layout
}
// GetLayoutOk returns a tuple with the Layout field value
// and a boolean to check if the value has been set.
func (o *GetNodes200Response) GetLayoutOk() (*ClusterLayout, bool) {
if o == nil {
return nil, false
}
return &o.Layout, true
}
// SetLayout sets field value
func (o *GetNodes200Response) SetLayout(v ClusterLayout) {
o.Layout = v
}
func (o GetNodes200Response) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["node"] = o.Node
}
if true {
toSerialize["garageVersion"] = o.GarageVersion
}
if true {
toSerialize["knownNodes"] = o.KnownNodes
}
if true {
toSerialize["layout"] = o.Layout
}
return json.Marshal(toSerialize)
}
type NullableGetNodes200Response struct {
value *GetNodes200Response
isSet bool
}
func (v NullableGetNodes200Response) Get() *GetNodes200Response {
return v.value
}
func (v *NullableGetNodes200Response) Set(val *GetNodes200Response) {
v.value = val
v.isSet = true
}
func (v NullableGetNodes200Response) IsSet() bool {
return v.isSet
}
func (v *NullableGetNodes200Response) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGetNodes200Response(val *GetNodes200Response) *NullableGetNodes200Response {
return &NullableGetNodes200Response{value: val, isSet: true}
}
func (v NullableGetNodes200Response) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGetNodes200Response) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,166 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// ImportKeyRequest struct for ImportKeyRequest
type ImportKeyRequest struct {
Name string `json:"name"`
AccessKeyId string `json:"accessKeyId"`
SecretAccessKey string `json:"secretAccessKey"`
}
// NewImportKeyRequest instantiates a new ImportKeyRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewImportKeyRequest(name string, accessKeyId string, secretAccessKey string) *ImportKeyRequest {
this := ImportKeyRequest{}
this.Name = name
this.AccessKeyId = accessKeyId
this.SecretAccessKey = secretAccessKey
return &this
}
// NewImportKeyRequestWithDefaults instantiates a new ImportKeyRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewImportKeyRequestWithDefaults() *ImportKeyRequest {
this := ImportKeyRequest{}
return &this
}
// GetName returns the Name field value
func (o *ImportKeyRequest) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *ImportKeyRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ImportKeyRequest) SetName(v string) {
o.Name = v
}
// GetAccessKeyId returns the AccessKeyId field value
func (o *ImportKeyRequest) GetAccessKeyId() string {
if o == nil {
var ret string
return ret
}
return o.AccessKeyId
}
// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value
// and a boolean to check if the value has been set.
func (o *ImportKeyRequest) GetAccessKeyIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.AccessKeyId, true
}
// SetAccessKeyId sets field value
func (o *ImportKeyRequest) SetAccessKeyId(v string) {
o.AccessKeyId = v
}
// GetSecretAccessKey returns the SecretAccessKey field value
func (o *ImportKeyRequest) GetSecretAccessKey() string {
if o == nil {
var ret string
return ret
}
return o.SecretAccessKey
}
// GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value
// and a boolean to check if the value has been set.
func (o *ImportKeyRequest) GetSecretAccessKeyOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.SecretAccessKey, true
}
// SetSecretAccessKey sets field value
func (o *ImportKeyRequest) SetSecretAccessKey(v string) {
o.SecretAccessKey = v
}
func (o ImportKeyRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["name"] = o.Name
}
if true {
toSerialize["accessKeyId"] = o.AccessKeyId
}
if true {
toSerialize["secretAccessKey"] = o.SecretAccessKey
}
return json.Marshal(toSerialize)
}
type NullableImportKeyRequest struct {
value *ImportKeyRequest
isSet bool
}
func (v NullableImportKeyRequest) Get() *ImportKeyRequest {
return v.value
}
func (v *NullableImportKeyRequest) Set(val *ImportKeyRequest) {
v.value = val
v.isSet = true
}
func (v NullableImportKeyRequest) IsSet() bool {
return v.isSet
}
func (v *NullableImportKeyRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableImportKeyRequest(val *ImportKeyRequest) *NullableImportKeyRequest {
return &NullableImportKeyRequest{value: val, isSet: true}
}
func (v NullableImportKeyRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableImportKeyRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

259
golang/model_key_info.go Normal file
View file

@ -0,0 +1,259 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// KeyInfo struct for KeyInfo
type KeyInfo struct {
Name *string `json:"name,omitempty"`
AccessKeyId *string `json:"accessKeyId,omitempty"`
SecretAccessKey *string `json:"secretAccessKey,omitempty"`
Permissions *KeyInfoPermissions `json:"permissions,omitempty"`
Buckets []KeyInfoBucketsInner `json:"buckets,omitempty"`
}
// NewKeyInfo instantiates a new KeyInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewKeyInfo() *KeyInfo {
this := KeyInfo{}
return &this
}
// NewKeyInfoWithDefaults instantiates a new KeyInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewKeyInfoWithDefaults() *KeyInfo {
this := KeyInfo{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *KeyInfo) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *KeyInfo) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *KeyInfo) SetName(v string) {
o.Name = &v
}
// GetAccessKeyId returns the AccessKeyId field value if set, zero value otherwise.
func (o *KeyInfo) GetAccessKeyId() string {
if o == nil || o.AccessKeyId == nil {
var ret string
return ret
}
return *o.AccessKeyId
}
// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetAccessKeyIdOk() (*string, bool) {
if o == nil || o.AccessKeyId == nil {
return nil, false
}
return o.AccessKeyId, true
}
// HasAccessKeyId returns a boolean if a field has been set.
func (o *KeyInfo) HasAccessKeyId() bool {
if o != nil && o.AccessKeyId != nil {
return true
}
return false
}
// SetAccessKeyId gets a reference to the given string and assigns it to the AccessKeyId field.
func (o *KeyInfo) SetAccessKeyId(v string) {
o.AccessKeyId = &v
}
// GetSecretAccessKey returns the SecretAccessKey field value if set, zero value otherwise.
func (o *KeyInfo) GetSecretAccessKey() string {
if o == nil || o.SecretAccessKey == nil {
var ret string
return ret
}
return *o.SecretAccessKey
}
// GetSecretAccessKeyOk returns a tuple with the SecretAccessKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetSecretAccessKeyOk() (*string, bool) {
if o == nil || o.SecretAccessKey == nil {
return nil, false
}
return o.SecretAccessKey, true
}
// HasSecretAccessKey returns a boolean if a field has been set.
func (o *KeyInfo) HasSecretAccessKey() bool {
if o != nil && o.SecretAccessKey != nil {
return true
}
return false
}
// SetSecretAccessKey gets a reference to the given string and assigns it to the SecretAccessKey field.
func (o *KeyInfo) SetSecretAccessKey(v string) {
o.SecretAccessKey = &v
}
// GetPermissions returns the Permissions field value if set, zero value otherwise.
func (o *KeyInfo) GetPermissions() KeyInfoPermissions {
if o == nil || o.Permissions == nil {
var ret KeyInfoPermissions
return ret
}
return *o.Permissions
}
// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetPermissionsOk() (*KeyInfoPermissions, bool) {
if o == nil || o.Permissions == nil {
return nil, false
}
return o.Permissions, true
}
// HasPermissions returns a boolean if a field has been set.
func (o *KeyInfo) HasPermissions() bool {
if o != nil && o.Permissions != nil {
return true
}
return false
}
// SetPermissions gets a reference to the given KeyInfoPermissions and assigns it to the Permissions field.
func (o *KeyInfo) SetPermissions(v KeyInfoPermissions) {
o.Permissions = &v
}
// GetBuckets returns the Buckets field value if set, zero value otherwise.
func (o *KeyInfo) GetBuckets() []KeyInfoBucketsInner {
if o == nil || o.Buckets == nil {
var ret []KeyInfoBucketsInner
return ret
}
return o.Buckets
}
// GetBucketsOk returns a tuple with the Buckets field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfo) GetBucketsOk() ([]KeyInfoBucketsInner, bool) {
if o == nil || o.Buckets == nil {
return nil, false
}
return o.Buckets, true
}
// HasBuckets returns a boolean if a field has been set.
func (o *KeyInfo) HasBuckets() bool {
if o != nil && o.Buckets != nil {
return true
}
return false
}
// SetBuckets gets a reference to the given []KeyInfoBucketsInner and assigns it to the Buckets field.
func (o *KeyInfo) SetBuckets(v []KeyInfoBucketsInner) {
o.Buckets = v
}
func (o KeyInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.AccessKeyId != nil {
toSerialize["accessKeyId"] = o.AccessKeyId
}
if o.SecretAccessKey != nil {
toSerialize["secretAccessKey"] = o.SecretAccessKey
}
if o.Permissions != nil {
toSerialize["permissions"] = o.Permissions
}
if o.Buckets != nil {
toSerialize["buckets"] = o.Buckets
}
return json.Marshal(toSerialize)
}
type NullableKeyInfo struct {
value *KeyInfo
isSet bool
}
func (v NullableKeyInfo) Get() *KeyInfo {
return v.value
}
func (v *NullableKeyInfo) Set(val *KeyInfo) {
v.value = val
v.isSet = true
}
func (v NullableKeyInfo) IsSet() bool {
return v.isSet
}
func (v *NullableKeyInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKeyInfo(val *KeyInfo) *NullableKeyInfo {
return &NullableKeyInfo{value: val, isSet: true}
}
func (v NullableKeyInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKeyInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,223 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// KeyInfoBucketsInner struct for KeyInfoBucketsInner
type KeyInfoBucketsInner struct {
Id *string `json:"id,omitempty"`
GlobalAliases []string `json:"globalAliases,omitempty"`
LocalAliases []string `json:"localAliases,omitempty"`
Permissions *KeyInfoBucketsInnerPermissions `json:"permissions,omitempty"`
}
// NewKeyInfoBucketsInner instantiates a new KeyInfoBucketsInner object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewKeyInfoBucketsInner() *KeyInfoBucketsInner {
this := KeyInfoBucketsInner{}
return &this
}
// NewKeyInfoBucketsInnerWithDefaults instantiates a new KeyInfoBucketsInner object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewKeyInfoBucketsInnerWithDefaults() *KeyInfoBucketsInner {
this := KeyInfoBucketsInner{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *KeyInfoBucketsInner) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfoBucketsInner) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *KeyInfoBucketsInner) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *KeyInfoBucketsInner) SetId(v string) {
o.Id = &v
}
// GetGlobalAliases returns the GlobalAliases field value if set, zero value otherwise.
func (o *KeyInfoBucketsInner) GetGlobalAliases() []string {
if o == nil || o.GlobalAliases == nil {
var ret []string
return ret
}
return o.GlobalAliases
}
// GetGlobalAliasesOk returns a tuple with the GlobalAliases field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfoBucketsInner) GetGlobalAliasesOk() ([]string, bool) {
if o == nil || o.GlobalAliases == nil {
return nil, false
}
return o.GlobalAliases, true
}
// HasGlobalAliases returns a boolean if a field has been set.
func (o *KeyInfoBucketsInner) HasGlobalAliases() bool {
if o != nil && o.GlobalAliases != nil {
return true
}
return false
}
// SetGlobalAliases gets a reference to the given []string and assigns it to the GlobalAliases field.
func (o *KeyInfoBucketsInner) SetGlobalAliases(v []string) {
o.GlobalAliases = v
}
// GetLocalAliases returns the LocalAliases field value if set, zero value otherwise.
func (o *KeyInfoBucketsInner) GetLocalAliases() []string {
if o == nil || o.LocalAliases == nil {
var ret []string
return ret
}
return o.LocalAliases
}
// GetLocalAliasesOk returns a tuple with the LocalAliases field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfoBucketsInner) GetLocalAliasesOk() ([]string, bool) {
if o == nil || o.LocalAliases == nil {
return nil, false
}
return o.LocalAliases, true
}
// HasLocalAliases returns a boolean if a field has been set.
func (o *KeyInfoBucketsInner) HasLocalAliases() bool {
if o != nil && o.LocalAliases != nil {
return true
}
return false
}
// SetLocalAliases gets a reference to the given []string and assigns it to the LocalAliases field.
func (o *KeyInfoBucketsInner) SetLocalAliases(v []string) {
o.LocalAliases = v
}
// GetPermissions returns the Permissions field value if set, zero value otherwise.
func (o *KeyInfoBucketsInner) GetPermissions() KeyInfoBucketsInnerPermissions {
if o == nil || o.Permissions == nil {
var ret KeyInfoBucketsInnerPermissions
return ret
}
return *o.Permissions
}
// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfoBucketsInner) GetPermissionsOk() (*KeyInfoBucketsInnerPermissions, bool) {
if o == nil || o.Permissions == nil {
return nil, false
}
return o.Permissions, true
}
// HasPermissions returns a boolean if a field has been set.
func (o *KeyInfoBucketsInner) HasPermissions() bool {
if o != nil && o.Permissions != nil {
return true
}
return false
}
// SetPermissions gets a reference to the given KeyInfoBucketsInnerPermissions and assigns it to the Permissions field.
func (o *KeyInfoBucketsInner) SetPermissions(v KeyInfoBucketsInnerPermissions) {
o.Permissions = &v
}
func (o KeyInfoBucketsInner) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.GlobalAliases != nil {
toSerialize["globalAliases"] = o.GlobalAliases
}
if o.LocalAliases != nil {
toSerialize["localAliases"] = o.LocalAliases
}
if o.Permissions != nil {
toSerialize["permissions"] = o.Permissions
}
return json.Marshal(toSerialize)
}
type NullableKeyInfoBucketsInner struct {
value *KeyInfoBucketsInner
isSet bool
}
func (v NullableKeyInfoBucketsInner) Get() *KeyInfoBucketsInner {
return v.value
}
func (v *NullableKeyInfoBucketsInner) Set(val *KeyInfoBucketsInner) {
v.value = val
v.isSet = true
}
func (v NullableKeyInfoBucketsInner) IsSet() bool {
return v.isSet
}
func (v *NullableKeyInfoBucketsInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKeyInfoBucketsInner(val *KeyInfoBucketsInner) *NullableKeyInfoBucketsInner {
return &NullableKeyInfoBucketsInner{value: val, isSet: true}
}
func (v NullableKeyInfoBucketsInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKeyInfoBucketsInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,187 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// KeyInfoBucketsInnerPermissions struct for KeyInfoBucketsInnerPermissions
type KeyInfoBucketsInnerPermissions struct {
Read *bool `json:"read,omitempty"`
Write *bool `json:"write,omitempty"`
Owner *bool `json:"owner,omitempty"`
}
// NewKeyInfoBucketsInnerPermissions instantiates a new KeyInfoBucketsInnerPermissions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewKeyInfoBucketsInnerPermissions() *KeyInfoBucketsInnerPermissions {
this := KeyInfoBucketsInnerPermissions{}
return &this
}
// NewKeyInfoBucketsInnerPermissionsWithDefaults instantiates a new KeyInfoBucketsInnerPermissions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewKeyInfoBucketsInnerPermissionsWithDefaults() *KeyInfoBucketsInnerPermissions {
this := KeyInfoBucketsInnerPermissions{}
return &this
}
// GetRead returns the Read field value if set, zero value otherwise.
func (o *KeyInfoBucketsInnerPermissions) GetRead() bool {
if o == nil || o.Read == nil {
var ret bool
return ret
}
return *o.Read
}
// GetReadOk returns a tuple with the Read field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfoBucketsInnerPermissions) GetReadOk() (*bool, bool) {
if o == nil || o.Read == nil {
return nil, false
}
return o.Read, true
}
// HasRead returns a boolean if a field has been set.
func (o *KeyInfoBucketsInnerPermissions) HasRead() bool {
if o != nil && o.Read != nil {
return true
}
return false
}
// SetRead gets a reference to the given bool and assigns it to the Read field.
func (o *KeyInfoBucketsInnerPermissions) SetRead(v bool) {
o.Read = &v
}
// GetWrite returns the Write field value if set, zero value otherwise.
func (o *KeyInfoBucketsInnerPermissions) GetWrite() bool {
if o == nil || o.Write == nil {
var ret bool
return ret
}
return *o.Write
}
// GetWriteOk returns a tuple with the Write field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfoBucketsInnerPermissions) GetWriteOk() (*bool, bool) {
if o == nil || o.Write == nil {
return nil, false
}
return o.Write, true
}
// HasWrite returns a boolean if a field has been set.
func (o *KeyInfoBucketsInnerPermissions) HasWrite() bool {
if o != nil && o.Write != nil {
return true
}
return false
}
// SetWrite gets a reference to the given bool and assigns it to the Write field.
func (o *KeyInfoBucketsInnerPermissions) SetWrite(v bool) {
o.Write = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *KeyInfoBucketsInnerPermissions) GetOwner() bool {
if o == nil || o.Owner == nil {
var ret bool
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfoBucketsInnerPermissions) GetOwnerOk() (*bool, bool) {
if o == nil || o.Owner == nil {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *KeyInfoBucketsInnerPermissions) HasOwner() bool {
if o != nil && o.Owner != nil {
return true
}
return false
}
// SetOwner gets a reference to the given bool and assigns it to the Owner field.
func (o *KeyInfoBucketsInnerPermissions) SetOwner(v bool) {
o.Owner = &v
}
func (o KeyInfoBucketsInnerPermissions) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Read != nil {
toSerialize["read"] = o.Read
}
if o.Write != nil {
toSerialize["write"] = o.Write
}
if o.Owner != nil {
toSerialize["owner"] = o.Owner
}
return json.Marshal(toSerialize)
}
type NullableKeyInfoBucketsInnerPermissions struct {
value *KeyInfoBucketsInnerPermissions
isSet bool
}
func (v NullableKeyInfoBucketsInnerPermissions) Get() *KeyInfoBucketsInnerPermissions {
return v.value
}
func (v *NullableKeyInfoBucketsInnerPermissions) Set(val *KeyInfoBucketsInnerPermissions) {
v.value = val
v.isSet = true
}
func (v NullableKeyInfoBucketsInnerPermissions) IsSet() bool {
return v.isSet
}
func (v *NullableKeyInfoBucketsInnerPermissions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKeyInfoBucketsInnerPermissions(val *KeyInfoBucketsInnerPermissions) *NullableKeyInfoBucketsInnerPermissions {
return &NullableKeyInfoBucketsInnerPermissions{value: val, isSet: true}
}
func (v NullableKeyInfoBucketsInnerPermissions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKeyInfoBucketsInnerPermissions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,115 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// KeyInfoPermissions struct for KeyInfoPermissions
type KeyInfoPermissions struct {
CreateBucket *bool `json:"createBucket,omitempty"`
}
// NewKeyInfoPermissions instantiates a new KeyInfoPermissions object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewKeyInfoPermissions() *KeyInfoPermissions {
this := KeyInfoPermissions{}
return &this
}
// NewKeyInfoPermissionsWithDefaults instantiates a new KeyInfoPermissions object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewKeyInfoPermissionsWithDefaults() *KeyInfoPermissions {
this := KeyInfoPermissions{}
return &this
}
// GetCreateBucket returns the CreateBucket field value if set, zero value otherwise.
func (o *KeyInfoPermissions) GetCreateBucket() bool {
if o == nil || o.CreateBucket == nil {
var ret bool
return ret
}
return *o.CreateBucket
}
// GetCreateBucketOk returns a tuple with the CreateBucket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *KeyInfoPermissions) GetCreateBucketOk() (*bool, bool) {
if o == nil || o.CreateBucket == nil {
return nil, false
}
return o.CreateBucket, true
}
// HasCreateBucket returns a boolean if a field has been set.
func (o *KeyInfoPermissions) HasCreateBucket() bool {
if o != nil && o.CreateBucket != nil {
return true
}
return false
}
// SetCreateBucket gets a reference to the given bool and assigns it to the CreateBucket field.
func (o *KeyInfoPermissions) SetCreateBucket(v bool) {
o.CreateBucket = &v
}
func (o KeyInfoPermissions) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CreateBucket != nil {
toSerialize["createBucket"] = o.CreateBucket
}
return json.Marshal(toSerialize)
}
type NullableKeyInfoPermissions struct {
value *KeyInfoPermissions
isSet bool
}
func (v NullableKeyInfoPermissions) Get() *KeyInfoPermissions {
return v.value
}
func (v *NullableKeyInfoPermissions) Set(val *KeyInfoPermissions) {
v.value = val
v.isSet = true
}
func (v NullableKeyInfoPermissions) IsSet() bool {
return v.isSet
}
func (v *NullableKeyInfoPermissions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableKeyInfoPermissions(val *KeyInfoPermissions) *NullableKeyInfoPermissions {
return &NullableKeyInfoPermissions{value: val, isSet: true}
}
func (v NullableKeyInfoPermissions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableKeyInfoPermissions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,115 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// LayoutVersion struct for LayoutVersion
type LayoutVersion struct {
Version *int32 `json:"version,omitempty"`
}
// NewLayoutVersion instantiates a new LayoutVersion object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewLayoutVersion() *LayoutVersion {
this := LayoutVersion{}
return &this
}
// NewLayoutVersionWithDefaults instantiates a new LayoutVersion object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewLayoutVersionWithDefaults() *LayoutVersion {
this := LayoutVersion{}
return &this
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *LayoutVersion) GetVersion() int32 {
if o == nil || o.Version == nil {
var ret int32
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LayoutVersion) GetVersionOk() (*int32, bool) {
if o == nil || o.Version == nil {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *LayoutVersion) HasVersion() bool {
if o != nil && o.Version != nil {
return true
}
return false
}
// SetVersion gets a reference to the given int32 and assigns it to the Version field.
func (o *LayoutVersion) SetVersion(v int32) {
o.Version = &v
}
func (o LayoutVersion) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Version != nil {
toSerialize["version"] = o.Version
}
return json.Marshal(toSerialize)
}
type NullableLayoutVersion struct {
value *LayoutVersion
isSet bool
}
func (v NullableLayoutVersion) Get() *LayoutVersion {
return v.value
}
func (v *NullableLayoutVersion) Set(val *LayoutVersion) {
v.value = val
v.isSet = true
}
func (v NullableLayoutVersion) IsSet() bool {
return v.isSet
}
func (v *NullableLayoutVersion) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLayoutVersion(val *LayoutVersion) *NullableLayoutVersion {
return &NullableLayoutVersion{value: val, isSet: true}
}
func (v NullableLayoutVersion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLayoutVersion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,180 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// ListBuckets200ResponseInner struct for ListBuckets200ResponseInner
type ListBuckets200ResponseInner struct {
Id string `json:"id"`
GlobalAliases []string `json:"globalAliases,omitempty"`
LocalAliases []ListBuckets200ResponseInnerLocalAliasesInner `json:"localAliases,omitempty"`
}
// NewListBuckets200ResponseInner instantiates a new ListBuckets200ResponseInner object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewListBuckets200ResponseInner(id string) *ListBuckets200ResponseInner {
this := ListBuckets200ResponseInner{}
this.Id = id
return &this
}
// NewListBuckets200ResponseInnerWithDefaults instantiates a new ListBuckets200ResponseInner object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewListBuckets200ResponseInnerWithDefaults() *ListBuckets200ResponseInner {
this := ListBuckets200ResponseInner{}
return &this
}
// GetId returns the Id field value
func (o *ListBuckets200ResponseInner) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *ListBuckets200ResponseInner) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *ListBuckets200ResponseInner) SetId(v string) {
o.Id = v
}
// GetGlobalAliases returns the GlobalAliases field value if set, zero value otherwise.
func (o *ListBuckets200ResponseInner) GetGlobalAliases() []string {
if o == nil || o.GlobalAliases == nil {
var ret []string
return ret
}
return o.GlobalAliases
}
// GetGlobalAliasesOk returns a tuple with the GlobalAliases field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ListBuckets200ResponseInner) GetGlobalAliasesOk() ([]string, bool) {
if o == nil || o.GlobalAliases == nil {
return nil, false
}
return o.GlobalAliases, true
}
// HasGlobalAliases returns a boolean if a field has been set.
func (o *ListBuckets200ResponseInner) HasGlobalAliases() bool {
if o != nil && o.GlobalAliases != nil {
return true
}
return false
}
// SetGlobalAliases gets a reference to the given []string and assigns it to the GlobalAliases field.
func (o *ListBuckets200ResponseInner) SetGlobalAliases(v []string) {
o.GlobalAliases = v
}
// GetLocalAliases returns the LocalAliases field value if set, zero value otherwise.
func (o *ListBuckets200ResponseInner) GetLocalAliases() []ListBuckets200ResponseInnerLocalAliasesInner {
if o == nil || o.LocalAliases == nil {
var ret []ListBuckets200ResponseInnerLocalAliasesInner
return ret
}
return o.LocalAliases
}
// GetLocalAliasesOk returns a tuple with the LocalAliases field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ListBuckets200ResponseInner) GetLocalAliasesOk() ([]ListBuckets200ResponseInnerLocalAliasesInner, bool) {
if o == nil || o.LocalAliases == nil {
return nil, false
}
return o.LocalAliases, true
}
// HasLocalAliases returns a boolean if a field has been set.
func (o *ListBuckets200ResponseInner) HasLocalAliases() bool {
if o != nil && o.LocalAliases != nil {
return true
}
return false
}
// SetLocalAliases gets a reference to the given []ListBuckets200ResponseInnerLocalAliasesInner and assigns it to the LocalAliases field.
func (o *ListBuckets200ResponseInner) SetLocalAliases(v []ListBuckets200ResponseInnerLocalAliasesInner) {
o.LocalAliases = v
}
func (o ListBuckets200ResponseInner) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if o.GlobalAliases != nil {
toSerialize["globalAliases"] = o.GlobalAliases
}
if o.LocalAliases != nil {
toSerialize["localAliases"] = o.LocalAliases
}
return json.Marshal(toSerialize)
}
type NullableListBuckets200ResponseInner struct {
value *ListBuckets200ResponseInner
isSet bool
}
func (v NullableListBuckets200ResponseInner) Get() *ListBuckets200ResponseInner {
return v.value
}
func (v *NullableListBuckets200ResponseInner) Set(val *ListBuckets200ResponseInner) {
v.value = val
v.isSet = true
}
func (v NullableListBuckets200ResponseInner) IsSet() bool {
return v.isSet
}
func (v *NullableListBuckets200ResponseInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableListBuckets200ResponseInner(val *ListBuckets200ResponseInner) *NullableListBuckets200ResponseInner {
return &NullableListBuckets200ResponseInner{value: val, isSet: true}
}
func (v NullableListBuckets200ResponseInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableListBuckets200ResponseInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,137 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// ListBuckets200ResponseInnerLocalAliasesInner struct for ListBuckets200ResponseInnerLocalAliasesInner
type ListBuckets200ResponseInnerLocalAliasesInner struct {
Alias string `json:"alias"`
AccessKeyId string `json:"accessKeyId"`
}
// NewListBuckets200ResponseInnerLocalAliasesInner instantiates a new ListBuckets200ResponseInnerLocalAliasesInner object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewListBuckets200ResponseInnerLocalAliasesInner(alias string, accessKeyId string) *ListBuckets200ResponseInnerLocalAliasesInner {
this := ListBuckets200ResponseInnerLocalAliasesInner{}
this.Alias = alias
this.AccessKeyId = accessKeyId
return &this
}
// NewListBuckets200ResponseInnerLocalAliasesInnerWithDefaults instantiates a new ListBuckets200ResponseInnerLocalAliasesInner object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewListBuckets200ResponseInnerLocalAliasesInnerWithDefaults() *ListBuckets200ResponseInnerLocalAliasesInner {
this := ListBuckets200ResponseInnerLocalAliasesInner{}
return &this
}
// GetAlias returns the Alias field value
func (o *ListBuckets200ResponseInnerLocalAliasesInner) GetAlias() string {
if o == nil {
var ret string
return ret
}
return o.Alias
}
// GetAliasOk returns a tuple with the Alias field value
// and a boolean to check if the value has been set.
func (o *ListBuckets200ResponseInnerLocalAliasesInner) GetAliasOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Alias, true
}
// SetAlias sets field value
func (o *ListBuckets200ResponseInnerLocalAliasesInner) SetAlias(v string) {
o.Alias = v
}
// GetAccessKeyId returns the AccessKeyId field value
func (o *ListBuckets200ResponseInnerLocalAliasesInner) GetAccessKeyId() string {
if o == nil {
var ret string
return ret
}
return o.AccessKeyId
}
// GetAccessKeyIdOk returns a tuple with the AccessKeyId field value
// and a boolean to check if the value has been set.
func (o *ListBuckets200ResponseInnerLocalAliasesInner) GetAccessKeyIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.AccessKeyId, true
}
// SetAccessKeyId sets field value
func (o *ListBuckets200ResponseInnerLocalAliasesInner) SetAccessKeyId(v string) {
o.AccessKeyId = v
}
func (o ListBuckets200ResponseInnerLocalAliasesInner) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["alias"] = o.Alias
}
if true {
toSerialize["accessKeyId"] = o.AccessKeyId
}
return json.Marshal(toSerialize)
}
type NullableListBuckets200ResponseInnerLocalAliasesInner struct {
value *ListBuckets200ResponseInnerLocalAliasesInner
isSet bool
}
func (v NullableListBuckets200ResponseInnerLocalAliasesInner) Get() *ListBuckets200ResponseInnerLocalAliasesInner {
return v.value
}
func (v *NullableListBuckets200ResponseInnerLocalAliasesInner) Set(val *ListBuckets200ResponseInnerLocalAliasesInner) {
v.value = val
v.isSet = true
}
func (v NullableListBuckets200ResponseInnerLocalAliasesInner) IsSet() bool {
return v.isSet
}
func (v *NullableListBuckets200ResponseInnerLocalAliasesInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableListBuckets200ResponseInnerLocalAliasesInner(val *ListBuckets200ResponseInnerLocalAliasesInner) *NullableListBuckets200ResponseInnerLocalAliasesInner {
return &NullableListBuckets200ResponseInnerLocalAliasesInner{value: val, isSet: true}
}
func (v NullableListBuckets200ResponseInnerLocalAliasesInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableListBuckets200ResponseInnerLocalAliasesInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,144 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// ListKeys200ResponseInner struct for ListKeys200ResponseInner
type ListKeys200ResponseInner struct {
Id string `json:"id"`
Name *string `json:"name,omitempty"`
}
// NewListKeys200ResponseInner instantiates a new ListKeys200ResponseInner object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewListKeys200ResponseInner(id string) *ListKeys200ResponseInner {
this := ListKeys200ResponseInner{}
this.Id = id
return &this
}
// NewListKeys200ResponseInnerWithDefaults instantiates a new ListKeys200ResponseInner object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewListKeys200ResponseInnerWithDefaults() *ListKeys200ResponseInner {
this := ListKeys200ResponseInner{}
return &this
}
// GetId returns the Id field value
func (o *ListKeys200ResponseInner) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *ListKeys200ResponseInner) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *ListKeys200ResponseInner) SetId(v string) {
o.Id = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *ListKeys200ResponseInner) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ListKeys200ResponseInner) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *ListKeys200ResponseInner) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *ListKeys200ResponseInner) SetName(v string) {
o.Name = &v
}
func (o ListKeys200ResponseInner) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
return json.Marshal(toSerialize)
}
type NullableListKeys200ResponseInner struct {
value *ListKeys200ResponseInner
isSet bool
}
func (v NullableListKeys200ResponseInner) Get() *ListKeys200ResponseInner {
return v.value
}
func (v *NullableListKeys200ResponseInner) Set(val *ListKeys200ResponseInner) {
v.value = val
v.isSet = true
}
func (v NullableListKeys200ResponseInner) IsSet() bool {
return v.isSet
}
func (v *NullableListKeys200ResponseInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableListKeys200ResponseInner(val *ListKeys200ResponseInner) *NullableListKeys200ResponseInner {
return &NullableListKeys200ResponseInner{value: val, isSet: true}
}
func (v NullableListKeys200ResponseInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableListKeys200ResponseInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,169 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// NodeClusterInfo struct for NodeClusterInfo
type NodeClusterInfo struct {
Zone string `json:"zone"`
Capacity NullableInt32 `json:"capacity"`
// User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage
Tags []string `json:"tags"`
}
// NewNodeClusterInfo instantiates a new NodeClusterInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewNodeClusterInfo(zone string, capacity NullableInt32, tags []string) *NodeClusterInfo {
this := NodeClusterInfo{}
this.Zone = zone
this.Capacity = capacity
this.Tags = tags
return &this
}
// NewNodeClusterInfoWithDefaults instantiates a new NodeClusterInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewNodeClusterInfoWithDefaults() *NodeClusterInfo {
this := NodeClusterInfo{}
return &this
}
// GetZone returns the Zone field value
func (o *NodeClusterInfo) GetZone() string {
if o == nil {
var ret string
return ret
}
return o.Zone
}
// GetZoneOk returns a tuple with the Zone field value
// and a boolean to check if the value has been set.
func (o *NodeClusterInfo) GetZoneOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Zone, true
}
// SetZone sets field value
func (o *NodeClusterInfo) SetZone(v string) {
o.Zone = v
}
// GetCapacity returns the Capacity field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *NodeClusterInfo) GetCapacity() int32 {
if o == nil || o.Capacity.Get() == nil {
var ret int32
return ret
}
return *o.Capacity.Get()
}
// GetCapacityOk returns a tuple with the Capacity field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *NodeClusterInfo) GetCapacityOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.Capacity.Get(), o.Capacity.IsSet()
}
// SetCapacity sets field value
func (o *NodeClusterInfo) SetCapacity(v int32) {
o.Capacity.Set(&v)
}
// GetTags returns the Tags field value
func (o *NodeClusterInfo) GetTags() []string {
if o == nil {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value
// and a boolean to check if the value has been set.
func (o *NodeClusterInfo) GetTagsOk() ([]string, bool) {
if o == nil {
return nil, false
}
return o.Tags, true
}
// SetTags sets field value
func (o *NodeClusterInfo) SetTags(v []string) {
o.Tags = v
}
func (o NodeClusterInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["zone"] = o.Zone
}
if true {
toSerialize["capacity"] = o.Capacity.Get()
}
if true {
toSerialize["tags"] = o.Tags
}
return json.Marshal(toSerialize)
}
type NullableNodeClusterInfo struct {
value *NodeClusterInfo
isSet bool
}
func (v NullableNodeClusterInfo) Get() *NodeClusterInfo {
return v.value
}
func (v *NullableNodeClusterInfo) Set(val *NodeClusterInfo) {
v.value = val
v.isSet = true
}
func (v NullableNodeClusterInfo) IsSet() bool {
return v.isSet
}
func (v *NullableNodeClusterInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNodeClusterInfo(val *NodeClusterInfo) *NullableNodeClusterInfo {
return &NullableNodeClusterInfo{value: val, isSet: true}
}
func (v NullableNodeClusterInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNodeClusterInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,197 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// NodeNetworkInfo struct for NodeNetworkInfo
type NodeNetworkInfo struct {
Addr string `json:"addr"`
IsUp bool `json:"is_up"`
LastSeenSecsAgo NullableInt32 `json:"last_seen_secs_ago"`
Hostname string `json:"hostname"`
}
// NewNodeNetworkInfo instantiates a new NodeNetworkInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewNodeNetworkInfo(addr string, isUp bool, lastSeenSecsAgo NullableInt32, hostname string) *NodeNetworkInfo {
this := NodeNetworkInfo{}
this.Addr = addr
this.IsUp = isUp
this.LastSeenSecsAgo = lastSeenSecsAgo
this.Hostname = hostname
return &this
}
// NewNodeNetworkInfoWithDefaults instantiates a new NodeNetworkInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewNodeNetworkInfoWithDefaults() *NodeNetworkInfo {
this := NodeNetworkInfo{}
return &this
}
// GetAddr returns the Addr field value
func (o *NodeNetworkInfo) GetAddr() string {
if o == nil {
var ret string
return ret
}
return o.Addr
}
// GetAddrOk returns a tuple with the Addr field value
// and a boolean to check if the value has been set.
func (o *NodeNetworkInfo) GetAddrOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Addr, true
}
// SetAddr sets field value
func (o *NodeNetworkInfo) SetAddr(v string) {
o.Addr = v
}
// GetIsUp returns the IsUp field value
func (o *NodeNetworkInfo) GetIsUp() bool {
if o == nil {
var ret bool
return ret
}
return o.IsUp
}
// GetIsUpOk returns a tuple with the IsUp field value
// and a boolean to check if the value has been set.
func (o *NodeNetworkInfo) GetIsUpOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsUp, true
}
// SetIsUp sets field value
func (o *NodeNetworkInfo) SetIsUp(v bool) {
o.IsUp = v
}
// GetLastSeenSecsAgo returns the LastSeenSecsAgo field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *NodeNetworkInfo) GetLastSeenSecsAgo() int32 {
if o == nil || o.LastSeenSecsAgo.Get() == nil {
var ret int32
return ret
}
return *o.LastSeenSecsAgo.Get()
}
// GetLastSeenSecsAgoOk returns a tuple with the LastSeenSecsAgo field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *NodeNetworkInfo) GetLastSeenSecsAgoOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.LastSeenSecsAgo.Get(), o.LastSeenSecsAgo.IsSet()
}
// SetLastSeenSecsAgo sets field value
func (o *NodeNetworkInfo) SetLastSeenSecsAgo(v int32) {
o.LastSeenSecsAgo.Set(&v)
}
// GetHostname returns the Hostname field value
func (o *NodeNetworkInfo) GetHostname() string {
if o == nil {
var ret string
return ret
}
return o.Hostname
}
// GetHostnameOk returns a tuple with the Hostname field value
// and a boolean to check if the value has been set.
func (o *NodeNetworkInfo) GetHostnameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Hostname, true
}
// SetHostname sets field value
func (o *NodeNetworkInfo) SetHostname(v string) {
o.Hostname = v
}
func (o NodeNetworkInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["addr"] = o.Addr
}
if true {
toSerialize["is_up"] = o.IsUp
}
if true {
toSerialize["last_seen_secs_ago"] = o.LastSeenSecsAgo.Get()
}
if true {
toSerialize["hostname"] = o.Hostname
}
return json.Marshal(toSerialize)
}
type NullableNodeNetworkInfo struct {
value *NodeNetworkInfo
isSet bool
}
func (v NullableNodeNetworkInfo) Get() *NodeNetworkInfo {
return v.value
}
func (v *NullableNodeNetworkInfo) Set(val *NodeNetworkInfo) {
v.value = val
v.isSet = true
}
func (v NullableNodeNetworkInfo) IsSet() bool {
return v.isSet
}
func (v *NullableNodeNetworkInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNodeNetworkInfo(val *NodeNetworkInfo) *NullableNodeNetworkInfo {
return &NullableNodeNetworkInfo{value: val, isSet: true}
}
func (v NullableNodeNetworkInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNodeNetworkInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,151 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// UpdateBucketRequest struct for UpdateBucketRequest
type UpdateBucketRequest struct {
WebsiteAccess *UpdateBucketRequestWebsiteAccess `json:"websiteAccess,omitempty"`
Quotas *UpdateBucketRequestQuotas `json:"quotas,omitempty"`
}
// NewUpdateBucketRequest instantiates a new UpdateBucketRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewUpdateBucketRequest() *UpdateBucketRequest {
this := UpdateBucketRequest{}
return &this
}
// NewUpdateBucketRequestWithDefaults instantiates a new UpdateBucketRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewUpdateBucketRequestWithDefaults() *UpdateBucketRequest {
this := UpdateBucketRequest{}
return &this
}
// GetWebsiteAccess returns the WebsiteAccess field value if set, zero value otherwise.
func (o *UpdateBucketRequest) GetWebsiteAccess() UpdateBucketRequestWebsiteAccess {
if o == nil || o.WebsiteAccess == nil {
var ret UpdateBucketRequestWebsiteAccess
return ret
}
return *o.WebsiteAccess
}
// GetWebsiteAccessOk returns a tuple with the WebsiteAccess field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateBucketRequest) GetWebsiteAccessOk() (*UpdateBucketRequestWebsiteAccess, bool) {
if o == nil || o.WebsiteAccess == nil {
return nil, false
}
return o.WebsiteAccess, true
}
// HasWebsiteAccess returns a boolean if a field has been set.
func (o *UpdateBucketRequest) HasWebsiteAccess() bool {
if o != nil && o.WebsiteAccess != nil {
return true
}
return false
}
// SetWebsiteAccess gets a reference to the given UpdateBucketRequestWebsiteAccess and assigns it to the WebsiteAccess field.
func (o *UpdateBucketRequest) SetWebsiteAccess(v UpdateBucketRequestWebsiteAccess) {
o.WebsiteAccess = &v
}
// GetQuotas returns the Quotas field value if set, zero value otherwise.
func (o *UpdateBucketRequest) GetQuotas() UpdateBucketRequestQuotas {
if o == nil || o.Quotas == nil {
var ret UpdateBucketRequestQuotas
return ret
}
return *o.Quotas
}
// GetQuotasOk returns a tuple with the Quotas field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateBucketRequest) GetQuotasOk() (*UpdateBucketRequestQuotas, bool) {
if o == nil || o.Quotas == nil {
return nil, false
}
return o.Quotas, true
}
// HasQuotas returns a boolean if a field has been set.
func (o *UpdateBucketRequest) HasQuotas() bool {
if o != nil && o.Quotas != nil {
return true
}
return false
}
// SetQuotas gets a reference to the given UpdateBucketRequestQuotas and assigns it to the Quotas field.
func (o *UpdateBucketRequest) SetQuotas(v UpdateBucketRequestQuotas) {
o.Quotas = &v
}
func (o UpdateBucketRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.WebsiteAccess != nil {
toSerialize["websiteAccess"] = o.WebsiteAccess
}
if o.Quotas != nil {
toSerialize["quotas"] = o.Quotas
}
return json.Marshal(toSerialize)
}
type NullableUpdateBucketRequest struct {
value *UpdateBucketRequest
isSet bool
}
func (v NullableUpdateBucketRequest) Get() *UpdateBucketRequest {
return v.value
}
func (v *NullableUpdateBucketRequest) Set(val *UpdateBucketRequest) {
v.value = val
v.isSet = true
}
func (v NullableUpdateBucketRequest) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateBucketRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateBucketRequest(val *UpdateBucketRequest) *NullableUpdateBucketRequest {
return &NullableUpdateBucketRequest{value: val, isSet: true}
}
func (v NullableUpdateBucketRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateBucketRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,171 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// UpdateBucketRequestQuotas struct for UpdateBucketRequestQuotas
type UpdateBucketRequestQuotas struct {
MaxSize NullableInt32 `json:"maxSize,omitempty"`
MaxObjects NullableInt32 `json:"maxObjects,omitempty"`
}
// NewUpdateBucketRequestQuotas instantiates a new UpdateBucketRequestQuotas object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewUpdateBucketRequestQuotas() *UpdateBucketRequestQuotas {
this := UpdateBucketRequestQuotas{}
return &this
}
// NewUpdateBucketRequestQuotasWithDefaults instantiates a new UpdateBucketRequestQuotas object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewUpdateBucketRequestQuotasWithDefaults() *UpdateBucketRequestQuotas {
this := UpdateBucketRequestQuotas{}
return &this
}
// GetMaxSize returns the MaxSize field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateBucketRequestQuotas) GetMaxSize() int32 {
if o == nil || o.MaxSize.Get() == nil {
var ret int32
return ret
}
return *o.MaxSize.Get()
}
// GetMaxSizeOk returns a tuple with the MaxSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateBucketRequestQuotas) GetMaxSizeOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.MaxSize.Get(), o.MaxSize.IsSet()
}
// HasMaxSize returns a boolean if a field has been set.
func (o *UpdateBucketRequestQuotas) HasMaxSize() bool {
if o != nil && o.MaxSize.IsSet() {
return true
}
return false
}
// SetMaxSize gets a reference to the given NullableInt32 and assigns it to the MaxSize field.
func (o *UpdateBucketRequestQuotas) SetMaxSize(v int32) {
o.MaxSize.Set(&v)
}
// SetMaxSizeNil sets the value for MaxSize to be an explicit nil
func (o *UpdateBucketRequestQuotas) SetMaxSizeNil() {
o.MaxSize.Set(nil)
}
// UnsetMaxSize ensures that no value is present for MaxSize, not even an explicit nil
func (o *UpdateBucketRequestQuotas) UnsetMaxSize() {
o.MaxSize.Unset()
}
// GetMaxObjects returns the MaxObjects field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateBucketRequestQuotas) GetMaxObjects() int32 {
if o == nil || o.MaxObjects.Get() == nil {
var ret int32
return ret
}
return *o.MaxObjects.Get()
}
// GetMaxObjectsOk returns a tuple with the MaxObjects field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateBucketRequestQuotas) GetMaxObjectsOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.MaxObjects.Get(), o.MaxObjects.IsSet()
}
// HasMaxObjects returns a boolean if a field has been set.
func (o *UpdateBucketRequestQuotas) HasMaxObjects() bool {
if o != nil && o.MaxObjects.IsSet() {
return true
}
return false
}
// SetMaxObjects gets a reference to the given NullableInt32 and assigns it to the MaxObjects field.
func (o *UpdateBucketRequestQuotas) SetMaxObjects(v int32) {
o.MaxObjects.Set(&v)
}
// SetMaxObjectsNil sets the value for MaxObjects to be an explicit nil
func (o *UpdateBucketRequestQuotas) SetMaxObjectsNil() {
o.MaxObjects.Set(nil)
}
// UnsetMaxObjects ensures that no value is present for MaxObjects, not even an explicit nil
func (o *UpdateBucketRequestQuotas) UnsetMaxObjects() {
o.MaxObjects.Unset()
}
func (o UpdateBucketRequestQuotas) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.MaxSize.IsSet() {
toSerialize["maxSize"] = o.MaxSize.Get()
}
if o.MaxObjects.IsSet() {
toSerialize["maxObjects"] = o.MaxObjects.Get()
}
return json.Marshal(toSerialize)
}
type NullableUpdateBucketRequestQuotas struct {
value *UpdateBucketRequestQuotas
isSet bool
}
func (v NullableUpdateBucketRequestQuotas) Get() *UpdateBucketRequestQuotas {
return v.value
}
func (v *NullableUpdateBucketRequestQuotas) Set(val *UpdateBucketRequestQuotas) {
v.value = val
v.isSet = true
}
func (v NullableUpdateBucketRequestQuotas) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateBucketRequestQuotas) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateBucketRequestQuotas(val *UpdateBucketRequestQuotas) *NullableUpdateBucketRequestQuotas {
return &NullableUpdateBucketRequestQuotas{value: val, isSet: true}
}
func (v NullableUpdateBucketRequestQuotas) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateBucketRequestQuotas) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,187 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// UpdateBucketRequestWebsiteAccess struct for UpdateBucketRequestWebsiteAccess
type UpdateBucketRequestWebsiteAccess struct {
Enabled *bool `json:"enabled,omitempty"`
IndexDocument *string `json:"indexDocument,omitempty"`
ErrorDocument *string `json:"errorDocument,omitempty"`
}
// NewUpdateBucketRequestWebsiteAccess instantiates a new UpdateBucketRequestWebsiteAccess object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewUpdateBucketRequestWebsiteAccess() *UpdateBucketRequestWebsiteAccess {
this := UpdateBucketRequestWebsiteAccess{}
return &this
}
// NewUpdateBucketRequestWebsiteAccessWithDefaults instantiates a new UpdateBucketRequestWebsiteAccess object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewUpdateBucketRequestWebsiteAccessWithDefaults() *UpdateBucketRequestWebsiteAccess {
this := UpdateBucketRequestWebsiteAccess{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *UpdateBucketRequestWebsiteAccess) GetEnabled() bool {
if o == nil || o.Enabled == nil {
var ret bool
return ret
}
return *o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateBucketRequestWebsiteAccess) GetEnabledOk() (*bool, bool) {
if o == nil || o.Enabled == nil {
return nil, false
}
return o.Enabled, true
}
// HasEnabled returns a boolean if a field has been set.
func (o *UpdateBucketRequestWebsiteAccess) HasEnabled() bool {
if o != nil && o.Enabled != nil {
return true
}
return false
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *UpdateBucketRequestWebsiteAccess) SetEnabled(v bool) {
o.Enabled = &v
}
// GetIndexDocument returns the IndexDocument field value if set, zero value otherwise.
func (o *UpdateBucketRequestWebsiteAccess) GetIndexDocument() string {
if o == nil || o.IndexDocument == nil {
var ret string
return ret
}
return *o.IndexDocument
}
// GetIndexDocumentOk returns a tuple with the IndexDocument field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateBucketRequestWebsiteAccess) GetIndexDocumentOk() (*string, bool) {
if o == nil || o.IndexDocument == nil {
return nil, false
}
return o.IndexDocument, true
}
// HasIndexDocument returns a boolean if a field has been set.
func (o *UpdateBucketRequestWebsiteAccess) HasIndexDocument() bool {
if o != nil && o.IndexDocument != nil {
return true
}
return false
}
// SetIndexDocument gets a reference to the given string and assigns it to the IndexDocument field.
func (o *UpdateBucketRequestWebsiteAccess) SetIndexDocument(v string) {
o.IndexDocument = &v
}
// GetErrorDocument returns the ErrorDocument field value if set, zero value otherwise.
func (o *UpdateBucketRequestWebsiteAccess) GetErrorDocument() string {
if o == nil || o.ErrorDocument == nil {
var ret string
return ret
}
return *o.ErrorDocument
}
// GetErrorDocumentOk returns a tuple with the ErrorDocument field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateBucketRequestWebsiteAccess) GetErrorDocumentOk() (*string, bool) {
if o == nil || o.ErrorDocument == nil {
return nil, false
}
return o.ErrorDocument, true
}
// HasErrorDocument returns a boolean if a field has been set.
func (o *UpdateBucketRequestWebsiteAccess) HasErrorDocument() bool {
if o != nil && o.ErrorDocument != nil {
return true
}
return false
}
// SetErrorDocument gets a reference to the given string and assigns it to the ErrorDocument field.
func (o *UpdateBucketRequestWebsiteAccess) SetErrorDocument(v string) {
o.ErrorDocument = &v
}
func (o UpdateBucketRequestWebsiteAccess) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Enabled != nil {
toSerialize["enabled"] = o.Enabled
}
if o.IndexDocument != nil {
toSerialize["indexDocument"] = o.IndexDocument
}
if o.ErrorDocument != nil {
toSerialize["errorDocument"] = o.ErrorDocument
}
return json.Marshal(toSerialize)
}
type NullableUpdateBucketRequestWebsiteAccess struct {
value *UpdateBucketRequestWebsiteAccess
isSet bool
}
func (v NullableUpdateBucketRequestWebsiteAccess) Get() *UpdateBucketRequestWebsiteAccess {
return v.value
}
func (v *NullableUpdateBucketRequestWebsiteAccess) Set(val *UpdateBucketRequestWebsiteAccess) {
v.value = val
v.isSet = true
}
func (v NullableUpdateBucketRequestWebsiteAccess) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateBucketRequestWebsiteAccess) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateBucketRequestWebsiteAccess(val *UpdateBucketRequestWebsiteAccess) *NullableUpdateBucketRequestWebsiteAccess {
return &NullableUpdateBucketRequestWebsiteAccess{value: val, isSet: true}
}
func (v NullableUpdateBucketRequestWebsiteAccess) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateBucketRequestWebsiteAccess) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,187 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// UpdateKeyRequest struct for UpdateKeyRequest
type UpdateKeyRequest struct {
Name *string `json:"name,omitempty"`
Allow *UpdateKeyRequestAllow `json:"allow,omitempty"`
Deny *UpdateKeyRequestDeny `json:"deny,omitempty"`
}
// NewUpdateKeyRequest instantiates a new UpdateKeyRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewUpdateKeyRequest() *UpdateKeyRequest {
this := UpdateKeyRequest{}
return &this
}
// NewUpdateKeyRequestWithDefaults instantiates a new UpdateKeyRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewUpdateKeyRequestWithDefaults() *UpdateKeyRequest {
this := UpdateKeyRequest{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *UpdateKeyRequest) GetName() string {
if o == nil || o.Name == nil {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateKeyRequest) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *UpdateKeyRequest) HasName() bool {
if o != nil && o.Name != nil {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *UpdateKeyRequest) SetName(v string) {
o.Name = &v
}
// GetAllow returns the Allow field value if set, zero value otherwise.
func (o *UpdateKeyRequest) GetAllow() UpdateKeyRequestAllow {
if o == nil || o.Allow == nil {
var ret UpdateKeyRequestAllow
return ret
}
return *o.Allow
}
// GetAllowOk returns a tuple with the Allow field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateKeyRequest) GetAllowOk() (*UpdateKeyRequestAllow, bool) {
if o == nil || o.Allow == nil {
return nil, false
}
return o.Allow, true
}
// HasAllow returns a boolean if a field has been set.
func (o *UpdateKeyRequest) HasAllow() bool {
if o != nil && o.Allow != nil {
return true
}
return false
}
// SetAllow gets a reference to the given UpdateKeyRequestAllow and assigns it to the Allow field.
func (o *UpdateKeyRequest) SetAllow(v UpdateKeyRequestAllow) {
o.Allow = &v
}
// GetDeny returns the Deny field value if set, zero value otherwise.
func (o *UpdateKeyRequest) GetDeny() UpdateKeyRequestDeny {
if o == nil || o.Deny == nil {
var ret UpdateKeyRequestDeny
return ret
}
return *o.Deny
}
// GetDenyOk returns a tuple with the Deny field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateKeyRequest) GetDenyOk() (*UpdateKeyRequestDeny, bool) {
if o == nil || o.Deny == nil {
return nil, false
}
return o.Deny, true
}
// HasDeny returns a boolean if a field has been set.
func (o *UpdateKeyRequest) HasDeny() bool {
if o != nil && o.Deny != nil {
return true
}
return false
}
// SetDeny gets a reference to the given UpdateKeyRequestDeny and assigns it to the Deny field.
func (o *UpdateKeyRequest) SetDeny(v UpdateKeyRequestDeny) {
o.Deny = &v
}
func (o UpdateKeyRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.Allow != nil {
toSerialize["allow"] = o.Allow
}
if o.Deny != nil {
toSerialize["deny"] = o.Deny
}
return json.Marshal(toSerialize)
}
type NullableUpdateKeyRequest struct {
value *UpdateKeyRequest
isSet bool
}
func (v NullableUpdateKeyRequest) Get() *UpdateKeyRequest {
return v.value
}
func (v *NullableUpdateKeyRequest) Set(val *UpdateKeyRequest) {
v.value = val
v.isSet = true
}
func (v NullableUpdateKeyRequest) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateKeyRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateKeyRequest(val *UpdateKeyRequest) *NullableUpdateKeyRequest {
return &NullableUpdateKeyRequest{value: val, isSet: true}
}
func (v NullableUpdateKeyRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateKeyRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,115 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// UpdateKeyRequestAllow struct for UpdateKeyRequestAllow
type UpdateKeyRequestAllow struct {
CreateBucket *bool `json:"createBucket,omitempty"`
}
// NewUpdateKeyRequestAllow instantiates a new UpdateKeyRequestAllow object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewUpdateKeyRequestAllow() *UpdateKeyRequestAllow {
this := UpdateKeyRequestAllow{}
return &this
}
// NewUpdateKeyRequestAllowWithDefaults instantiates a new UpdateKeyRequestAllow object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewUpdateKeyRequestAllowWithDefaults() *UpdateKeyRequestAllow {
this := UpdateKeyRequestAllow{}
return &this
}
// GetCreateBucket returns the CreateBucket field value if set, zero value otherwise.
func (o *UpdateKeyRequestAllow) GetCreateBucket() bool {
if o == nil || o.CreateBucket == nil {
var ret bool
return ret
}
return *o.CreateBucket
}
// GetCreateBucketOk returns a tuple with the CreateBucket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateKeyRequestAllow) GetCreateBucketOk() (*bool, bool) {
if o == nil || o.CreateBucket == nil {
return nil, false
}
return o.CreateBucket, true
}
// HasCreateBucket returns a boolean if a field has been set.
func (o *UpdateKeyRequestAllow) HasCreateBucket() bool {
if o != nil && o.CreateBucket != nil {
return true
}
return false
}
// SetCreateBucket gets a reference to the given bool and assigns it to the CreateBucket field.
func (o *UpdateKeyRequestAllow) SetCreateBucket(v bool) {
o.CreateBucket = &v
}
func (o UpdateKeyRequestAllow) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CreateBucket != nil {
toSerialize["createBucket"] = o.CreateBucket
}
return json.Marshal(toSerialize)
}
type NullableUpdateKeyRequestAllow struct {
value *UpdateKeyRequestAllow
isSet bool
}
func (v NullableUpdateKeyRequestAllow) Get() *UpdateKeyRequestAllow {
return v.value
}
func (v *NullableUpdateKeyRequestAllow) Set(val *UpdateKeyRequestAllow) {
v.value = val
v.isSet = true
}
func (v NullableUpdateKeyRequestAllow) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateKeyRequestAllow) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateKeyRequestAllow(val *UpdateKeyRequestAllow) *NullableUpdateKeyRequestAllow {
return &NullableUpdateKeyRequestAllow{value: val, isSet: true}
}
func (v NullableUpdateKeyRequestAllow) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateKeyRequestAllow) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View file

@ -0,0 +1,115 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// UpdateKeyRequestDeny struct for UpdateKeyRequestDeny
type UpdateKeyRequestDeny struct {
CreateBucket *bool `json:"createBucket,omitempty"`
}
// NewUpdateKeyRequestDeny instantiates a new UpdateKeyRequestDeny object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewUpdateKeyRequestDeny() *UpdateKeyRequestDeny {
this := UpdateKeyRequestDeny{}
return &this
}
// NewUpdateKeyRequestDenyWithDefaults instantiates a new UpdateKeyRequestDeny object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewUpdateKeyRequestDenyWithDefaults() *UpdateKeyRequestDeny {
this := UpdateKeyRequestDeny{}
return &this
}
// GetCreateBucket returns the CreateBucket field value if set, zero value otherwise.
func (o *UpdateKeyRequestDeny) GetCreateBucket() bool {
if o == nil || o.CreateBucket == nil {
var ret bool
return ret
}
return *o.CreateBucket
}
// GetCreateBucketOk returns a tuple with the CreateBucket field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateKeyRequestDeny) GetCreateBucketOk() (*bool, bool) {
if o == nil || o.CreateBucket == nil {
return nil, false
}
return o.CreateBucket, true
}
// HasCreateBucket returns a boolean if a field has been set.
func (o *UpdateKeyRequestDeny) HasCreateBucket() bool {
if o != nil && o.CreateBucket != nil {
return true
}
return false
}
// SetCreateBucket gets a reference to the given bool and assigns it to the CreateBucket field.
func (o *UpdateKeyRequestDeny) SetCreateBucket(v bool) {
o.CreateBucket = &v
}
func (o UpdateKeyRequestDeny) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CreateBucket != nil {
toSerialize["createBucket"] = o.CreateBucket
}
return json.Marshal(toSerialize)
}
type NullableUpdateKeyRequestDeny struct {
value *UpdateKeyRequestDeny
isSet bool
}
func (v NullableUpdateKeyRequestDeny) Get() *UpdateKeyRequestDeny {
return v.value
}
func (v *NullableUpdateKeyRequestDeny) Set(val *UpdateKeyRequestDeny) {
v.value = val
v.isSet = true
}
func (v NullableUpdateKeyRequestDeny) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateKeyRequestDeny) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateKeyRequestDeny(val *UpdateKeyRequestDeny) *NullableUpdateKeyRequestDeny {
return &NullableUpdateKeyRequestDeny{value: val, isSet: true}
}
func (v NullableUpdateKeyRequestDeny) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateKeyRequestDeny) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

47
golang/response.go Normal file
View file

@ -0,0 +1,47 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"net/http"
)
// APIResponse stores the API response returned by the server.
type APIResponse struct {
*http.Response `json:"-"`
Message string `json:"message,omitempty"`
// Operation is the name of the OpenAPI operation.
Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil.
RequestURL string `json:"url,omitempty"`
// Method is the HTTP method used for the request. This value is always
// available, even if the embedded *http.Response is nil.
Method string `json:"method,omitempty"`
// Payload holds the contents of the response body (which may be nil or empty).
// This is provided here as the raw response.Body() reader will have already
// been drained.
Payload []byte `json:"-"`
}
// NewAPIResponse returns a new APIResponse object.
func NewAPIResponse(r *http.Response) *APIResponse {
response := &APIResponse{Response: r}
return response
}
// NewAPIResponseWithError returns a new APIResponse object with the provided error message.
func NewAPIResponseWithError(errorMessage string) *APIResponse {
response := &APIResponse{Message: errorMessage}
return response
}

328
golang/utils.go Normal file
View file

@ -0,0 +1,328 @@
/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
"time"
)
// PtrBool is a helper routine that returns a pointer to given boolean value.
func PtrBool(v bool) *bool { return &v }
// PtrInt is a helper routine that returns a pointer to given integer value.
func PtrInt(v int) *int { return &v }
// PtrInt32 is a helper routine that returns a pointer to given integer value.
func PtrInt32(v int32) *int32 { return &v }
// PtrInt64 is a helper routine that returns a pointer to given integer value.
func PtrInt64(v int64) *int64 { return &v }
// PtrFloat32 is a helper routine that returns a pointer to given float value.
func PtrFloat32(v float32) *float32 { return &v }
// PtrFloat64 is a helper routine that returns a pointer to given float value.
func PtrFloat64(v float64) *float64 { return &v }
// PtrString is a helper routine that returns a pointer to given string value.
func PtrString(v string) *string { return &v }
// PtrTime is helper routine that returns a pointer to given Time value.
func PtrTime(v time.Time) *time.Time { return &v }
type NullableBool struct {
value *bool
isSet bool
}
func (v NullableBool) Get() *bool {
return v.value
}
func (v *NullableBool) Set(val *bool) {
v.value = val
v.isSet = true
}
func (v NullableBool) IsSet() bool {
return v.isSet
}
func (v *NullableBool) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBool(val *bool) *NullableBool {
return &NullableBool{value: val, isSet: true}
}
func (v NullableBool) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBool) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt struct {
value *int
isSet bool
}
func (v NullableInt) Get() *int {
return v.value
}
func (v *NullableInt) Set(val *int) {
v.value = val
v.isSet = true
}
func (v NullableInt) IsSet() bool {
return v.isSet
}
func (v *NullableInt) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt(val *int) *NullableInt {
return &NullableInt{value: val, isSet: true}
}
func (v NullableInt) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt32 struct {
value *int32
isSet bool
}
func (v NullableInt32) Get() *int32 {
return v.value
}
func (v *NullableInt32) Set(val *int32) {
v.value = val
v.isSet = true
}
func (v NullableInt32) IsSet() bool {
return v.isSet
}
func (v *NullableInt32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt32(val *int32) *NullableInt32 {
return &NullableInt32{value: val, isSet: true}
}
func (v NullableInt32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableInt64 struct {
value *int64
isSet bool
}
func (v NullableInt64) Get() *int64 {
return v.value
}
func (v *NullableInt64) Set(val *int64) {
v.value = val
v.isSet = true
}
func (v NullableInt64) IsSet() bool {
return v.isSet
}
func (v *NullableInt64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInt64(val *int64) *NullableInt64 {
return &NullableInt64{value: val, isSet: true}
}
func (v NullableInt64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInt64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat32 struct {
value *float32
isSet bool
}
func (v NullableFloat32) Get() *float32 {
return v.value
}
func (v *NullableFloat32) Set(val *float32) {
v.value = val
v.isSet = true
}
func (v NullableFloat32) IsSet() bool {
return v.isSet
}
func (v *NullableFloat32) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat32(val *float32) *NullableFloat32 {
return &NullableFloat32{value: val, isSet: true}
}
func (v NullableFloat32) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat32) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableFloat64 struct {
value *float64
isSet bool
}
func (v NullableFloat64) Get() *float64 {
return v.value
}
func (v *NullableFloat64) Set(val *float64) {
v.value = val
v.isSet = true
}
func (v NullableFloat64) IsSet() bool {
return v.isSet
}
func (v *NullableFloat64) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFloat64(val *float64) *NullableFloat64 {
return &NullableFloat64{value: val, isSet: true}
}
func (v NullableFloat64) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFloat64) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableString struct {
value *string
isSet bool
}
func (v NullableString) Get() *string {
return v.value
}
func (v *NullableString) Set(val *string) {
v.value = val
v.isSet = true
}
func (v NullableString) IsSet() bool {
return v.isSet
}
func (v *NullableString) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableString(val *string) *NullableString {
return &NullableString{value: val, isSet: true}
}
func (v NullableString) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableString) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
type NullableTime struct {
value *time.Time
isSet bool
}
func (v NullableTime) Get() *time.Time {
return v.value
}
func (v *NullableTime) Set(val *time.Time) {
v.value = val
v.isSet = true
}
func (v NullableTime) IsSet() bool {
return v.isSet
}
func (v *NullableTime) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableTime(val *time.Time) *NullableTime {
return &NullableTime{value: val, isSet: true}
}
func (v NullableTime) MarshalJSON() ([]byte, error) {
return v.value.MarshalJSON()
}
func (v *NullableTime) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}