├── .gitignore ├── .openapi-generator-ignore ├── .openapi-generator ├── FILES └── VERSION ├── .travis.yml ├── README.md ├── api └── openapi.yaml ├── api_nft_storage.go ├── client.go ├── configuration.go ├── docs ├── Deal.md ├── DeleteResponse.md ├── ErrorResponse.md ├── ErrorResponseError.md ├── ForbiddenErrorResponse.md ├── ForbiddenErrorResponseError.md ├── GetResponse.md ├── Links.md ├── LinksFile.md ├── ListResponse.md ├── NFT.md ├── NFTStorageAPI.md ├── Pin.md ├── PinStatus.md ├── UnauthorizedErrorResponse.md ├── UnauthorizedErrorResponseError.md └── UploadResponse.md ├── git_push.sh ├── go.mod ├── go.sum ├── model_deal.go ├── model_delete_response.go ├── model_error_response.go ├── model_error_response_error.go ├── model_forbidden_error_response.go ├── model_forbidden_error_response_error.go ├── model_get_response.go ├── model_links.go ├── model_links_file.go ├── model_list_response.go ├── model_nft.go ├── model_pin.go ├── model_pin_status.go ├── model_unauthorized_error_response.go ├── model_unauthorized_error_response_error.go ├── model_upload_response.go ├── response.go └── utils.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | -------------------------------------------------------------------------------- /.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | .gitignore 2 | .openapi-generator-ignore 3 | .travis.yml 4 | README.md 5 | api/openapi.yaml 6 | api_nft_storage.go 7 | client.go 8 | configuration.go 9 | docs/Deal.md 10 | docs/DeleteResponse.md 11 | docs/ErrorResponse.md 12 | docs/ErrorResponseError.md 13 | docs/ForbiddenErrorResponse.md 14 | docs/ForbiddenErrorResponseError.md 15 | docs/GetResponse.md 16 | docs/Links.md 17 | docs/LinksFile.md 18 | docs/ListResponse.md 19 | docs/NFT.md 20 | docs/NFTStorageAPI.md 21 | docs/Pin.md 22 | docs/PinStatus.md 23 | docs/UnauthorizedErrorResponse.md 24 | docs/UnauthorizedErrorResponseError.md 25 | docs/UploadResponse.md 26 | git_push.sh 27 | go.mod 28 | go.sum 29 | model_deal.go 30 | model_delete_response.go 31 | model_error_response.go 32 | model_error_response_error.go 33 | model_forbidden_error_response.go 34 | model_forbidden_error_response_error.go 35 | model_get_response.go 36 | model_links.go 37 | model_links_file.go 38 | model_list_response.go 39 | model_nft.go 40 | model_pin.go 41 | model_pin_status.go 42 | model_unauthorized_error_response.go 43 | model_unauthorized_error_response_error.go 44 | model_upload_response.go 45 | response.go 46 | utils.go 47 | -------------------------------------------------------------------------------- /.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 5.1.1-SNAPSHOT -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | install: 4 | - go get -d -v . 5 | 6 | script: 7 | - go build -v ./ 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Go API client for nftstorage 2 | 3 | _This client was generated via the OpenAPI schema and is experimental, unsupported, and may not work at all!_ 4 | 5 | No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 6 | 7 | ## Overview 8 | 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. 9 | 10 | - API version: 1.0 11 | - Package version: 1.0.0 12 | - Build package: org.openapitools.codegen.languages.GoClientCodegen 13 | 14 | ## Installation 15 | 16 | Install the following dependencies: 17 | 18 | ```shell 19 | go get github.com/stretchr/testify/assert 20 | go get golang.org/x/oauth2 21 | go get golang.org/x/net/context 22 | ``` 23 | 24 | Put the package under your project folder and add the following in import: 25 | 26 | ```golang 27 | import sw "./nftstorage" 28 | ``` 29 | 30 | To use a proxy, set the environment variable `HTTP_PROXY`: 31 | 32 | ```golang 33 | os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") 34 | ``` 35 | 36 | ## Configuration of Server URL 37 | 38 | Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. 39 | 40 | ### Select Server Configuration 41 | 42 | For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. 43 | 44 | ```golang 45 | ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) 46 | ``` 47 | 48 | ### Templated Server URL 49 | 50 | Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. 51 | 52 | ```golang 53 | ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ 54 | "basePath": "v2", 55 | }) 56 | ``` 57 | 58 | Note, enum values are always validated and all unused variables are silently ignored. 59 | 60 | ### URLs Configuration per Operation 61 | 62 | Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. 63 | An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. 64 | Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. 65 | 66 | ``` 67 | ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ 68 | "{classname}Service.{nickname}": 2, 69 | }) 70 | ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ 71 | "{classname}Service.{nickname}": { 72 | "port": "8443", 73 | }, 74 | }) 75 | ``` 76 | 77 | ## Documentation for API Endpoints 78 | 79 | All URIs are relative to *https://api.nft.storage* 80 | 81 | Class | Method | HTTP request | Description 82 | ------------ | ------------- | ------------- | ------------- 83 | *NFTStorageAPI* | [**Delete**](docs/NFTStorageAPI.md#delete) | **Delete** /{cid} | Stop storing the content with the passed CID 84 | *NFTStorageAPI* | [**List**](docs/NFTStorageAPI.md#list) | **Get** / | List all stored files 85 | *NFTStorageAPI* | [**Status**](docs/NFTStorageAPI.md#status) | **Get** /{cid} | Get information for the stored file CID 86 | *NFTStorageAPI* | [**Store**](docs/NFTStorageAPI.md#store) | **Post** /upload | Store a file 87 | 88 | 89 | ## Documentation For Models 90 | 91 | - [Deal](docs/Deal.md) 92 | - [DeleteResponse](docs/DeleteResponse.md) 93 | - [ErrorResponse](docs/ErrorResponse.md) 94 | - [ErrorResponseError](docs/ErrorResponseError.md) 95 | - [ForbiddenErrorResponse](docs/ForbiddenErrorResponse.md) 96 | - [ForbiddenErrorResponseError](docs/ForbiddenErrorResponseError.md) 97 | - [GetResponse](docs/GetResponse.md) 98 | - [Links](docs/Links.md) 99 | - [LinksFile](docs/LinksFile.md) 100 | - [ListResponse](docs/ListResponse.md) 101 | - [NFT](docs/NFT.md) 102 | - [Pin](docs/Pin.md) 103 | - [PinStatus](docs/PinStatus.md) 104 | - [UnauthorizedErrorResponse](docs/UnauthorizedErrorResponse.md) 105 | - [UnauthorizedErrorResponseError](docs/UnauthorizedErrorResponseError.md) 106 | - [UploadResponse](docs/UploadResponse.md) 107 | 108 | 109 | ## Documentation For Authorization 110 | 111 | 112 | 113 | ### bearerAuth 114 | 115 | - **Type**: HTTP Bearer token authentication 116 | 117 | Example 118 | 119 | ```golang 120 | auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARERTOKENSTRING") 121 | r, err := client.Service.Operation(auth, args) 122 | ``` 123 | 124 | 125 | ## Documentation for Utility Methods 126 | 127 | Due to the fact that model structure members are all pointers, this package contains 128 | a number of utility functions to easily obtain pointers to values of basic types. 129 | Each of these functions takes a value of the given basic type and returns a pointer to it: 130 | 131 | * `PtrBool` 132 | * `PtrInt` 133 | * `PtrInt32` 134 | * `PtrInt64` 135 | * `PtrFloat` 136 | * `PtrFloat32` 137 | * `PtrFloat64` 138 | * `PtrString` 139 | * `PtrTime` 140 | 141 | ## Author 142 | 143 | 144 | 145 | -------------------------------------------------------------------------------- /api_nft_storage.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "bytes" 15 | _context "context" 16 | _ioutil "io/ioutil" 17 | _nethttp "net/http" 18 | _neturl "net/url" 19 | "os" 20 | "strings" 21 | "time" 22 | ) 23 | 24 | // Linger please 25 | var ( 26 | _ _context.Context 27 | ) 28 | 29 | // NFTStorageAPIService NFTStorageAPI service 30 | type NFTStorageAPIService service 31 | 32 | type ApiDeleteRequest struct { 33 | ctx _context.Context 34 | ApiService *NFTStorageAPIService 35 | cid string 36 | } 37 | 38 | func (r ApiDeleteRequest) Execute() (DeleteResponse, *_nethttp.Response, error) { 39 | return r.ApiService.DeleteExecute(r) 40 | } 41 | 42 | /* 43 | * Delete Stop storing the content with the passed CID 44 | * Stop storing the content with the passed CID on nft.storage. 45 | - Unpin the item from the underlying IPFS pinning service. 46 | - Cease renewals for expired Filecoin deals involving the CID. 47 | 48 | ⚠️ This does not remove the content from the network. 49 | 50 | - Does not terminate any established Filecoin deal. 51 | - Does not remove the content from other IPFS nodes in the network that already cached or pinned the CID. 52 | 53 | Note: the content will remain available if another user has stored the CID with nft.storage. 54 | 55 | * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 56 | * @param cid CID for the NFT 57 | * @return ApiDeleteRequest 58 | */ 59 | func (a *NFTStorageAPIService) Delete(ctx _context.Context, cid string) ApiDeleteRequest { 60 | return ApiDeleteRequest{ 61 | ApiService: a, 62 | ctx: ctx, 63 | cid: cid, 64 | } 65 | } 66 | 67 | /* 68 | * Execute executes the request 69 | * @return DeleteResponse 70 | */ 71 | func (a *NFTStorageAPIService) DeleteExecute(r ApiDeleteRequest) (DeleteResponse, *_nethttp.Response, error) { 72 | var ( 73 | localVarHTTPMethod = _nethttp.MethodDelete 74 | localVarPostBody interface{} 75 | localVarFormFileName string 76 | localVarFileName string 77 | localVarFileBytes []byte 78 | localVarReturnValue DeleteResponse 79 | ) 80 | 81 | localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NFTStorageAPIService.Delete") 82 | if err != nil { 83 | return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} 84 | } 85 | 86 | localVarPath := localBasePath + "/{cid}" 87 | localVarPath = strings.Replace(localVarPath, "{"+"cid"+"}", _neturl.PathEscape(parameterToString(r.cid, "")), -1) 88 | 89 | localVarHeaderParams := make(map[string]string) 90 | localVarQueryParams := _neturl.Values{} 91 | localVarFormParams := _neturl.Values{} 92 | 93 | // to determine the Content-Type header 94 | localVarHTTPContentTypes := []string{} 95 | 96 | // set Content-Type header 97 | localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) 98 | if localVarHTTPContentType != "" { 99 | localVarHeaderParams["Content-Type"] = localVarHTTPContentType 100 | } 101 | 102 | // to determine the Accept header 103 | localVarHTTPHeaderAccepts := []string{"application/json"} 104 | 105 | // set Accept header 106 | localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) 107 | if localVarHTTPHeaderAccept != "" { 108 | localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept 109 | } 110 | req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) 111 | if err != nil { 112 | return localVarReturnValue, nil, err 113 | } 114 | 115 | localVarHTTPResponse, err := a.client.callAPI(req) 116 | if err != nil || localVarHTTPResponse == nil { 117 | return localVarReturnValue, localVarHTTPResponse, err 118 | } 119 | 120 | localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) 121 | localVarHTTPResponse.Body.Close() 122 | localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) 123 | if err != nil { 124 | return localVarReturnValue, localVarHTTPResponse, err 125 | } 126 | 127 | if localVarHTTPResponse.StatusCode >= 300 { 128 | newErr := GenericOpenAPIError{ 129 | body: localVarBody, 130 | error: localVarHTTPResponse.Status, 131 | } 132 | if localVarHTTPResponse.StatusCode == 401 { 133 | var v UnauthorizedErrorResponse 134 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 135 | if err != nil { 136 | newErr.error = err.Error() 137 | return localVarReturnValue, localVarHTTPResponse, newErr 138 | } 139 | newErr.model = v 140 | return localVarReturnValue, localVarHTTPResponse, newErr 141 | } 142 | if localVarHTTPResponse.StatusCode == 403 { 143 | var v ForbiddenErrorResponse 144 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 145 | if err != nil { 146 | newErr.error = err.Error() 147 | return localVarReturnValue, localVarHTTPResponse, newErr 148 | } 149 | newErr.model = v 150 | return localVarReturnValue, localVarHTTPResponse, newErr 151 | } 152 | if localVarHTTPResponse.StatusCode >= 500 { 153 | var v ErrorResponse 154 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 155 | if err != nil { 156 | newErr.error = err.Error() 157 | return localVarReturnValue, localVarHTTPResponse, newErr 158 | } 159 | newErr.model = v 160 | } 161 | return localVarReturnValue, localVarHTTPResponse, newErr 162 | } 163 | 164 | err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 165 | if err != nil { 166 | newErr := GenericOpenAPIError{ 167 | body: localVarBody, 168 | error: err.Error(), 169 | } 170 | return localVarReturnValue, localVarHTTPResponse, newErr 171 | } 172 | 173 | return localVarReturnValue, localVarHTTPResponse, nil 174 | } 175 | 176 | type ApiListRequest struct { 177 | ctx _context.Context 178 | ApiService *NFTStorageAPIService 179 | before *time.Time 180 | limit *int32 181 | } 182 | 183 | func (r ApiListRequest) Before(before time.Time) ApiListRequest { 184 | r.before = &before 185 | return r 186 | } 187 | func (r ApiListRequest) Limit(limit int32) ApiListRequest { 188 | r.limit = &limit 189 | return r 190 | } 191 | 192 | func (r ApiListRequest) Execute() (ListResponse, *_nethttp.Response, error) { 193 | return r.ApiService.ListExecute(r) 194 | } 195 | 196 | /* 197 | * List List all stored files 198 | * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 199 | * @return ApiListRequest 200 | */ 201 | func (a *NFTStorageAPIService) List(ctx _context.Context) ApiListRequest { 202 | return ApiListRequest{ 203 | ApiService: a, 204 | ctx: ctx, 205 | } 206 | } 207 | 208 | /* 209 | * Execute executes the request 210 | * @return ListResponse 211 | */ 212 | func (a *NFTStorageAPIService) ListExecute(r ApiListRequest) (ListResponse, *_nethttp.Response, error) { 213 | var ( 214 | localVarHTTPMethod = _nethttp.MethodGet 215 | localVarPostBody interface{} 216 | localVarFormFileName string 217 | localVarFileName string 218 | localVarFileBytes []byte 219 | localVarReturnValue ListResponse 220 | ) 221 | 222 | localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NFTStorageAPIService.List") 223 | if err != nil { 224 | return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} 225 | } 226 | 227 | localVarPath := localBasePath + "/" 228 | 229 | localVarHeaderParams := make(map[string]string) 230 | localVarQueryParams := _neturl.Values{} 231 | localVarFormParams := _neturl.Values{} 232 | 233 | if r.before != nil { 234 | localVarQueryParams.Add("before", parameterToString(*r.before, "")) 235 | } 236 | if r.limit != nil { 237 | localVarQueryParams.Add("limit", parameterToString(*r.limit, "")) 238 | } 239 | // to determine the Content-Type header 240 | localVarHTTPContentTypes := []string{} 241 | 242 | // set Content-Type header 243 | localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) 244 | if localVarHTTPContentType != "" { 245 | localVarHeaderParams["Content-Type"] = localVarHTTPContentType 246 | } 247 | 248 | // to determine the Accept header 249 | localVarHTTPHeaderAccepts := []string{"application/json"} 250 | 251 | // set Accept header 252 | localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) 253 | if localVarHTTPHeaderAccept != "" { 254 | localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept 255 | } 256 | req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) 257 | if err != nil { 258 | return localVarReturnValue, nil, err 259 | } 260 | 261 | localVarHTTPResponse, err := a.client.callAPI(req) 262 | if err != nil || localVarHTTPResponse == nil { 263 | return localVarReturnValue, localVarHTTPResponse, err 264 | } 265 | 266 | localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) 267 | localVarHTTPResponse.Body.Close() 268 | localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) 269 | if err != nil { 270 | return localVarReturnValue, localVarHTTPResponse, err 271 | } 272 | 273 | if localVarHTTPResponse.StatusCode >= 300 { 274 | newErr := GenericOpenAPIError{ 275 | body: localVarBody, 276 | error: localVarHTTPResponse.Status, 277 | } 278 | if localVarHTTPResponse.StatusCode == 401 { 279 | var v UnauthorizedErrorResponse 280 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 281 | if err != nil { 282 | newErr.error = err.Error() 283 | return localVarReturnValue, localVarHTTPResponse, newErr 284 | } 285 | newErr.model = v 286 | return localVarReturnValue, localVarHTTPResponse, newErr 287 | } 288 | if localVarHTTPResponse.StatusCode == 403 { 289 | var v ForbiddenErrorResponse 290 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 291 | if err != nil { 292 | newErr.error = err.Error() 293 | return localVarReturnValue, localVarHTTPResponse, newErr 294 | } 295 | newErr.model = v 296 | return localVarReturnValue, localVarHTTPResponse, newErr 297 | } 298 | if localVarHTTPResponse.StatusCode >= 500 { 299 | var v ErrorResponse 300 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 301 | if err != nil { 302 | newErr.error = err.Error() 303 | return localVarReturnValue, localVarHTTPResponse, newErr 304 | } 305 | newErr.model = v 306 | } 307 | return localVarReturnValue, localVarHTTPResponse, newErr 308 | } 309 | 310 | err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 311 | if err != nil { 312 | newErr := GenericOpenAPIError{ 313 | body: localVarBody, 314 | error: err.Error(), 315 | } 316 | return localVarReturnValue, localVarHTTPResponse, newErr 317 | } 318 | 319 | return localVarReturnValue, localVarHTTPResponse, nil 320 | } 321 | 322 | type ApiStatusRequest struct { 323 | ctx _context.Context 324 | ApiService *NFTStorageAPIService 325 | cid string 326 | } 327 | 328 | func (r ApiStatusRequest) Execute() (GetResponse, *_nethttp.Response, error) { 329 | return r.ApiService.StatusExecute(r) 330 | } 331 | 332 | /* 333 | * Status Get information for the stored file CID 334 | * Includes the IPFS pinning state and the Filecoin deal state. 335 | * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 336 | * @param cid CID for the NFT 337 | * @return ApiStatusRequest 338 | */ 339 | func (a *NFTStorageAPIService) Status(ctx _context.Context, cid string) ApiStatusRequest { 340 | return ApiStatusRequest{ 341 | ApiService: a, 342 | ctx: ctx, 343 | cid: cid, 344 | } 345 | } 346 | 347 | /* 348 | * Execute executes the request 349 | * @return GetResponse 350 | */ 351 | func (a *NFTStorageAPIService) StatusExecute(r ApiStatusRequest) (GetResponse, *_nethttp.Response, error) { 352 | var ( 353 | localVarHTTPMethod = _nethttp.MethodGet 354 | localVarPostBody interface{} 355 | localVarFormFileName string 356 | localVarFileName string 357 | localVarFileBytes []byte 358 | localVarReturnValue GetResponse 359 | ) 360 | 361 | localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NFTStorageAPIService.Status") 362 | if err != nil { 363 | return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} 364 | } 365 | 366 | localVarPath := localBasePath + "/{cid}" 367 | localVarPath = strings.Replace(localVarPath, "{"+"cid"+"}", _neturl.PathEscape(parameterToString(r.cid, "")), -1) 368 | 369 | localVarHeaderParams := make(map[string]string) 370 | localVarQueryParams := _neturl.Values{} 371 | localVarFormParams := _neturl.Values{} 372 | 373 | // to determine the Content-Type header 374 | localVarHTTPContentTypes := []string{} 375 | 376 | // set Content-Type header 377 | localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) 378 | if localVarHTTPContentType != "" { 379 | localVarHeaderParams["Content-Type"] = localVarHTTPContentType 380 | } 381 | 382 | // to determine the Accept header 383 | localVarHTTPHeaderAccepts := []string{"application/json"} 384 | 385 | // set Accept header 386 | localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) 387 | if localVarHTTPHeaderAccept != "" { 388 | localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept 389 | } 390 | req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) 391 | if err != nil { 392 | return localVarReturnValue, nil, err 393 | } 394 | 395 | localVarHTTPResponse, err := a.client.callAPI(req) 396 | if err != nil || localVarHTTPResponse == nil { 397 | return localVarReturnValue, localVarHTTPResponse, err 398 | } 399 | 400 | localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) 401 | localVarHTTPResponse.Body.Close() 402 | localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) 403 | if err != nil { 404 | return localVarReturnValue, localVarHTTPResponse, err 405 | } 406 | 407 | if localVarHTTPResponse.StatusCode >= 300 { 408 | newErr := GenericOpenAPIError{ 409 | body: localVarBody, 410 | error: localVarHTTPResponse.Status, 411 | } 412 | if localVarHTTPResponse.StatusCode == 401 { 413 | var v UnauthorizedErrorResponse 414 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 415 | if err != nil { 416 | newErr.error = err.Error() 417 | return localVarReturnValue, localVarHTTPResponse, newErr 418 | } 419 | newErr.model = v 420 | return localVarReturnValue, localVarHTTPResponse, newErr 421 | } 422 | if localVarHTTPResponse.StatusCode == 403 { 423 | var v ForbiddenErrorResponse 424 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 425 | if err != nil { 426 | newErr.error = err.Error() 427 | return localVarReturnValue, localVarHTTPResponse, newErr 428 | } 429 | newErr.model = v 430 | return localVarReturnValue, localVarHTTPResponse, newErr 431 | } 432 | if localVarHTTPResponse.StatusCode >= 500 { 433 | var v ErrorResponse 434 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 435 | if err != nil { 436 | newErr.error = err.Error() 437 | return localVarReturnValue, localVarHTTPResponse, newErr 438 | } 439 | newErr.model = v 440 | } 441 | return localVarReturnValue, localVarHTTPResponse, newErr 442 | } 443 | 444 | err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 445 | if err != nil { 446 | newErr := GenericOpenAPIError{ 447 | body: localVarBody, 448 | error: err.Error(), 449 | } 450 | return localVarReturnValue, localVarHTTPResponse, newErr 451 | } 452 | 453 | return localVarReturnValue, localVarHTTPResponse, nil 454 | } 455 | 456 | type ApiStoreRequest struct { 457 | ctx _context.Context 458 | ApiService *NFTStorageAPIService 459 | body **os.File 460 | } 461 | 462 | func (r ApiStoreRequest) Body(body *os.File) ApiStoreRequest { 463 | r.body = &body 464 | return r 465 | } 466 | 467 | func (r ApiStoreRequest) Execute() (UploadResponse, *_nethttp.Response, error) { 468 | return r.ApiService.StoreExecute(r) 469 | } 470 | 471 | /* 472 | * Store Store a file 473 | * Store a file with nft.storage. 474 | 475 | - Submit a HTTP `POST` request passing the file data in the request body. 476 | - To store multiple files in a directory, submit a `multipart/form-data` HTTP `POST` request. 477 | 478 | Use the `Content-Disposition` header for each part to specify a filename. 479 | 480 | * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). 481 | * @return ApiStoreRequest 482 | */ 483 | func (a *NFTStorageAPIService) Store(ctx _context.Context) ApiStoreRequest { 484 | return ApiStoreRequest{ 485 | ApiService: a, 486 | ctx: ctx, 487 | } 488 | } 489 | 490 | /* 491 | * Execute executes the request 492 | * @return UploadResponse 493 | */ 494 | func (a *NFTStorageAPIService) StoreExecute(r ApiStoreRequest) (UploadResponse, *_nethttp.Response, error) { 495 | var ( 496 | localVarHTTPMethod = _nethttp.MethodPost 497 | localVarPostBody interface{} 498 | localVarFormFileName string 499 | localVarFileName string 500 | localVarFileBytes []byte 501 | localVarReturnValue UploadResponse 502 | ) 503 | 504 | localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NFTStorageAPIService.Store") 505 | if err != nil { 506 | return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} 507 | } 508 | 509 | localVarPath := localBasePath + "/upload" 510 | 511 | localVarHeaderParams := make(map[string]string) 512 | localVarQueryParams := _neturl.Values{} 513 | localVarFormParams := _neturl.Values{} 514 | if r.body == nil { 515 | return localVarReturnValue, nil, reportError("body is required and must be specified") 516 | } 517 | 518 | // to determine the Content-Type header 519 | localVarHTTPContentTypes := []string{"image/png", "application/octet-stream", "multipart/form-data"} 520 | 521 | // set Content-Type header 522 | localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) 523 | if localVarHTTPContentType != "" { 524 | localVarHeaderParams["Content-Type"] = localVarHTTPContentType 525 | } 526 | 527 | // to determine the Accept header 528 | localVarHTTPHeaderAccepts := []string{"application/json"} 529 | 530 | // set Accept header 531 | localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) 532 | if localVarHTTPHeaderAccept != "" { 533 | localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept 534 | } 535 | // body params 536 | localVarPostBody = r.body 537 | req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) 538 | if err != nil { 539 | return localVarReturnValue, nil, err 540 | } 541 | 542 | localVarHTTPResponse, err := a.client.callAPI(req) 543 | if err != nil || localVarHTTPResponse == nil { 544 | return localVarReturnValue, localVarHTTPResponse, err 545 | } 546 | 547 | localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) 548 | localVarHTTPResponse.Body.Close() 549 | localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) 550 | if err != nil { 551 | return localVarReturnValue, localVarHTTPResponse, err 552 | } 553 | 554 | if localVarHTTPResponse.StatusCode >= 300 { 555 | newErr := GenericOpenAPIError{ 556 | body: localVarBody, 557 | error: localVarHTTPResponse.Status, 558 | } 559 | if localVarHTTPResponse.StatusCode == 401 { 560 | var v UnauthorizedErrorResponse 561 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 562 | if err != nil { 563 | newErr.error = err.Error() 564 | return localVarReturnValue, localVarHTTPResponse, newErr 565 | } 566 | newErr.model = v 567 | return localVarReturnValue, localVarHTTPResponse, newErr 568 | } 569 | if localVarHTTPResponse.StatusCode == 403 { 570 | var v ForbiddenErrorResponse 571 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 572 | if err != nil { 573 | newErr.error = err.Error() 574 | return localVarReturnValue, localVarHTTPResponse, newErr 575 | } 576 | newErr.model = v 577 | return localVarReturnValue, localVarHTTPResponse, newErr 578 | } 579 | if localVarHTTPResponse.StatusCode >= 500 { 580 | var v ErrorResponse 581 | err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 582 | if err != nil { 583 | newErr.error = err.Error() 584 | return localVarReturnValue, localVarHTTPResponse, newErr 585 | } 586 | newErr.model = v 587 | } 588 | return localVarReturnValue, localVarHTTPResponse, newErr 589 | } 590 | 591 | err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) 592 | if err != nil { 593 | newErr := GenericOpenAPIError{ 594 | body: localVarBody, 595 | error: err.Error(), 596 | } 597 | return localVarReturnValue, localVarHTTPResponse, newErr 598 | } 599 | 600 | return localVarReturnValue, localVarHTTPResponse, nil 601 | } 602 | -------------------------------------------------------------------------------- /client.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "bytes" 15 | "context" 16 | "encoding/json" 17 | "encoding/xml" 18 | "errors" 19 | "fmt" 20 | "io" 21 | "log" 22 | "mime/multipart" 23 | "net/http" 24 | "net/http/httputil" 25 | "net/url" 26 | "os" 27 | "path/filepath" 28 | "reflect" 29 | "regexp" 30 | "strconv" 31 | "strings" 32 | "time" 33 | "unicode/utf8" 34 | 35 | "golang.org/x/oauth2" 36 | ) 37 | 38 | var ( 39 | jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) 40 | xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) 41 | ) 42 | 43 | // APIClient manages communication with the NFT Storage API API v1.0 44 | // In most cases there should be only one, shared, APIClient. 45 | type APIClient struct { 46 | cfg *Configuration 47 | common service // Reuse a single struct instead of allocating one for each service on the heap. 48 | 49 | // API Services 50 | 51 | NFTStorageAPI *NFTStorageAPIService 52 | } 53 | 54 | type service struct { 55 | client *APIClient 56 | } 57 | 58 | // NewAPIClient creates a new API client. Requires a userAgent string describing your application. 59 | // optionally a custom http.Client to allow for advanced features such as caching. 60 | func NewAPIClient(cfg *Configuration) *APIClient { 61 | if cfg.HTTPClient == nil { 62 | cfg.HTTPClient = http.DefaultClient 63 | } 64 | 65 | c := &APIClient{} 66 | c.cfg = cfg 67 | c.common.client = c 68 | 69 | // API Services 70 | c.NFTStorageAPI = (*NFTStorageAPIService)(&c.common) 71 | 72 | return c 73 | } 74 | 75 | func atoi(in string) (int, error) { 76 | return strconv.Atoi(in) 77 | } 78 | 79 | // selectHeaderContentType select a content type from the available list. 80 | func selectHeaderContentType(contentTypes []string) string { 81 | if len(contentTypes) == 0 { 82 | return "" 83 | } 84 | if contains(contentTypes, "application/json") { 85 | return "application/json" 86 | } 87 | return contentTypes[0] // use the first content type specified in 'consumes' 88 | } 89 | 90 | // selectHeaderAccept join all accept types and return 91 | func selectHeaderAccept(accepts []string) string { 92 | if len(accepts) == 0 { 93 | return "" 94 | } 95 | 96 | if contains(accepts, "application/json") { 97 | return "application/json" 98 | } 99 | 100 | return strings.Join(accepts, ",") 101 | } 102 | 103 | // contains is a case insenstive match, finding needle in a haystack 104 | func contains(haystack []string, needle string) bool { 105 | for _, a := range haystack { 106 | if strings.ToLower(a) == strings.ToLower(needle) { 107 | return true 108 | } 109 | } 110 | return false 111 | } 112 | 113 | // Verify optional parameters are of the correct type. 114 | func typeCheckParameter(obj interface{}, expected string, name string) error { 115 | // Make sure there is an object. 116 | if obj == nil { 117 | return nil 118 | } 119 | 120 | // Check the type is as expected. 121 | if reflect.TypeOf(obj).String() != expected { 122 | return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) 123 | } 124 | return nil 125 | } 126 | 127 | // parameterToString convert interface{} parameters to string, using a delimiter if format is provided. 128 | func parameterToString(obj interface{}, collectionFormat string) string { 129 | var delimiter string 130 | 131 | switch collectionFormat { 132 | case "pipes": 133 | delimiter = "|" 134 | case "ssv": 135 | delimiter = " " 136 | case "tsv": 137 | delimiter = "\t" 138 | case "csv": 139 | delimiter = "," 140 | } 141 | 142 | if reflect.TypeOf(obj).Kind() == reflect.Slice { 143 | return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") 144 | } else if t, ok := obj.(time.Time); ok { 145 | return t.Format(time.RFC3339) 146 | } 147 | 148 | return fmt.Sprintf("%v", obj) 149 | } 150 | 151 | // helper for converting interface{} parameters to json strings 152 | func parameterToJson(obj interface{}) (string, error) { 153 | jsonBuf, err := json.Marshal(obj) 154 | if err != nil { 155 | return "", err 156 | } 157 | return string(jsonBuf), err 158 | } 159 | 160 | // callAPI do the request. 161 | func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { 162 | if c.cfg.Debug { 163 | dump, err := httputil.DumpRequestOut(request, true) 164 | if err != nil { 165 | return nil, err 166 | } 167 | log.Printf("\n%s\n", string(dump)) 168 | } 169 | 170 | resp, err := c.cfg.HTTPClient.Do(request) 171 | if err != nil { 172 | return resp, err 173 | } 174 | 175 | if c.cfg.Debug { 176 | dump, err := httputil.DumpResponse(resp, true) 177 | if err != nil { 178 | return resp, err 179 | } 180 | log.Printf("\n%s\n", string(dump)) 181 | } 182 | return resp, err 183 | } 184 | 185 | // Allow modification of underlying config for alternate implementations and testing 186 | // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior 187 | func (c *APIClient) GetConfig() *Configuration { 188 | return c.cfg 189 | } 190 | 191 | // prepareRequest build the request 192 | func (c *APIClient) prepareRequest( 193 | ctx context.Context, 194 | path string, method string, 195 | postBody interface{}, 196 | headerParams map[string]string, 197 | queryParams url.Values, 198 | formParams url.Values, 199 | formFileName string, 200 | fileName string, 201 | fileBytes []byte) (localVarRequest *http.Request, err error) { 202 | 203 | var body *bytes.Buffer 204 | 205 | // Detect postBody type and post. 206 | if postBody != nil { 207 | contentType := headerParams["Content-Type"] 208 | if contentType == "" { 209 | contentType = detectContentType(postBody) 210 | headerParams["Content-Type"] = contentType 211 | } 212 | 213 | body, err = setBody(postBody, contentType) 214 | if err != nil { 215 | return nil, err 216 | } 217 | } 218 | 219 | // add form parameters and file if available. 220 | if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { 221 | if body != nil { 222 | return nil, errors.New("Cannot specify postBody and multipart form at the same time.") 223 | } 224 | body = &bytes.Buffer{} 225 | w := multipart.NewWriter(body) 226 | 227 | for k, v := range formParams { 228 | for _, iv := range v { 229 | if strings.HasPrefix(k, "@") { // file 230 | err = addFile(w, k[1:], iv) 231 | if err != nil { 232 | return nil, err 233 | } 234 | } else { // form value 235 | w.WriteField(k, iv) 236 | } 237 | } 238 | } 239 | if len(fileBytes) > 0 && fileName != "" { 240 | w.Boundary() 241 | //_, fileNm := filepath.Split(fileName) 242 | part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) 243 | if err != nil { 244 | return nil, err 245 | } 246 | _, err = part.Write(fileBytes) 247 | if err != nil { 248 | return nil, err 249 | } 250 | } 251 | 252 | // Set the Boundary in the Content-Type 253 | headerParams["Content-Type"] = w.FormDataContentType() 254 | 255 | // Set Content-Length 256 | headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) 257 | w.Close() 258 | } 259 | 260 | if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { 261 | if body != nil { 262 | return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") 263 | } 264 | body = &bytes.Buffer{} 265 | body.WriteString(formParams.Encode()) 266 | // Set Content-Length 267 | headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) 268 | } 269 | 270 | // Setup path and query parameters 271 | url, err := url.Parse(path) 272 | if err != nil { 273 | return nil, err 274 | } 275 | 276 | // Override request host, if applicable 277 | if c.cfg.Host != "" { 278 | url.Host = c.cfg.Host 279 | } 280 | 281 | // Override request scheme, if applicable 282 | if c.cfg.Scheme != "" { 283 | url.Scheme = c.cfg.Scheme 284 | } 285 | 286 | // Adding Query Param 287 | query := url.Query() 288 | for k, v := range queryParams { 289 | for _, iv := range v { 290 | query.Add(k, iv) 291 | } 292 | } 293 | 294 | // Encode the parameters. 295 | url.RawQuery = query.Encode() 296 | 297 | // Generate a new request 298 | if body != nil { 299 | localVarRequest, err = http.NewRequest(method, url.String(), body) 300 | } else { 301 | localVarRequest, err = http.NewRequest(method, url.String(), nil) 302 | } 303 | if err != nil { 304 | return nil, err 305 | } 306 | 307 | // add header parameters, if any 308 | if len(headerParams) > 0 { 309 | headers := http.Header{} 310 | for h, v := range headerParams { 311 | headers.Set(h, v) 312 | } 313 | localVarRequest.Header = headers 314 | } 315 | 316 | // Add the user agent to the request. 317 | localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) 318 | 319 | if ctx != nil { 320 | // add context to the request 321 | localVarRequest = localVarRequest.WithContext(ctx) 322 | 323 | // Walk through any authentication. 324 | 325 | // OAuth2 authentication 326 | if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { 327 | // We were able to grab an oauth2 token from the context 328 | var latestToken *oauth2.Token 329 | if latestToken, err = tok.Token(); err != nil { 330 | return nil, err 331 | } 332 | 333 | latestToken.SetAuthHeader(localVarRequest) 334 | } 335 | 336 | // Basic HTTP Authentication 337 | if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { 338 | localVarRequest.SetBasicAuth(auth.UserName, auth.Password) 339 | } 340 | 341 | // AccessToken Authentication 342 | if auth, ok := ctx.Value(ContextAccessToken).(string); ok { 343 | localVarRequest.Header.Add("Authorization", "Bearer "+auth) 344 | } 345 | 346 | } 347 | 348 | for header, value := range c.cfg.DefaultHeader { 349 | localVarRequest.Header.Add(header, value) 350 | } 351 | return localVarRequest, nil 352 | } 353 | 354 | func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { 355 | if len(b) == 0 { 356 | return nil 357 | } 358 | if s, ok := v.(*string); ok { 359 | *s = string(b) 360 | return nil 361 | } 362 | if xmlCheck.MatchString(contentType) { 363 | if err = xml.Unmarshal(b, v); err != nil { 364 | return err 365 | } 366 | return nil 367 | } 368 | if jsonCheck.MatchString(contentType) { 369 | if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas 370 | if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined 371 | if err = unmarshalObj.UnmarshalJSON(b); err != nil { 372 | return err 373 | } 374 | } else { 375 | return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") 376 | } 377 | } else if err = json.Unmarshal(b, v); err != nil { // simple model 378 | return err 379 | } 380 | return nil 381 | } 382 | return errors.New("undefined response type") 383 | } 384 | 385 | // Add a file to the multipart request 386 | func addFile(w *multipart.Writer, fieldName, path string) error { 387 | file, err := os.Open(path) 388 | if err != nil { 389 | return err 390 | } 391 | defer file.Close() 392 | 393 | part, err := w.CreateFormFile(fieldName, filepath.Base(path)) 394 | if err != nil { 395 | return err 396 | } 397 | _, err = io.Copy(part, file) 398 | 399 | return err 400 | } 401 | 402 | // Prevent trying to import "fmt" 403 | func reportError(format string, a ...interface{}) error { 404 | return fmt.Errorf(format, a...) 405 | } 406 | 407 | // Set request body from an interface{} 408 | func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { 409 | if bodyBuf == nil { 410 | bodyBuf = &bytes.Buffer{} 411 | } 412 | 413 | if reader, ok := body.(io.Reader); ok { 414 | _, err = bodyBuf.ReadFrom(reader) 415 | } else if fp, ok := body.(**os.File); ok { 416 | _, err = bodyBuf.ReadFrom(*fp) 417 | } else if b, ok := body.([]byte); ok { 418 | _, err = bodyBuf.Write(b) 419 | } else if s, ok := body.(string); ok { 420 | _, err = bodyBuf.WriteString(s) 421 | } else if s, ok := body.(*string); ok { 422 | _, err = bodyBuf.WriteString(*s) 423 | } else if jsonCheck.MatchString(contentType) { 424 | err = json.NewEncoder(bodyBuf).Encode(body) 425 | } else if xmlCheck.MatchString(contentType) { 426 | err = xml.NewEncoder(bodyBuf).Encode(body) 427 | } 428 | 429 | if err != nil { 430 | return nil, err 431 | } 432 | 433 | if bodyBuf.Len() == 0 { 434 | err = fmt.Errorf("Invalid body type %s\n", contentType) 435 | return nil, err 436 | } 437 | return bodyBuf, nil 438 | } 439 | 440 | // detectContentType method is used to figure out `Request.Body` content type for request header 441 | func detectContentType(body interface{}) string { 442 | contentType := "text/plain; charset=utf-8" 443 | kind := reflect.TypeOf(body).Kind() 444 | 445 | switch kind { 446 | case reflect.Struct, reflect.Map, reflect.Ptr: 447 | contentType = "application/json; charset=utf-8" 448 | case reflect.String: 449 | contentType = "text/plain; charset=utf-8" 450 | default: 451 | if b, ok := body.([]byte); ok { 452 | contentType = http.DetectContentType(b) 453 | } else if kind == reflect.Slice { 454 | contentType = "application/json; charset=utf-8" 455 | } 456 | } 457 | 458 | return contentType 459 | } 460 | 461 | // Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go 462 | type cacheControl map[string]string 463 | 464 | func parseCacheControl(headers http.Header) cacheControl { 465 | cc := cacheControl{} 466 | ccHeader := headers.Get("Cache-Control") 467 | for _, part := range strings.Split(ccHeader, ",") { 468 | part = strings.Trim(part, " ") 469 | if part == "" { 470 | continue 471 | } 472 | if strings.ContainsRune(part, '=') { 473 | keyval := strings.Split(part, "=") 474 | cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") 475 | } else { 476 | cc[part] = "" 477 | } 478 | } 479 | return cc 480 | } 481 | 482 | // CacheExpires helper function to determine remaining time before repeating a request. 483 | func CacheExpires(r *http.Response) time.Time { 484 | // Figure out when the cache expires. 485 | var expires time.Time 486 | now, err := time.Parse(time.RFC1123, r.Header.Get("date")) 487 | if err != nil { 488 | return time.Now() 489 | } 490 | respCacheControl := parseCacheControl(r.Header) 491 | 492 | if maxAge, ok := respCacheControl["max-age"]; ok { 493 | lifetime, err := time.ParseDuration(maxAge + "s") 494 | if err != nil { 495 | expires = now 496 | } else { 497 | expires = now.Add(lifetime) 498 | } 499 | } else { 500 | expiresHeader := r.Header.Get("Expires") 501 | if expiresHeader != "" { 502 | expires, err = time.Parse(time.RFC1123, expiresHeader) 503 | if err != nil { 504 | expires = now 505 | } 506 | } 507 | } 508 | return expires 509 | } 510 | 511 | func strlen(s string) int { 512 | return utf8.RuneCountInString(s) 513 | } 514 | 515 | // GenericOpenAPIError Provides access to the body, error and model on returned errors. 516 | type GenericOpenAPIError struct { 517 | body []byte 518 | error string 519 | model interface{} 520 | } 521 | 522 | // Error returns non-empty string if there was an error. 523 | func (e GenericOpenAPIError) Error() string { 524 | return e.error 525 | } 526 | 527 | // Body returns the raw bytes of the response 528 | func (e GenericOpenAPIError) Body() []byte { 529 | return e.body 530 | } 531 | 532 | // Model returns the unpacked model of the error 533 | func (e GenericOpenAPIError) Model() interface{} { 534 | return e.model 535 | } 536 | -------------------------------------------------------------------------------- /configuration.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "context" 15 | "fmt" 16 | "net/http" 17 | "strings" 18 | ) 19 | 20 | // contextKeys are used to identify the type of value in the context. 21 | // Since these are string, it is possible to get a short description of the 22 | // context key for logging and debugging using key.String(). 23 | 24 | type contextKey string 25 | 26 | func (c contextKey) String() string { 27 | return "auth " + string(c) 28 | } 29 | 30 | var ( 31 | // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. 32 | ContextOAuth2 = contextKey("token") 33 | 34 | // ContextBasicAuth takes BasicAuth as authentication for the request. 35 | ContextBasicAuth = contextKey("basic") 36 | 37 | // ContextAccessToken takes a string oauth2 access token as authentication for the request. 38 | ContextAccessToken = contextKey("accesstoken") 39 | 40 | // ContextAPIKeys takes a string apikey as authentication for the request 41 | ContextAPIKeys = contextKey("apiKeys") 42 | 43 | // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. 44 | ContextHttpSignatureAuth = contextKey("httpsignature") 45 | 46 | // ContextServerIndex uses a server configuration from the index. 47 | ContextServerIndex = contextKey("serverIndex") 48 | 49 | // ContextOperationServerIndices uses a server configuration from the index mapping. 50 | ContextOperationServerIndices = contextKey("serverOperationIndices") 51 | 52 | // ContextServerVariables overrides a server configuration variables. 53 | ContextServerVariables = contextKey("serverVariables") 54 | 55 | // ContextOperationServerVariables overrides a server configuration variables using operation specific values. 56 | ContextOperationServerVariables = contextKey("serverOperationVariables") 57 | ) 58 | 59 | // BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth 60 | type BasicAuth struct { 61 | UserName string `json:"userName,omitempty"` 62 | Password string `json:"password,omitempty"` 63 | } 64 | 65 | // APIKey provides API key based authentication to a request passed via context using ContextAPIKey 66 | type APIKey struct { 67 | Key string 68 | Prefix string 69 | } 70 | 71 | // ServerVariable stores the information about a server variable 72 | type ServerVariable struct { 73 | Description string 74 | DefaultValue string 75 | EnumValues []string 76 | } 77 | 78 | // ServerConfiguration stores the information about a server 79 | type ServerConfiguration struct { 80 | URL string 81 | Description string 82 | Variables map[string]ServerVariable 83 | } 84 | 85 | // ServerConfigurations stores multiple ServerConfiguration items 86 | type ServerConfigurations []ServerConfiguration 87 | 88 | // Configuration stores the configuration of the API client 89 | type Configuration struct { 90 | Host string `json:"host,omitempty"` 91 | Scheme string `json:"scheme,omitempty"` 92 | DefaultHeader map[string]string `json:"defaultHeader,omitempty"` 93 | UserAgent string `json:"userAgent,omitempty"` 94 | Debug bool `json:"debug,omitempty"` 95 | Servers ServerConfigurations 96 | OperationServers map[string]ServerConfigurations 97 | HTTPClient *http.Client 98 | } 99 | 100 | // NewConfiguration returns a new Configuration object 101 | func NewConfiguration() *Configuration { 102 | cfg := &Configuration{ 103 | DefaultHeader: make(map[string]string), 104 | UserAgent: "OpenAPI-Generator/1.0.0/go", 105 | Debug: false, 106 | Servers: ServerConfigurations{ 107 | { 108 | URL: "https://api.nft.storage", 109 | Description: "No description provided", 110 | }, 111 | }, 112 | OperationServers: map[string]ServerConfigurations{ 113 | }, 114 | } 115 | return cfg 116 | } 117 | 118 | // AddDefaultHeader adds a new HTTP header to the default header in the request 119 | func (c *Configuration) AddDefaultHeader(key string, value string) { 120 | c.DefaultHeader[key] = value 121 | } 122 | 123 | // URL formats template on a index using given variables 124 | func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { 125 | if index < 0 || len(sc) <= index { 126 | return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) 127 | } 128 | server := sc[index] 129 | url := server.URL 130 | 131 | // go through variables and replace placeholders 132 | for name, variable := range server.Variables { 133 | if value, ok := variables[name]; ok { 134 | found := bool(len(variable.EnumValues) == 0) 135 | for _, enumValue := range variable.EnumValues { 136 | if value == enumValue { 137 | found = true 138 | } 139 | } 140 | if !found { 141 | return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) 142 | } 143 | url = strings.Replace(url, "{"+name+"}", value, -1) 144 | } else { 145 | url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) 146 | } 147 | } 148 | return url, nil 149 | } 150 | 151 | // ServerURL returns URL based on server settings 152 | func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { 153 | return c.Servers.URL(index, variables) 154 | } 155 | 156 | func getServerIndex(ctx context.Context) (int, error) { 157 | si := ctx.Value(ContextServerIndex) 158 | if si != nil { 159 | if index, ok := si.(int); ok { 160 | return index, nil 161 | } 162 | return 0, reportError("Invalid type %T should be int", si) 163 | } 164 | return 0, nil 165 | } 166 | 167 | func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { 168 | osi := ctx.Value(ContextOperationServerIndices) 169 | if osi != nil { 170 | if operationIndices, ok := osi.(map[string]int); !ok { 171 | return 0, reportError("Invalid type %T should be map[string]int", osi) 172 | } else { 173 | index, ok := operationIndices[endpoint] 174 | if ok { 175 | return index, nil 176 | } 177 | } 178 | } 179 | return getServerIndex(ctx) 180 | } 181 | 182 | func getServerVariables(ctx context.Context) (map[string]string, error) { 183 | sv := ctx.Value(ContextServerVariables) 184 | if sv != nil { 185 | if variables, ok := sv.(map[string]string); ok { 186 | return variables, nil 187 | } 188 | return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) 189 | } 190 | return nil, nil 191 | } 192 | 193 | func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { 194 | osv := ctx.Value(ContextOperationServerVariables) 195 | if osv != nil { 196 | if operationVariables, ok := osv.(map[string]map[string]string); !ok { 197 | return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) 198 | } else { 199 | variables, ok := operationVariables[endpoint] 200 | if ok { 201 | return variables, nil 202 | } 203 | } 204 | } 205 | return getServerVariables(ctx) 206 | } 207 | 208 | // ServerURLWithContext returns a new server URL given an endpoint 209 | func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { 210 | sc, ok := c.OperationServers[endpoint] 211 | if !ok { 212 | sc = c.Servers 213 | } 214 | 215 | if ctx == nil { 216 | return sc.URL(0, nil) 217 | } 218 | 219 | index, err := getServerOperationIndex(ctx, endpoint) 220 | if err != nil { 221 | return "", err 222 | } 223 | 224 | variables, err := getServerOperationVariables(ctx, endpoint) 225 | if err != nil { 226 | return "", err 227 | } 228 | 229 | return sc.URL(index, variables) 230 | } 231 | -------------------------------------------------------------------------------- /docs/Deal.md: -------------------------------------------------------------------------------- 1 | # Deal 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **BatchRootCid** | Pointer to **string** | | [optional] 8 | **LastChange** | **string** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | 9 | **Miner** | Pointer to **string** | Miner ID | [optional] 10 | **Network** | Pointer to **string** | Filecoin network for this Deal | [optional] 11 | **PieceCid** | Pointer to **string** | Piece CID string | [optional] 12 | **Status** | **string** | Deal status | 13 | **StatusText** | Pointer to **string** | Deal status description. | [optional] 14 | **ChainDealID** | Pointer to **float32** | Identifier for the deal stored on chain. | [optional] 15 | **DealActivation** | Pointer to **string** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional] 16 | **DealExpiration** | Pointer to **string** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional] 17 | 18 | ## Methods 19 | 20 | ### NewDeal 21 | 22 | `func NewDeal(lastChange string, status string, ) *Deal` 23 | 24 | NewDeal instantiates a new Deal object 25 | This constructor will assign default values to properties that have it defined, 26 | and makes sure properties required by API are set, but the set of arguments 27 | will change when the set of required properties is changed 28 | 29 | ### NewDealWithDefaults 30 | 31 | `func NewDealWithDefaults() *Deal` 32 | 33 | NewDealWithDefaults instantiates a new Deal object 34 | This constructor will only assign default values to properties that have it defined, 35 | but it doesn't guarantee that properties required by API are set 36 | 37 | ### GetBatchRootCid 38 | 39 | `func (o *Deal) GetBatchRootCid() string` 40 | 41 | GetBatchRootCid returns the BatchRootCid field if non-nil, zero value otherwise. 42 | 43 | ### GetBatchRootCidOk 44 | 45 | `func (o *Deal) GetBatchRootCidOk() (*string, bool)` 46 | 47 | GetBatchRootCidOk returns a tuple with the BatchRootCid field if it's non-nil, zero value otherwise 48 | and a boolean to check if the value has been set. 49 | 50 | ### SetBatchRootCid 51 | 52 | `func (o *Deal) SetBatchRootCid(v string)` 53 | 54 | SetBatchRootCid sets BatchRootCid field to given value. 55 | 56 | ### HasBatchRootCid 57 | 58 | `func (o *Deal) HasBatchRootCid() bool` 59 | 60 | HasBatchRootCid returns a boolean if a field has been set. 61 | 62 | ### GetLastChange 63 | 64 | `func (o *Deal) GetLastChange() string` 65 | 66 | GetLastChange returns the LastChange field if non-nil, zero value otherwise. 67 | 68 | ### GetLastChangeOk 69 | 70 | `func (o *Deal) GetLastChangeOk() (*string, bool)` 71 | 72 | GetLastChangeOk returns a tuple with the LastChange field if it's non-nil, zero value otherwise 73 | and a boolean to check if the value has been set. 74 | 75 | ### SetLastChange 76 | 77 | `func (o *Deal) SetLastChange(v string)` 78 | 79 | SetLastChange sets LastChange field to given value. 80 | 81 | 82 | ### GetMiner 83 | 84 | `func (o *Deal) GetMiner() string` 85 | 86 | GetMiner returns the Miner field if non-nil, zero value otherwise. 87 | 88 | ### GetMinerOk 89 | 90 | `func (o *Deal) GetMinerOk() (*string, bool)` 91 | 92 | GetMinerOk returns a tuple with the Miner field if it's non-nil, zero value otherwise 93 | and a boolean to check if the value has been set. 94 | 95 | ### SetMiner 96 | 97 | `func (o *Deal) SetMiner(v string)` 98 | 99 | SetMiner sets Miner field to given value. 100 | 101 | ### HasMiner 102 | 103 | `func (o *Deal) HasMiner() bool` 104 | 105 | HasMiner returns a boolean if a field has been set. 106 | 107 | ### GetNetwork 108 | 109 | `func (o *Deal) GetNetwork() string` 110 | 111 | GetNetwork returns the Network field if non-nil, zero value otherwise. 112 | 113 | ### GetNetworkOk 114 | 115 | `func (o *Deal) GetNetworkOk() (*string, bool)` 116 | 117 | GetNetworkOk returns a tuple with the Network field if it's non-nil, zero value otherwise 118 | and a boolean to check if the value has been set. 119 | 120 | ### SetNetwork 121 | 122 | `func (o *Deal) SetNetwork(v string)` 123 | 124 | SetNetwork sets Network field to given value. 125 | 126 | ### HasNetwork 127 | 128 | `func (o *Deal) HasNetwork() bool` 129 | 130 | HasNetwork returns a boolean if a field has been set. 131 | 132 | ### GetPieceCid 133 | 134 | `func (o *Deal) GetPieceCid() string` 135 | 136 | GetPieceCid returns the PieceCid field if non-nil, zero value otherwise. 137 | 138 | ### GetPieceCidOk 139 | 140 | `func (o *Deal) GetPieceCidOk() (*string, bool)` 141 | 142 | GetPieceCidOk returns a tuple with the PieceCid field if it's non-nil, zero value otherwise 143 | and a boolean to check if the value has been set. 144 | 145 | ### SetPieceCid 146 | 147 | `func (o *Deal) SetPieceCid(v string)` 148 | 149 | SetPieceCid sets PieceCid field to given value. 150 | 151 | ### HasPieceCid 152 | 153 | `func (o *Deal) HasPieceCid() bool` 154 | 155 | HasPieceCid returns a boolean if a field has been set. 156 | 157 | ### GetStatus 158 | 159 | `func (o *Deal) GetStatus() string` 160 | 161 | GetStatus returns the Status field if non-nil, zero value otherwise. 162 | 163 | ### GetStatusOk 164 | 165 | `func (o *Deal) GetStatusOk() (*string, bool)` 166 | 167 | GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise 168 | and a boolean to check if the value has been set. 169 | 170 | ### SetStatus 171 | 172 | `func (o *Deal) SetStatus(v string)` 173 | 174 | SetStatus sets Status field to given value. 175 | 176 | 177 | ### GetStatusText 178 | 179 | `func (o *Deal) GetStatusText() string` 180 | 181 | GetStatusText returns the StatusText field if non-nil, zero value otherwise. 182 | 183 | ### GetStatusTextOk 184 | 185 | `func (o *Deal) GetStatusTextOk() (*string, bool)` 186 | 187 | GetStatusTextOk returns a tuple with the StatusText field if it's non-nil, zero value otherwise 188 | and a boolean to check if the value has been set. 189 | 190 | ### SetStatusText 191 | 192 | `func (o *Deal) SetStatusText(v string)` 193 | 194 | SetStatusText sets StatusText field to given value. 195 | 196 | ### HasStatusText 197 | 198 | `func (o *Deal) HasStatusText() bool` 199 | 200 | HasStatusText returns a boolean if a field has been set. 201 | 202 | ### GetChainDealID 203 | 204 | `func (o *Deal) GetChainDealID() float32` 205 | 206 | GetChainDealID returns the ChainDealID field if non-nil, zero value otherwise. 207 | 208 | ### GetChainDealIDOk 209 | 210 | `func (o *Deal) GetChainDealIDOk() (*float32, bool)` 211 | 212 | GetChainDealIDOk returns a tuple with the ChainDealID field if it's non-nil, zero value otherwise 213 | and a boolean to check if the value has been set. 214 | 215 | ### SetChainDealID 216 | 217 | `func (o *Deal) SetChainDealID(v float32)` 218 | 219 | SetChainDealID sets ChainDealID field to given value. 220 | 221 | ### HasChainDealID 222 | 223 | `func (o *Deal) HasChainDealID() bool` 224 | 225 | HasChainDealID returns a boolean if a field has been set. 226 | 227 | ### GetDealActivation 228 | 229 | `func (o *Deal) GetDealActivation() string` 230 | 231 | GetDealActivation returns the DealActivation field if non-nil, zero value otherwise. 232 | 233 | ### GetDealActivationOk 234 | 235 | `func (o *Deal) GetDealActivationOk() (*string, bool)` 236 | 237 | GetDealActivationOk returns a tuple with the DealActivation field if it's non-nil, zero value otherwise 238 | and a boolean to check if the value has been set. 239 | 240 | ### SetDealActivation 241 | 242 | `func (o *Deal) SetDealActivation(v string)` 243 | 244 | SetDealActivation sets DealActivation field to given value. 245 | 246 | ### HasDealActivation 247 | 248 | `func (o *Deal) HasDealActivation() bool` 249 | 250 | HasDealActivation returns a boolean if a field has been set. 251 | 252 | ### GetDealExpiration 253 | 254 | `func (o *Deal) GetDealExpiration() string` 255 | 256 | GetDealExpiration returns the DealExpiration field if non-nil, zero value otherwise. 257 | 258 | ### GetDealExpirationOk 259 | 260 | `func (o *Deal) GetDealExpirationOk() (*string, bool)` 261 | 262 | GetDealExpirationOk returns a tuple with the DealExpiration field if it's non-nil, zero value otherwise 263 | and a boolean to check if the value has been set. 264 | 265 | ### SetDealExpiration 266 | 267 | `func (o *Deal) SetDealExpiration(v string)` 268 | 269 | SetDealExpiration sets DealExpiration field to given value. 270 | 271 | ### HasDealExpiration 272 | 273 | `func (o *Deal) HasDealExpiration() bool` 274 | 275 | HasDealExpiration returns a boolean if a field has been set. 276 | 277 | 278 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 279 | 280 | 281 | -------------------------------------------------------------------------------- /docs/DeleteResponse.md: -------------------------------------------------------------------------------- 1 | # DeleteResponse 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ok** | Pointer to **bool** | | [optional] 8 | 9 | ## Methods 10 | 11 | ### NewDeleteResponse 12 | 13 | `func NewDeleteResponse() *DeleteResponse` 14 | 15 | NewDeleteResponse instantiates a new DeleteResponse object 16 | This constructor will assign default values to properties that have it defined, 17 | and makes sure properties required by API are set, but the set of arguments 18 | will change when the set of required properties is changed 19 | 20 | ### NewDeleteResponseWithDefaults 21 | 22 | `func NewDeleteResponseWithDefaults() *DeleteResponse` 23 | 24 | NewDeleteResponseWithDefaults instantiates a new DeleteResponse object 25 | This constructor will only assign default values to properties that have it defined, 26 | but it doesn't guarantee that properties required by API are set 27 | 28 | ### GetOk 29 | 30 | `func (o *DeleteResponse) GetOk() bool` 31 | 32 | GetOk returns the Ok field if non-nil, zero value otherwise. 33 | 34 | ### GetOkOk 35 | 36 | `func (o *DeleteResponse) GetOkOk() (*bool, bool)` 37 | 38 | GetOkOk returns a tuple with the Ok field if it's non-nil, zero value otherwise 39 | and a boolean to check if the value has been set. 40 | 41 | ### SetOk 42 | 43 | `func (o *DeleteResponse) SetOk(v bool)` 44 | 45 | SetOk sets Ok field to given value. 46 | 47 | ### HasOk 48 | 49 | `func (o *DeleteResponse) HasOk() bool` 50 | 51 | HasOk returns a boolean if a field has been set. 52 | 53 | 54 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs/ErrorResponse.md: -------------------------------------------------------------------------------- 1 | # ErrorResponse 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ok** | Pointer to **bool** | | [optional] [default to false] 8 | **Error** | Pointer to [**ErrorResponseError**](ErrorResponseError.md) | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewErrorResponse 13 | 14 | `func NewErrorResponse() *ErrorResponse` 15 | 16 | NewErrorResponse instantiates a new ErrorResponse object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewErrorResponseWithDefaults 22 | 23 | `func NewErrorResponseWithDefaults() *ErrorResponse` 24 | 25 | NewErrorResponseWithDefaults instantiates a new ErrorResponse object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetOk 30 | 31 | `func (o *ErrorResponse) GetOk() bool` 32 | 33 | GetOk returns the Ok field if non-nil, zero value otherwise. 34 | 35 | ### GetOkOk 36 | 37 | `func (o *ErrorResponse) GetOkOk() (*bool, bool)` 38 | 39 | GetOkOk returns a tuple with the Ok field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetOk 43 | 44 | `func (o *ErrorResponse) SetOk(v bool)` 45 | 46 | SetOk sets Ok field to given value. 47 | 48 | ### HasOk 49 | 50 | `func (o *ErrorResponse) HasOk() bool` 51 | 52 | HasOk returns a boolean if a field has been set. 53 | 54 | ### GetError 55 | 56 | `func (o *ErrorResponse) GetError() ErrorResponseError` 57 | 58 | GetError returns the Error field if non-nil, zero value otherwise. 59 | 60 | ### GetErrorOk 61 | 62 | `func (o *ErrorResponse) GetErrorOk() (*ErrorResponseError, bool)` 63 | 64 | GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetError 68 | 69 | `func (o *ErrorResponse) SetError(v ErrorResponseError)` 70 | 71 | SetError sets Error field to given value. 72 | 73 | ### HasError 74 | 75 | `func (o *ErrorResponse) HasError() bool` 76 | 77 | HasError returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/ErrorResponseError.md: -------------------------------------------------------------------------------- 1 | # ErrorResponseError 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Name** | Pointer to **string** | | [optional] 8 | **Message** | Pointer to **string** | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewErrorResponseError 13 | 14 | `func NewErrorResponseError() *ErrorResponseError` 15 | 16 | NewErrorResponseError instantiates a new ErrorResponseError object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewErrorResponseErrorWithDefaults 22 | 23 | `func NewErrorResponseErrorWithDefaults() *ErrorResponseError` 24 | 25 | NewErrorResponseErrorWithDefaults instantiates a new ErrorResponseError object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetName 30 | 31 | `func (o *ErrorResponseError) GetName() string` 32 | 33 | GetName returns the Name field if non-nil, zero value otherwise. 34 | 35 | ### GetNameOk 36 | 37 | `func (o *ErrorResponseError) GetNameOk() (*string, bool)` 38 | 39 | GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetName 43 | 44 | `func (o *ErrorResponseError) SetName(v string)` 45 | 46 | SetName sets Name field to given value. 47 | 48 | ### HasName 49 | 50 | `func (o *ErrorResponseError) HasName() bool` 51 | 52 | HasName returns a boolean if a field has been set. 53 | 54 | ### GetMessage 55 | 56 | `func (o *ErrorResponseError) GetMessage() string` 57 | 58 | GetMessage returns the Message field if non-nil, zero value otherwise. 59 | 60 | ### GetMessageOk 61 | 62 | `func (o *ErrorResponseError) GetMessageOk() (*string, bool)` 63 | 64 | GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetMessage 68 | 69 | `func (o *ErrorResponseError) SetMessage(v string)` 70 | 71 | SetMessage sets Message field to given value. 72 | 73 | ### HasMessage 74 | 75 | `func (o *ErrorResponseError) HasMessage() bool` 76 | 77 | HasMessage returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/ForbiddenErrorResponse.md: -------------------------------------------------------------------------------- 1 | # ForbiddenErrorResponse 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ok** | Pointer to **bool** | | [optional] [default to false] 8 | **Error** | Pointer to [**ForbiddenErrorResponseError**](ForbiddenErrorResponseError.md) | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewForbiddenErrorResponse 13 | 14 | `func NewForbiddenErrorResponse() *ForbiddenErrorResponse` 15 | 16 | NewForbiddenErrorResponse instantiates a new ForbiddenErrorResponse object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewForbiddenErrorResponseWithDefaults 22 | 23 | `func NewForbiddenErrorResponseWithDefaults() *ForbiddenErrorResponse` 24 | 25 | NewForbiddenErrorResponseWithDefaults instantiates a new ForbiddenErrorResponse object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetOk 30 | 31 | `func (o *ForbiddenErrorResponse) GetOk() bool` 32 | 33 | GetOk returns the Ok field if non-nil, zero value otherwise. 34 | 35 | ### GetOkOk 36 | 37 | `func (o *ForbiddenErrorResponse) GetOkOk() (*bool, bool)` 38 | 39 | GetOkOk returns a tuple with the Ok field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetOk 43 | 44 | `func (o *ForbiddenErrorResponse) SetOk(v bool)` 45 | 46 | SetOk sets Ok field to given value. 47 | 48 | ### HasOk 49 | 50 | `func (o *ForbiddenErrorResponse) HasOk() bool` 51 | 52 | HasOk returns a boolean if a field has been set. 53 | 54 | ### GetError 55 | 56 | `func (o *ForbiddenErrorResponse) GetError() ForbiddenErrorResponseError` 57 | 58 | GetError returns the Error field if non-nil, zero value otherwise. 59 | 60 | ### GetErrorOk 61 | 62 | `func (o *ForbiddenErrorResponse) GetErrorOk() (*ForbiddenErrorResponseError, bool)` 63 | 64 | GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetError 68 | 69 | `func (o *ForbiddenErrorResponse) SetError(v ForbiddenErrorResponseError)` 70 | 71 | SetError sets Error field to given value. 72 | 73 | ### HasError 74 | 75 | `func (o *ForbiddenErrorResponse) HasError() bool` 76 | 77 | HasError returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/ForbiddenErrorResponseError.md: -------------------------------------------------------------------------------- 1 | # ForbiddenErrorResponseError 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Name** | Pointer to **string** | | [optional] [default to "HTTP Error"] 8 | **Message** | Pointer to **string** | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewForbiddenErrorResponseError 13 | 14 | `func NewForbiddenErrorResponseError() *ForbiddenErrorResponseError` 15 | 16 | NewForbiddenErrorResponseError instantiates a new ForbiddenErrorResponseError object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewForbiddenErrorResponseErrorWithDefaults 22 | 23 | `func NewForbiddenErrorResponseErrorWithDefaults() *ForbiddenErrorResponseError` 24 | 25 | NewForbiddenErrorResponseErrorWithDefaults instantiates a new ForbiddenErrorResponseError object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetName 30 | 31 | `func (o *ForbiddenErrorResponseError) GetName() string` 32 | 33 | GetName returns the Name field if non-nil, zero value otherwise. 34 | 35 | ### GetNameOk 36 | 37 | `func (o *ForbiddenErrorResponseError) GetNameOk() (*string, bool)` 38 | 39 | GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetName 43 | 44 | `func (o *ForbiddenErrorResponseError) SetName(v string)` 45 | 46 | SetName sets Name field to given value. 47 | 48 | ### HasName 49 | 50 | `func (o *ForbiddenErrorResponseError) HasName() bool` 51 | 52 | HasName returns a boolean if a field has been set. 53 | 54 | ### GetMessage 55 | 56 | `func (o *ForbiddenErrorResponseError) GetMessage() string` 57 | 58 | GetMessage returns the Message field if non-nil, zero value otherwise. 59 | 60 | ### GetMessageOk 61 | 62 | `func (o *ForbiddenErrorResponseError) GetMessageOk() (*string, bool)` 63 | 64 | GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetMessage 68 | 69 | `func (o *ForbiddenErrorResponseError) SetMessage(v string)` 70 | 71 | SetMessage sets Message field to given value. 72 | 73 | ### HasMessage 74 | 75 | `func (o *ForbiddenErrorResponseError) HasMessage() bool` 76 | 77 | HasMessage returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/GetResponse.md: -------------------------------------------------------------------------------- 1 | # GetResponse 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ok** | Pointer to **bool** | | [optional] [default to true] 8 | **Value** | Pointer to [**NFT**](NFT.md) | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewGetResponse 13 | 14 | `func NewGetResponse() *GetResponse` 15 | 16 | NewGetResponse instantiates a new GetResponse object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewGetResponseWithDefaults 22 | 23 | `func NewGetResponseWithDefaults() *GetResponse` 24 | 25 | NewGetResponseWithDefaults instantiates a new GetResponse object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetOk 30 | 31 | `func (o *GetResponse) GetOk() bool` 32 | 33 | GetOk returns the Ok field if non-nil, zero value otherwise. 34 | 35 | ### GetOkOk 36 | 37 | `func (o *GetResponse) GetOkOk() (*bool, bool)` 38 | 39 | GetOkOk returns a tuple with the Ok field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetOk 43 | 44 | `func (o *GetResponse) SetOk(v bool)` 45 | 46 | SetOk sets Ok field to given value. 47 | 48 | ### HasOk 49 | 50 | `func (o *GetResponse) HasOk() bool` 51 | 52 | HasOk returns a boolean if a field has been set. 53 | 54 | ### GetValue 55 | 56 | `func (o *GetResponse) GetValue() NFT` 57 | 58 | GetValue returns the Value field if non-nil, zero value otherwise. 59 | 60 | ### GetValueOk 61 | 62 | `func (o *GetResponse) GetValueOk() (*NFT, bool)` 63 | 64 | GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetValue 68 | 69 | `func (o *GetResponse) SetValue(v NFT)` 70 | 71 | SetValue sets Value field to given value. 72 | 73 | ### HasValue 74 | 75 | `func (o *GetResponse) HasValue() bool` 76 | 77 | HasValue returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/Links.md: -------------------------------------------------------------------------------- 1 | # Links 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ipfs** | Pointer to **string** | | [optional] 8 | **Http** | Pointer to **string** | | [optional] 9 | **File** | Pointer to [**[]LinksFile**](LinksFile.md) | | [optional] 10 | 11 | ## Methods 12 | 13 | ### NewLinks 14 | 15 | `func NewLinks() *Links` 16 | 17 | NewLinks instantiates a new Links object 18 | This constructor will assign default values to properties that have it defined, 19 | and makes sure properties required by API are set, but the set of arguments 20 | will change when the set of required properties is changed 21 | 22 | ### NewLinksWithDefaults 23 | 24 | `func NewLinksWithDefaults() *Links` 25 | 26 | NewLinksWithDefaults instantiates a new Links object 27 | This constructor will only assign default values to properties that have it defined, 28 | but it doesn't guarantee that properties required by API are set 29 | 30 | ### GetIpfs 31 | 32 | `func (o *Links) GetIpfs() string` 33 | 34 | GetIpfs returns the Ipfs field if non-nil, zero value otherwise. 35 | 36 | ### GetIpfsOk 37 | 38 | `func (o *Links) GetIpfsOk() (*string, bool)` 39 | 40 | GetIpfsOk returns a tuple with the Ipfs field if it's non-nil, zero value otherwise 41 | and a boolean to check if the value has been set. 42 | 43 | ### SetIpfs 44 | 45 | `func (o *Links) SetIpfs(v string)` 46 | 47 | SetIpfs sets Ipfs field to given value. 48 | 49 | ### HasIpfs 50 | 51 | `func (o *Links) HasIpfs() bool` 52 | 53 | HasIpfs returns a boolean if a field has been set. 54 | 55 | ### GetHttp 56 | 57 | `func (o *Links) GetHttp() string` 58 | 59 | GetHttp returns the Http field if non-nil, zero value otherwise. 60 | 61 | ### GetHttpOk 62 | 63 | `func (o *Links) GetHttpOk() (*string, bool)` 64 | 65 | GetHttpOk returns a tuple with the Http field if it's non-nil, zero value otherwise 66 | and a boolean to check if the value has been set. 67 | 68 | ### SetHttp 69 | 70 | `func (o *Links) SetHttp(v string)` 71 | 72 | SetHttp sets Http field to given value. 73 | 74 | ### HasHttp 75 | 76 | `func (o *Links) HasHttp() bool` 77 | 78 | HasHttp returns a boolean if a field has been set. 79 | 80 | ### GetFile 81 | 82 | `func (o *Links) GetFile() []LinksFile` 83 | 84 | GetFile returns the File field if non-nil, zero value otherwise. 85 | 86 | ### GetFileOk 87 | 88 | `func (o *Links) GetFileOk() (*[]LinksFile, bool)` 89 | 90 | GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise 91 | and a boolean to check if the value has been set. 92 | 93 | ### SetFile 94 | 95 | `func (o *Links) SetFile(v []LinksFile)` 96 | 97 | SetFile sets File field to given value. 98 | 99 | ### HasFile 100 | 101 | `func (o *Links) HasFile() bool` 102 | 103 | HasFile returns a boolean if a field has been set. 104 | 105 | 106 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 107 | 108 | 109 | -------------------------------------------------------------------------------- /docs/LinksFile.md: -------------------------------------------------------------------------------- 1 | # LinksFile 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ipfs** | Pointer to **string** | | [optional] 8 | **Http** | Pointer to **string** | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewLinksFile 13 | 14 | `func NewLinksFile() *LinksFile` 15 | 16 | NewLinksFile instantiates a new LinksFile object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewLinksFileWithDefaults 22 | 23 | `func NewLinksFileWithDefaults() *LinksFile` 24 | 25 | NewLinksFileWithDefaults instantiates a new LinksFile object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetIpfs 30 | 31 | `func (o *LinksFile) GetIpfs() string` 32 | 33 | GetIpfs returns the Ipfs field if non-nil, zero value otherwise. 34 | 35 | ### GetIpfsOk 36 | 37 | `func (o *LinksFile) GetIpfsOk() (*string, bool)` 38 | 39 | GetIpfsOk returns a tuple with the Ipfs field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetIpfs 43 | 44 | `func (o *LinksFile) SetIpfs(v string)` 45 | 46 | SetIpfs sets Ipfs field to given value. 47 | 48 | ### HasIpfs 49 | 50 | `func (o *LinksFile) HasIpfs() bool` 51 | 52 | HasIpfs returns a boolean if a field has been set. 53 | 54 | ### GetHttp 55 | 56 | `func (o *LinksFile) GetHttp() string` 57 | 58 | GetHttp returns the Http field if non-nil, zero value otherwise. 59 | 60 | ### GetHttpOk 61 | 62 | `func (o *LinksFile) GetHttpOk() (*string, bool)` 63 | 64 | GetHttpOk returns a tuple with the Http field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetHttp 68 | 69 | `func (o *LinksFile) SetHttp(v string)` 70 | 71 | SetHttp sets Http field to given value. 72 | 73 | ### HasHttp 74 | 75 | `func (o *LinksFile) HasHttp() bool` 76 | 77 | HasHttp returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/ListResponse.md: -------------------------------------------------------------------------------- 1 | # ListResponse 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ok** | Pointer to **bool** | | [optional] [default to true] 8 | **Value** | Pointer to [**[]NFT**](NFT.md) | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewListResponse 13 | 14 | `func NewListResponse() *ListResponse` 15 | 16 | NewListResponse instantiates a new ListResponse object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewListResponseWithDefaults 22 | 23 | `func NewListResponseWithDefaults() *ListResponse` 24 | 25 | NewListResponseWithDefaults instantiates a new ListResponse object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetOk 30 | 31 | `func (o *ListResponse) GetOk() bool` 32 | 33 | GetOk returns the Ok field if non-nil, zero value otherwise. 34 | 35 | ### GetOkOk 36 | 37 | `func (o *ListResponse) GetOkOk() (*bool, bool)` 38 | 39 | GetOkOk returns a tuple with the Ok field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetOk 43 | 44 | `func (o *ListResponse) SetOk(v bool)` 45 | 46 | SetOk sets Ok field to given value. 47 | 48 | ### HasOk 49 | 50 | `func (o *ListResponse) HasOk() bool` 51 | 52 | HasOk returns a boolean if a field has been set. 53 | 54 | ### GetValue 55 | 56 | `func (o *ListResponse) GetValue() []NFT` 57 | 58 | GetValue returns the Value field if non-nil, zero value otherwise. 59 | 60 | ### GetValueOk 61 | 62 | `func (o *ListResponse) GetValueOk() (*[]NFT, bool)` 63 | 64 | GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetValue 68 | 69 | `func (o *ListResponse) SetValue(v []NFT)` 70 | 71 | SetValue sets Value field to given value. 72 | 73 | ### HasValue 74 | 75 | `func (o *ListResponse) HasValue() bool` 76 | 77 | HasValue returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/NFT.md: -------------------------------------------------------------------------------- 1 | # NFT 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Cid** | Pointer to **string** | Self-describing content-addressed identifiers for distributed systems. Check [spec](https://github.com/multiformats/cid) for more info. | [optional] 8 | **Size** | Pointer to **float32** | Size in bytes of the NFT data. | [optional] [default to 132614] 9 | **Created** | Pointer to **time.Time** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional] 10 | **Type** | Pointer to **string** | MIME type of the upload file or 'directory' when uploading multiple files. | [optional] 11 | **Scope** | Pointer to **string** | Name of the JWT token used to create this NFT. | [optional] [default to "default"] 12 | **Pin** | Pointer to [**Pin**](Pin.md) | | [optional] 13 | **Files** | Pointer to **[]map[string]interface{}** | Files in the directory (only if this NFT is a directory). | [optional] 14 | **Deals** | Pointer to [**[]Deal**](Deal.md) | | [optional] 15 | 16 | ## Methods 17 | 18 | ### NewNFT 19 | 20 | `func NewNFT() *NFT` 21 | 22 | NewNFT instantiates a new NFT object 23 | This constructor will assign default values to properties that have it defined, 24 | and makes sure properties required by API are set, but the set of arguments 25 | will change when the set of required properties is changed 26 | 27 | ### NewNFTWithDefaults 28 | 29 | `func NewNFTWithDefaults() *NFT` 30 | 31 | NewNFTWithDefaults instantiates a new NFT object 32 | This constructor will only assign default values to properties that have it defined, 33 | but it doesn't guarantee that properties required by API are set 34 | 35 | ### GetCid 36 | 37 | `func (o *NFT) GetCid() string` 38 | 39 | GetCid returns the Cid field if non-nil, zero value otherwise. 40 | 41 | ### GetCidOk 42 | 43 | `func (o *NFT) GetCidOk() (*string, bool)` 44 | 45 | GetCidOk returns a tuple with the Cid field if it's non-nil, zero value otherwise 46 | and a boolean to check if the value has been set. 47 | 48 | ### SetCid 49 | 50 | `func (o *NFT) SetCid(v string)` 51 | 52 | SetCid sets Cid field to given value. 53 | 54 | ### HasCid 55 | 56 | `func (o *NFT) HasCid() bool` 57 | 58 | HasCid returns a boolean if a field has been set. 59 | 60 | ### GetSize 61 | 62 | `func (o *NFT) GetSize() float32` 63 | 64 | GetSize returns the Size field if non-nil, zero value otherwise. 65 | 66 | ### GetSizeOk 67 | 68 | `func (o *NFT) GetSizeOk() (*float32, bool)` 69 | 70 | GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise 71 | and a boolean to check if the value has been set. 72 | 73 | ### SetSize 74 | 75 | `func (o *NFT) SetSize(v float32)` 76 | 77 | SetSize sets Size field to given value. 78 | 79 | ### HasSize 80 | 81 | `func (o *NFT) HasSize() bool` 82 | 83 | HasSize returns a boolean if a field has been set. 84 | 85 | ### GetCreated 86 | 87 | `func (o *NFT) GetCreated() time.Time` 88 | 89 | GetCreated returns the Created field if non-nil, zero value otherwise. 90 | 91 | ### GetCreatedOk 92 | 93 | `func (o *NFT) GetCreatedOk() (*time.Time, bool)` 94 | 95 | GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise 96 | and a boolean to check if the value has been set. 97 | 98 | ### SetCreated 99 | 100 | `func (o *NFT) SetCreated(v time.Time)` 101 | 102 | SetCreated sets Created field to given value. 103 | 104 | ### HasCreated 105 | 106 | `func (o *NFT) HasCreated() bool` 107 | 108 | HasCreated returns a boolean if a field has been set. 109 | 110 | ### GetType 111 | 112 | `func (o *NFT) GetType() string` 113 | 114 | GetType returns the Type field if non-nil, zero value otherwise. 115 | 116 | ### GetTypeOk 117 | 118 | `func (o *NFT) GetTypeOk() (*string, bool)` 119 | 120 | GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise 121 | and a boolean to check if the value has been set. 122 | 123 | ### SetType 124 | 125 | `func (o *NFT) SetType(v string)` 126 | 127 | SetType sets Type field to given value. 128 | 129 | ### HasType 130 | 131 | `func (o *NFT) HasType() bool` 132 | 133 | HasType returns a boolean if a field has been set. 134 | 135 | ### GetScope 136 | 137 | `func (o *NFT) GetScope() string` 138 | 139 | GetScope returns the Scope field if non-nil, zero value otherwise. 140 | 141 | ### GetScopeOk 142 | 143 | `func (o *NFT) GetScopeOk() (*string, bool)` 144 | 145 | GetScopeOk returns a tuple with the Scope field if it's non-nil, zero value otherwise 146 | and a boolean to check if the value has been set. 147 | 148 | ### SetScope 149 | 150 | `func (o *NFT) SetScope(v string)` 151 | 152 | SetScope sets Scope field to given value. 153 | 154 | ### HasScope 155 | 156 | `func (o *NFT) HasScope() bool` 157 | 158 | HasScope returns a boolean if a field has been set. 159 | 160 | ### GetPin 161 | 162 | `func (o *NFT) GetPin() Pin` 163 | 164 | GetPin returns the Pin field if non-nil, zero value otherwise. 165 | 166 | ### GetPinOk 167 | 168 | `func (o *NFT) GetPinOk() (*Pin, bool)` 169 | 170 | GetPinOk returns a tuple with the Pin field if it's non-nil, zero value otherwise 171 | and a boolean to check if the value has been set. 172 | 173 | ### SetPin 174 | 175 | `func (o *NFT) SetPin(v Pin)` 176 | 177 | SetPin sets Pin field to given value. 178 | 179 | ### HasPin 180 | 181 | `func (o *NFT) HasPin() bool` 182 | 183 | HasPin returns a boolean if a field has been set. 184 | 185 | ### GetFiles 186 | 187 | `func (o *NFT) GetFiles() []map[string]interface{}` 188 | 189 | GetFiles returns the Files field if non-nil, zero value otherwise. 190 | 191 | ### GetFilesOk 192 | 193 | `func (o *NFT) GetFilesOk() (*[]map[string]interface{}, bool)` 194 | 195 | GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise 196 | and a boolean to check if the value has been set. 197 | 198 | ### SetFiles 199 | 200 | `func (o *NFT) SetFiles(v []map[string]interface{})` 201 | 202 | SetFiles sets Files field to given value. 203 | 204 | ### HasFiles 205 | 206 | `func (o *NFT) HasFiles() bool` 207 | 208 | HasFiles returns a boolean if a field has been set. 209 | 210 | ### GetDeals 211 | 212 | `func (o *NFT) GetDeals() []Deal` 213 | 214 | GetDeals returns the Deals field if non-nil, zero value otherwise. 215 | 216 | ### GetDealsOk 217 | 218 | `func (o *NFT) GetDealsOk() (*[]Deal, bool)` 219 | 220 | GetDealsOk returns a tuple with the Deals field if it's non-nil, zero value otherwise 221 | and a boolean to check if the value has been set. 222 | 223 | ### SetDeals 224 | 225 | `func (o *NFT) SetDeals(v []Deal)` 226 | 227 | SetDeals sets Deals field to given value. 228 | 229 | ### HasDeals 230 | 231 | `func (o *NFT) HasDeals() bool` 232 | 233 | HasDeals returns a boolean if a field has been set. 234 | 235 | 236 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 237 | 238 | 239 | -------------------------------------------------------------------------------- /docs/NFTStorageAPI.md: -------------------------------------------------------------------------------- 1 | # \NFTStorageAPI 2 | 3 | All URIs are relative to *https://api.nft.storage* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**Delete**](NFTStorageAPI.md#Delete) | **Delete** /{cid} | Stop storing the content with the passed CID 8 | [**List**](NFTStorageAPI.md#List) | **Get** / | List all stored files 9 | [**Status**](NFTStorageAPI.md#Status) | **Get** /{cid} | Get information for the stored file CID 10 | [**Store**](NFTStorageAPI.md#Store) | **Post** /upload | Store a file 11 | 12 | 13 | 14 | ## Delete 15 | 16 | > DeleteResponse Delete(ctx, cid).Execute() 17 | 18 | Stop storing the content with the passed CID 19 | 20 | 21 | 22 | ### Example 23 | 24 | ```go 25 | package main 26 | 27 | import ( 28 | "context" 29 | "fmt" 30 | "os" 31 | openapiclient "./openapi" 32 | ) 33 | 34 | func main() { 35 | cid := "cid_example" // string | CID for the NFT 36 | 37 | configuration := openapiclient.NewConfiguration() 38 | api_client := openapiclient.NewAPIClient(configuration) 39 | resp, r, err := api_client.NFTStorageAPI.Delete(context.Background(), cid).Execute() 40 | if err != nil { 41 | fmt.Fprintf(os.Stderr, "Error when calling `NFTStorageAPI.Delete``: %v\n", err) 42 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 43 | } 44 | // response from `Delete`: DeleteResponse 45 | fmt.Fprintf(os.Stdout, "Response from `NFTStorageAPI.Delete`: %v\n", resp) 46 | } 47 | ``` 48 | 49 | ### Path Parameters 50 | 51 | 52 | Name | Type | Description | Notes 53 | ------------- | ------------- | ------------- | ------------- 54 | **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 55 | **cid** | **string** | CID for the NFT | 56 | 57 | ### Other Parameters 58 | 59 | Other parameters are passed through a pointer to a apiDeleteRequest struct via the builder pattern 60 | 61 | 62 | Name | Type | Description | Notes 63 | ------------- | ------------- | ------------- | ------------- 64 | 65 | 66 | ### Return type 67 | 68 | [**DeleteResponse**](DeleteResponse.md) 69 | 70 | ### Authorization 71 | 72 | [bearerAuth](../README.md#bearerAuth) 73 | 74 | ### HTTP request headers 75 | 76 | - **Content-Type**: Not defined 77 | - **Accept**: application/json 78 | 79 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 80 | [[Back to Model list]](../README.md#documentation-for-models) 81 | [[Back to README]](../README.md) 82 | 83 | 84 | ## List 85 | 86 | > ListResponse List(ctx).Before(before).Limit(limit).Execute() 87 | 88 | List all stored files 89 | 90 | ### Example 91 | 92 | ```go 93 | package main 94 | 95 | import ( 96 | "context" 97 | "fmt" 98 | "os" 99 | "time" 100 | openapiclient "./openapi" 101 | ) 102 | 103 | func main() { 104 | before := time.Now() // time.Time | Return results created before provided timestamp (optional) 105 | limit := int32(56) // int32 | Max records to return (optional) (default to 10) 106 | 107 | configuration := openapiclient.NewConfiguration() 108 | api_client := openapiclient.NewAPIClient(configuration) 109 | resp, r, err := api_client.NFTStorageAPI.List(context.Background()).Before(before).Limit(limit).Execute() 110 | if err != nil { 111 | fmt.Fprintf(os.Stderr, "Error when calling `NFTStorageAPI.List``: %v\n", err) 112 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 113 | } 114 | // response from `List`: ListResponse 115 | fmt.Fprintf(os.Stdout, "Response from `NFTStorageAPI.List`: %v\n", resp) 116 | } 117 | ``` 118 | 119 | ### Path Parameters 120 | 121 | 122 | 123 | ### Other Parameters 124 | 125 | Other parameters are passed through a pointer to a apiListRequest struct via the builder pattern 126 | 127 | 128 | Name | Type | Description | Notes 129 | ------------- | ------------- | ------------- | ------------- 130 | **before** | **time.Time** | Return results created before provided timestamp | 131 | **limit** | **int32** | Max records to return | [default to 10] 132 | 133 | ### Return type 134 | 135 | [**ListResponse**](ListResponse.md) 136 | 137 | ### Authorization 138 | 139 | [bearerAuth](../README.md#bearerAuth) 140 | 141 | ### HTTP request headers 142 | 143 | - **Content-Type**: Not defined 144 | - **Accept**: application/json 145 | 146 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 147 | [[Back to Model list]](../README.md#documentation-for-models) 148 | [[Back to README]](../README.md) 149 | 150 | 151 | ## Status 152 | 153 | > GetResponse Status(ctx, cid).Execute() 154 | 155 | Get information for the stored file CID 156 | 157 | 158 | 159 | ### Example 160 | 161 | ```go 162 | package main 163 | 164 | import ( 165 | "context" 166 | "fmt" 167 | "os" 168 | openapiclient "./openapi" 169 | ) 170 | 171 | func main() { 172 | cid := "cid_example" // string | CID for the NFT 173 | 174 | configuration := openapiclient.NewConfiguration() 175 | api_client := openapiclient.NewAPIClient(configuration) 176 | resp, r, err := api_client.NFTStorageAPI.Status(context.Background(), cid).Execute() 177 | if err != nil { 178 | fmt.Fprintf(os.Stderr, "Error when calling `NFTStorageAPI.Status``: %v\n", err) 179 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 180 | } 181 | // response from `Status`: GetResponse 182 | fmt.Fprintf(os.Stdout, "Response from `NFTStorageAPI.Status`: %v\n", resp) 183 | } 184 | ``` 185 | 186 | ### Path Parameters 187 | 188 | 189 | Name | Type | Description | Notes 190 | ------------- | ------------- | ------------- | ------------- 191 | **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 192 | **cid** | **string** | CID for the NFT | 193 | 194 | ### Other Parameters 195 | 196 | Other parameters are passed through a pointer to a apiStatusRequest struct via the builder pattern 197 | 198 | 199 | Name | Type | Description | Notes 200 | ------------- | ------------- | ------------- | ------------- 201 | 202 | 203 | ### Return type 204 | 205 | [**GetResponse**](GetResponse.md) 206 | 207 | ### Authorization 208 | 209 | [bearerAuth](../README.md#bearerAuth) 210 | 211 | ### HTTP request headers 212 | 213 | - **Content-Type**: Not defined 214 | - **Accept**: application/json 215 | 216 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 217 | [[Back to Model list]](../README.md#documentation-for-models) 218 | [[Back to README]](../README.md) 219 | 220 | 221 | ## Store 222 | 223 | > UploadResponse Store(ctx).Body(body).Execute() 224 | 225 | Store a file 226 | 227 | 228 | 229 | ### Example 230 | 231 | ```go 232 | package main 233 | 234 | import ( 235 | "context" 236 | "fmt" 237 | "os" 238 | openapiclient "./openapi" 239 | ) 240 | 241 | func main() { 242 | body := os.NewFile(1234, "some_file") // *os.File | 243 | 244 | configuration := openapiclient.NewConfiguration() 245 | api_client := openapiclient.NewAPIClient(configuration) 246 | resp, r, err := api_client.NFTStorageAPI.Store(context.Background()).Body(body).Execute() 247 | if err != nil { 248 | fmt.Fprintf(os.Stderr, "Error when calling `NFTStorageAPI.Store``: %v\n", err) 249 | fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) 250 | } 251 | // response from `Store`: UploadResponse 252 | fmt.Fprintf(os.Stdout, "Response from `NFTStorageAPI.Store`: %v\n", resp) 253 | } 254 | ``` 255 | 256 | ### Path Parameters 257 | 258 | 259 | 260 | ### Other Parameters 261 | 262 | Other parameters are passed through a pointer to a apiStoreRequest struct via the builder pattern 263 | 264 | 265 | Name | Type | Description | Notes 266 | ------------- | ------------- | ------------- | ------------- 267 | **body** | ***os.File** | | 268 | 269 | ### Return type 270 | 271 | [**UploadResponse**](UploadResponse.md) 272 | 273 | ### Authorization 274 | 275 | [bearerAuth](../README.md#bearerAuth) 276 | 277 | ### HTTP request headers 278 | 279 | - **Content-Type**: image/png, application/octet-stream, multipart/form-data 280 | - **Accept**: application/json 281 | 282 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 283 | [[Back to Model list]](../README.md#documentation-for-models) 284 | [[Back to README]](../README.md) 285 | 286 | -------------------------------------------------------------------------------- /docs/Pin.md: -------------------------------------------------------------------------------- 1 | # Pin 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Cid** | Pointer to **string** | Self-describing content-addressed identifiers for distributed systems. Check [spec](https://github.com/multiformats/cid) for more info. | [optional] 8 | **Name** | Pointer to **string** | | [optional] 9 | **Status** | Pointer to [**PinStatus**](PinStatus.md) | | [optional] 10 | **Created** | Pointer to **time.Time** | This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. | [optional] 11 | **Size** | Pointer to **float32** | | [optional] 12 | 13 | ## Methods 14 | 15 | ### NewPin 16 | 17 | `func NewPin() *Pin` 18 | 19 | NewPin instantiates a new Pin object 20 | This constructor will assign default values to properties that have it defined, 21 | and makes sure properties required by API are set, but the set of arguments 22 | will change when the set of required properties is changed 23 | 24 | ### NewPinWithDefaults 25 | 26 | `func NewPinWithDefaults() *Pin` 27 | 28 | NewPinWithDefaults instantiates a new Pin object 29 | This constructor will only assign default values to properties that have it defined, 30 | but it doesn't guarantee that properties required by API are set 31 | 32 | ### GetCid 33 | 34 | `func (o *Pin) GetCid() string` 35 | 36 | GetCid returns the Cid field if non-nil, zero value otherwise. 37 | 38 | ### GetCidOk 39 | 40 | `func (o *Pin) GetCidOk() (*string, bool)` 41 | 42 | GetCidOk returns a tuple with the Cid field if it's non-nil, zero value otherwise 43 | and a boolean to check if the value has been set. 44 | 45 | ### SetCid 46 | 47 | `func (o *Pin) SetCid(v string)` 48 | 49 | SetCid sets Cid field to given value. 50 | 51 | ### HasCid 52 | 53 | `func (o *Pin) HasCid() bool` 54 | 55 | HasCid returns a boolean if a field has been set. 56 | 57 | ### GetName 58 | 59 | `func (o *Pin) GetName() string` 60 | 61 | GetName returns the Name field if non-nil, zero value otherwise. 62 | 63 | ### GetNameOk 64 | 65 | `func (o *Pin) GetNameOk() (*string, bool)` 66 | 67 | GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise 68 | and a boolean to check if the value has been set. 69 | 70 | ### SetName 71 | 72 | `func (o *Pin) SetName(v string)` 73 | 74 | SetName sets Name field to given value. 75 | 76 | ### HasName 77 | 78 | `func (o *Pin) HasName() bool` 79 | 80 | HasName returns a boolean if a field has been set. 81 | 82 | ### GetStatus 83 | 84 | `func (o *Pin) GetStatus() PinStatus` 85 | 86 | GetStatus returns the Status field if non-nil, zero value otherwise. 87 | 88 | ### GetStatusOk 89 | 90 | `func (o *Pin) GetStatusOk() (*PinStatus, bool)` 91 | 92 | GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise 93 | and a boolean to check if the value has been set. 94 | 95 | ### SetStatus 96 | 97 | `func (o *Pin) SetStatus(v PinStatus)` 98 | 99 | SetStatus sets Status field to given value. 100 | 101 | ### HasStatus 102 | 103 | `func (o *Pin) HasStatus() bool` 104 | 105 | HasStatus returns a boolean if a field has been set. 106 | 107 | ### GetCreated 108 | 109 | `func (o *Pin) GetCreated() time.Time` 110 | 111 | GetCreated returns the Created field if non-nil, zero value otherwise. 112 | 113 | ### GetCreatedOk 114 | 115 | `func (o *Pin) GetCreatedOk() (*time.Time, bool)` 116 | 117 | GetCreatedOk returns a tuple with the Created field if it's non-nil, zero value otherwise 118 | and a boolean to check if the value has been set. 119 | 120 | ### SetCreated 121 | 122 | `func (o *Pin) SetCreated(v time.Time)` 123 | 124 | SetCreated sets Created field to given value. 125 | 126 | ### HasCreated 127 | 128 | `func (o *Pin) HasCreated() bool` 129 | 130 | HasCreated returns a boolean if a field has been set. 131 | 132 | ### GetSize 133 | 134 | `func (o *Pin) GetSize() float32` 135 | 136 | GetSize returns the Size field if non-nil, zero value otherwise. 137 | 138 | ### GetSizeOk 139 | 140 | `func (o *Pin) GetSizeOk() (*float32, bool)` 141 | 142 | GetSizeOk returns a tuple with the Size field if it's non-nil, zero value otherwise 143 | and a boolean to check if the value has been set. 144 | 145 | ### SetSize 146 | 147 | `func (o *Pin) SetSize(v float32)` 148 | 149 | SetSize sets Size field to given value. 150 | 151 | ### HasSize 152 | 153 | `func (o *Pin) HasSize() bool` 154 | 155 | HasSize returns a boolean if a field has been set. 156 | 157 | 158 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 159 | 160 | 161 | -------------------------------------------------------------------------------- /docs/PinStatus.md: -------------------------------------------------------------------------------- 1 | # PinStatus 2 | 3 | ## Enum 4 | 5 | 6 | * `QUEUED` (value: `"queued"`) 7 | 8 | * `PINNING` (value: `"pinning"`) 9 | 10 | * `PINNED` (value: `"pinned"`) 11 | 12 | * `FAILED` (value: `"failed"`) 13 | 14 | 15 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/UnauthorizedErrorResponse.md: -------------------------------------------------------------------------------- 1 | # UnauthorizedErrorResponse 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ok** | Pointer to **bool** | | [optional] [default to false] 8 | **Error** | Pointer to [**UnauthorizedErrorResponseError**](UnauthorizedErrorResponseError.md) | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewUnauthorizedErrorResponse 13 | 14 | `func NewUnauthorizedErrorResponse() *UnauthorizedErrorResponse` 15 | 16 | NewUnauthorizedErrorResponse instantiates a new UnauthorizedErrorResponse object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewUnauthorizedErrorResponseWithDefaults 22 | 23 | `func NewUnauthorizedErrorResponseWithDefaults() *UnauthorizedErrorResponse` 24 | 25 | NewUnauthorizedErrorResponseWithDefaults instantiates a new UnauthorizedErrorResponse object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetOk 30 | 31 | `func (o *UnauthorizedErrorResponse) GetOk() bool` 32 | 33 | GetOk returns the Ok field if non-nil, zero value otherwise. 34 | 35 | ### GetOkOk 36 | 37 | `func (o *UnauthorizedErrorResponse) GetOkOk() (*bool, bool)` 38 | 39 | GetOkOk returns a tuple with the Ok field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetOk 43 | 44 | `func (o *UnauthorizedErrorResponse) SetOk(v bool)` 45 | 46 | SetOk sets Ok field to given value. 47 | 48 | ### HasOk 49 | 50 | `func (o *UnauthorizedErrorResponse) HasOk() bool` 51 | 52 | HasOk returns a boolean if a field has been set. 53 | 54 | ### GetError 55 | 56 | `func (o *UnauthorizedErrorResponse) GetError() UnauthorizedErrorResponseError` 57 | 58 | GetError returns the Error field if non-nil, zero value otherwise. 59 | 60 | ### GetErrorOk 61 | 62 | `func (o *UnauthorizedErrorResponse) GetErrorOk() (*UnauthorizedErrorResponseError, bool)` 63 | 64 | GetErrorOk returns a tuple with the Error field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetError 68 | 69 | `func (o *UnauthorizedErrorResponse) SetError(v UnauthorizedErrorResponseError)` 70 | 71 | SetError sets Error field to given value. 72 | 73 | ### HasError 74 | 75 | `func (o *UnauthorizedErrorResponse) HasError() bool` 76 | 77 | HasError returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/UnauthorizedErrorResponseError.md: -------------------------------------------------------------------------------- 1 | # UnauthorizedErrorResponseError 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Name** | Pointer to **string** | | [optional] [default to "HTTP Error"] 8 | **Message** | Pointer to **string** | | [optional] [default to "Unauthorized"] 9 | 10 | ## Methods 11 | 12 | ### NewUnauthorizedErrorResponseError 13 | 14 | `func NewUnauthorizedErrorResponseError() *UnauthorizedErrorResponseError` 15 | 16 | NewUnauthorizedErrorResponseError instantiates a new UnauthorizedErrorResponseError object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewUnauthorizedErrorResponseErrorWithDefaults 22 | 23 | `func NewUnauthorizedErrorResponseErrorWithDefaults() *UnauthorizedErrorResponseError` 24 | 25 | NewUnauthorizedErrorResponseErrorWithDefaults instantiates a new UnauthorizedErrorResponseError object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetName 30 | 31 | `func (o *UnauthorizedErrorResponseError) GetName() string` 32 | 33 | GetName returns the Name field if non-nil, zero value otherwise. 34 | 35 | ### GetNameOk 36 | 37 | `func (o *UnauthorizedErrorResponseError) GetNameOk() (*string, bool)` 38 | 39 | GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetName 43 | 44 | `func (o *UnauthorizedErrorResponseError) SetName(v string)` 45 | 46 | SetName sets Name field to given value. 47 | 48 | ### HasName 49 | 50 | `func (o *UnauthorizedErrorResponseError) HasName() bool` 51 | 52 | HasName returns a boolean if a field has been set. 53 | 54 | ### GetMessage 55 | 56 | `func (o *UnauthorizedErrorResponseError) GetMessage() string` 57 | 58 | GetMessage returns the Message field if non-nil, zero value otherwise. 59 | 60 | ### GetMessageOk 61 | 62 | `func (o *UnauthorizedErrorResponseError) GetMessageOk() (*string, bool)` 63 | 64 | GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetMessage 68 | 69 | `func (o *UnauthorizedErrorResponseError) SetMessage(v string)` 70 | 71 | SetMessage sets Message field to given value. 72 | 73 | ### HasMessage 74 | 75 | `func (o *UnauthorizedErrorResponseError) HasMessage() bool` 76 | 77 | HasMessage returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/UploadResponse.md: -------------------------------------------------------------------------------- 1 | # UploadResponse 2 | 3 | ## Properties 4 | 5 | Name | Type | Description | Notes 6 | ------------ | ------------- | ------------- | ------------- 7 | **Ok** | Pointer to **bool** | | [optional] [default to true] 8 | **Value** | Pointer to [**NFT**](NFT.md) | | [optional] 9 | 10 | ## Methods 11 | 12 | ### NewUploadResponse 13 | 14 | `func NewUploadResponse() *UploadResponse` 15 | 16 | NewUploadResponse instantiates a new UploadResponse object 17 | This constructor will assign default values to properties that have it defined, 18 | and makes sure properties required by API are set, but the set of arguments 19 | will change when the set of required properties is changed 20 | 21 | ### NewUploadResponseWithDefaults 22 | 23 | `func NewUploadResponseWithDefaults() *UploadResponse` 24 | 25 | NewUploadResponseWithDefaults instantiates a new UploadResponse object 26 | This constructor will only assign default values to properties that have it defined, 27 | but it doesn't guarantee that properties required by API are set 28 | 29 | ### GetOk 30 | 31 | `func (o *UploadResponse) GetOk() bool` 32 | 33 | GetOk returns the Ok field if non-nil, zero value otherwise. 34 | 35 | ### GetOkOk 36 | 37 | `func (o *UploadResponse) GetOkOk() (*bool, bool)` 38 | 39 | GetOkOk returns a tuple with the Ok field if it's non-nil, zero value otherwise 40 | and a boolean to check if the value has been set. 41 | 42 | ### SetOk 43 | 44 | `func (o *UploadResponse) SetOk(v bool)` 45 | 46 | SetOk sets Ok field to given value. 47 | 48 | ### HasOk 49 | 50 | `func (o *UploadResponse) HasOk() bool` 51 | 52 | HasOk returns a boolean if a field has been set. 53 | 54 | ### GetValue 55 | 56 | `func (o *UploadResponse) GetValue() NFT` 57 | 58 | GetValue returns the Value field if non-nil, zero value otherwise. 59 | 60 | ### GetValueOk 61 | 62 | `func (o *UploadResponse) GetValueOk() (*NFT, bool)` 63 | 64 | GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise 65 | and a boolean to check if the value has been set. 66 | 67 | ### SetValue 68 | 69 | `func (o *UploadResponse) SetValue(v NFT)` 70 | 71 | SetValue sets Value field to given value. 72 | 73 | ### HasValue 74 | 75 | `func (o *UploadResponse) HasValue() bool` 76 | 77 | HasValue returns a boolean if a field has been set. 78 | 79 | 80 | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 81 | 82 | 83 | -------------------------------------------------------------------------------- /git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | git_host=$4 10 | 11 | if [ "$git_host" = "" ]; then 12 | git_host="github.com" 13 | echo "[INFO] No command line input provided. Set \$git_host to $git_host" 14 | fi 15 | 16 | if [ "$git_user_id" = "" ]; then 17 | git_user_id="nftstorage" 18 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 19 | fi 20 | 21 | if [ "$git_repo_id" = "" ]; then 22 | git_repo_id="go-client" 23 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 24 | fi 25 | 26 | if [ "$release_note" = "" ]; then 27 | release_note="Minor update" 28 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 29 | fi 30 | 31 | # Initialize the local directory as a Git repository 32 | git init 33 | 34 | # Adds the files in the local repository and stages them for commit. 35 | git add . 36 | 37 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 38 | git commit -m "$release_note" 39 | 40 | # Sets the new remote 41 | git_remote=`git remote` 42 | if [ "$git_remote" = "" ]; then # git remote not defined 43 | 44 | if [ "$GIT_TOKEN" = "" ]; then 45 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 46 | git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git 47 | else 48 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git 49 | fi 50 | 51 | fi 52 | 53 | git pull origin master 54 | 55 | # Pushes (Forces) the changes in the local repository up to the remote repository 56 | echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" 57 | git push origin master 2>&1 | grep -v 'To https' 58 | 59 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/nftstorage/go-client 2 | 3 | go 1.13 4 | 5 | require golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 6 | -------------------------------------------------------------------------------- /model_deal.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // Deal struct for Deal 18 | type Deal struct { 19 | BatchRootCid *string `json:"batchRootCid,omitempty"` 20 | // This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. 21 | LastChange string `json:"lastChange"` 22 | // Miner ID 23 | Miner *string `json:"miner,omitempty"` 24 | // Filecoin network for this Deal 25 | Network *string `json:"network,omitempty"` 26 | // Piece CID string 27 | PieceCid *string `json:"pieceCid,omitempty"` 28 | // Deal status 29 | Status string `json:"status"` 30 | // Deal status description. 31 | StatusText *string `json:"statusText,omitempty"` 32 | // Identifier for the deal stored on chain. 33 | ChainDealID *float32 `json:"chainDealID,omitempty"` 34 | // This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. 35 | DealActivation *string `json:"dealActivation,omitempty"` 36 | // This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. 37 | DealExpiration *string `json:"dealExpiration,omitempty"` 38 | } 39 | 40 | // NewDeal instantiates a new Deal object 41 | // This constructor will assign default values to properties that have it defined, 42 | // and makes sure properties required by API are set, but the set of arguments 43 | // will change when the set of required properties is changed 44 | func NewDeal(lastChange string, status string) *Deal { 45 | this := Deal{} 46 | this.LastChange = lastChange 47 | this.Status = status 48 | return &this 49 | } 50 | 51 | // NewDealWithDefaults instantiates a new Deal object 52 | // This constructor will only assign default values to properties that have it defined, 53 | // but it doesn't guarantee that properties required by API are set 54 | func NewDealWithDefaults() *Deal { 55 | this := Deal{} 56 | return &this 57 | } 58 | 59 | // GetBatchRootCid returns the BatchRootCid field value if set, zero value otherwise. 60 | func (o *Deal) GetBatchRootCid() string { 61 | if o == nil || o.BatchRootCid == nil { 62 | var ret string 63 | return ret 64 | } 65 | return *o.BatchRootCid 66 | } 67 | 68 | // GetBatchRootCidOk returns a tuple with the BatchRootCid field value if set, nil otherwise 69 | // and a boolean to check if the value has been set. 70 | func (o *Deal) GetBatchRootCidOk() (*string, bool) { 71 | if o == nil || o.BatchRootCid == nil { 72 | return nil, false 73 | } 74 | return o.BatchRootCid, true 75 | } 76 | 77 | // HasBatchRootCid returns a boolean if a field has been set. 78 | func (o *Deal) HasBatchRootCid() bool { 79 | if o != nil && o.BatchRootCid != nil { 80 | return true 81 | } 82 | 83 | return false 84 | } 85 | 86 | // SetBatchRootCid gets a reference to the given string and assigns it to the BatchRootCid field. 87 | func (o *Deal) SetBatchRootCid(v string) { 88 | o.BatchRootCid = &v 89 | } 90 | 91 | // GetLastChange returns the LastChange field value 92 | func (o *Deal) GetLastChange() string { 93 | if o == nil { 94 | var ret string 95 | return ret 96 | } 97 | 98 | return o.LastChange 99 | } 100 | 101 | // GetLastChangeOk returns a tuple with the LastChange field value 102 | // and a boolean to check if the value has been set. 103 | func (o *Deal) GetLastChangeOk() (*string, bool) { 104 | if o == nil { 105 | return nil, false 106 | } 107 | return &o.LastChange, true 108 | } 109 | 110 | // SetLastChange sets field value 111 | func (o *Deal) SetLastChange(v string) { 112 | o.LastChange = v 113 | } 114 | 115 | // GetMiner returns the Miner field value if set, zero value otherwise. 116 | func (o *Deal) GetMiner() string { 117 | if o == nil || o.Miner == nil { 118 | var ret string 119 | return ret 120 | } 121 | return *o.Miner 122 | } 123 | 124 | // GetMinerOk returns a tuple with the Miner field value if set, nil otherwise 125 | // and a boolean to check if the value has been set. 126 | func (o *Deal) GetMinerOk() (*string, bool) { 127 | if o == nil || o.Miner == nil { 128 | return nil, false 129 | } 130 | return o.Miner, true 131 | } 132 | 133 | // HasMiner returns a boolean if a field has been set. 134 | func (o *Deal) HasMiner() bool { 135 | if o != nil && o.Miner != nil { 136 | return true 137 | } 138 | 139 | return false 140 | } 141 | 142 | // SetMiner gets a reference to the given string and assigns it to the Miner field. 143 | func (o *Deal) SetMiner(v string) { 144 | o.Miner = &v 145 | } 146 | 147 | // GetNetwork returns the Network field value if set, zero value otherwise. 148 | func (o *Deal) GetNetwork() string { 149 | if o == nil || o.Network == nil { 150 | var ret string 151 | return ret 152 | } 153 | return *o.Network 154 | } 155 | 156 | // GetNetworkOk returns a tuple with the Network field value if set, nil otherwise 157 | // and a boolean to check if the value has been set. 158 | func (o *Deal) GetNetworkOk() (*string, bool) { 159 | if o == nil || o.Network == nil { 160 | return nil, false 161 | } 162 | return o.Network, true 163 | } 164 | 165 | // HasNetwork returns a boolean if a field has been set. 166 | func (o *Deal) HasNetwork() bool { 167 | if o != nil && o.Network != nil { 168 | return true 169 | } 170 | 171 | return false 172 | } 173 | 174 | // SetNetwork gets a reference to the given string and assigns it to the Network field. 175 | func (o *Deal) SetNetwork(v string) { 176 | o.Network = &v 177 | } 178 | 179 | // GetPieceCid returns the PieceCid field value if set, zero value otherwise. 180 | func (o *Deal) GetPieceCid() string { 181 | if o == nil || o.PieceCid == nil { 182 | var ret string 183 | return ret 184 | } 185 | return *o.PieceCid 186 | } 187 | 188 | // GetPieceCidOk returns a tuple with the PieceCid field value if set, nil otherwise 189 | // and a boolean to check if the value has been set. 190 | func (o *Deal) GetPieceCidOk() (*string, bool) { 191 | if o == nil || o.PieceCid == nil { 192 | return nil, false 193 | } 194 | return o.PieceCid, true 195 | } 196 | 197 | // HasPieceCid returns a boolean if a field has been set. 198 | func (o *Deal) HasPieceCid() bool { 199 | if o != nil && o.PieceCid != nil { 200 | return true 201 | } 202 | 203 | return false 204 | } 205 | 206 | // SetPieceCid gets a reference to the given string and assigns it to the PieceCid field. 207 | func (o *Deal) SetPieceCid(v string) { 208 | o.PieceCid = &v 209 | } 210 | 211 | // GetStatus returns the Status field value 212 | func (o *Deal) GetStatus() string { 213 | if o == nil { 214 | var ret string 215 | return ret 216 | } 217 | 218 | return o.Status 219 | } 220 | 221 | // GetStatusOk returns a tuple with the Status field value 222 | // and a boolean to check if the value has been set. 223 | func (o *Deal) GetStatusOk() (*string, bool) { 224 | if o == nil { 225 | return nil, false 226 | } 227 | return &o.Status, true 228 | } 229 | 230 | // SetStatus sets field value 231 | func (o *Deal) SetStatus(v string) { 232 | o.Status = v 233 | } 234 | 235 | // GetStatusText returns the StatusText field value if set, zero value otherwise. 236 | func (o *Deal) GetStatusText() string { 237 | if o == nil || o.StatusText == nil { 238 | var ret string 239 | return ret 240 | } 241 | return *o.StatusText 242 | } 243 | 244 | // GetStatusTextOk returns a tuple with the StatusText field value if set, nil otherwise 245 | // and a boolean to check if the value has been set. 246 | func (o *Deal) GetStatusTextOk() (*string, bool) { 247 | if o == nil || o.StatusText == nil { 248 | return nil, false 249 | } 250 | return o.StatusText, true 251 | } 252 | 253 | // HasStatusText returns a boolean if a field has been set. 254 | func (o *Deal) HasStatusText() bool { 255 | if o != nil && o.StatusText != nil { 256 | return true 257 | } 258 | 259 | return false 260 | } 261 | 262 | // SetStatusText gets a reference to the given string and assigns it to the StatusText field. 263 | func (o *Deal) SetStatusText(v string) { 264 | o.StatusText = &v 265 | } 266 | 267 | // GetChainDealID returns the ChainDealID field value if set, zero value otherwise. 268 | func (o *Deal) GetChainDealID() float32 { 269 | if o == nil || o.ChainDealID == nil { 270 | var ret float32 271 | return ret 272 | } 273 | return *o.ChainDealID 274 | } 275 | 276 | // GetChainDealIDOk returns a tuple with the ChainDealID field value if set, nil otherwise 277 | // and a boolean to check if the value has been set. 278 | func (o *Deal) GetChainDealIDOk() (*float32, bool) { 279 | if o == nil || o.ChainDealID == nil { 280 | return nil, false 281 | } 282 | return o.ChainDealID, true 283 | } 284 | 285 | // HasChainDealID returns a boolean if a field has been set. 286 | func (o *Deal) HasChainDealID() bool { 287 | if o != nil && o.ChainDealID != nil { 288 | return true 289 | } 290 | 291 | return false 292 | } 293 | 294 | // SetChainDealID gets a reference to the given float32 and assigns it to the ChainDealID field. 295 | func (o *Deal) SetChainDealID(v float32) { 296 | o.ChainDealID = &v 297 | } 298 | 299 | // GetDealActivation returns the DealActivation field value if set, zero value otherwise. 300 | func (o *Deal) GetDealActivation() string { 301 | if o == nil || o.DealActivation == nil { 302 | var ret string 303 | return ret 304 | } 305 | return *o.DealActivation 306 | } 307 | 308 | // GetDealActivationOk returns a tuple with the DealActivation field value if set, nil otherwise 309 | // and a boolean to check if the value has been set. 310 | func (o *Deal) GetDealActivationOk() (*string, bool) { 311 | if o == nil || o.DealActivation == nil { 312 | return nil, false 313 | } 314 | return o.DealActivation, true 315 | } 316 | 317 | // HasDealActivation returns a boolean if a field has been set. 318 | func (o *Deal) HasDealActivation() bool { 319 | if o != nil && o.DealActivation != nil { 320 | return true 321 | } 322 | 323 | return false 324 | } 325 | 326 | // SetDealActivation gets a reference to the given string and assigns it to the DealActivation field. 327 | func (o *Deal) SetDealActivation(v string) { 328 | o.DealActivation = &v 329 | } 330 | 331 | // GetDealExpiration returns the DealExpiration field value if set, zero value otherwise. 332 | func (o *Deal) GetDealExpiration() string { 333 | if o == nil || o.DealExpiration == nil { 334 | var ret string 335 | return ret 336 | } 337 | return *o.DealExpiration 338 | } 339 | 340 | // GetDealExpirationOk returns a tuple with the DealExpiration field value if set, nil otherwise 341 | // and a boolean to check if the value has been set. 342 | func (o *Deal) GetDealExpirationOk() (*string, bool) { 343 | if o == nil || o.DealExpiration == nil { 344 | return nil, false 345 | } 346 | return o.DealExpiration, true 347 | } 348 | 349 | // HasDealExpiration returns a boolean if a field has been set. 350 | func (o *Deal) HasDealExpiration() bool { 351 | if o != nil && o.DealExpiration != nil { 352 | return true 353 | } 354 | 355 | return false 356 | } 357 | 358 | // SetDealExpiration gets a reference to the given string and assigns it to the DealExpiration field. 359 | func (o *Deal) SetDealExpiration(v string) { 360 | o.DealExpiration = &v 361 | } 362 | 363 | func (o Deal) MarshalJSON() ([]byte, error) { 364 | toSerialize := map[string]interface{}{} 365 | if o.BatchRootCid != nil { 366 | toSerialize["batchRootCid"] = o.BatchRootCid 367 | } 368 | if true { 369 | toSerialize["lastChange"] = o.LastChange 370 | } 371 | if o.Miner != nil { 372 | toSerialize["miner"] = o.Miner 373 | } 374 | if o.Network != nil { 375 | toSerialize["network"] = o.Network 376 | } 377 | if o.PieceCid != nil { 378 | toSerialize["pieceCid"] = o.PieceCid 379 | } 380 | if true { 381 | toSerialize["status"] = o.Status 382 | } 383 | if o.StatusText != nil { 384 | toSerialize["statusText"] = o.StatusText 385 | } 386 | if o.ChainDealID != nil { 387 | toSerialize["chainDealID"] = o.ChainDealID 388 | } 389 | if o.DealActivation != nil { 390 | toSerialize["dealActivation"] = o.DealActivation 391 | } 392 | if o.DealExpiration != nil { 393 | toSerialize["dealExpiration"] = o.DealExpiration 394 | } 395 | return json.Marshal(toSerialize) 396 | } 397 | 398 | type NullableDeal struct { 399 | value *Deal 400 | isSet bool 401 | } 402 | 403 | func (v NullableDeal) Get() *Deal { 404 | return v.value 405 | } 406 | 407 | func (v *NullableDeal) Set(val *Deal) { 408 | v.value = val 409 | v.isSet = true 410 | } 411 | 412 | func (v NullableDeal) IsSet() bool { 413 | return v.isSet 414 | } 415 | 416 | func (v *NullableDeal) Unset() { 417 | v.value = nil 418 | v.isSet = false 419 | } 420 | 421 | func NewNullableDeal(val *Deal) *NullableDeal { 422 | return &NullableDeal{value: val, isSet: true} 423 | } 424 | 425 | func (v NullableDeal) MarshalJSON() ([]byte, error) { 426 | return json.Marshal(v.value) 427 | } 428 | 429 | func (v *NullableDeal) UnmarshalJSON(src []byte) error { 430 | v.isSet = true 431 | return json.Unmarshal(src, &v.value) 432 | } 433 | 434 | 435 | -------------------------------------------------------------------------------- /model_delete_response.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // DeleteResponse struct for DeleteResponse 18 | type DeleteResponse struct { 19 | Ok *bool `json:"ok,omitempty"` 20 | } 21 | 22 | // NewDeleteResponse instantiates a new DeleteResponse object 23 | // This constructor will assign default values to properties that have it defined, 24 | // and makes sure properties required by API are set, but the set of arguments 25 | // will change when the set of required properties is changed 26 | func NewDeleteResponse() *DeleteResponse { 27 | this := DeleteResponse{} 28 | return &this 29 | } 30 | 31 | // NewDeleteResponseWithDefaults instantiates a new DeleteResponse object 32 | // This constructor will only assign default values to properties that have it defined, 33 | // but it doesn't guarantee that properties required by API are set 34 | func NewDeleteResponseWithDefaults() *DeleteResponse { 35 | this := DeleteResponse{} 36 | return &this 37 | } 38 | 39 | // GetOk returns the Ok field value if set, zero value otherwise. 40 | func (o *DeleteResponse) GetOk() bool { 41 | if o == nil || o.Ok == nil { 42 | var ret bool 43 | return ret 44 | } 45 | return *o.Ok 46 | } 47 | 48 | // GetOkOk returns a tuple with the Ok field value if set, nil otherwise 49 | // and a boolean to check if the value has been set. 50 | func (o *DeleteResponse) GetOkOk() (*bool, bool) { 51 | if o == nil || o.Ok == nil { 52 | return nil, false 53 | } 54 | return o.Ok, true 55 | } 56 | 57 | // HasOk returns a boolean if a field has been set. 58 | func (o *DeleteResponse) HasOk() bool { 59 | if o != nil && o.Ok != nil { 60 | return true 61 | } 62 | 63 | return false 64 | } 65 | 66 | // SetOk gets a reference to the given bool and assigns it to the Ok field. 67 | func (o *DeleteResponse) SetOk(v bool) { 68 | o.Ok = &v 69 | } 70 | 71 | func (o DeleteResponse) MarshalJSON() ([]byte, error) { 72 | toSerialize := map[string]interface{}{} 73 | if o.Ok != nil { 74 | toSerialize["ok"] = o.Ok 75 | } 76 | return json.Marshal(toSerialize) 77 | } 78 | 79 | type NullableDeleteResponse struct { 80 | value *DeleteResponse 81 | isSet bool 82 | } 83 | 84 | func (v NullableDeleteResponse) Get() *DeleteResponse { 85 | return v.value 86 | } 87 | 88 | func (v *NullableDeleteResponse) Set(val *DeleteResponse) { 89 | v.value = val 90 | v.isSet = true 91 | } 92 | 93 | func (v NullableDeleteResponse) IsSet() bool { 94 | return v.isSet 95 | } 96 | 97 | func (v *NullableDeleteResponse) Unset() { 98 | v.value = nil 99 | v.isSet = false 100 | } 101 | 102 | func NewNullableDeleteResponse(val *DeleteResponse) *NullableDeleteResponse { 103 | return &NullableDeleteResponse{value: val, isSet: true} 104 | } 105 | 106 | func (v NullableDeleteResponse) MarshalJSON() ([]byte, error) { 107 | return json.Marshal(v.value) 108 | } 109 | 110 | func (v *NullableDeleteResponse) UnmarshalJSON(src []byte) error { 111 | v.isSet = true 112 | return json.Unmarshal(src, &v.value) 113 | } 114 | 115 | 116 | -------------------------------------------------------------------------------- /model_error_response.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // ErrorResponse struct for ErrorResponse 18 | type ErrorResponse struct { 19 | Ok *bool `json:"ok,omitempty"` 20 | Error *ErrorResponseError `json:"error,omitempty"` 21 | } 22 | 23 | // NewErrorResponse instantiates a new ErrorResponse object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewErrorResponse() *ErrorResponse { 28 | this := ErrorResponse{} 29 | var ok bool = false 30 | this.Ok = &ok 31 | return &this 32 | } 33 | 34 | // NewErrorResponseWithDefaults instantiates a new ErrorResponse object 35 | // This constructor will only assign default values to properties that have it defined, 36 | // but it doesn't guarantee that properties required by API are set 37 | func NewErrorResponseWithDefaults() *ErrorResponse { 38 | this := ErrorResponse{} 39 | var ok bool = false 40 | this.Ok = &ok 41 | return &this 42 | } 43 | 44 | // GetOk returns the Ok field value if set, zero value otherwise. 45 | func (o *ErrorResponse) GetOk() bool { 46 | if o == nil || o.Ok == nil { 47 | var ret bool 48 | return ret 49 | } 50 | return *o.Ok 51 | } 52 | 53 | // GetOkOk returns a tuple with the Ok field value if set, nil otherwise 54 | // and a boolean to check if the value has been set. 55 | func (o *ErrorResponse) GetOkOk() (*bool, bool) { 56 | if o == nil || o.Ok == nil { 57 | return nil, false 58 | } 59 | return o.Ok, true 60 | } 61 | 62 | // HasOk returns a boolean if a field has been set. 63 | func (o *ErrorResponse) HasOk() bool { 64 | if o != nil && o.Ok != nil { 65 | return true 66 | } 67 | 68 | return false 69 | } 70 | 71 | // SetOk gets a reference to the given bool and assigns it to the Ok field. 72 | func (o *ErrorResponse) SetOk(v bool) { 73 | o.Ok = &v 74 | } 75 | 76 | // GetError returns the Error field value if set, zero value otherwise. 77 | func (o *ErrorResponse) GetError() ErrorResponseError { 78 | if o == nil || o.Error == nil { 79 | var ret ErrorResponseError 80 | return ret 81 | } 82 | return *o.Error 83 | } 84 | 85 | // GetErrorOk returns a tuple with the Error field value if set, nil otherwise 86 | // and a boolean to check if the value has been set. 87 | func (o *ErrorResponse) GetErrorOk() (*ErrorResponseError, bool) { 88 | if o == nil || o.Error == nil { 89 | return nil, false 90 | } 91 | return o.Error, true 92 | } 93 | 94 | // HasError returns a boolean if a field has been set. 95 | func (o *ErrorResponse) HasError() bool { 96 | if o != nil && o.Error != nil { 97 | return true 98 | } 99 | 100 | return false 101 | } 102 | 103 | // SetError gets a reference to the given ErrorResponseError and assigns it to the Error field. 104 | func (o *ErrorResponse) SetError(v ErrorResponseError) { 105 | o.Error = &v 106 | } 107 | 108 | func (o ErrorResponse) MarshalJSON() ([]byte, error) { 109 | toSerialize := map[string]interface{}{} 110 | if o.Ok != nil { 111 | toSerialize["ok"] = o.Ok 112 | } 113 | if o.Error != nil { 114 | toSerialize["error"] = o.Error 115 | } 116 | return json.Marshal(toSerialize) 117 | } 118 | 119 | type NullableErrorResponse struct { 120 | value *ErrorResponse 121 | isSet bool 122 | } 123 | 124 | func (v NullableErrorResponse) Get() *ErrorResponse { 125 | return v.value 126 | } 127 | 128 | func (v *NullableErrorResponse) Set(val *ErrorResponse) { 129 | v.value = val 130 | v.isSet = true 131 | } 132 | 133 | func (v NullableErrorResponse) IsSet() bool { 134 | return v.isSet 135 | } 136 | 137 | func (v *NullableErrorResponse) Unset() { 138 | v.value = nil 139 | v.isSet = false 140 | } 141 | 142 | func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { 143 | return &NullableErrorResponse{value: val, isSet: true} 144 | } 145 | 146 | func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { 147 | return json.Marshal(v.value) 148 | } 149 | 150 | func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { 151 | v.isSet = true 152 | return json.Unmarshal(src, &v.value) 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /model_error_response_error.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // ErrorResponseError struct for ErrorResponseError 18 | type ErrorResponseError struct { 19 | Name *string `json:"name,omitempty"` 20 | Message *string `json:"message,omitempty"` 21 | } 22 | 23 | // NewErrorResponseError instantiates a new ErrorResponseError object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewErrorResponseError() *ErrorResponseError { 28 | this := ErrorResponseError{} 29 | return &this 30 | } 31 | 32 | // NewErrorResponseErrorWithDefaults instantiates a new ErrorResponseError object 33 | // This constructor will only assign default values to properties that have it defined, 34 | // but it doesn't guarantee that properties required by API are set 35 | func NewErrorResponseErrorWithDefaults() *ErrorResponseError { 36 | this := ErrorResponseError{} 37 | return &this 38 | } 39 | 40 | // GetName returns the Name field value if set, zero value otherwise. 41 | func (o *ErrorResponseError) GetName() string { 42 | if o == nil || o.Name == nil { 43 | var ret string 44 | return ret 45 | } 46 | return *o.Name 47 | } 48 | 49 | // GetNameOk returns a tuple with the Name field value if set, nil otherwise 50 | // and a boolean to check if the value has been set. 51 | func (o *ErrorResponseError) GetNameOk() (*string, bool) { 52 | if o == nil || o.Name == nil { 53 | return nil, false 54 | } 55 | return o.Name, true 56 | } 57 | 58 | // HasName returns a boolean if a field has been set. 59 | func (o *ErrorResponseError) HasName() bool { 60 | if o != nil && o.Name != nil { 61 | return true 62 | } 63 | 64 | return false 65 | } 66 | 67 | // SetName gets a reference to the given string and assigns it to the Name field. 68 | func (o *ErrorResponseError) SetName(v string) { 69 | o.Name = &v 70 | } 71 | 72 | // GetMessage returns the Message field value if set, zero value otherwise. 73 | func (o *ErrorResponseError) GetMessage() string { 74 | if o == nil || o.Message == nil { 75 | var ret string 76 | return ret 77 | } 78 | return *o.Message 79 | } 80 | 81 | // GetMessageOk returns a tuple with the Message field value if set, nil otherwise 82 | // and a boolean to check if the value has been set. 83 | func (o *ErrorResponseError) GetMessageOk() (*string, bool) { 84 | if o == nil || o.Message == nil { 85 | return nil, false 86 | } 87 | return o.Message, true 88 | } 89 | 90 | // HasMessage returns a boolean if a field has been set. 91 | func (o *ErrorResponseError) HasMessage() bool { 92 | if o != nil && o.Message != nil { 93 | return true 94 | } 95 | 96 | return false 97 | } 98 | 99 | // SetMessage gets a reference to the given string and assigns it to the Message field. 100 | func (o *ErrorResponseError) SetMessage(v string) { 101 | o.Message = &v 102 | } 103 | 104 | func (o ErrorResponseError) MarshalJSON() ([]byte, error) { 105 | toSerialize := map[string]interface{}{} 106 | if o.Name != nil { 107 | toSerialize["name"] = o.Name 108 | } 109 | if o.Message != nil { 110 | toSerialize["message"] = o.Message 111 | } 112 | return json.Marshal(toSerialize) 113 | } 114 | 115 | type NullableErrorResponseError struct { 116 | value *ErrorResponseError 117 | isSet bool 118 | } 119 | 120 | func (v NullableErrorResponseError) Get() *ErrorResponseError { 121 | return v.value 122 | } 123 | 124 | func (v *NullableErrorResponseError) Set(val *ErrorResponseError) { 125 | v.value = val 126 | v.isSet = true 127 | } 128 | 129 | func (v NullableErrorResponseError) IsSet() bool { 130 | return v.isSet 131 | } 132 | 133 | func (v *NullableErrorResponseError) Unset() { 134 | v.value = nil 135 | v.isSet = false 136 | } 137 | 138 | func NewNullableErrorResponseError(val *ErrorResponseError) *NullableErrorResponseError { 139 | return &NullableErrorResponseError{value: val, isSet: true} 140 | } 141 | 142 | func (v NullableErrorResponseError) MarshalJSON() ([]byte, error) { 143 | return json.Marshal(v.value) 144 | } 145 | 146 | func (v *NullableErrorResponseError) UnmarshalJSON(src []byte) error { 147 | v.isSet = true 148 | return json.Unmarshal(src, &v.value) 149 | } 150 | 151 | 152 | -------------------------------------------------------------------------------- /model_forbidden_error_response.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // ForbiddenErrorResponse struct for ForbiddenErrorResponse 18 | type ForbiddenErrorResponse struct { 19 | Ok *bool `json:"ok,omitempty"` 20 | Error *ForbiddenErrorResponseError `json:"error,omitempty"` 21 | } 22 | 23 | // NewForbiddenErrorResponse instantiates a new ForbiddenErrorResponse object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewForbiddenErrorResponse() *ForbiddenErrorResponse { 28 | this := ForbiddenErrorResponse{} 29 | var ok bool = false 30 | this.Ok = &ok 31 | return &this 32 | } 33 | 34 | // NewForbiddenErrorResponseWithDefaults instantiates a new ForbiddenErrorResponse object 35 | // This constructor will only assign default values to properties that have it defined, 36 | // but it doesn't guarantee that properties required by API are set 37 | func NewForbiddenErrorResponseWithDefaults() *ForbiddenErrorResponse { 38 | this := ForbiddenErrorResponse{} 39 | var ok bool = false 40 | this.Ok = &ok 41 | return &this 42 | } 43 | 44 | // GetOk returns the Ok field value if set, zero value otherwise. 45 | func (o *ForbiddenErrorResponse) GetOk() bool { 46 | if o == nil || o.Ok == nil { 47 | var ret bool 48 | return ret 49 | } 50 | return *o.Ok 51 | } 52 | 53 | // GetOkOk returns a tuple with the Ok field value if set, nil otherwise 54 | // and a boolean to check if the value has been set. 55 | func (o *ForbiddenErrorResponse) GetOkOk() (*bool, bool) { 56 | if o == nil || o.Ok == nil { 57 | return nil, false 58 | } 59 | return o.Ok, true 60 | } 61 | 62 | // HasOk returns a boolean if a field has been set. 63 | func (o *ForbiddenErrorResponse) HasOk() bool { 64 | if o != nil && o.Ok != nil { 65 | return true 66 | } 67 | 68 | return false 69 | } 70 | 71 | // SetOk gets a reference to the given bool and assigns it to the Ok field. 72 | func (o *ForbiddenErrorResponse) SetOk(v bool) { 73 | o.Ok = &v 74 | } 75 | 76 | // GetError returns the Error field value if set, zero value otherwise. 77 | func (o *ForbiddenErrorResponse) GetError() ForbiddenErrorResponseError { 78 | if o == nil || o.Error == nil { 79 | var ret ForbiddenErrorResponseError 80 | return ret 81 | } 82 | return *o.Error 83 | } 84 | 85 | // GetErrorOk returns a tuple with the Error field value if set, nil otherwise 86 | // and a boolean to check if the value has been set. 87 | func (o *ForbiddenErrorResponse) GetErrorOk() (*ForbiddenErrorResponseError, bool) { 88 | if o == nil || o.Error == nil { 89 | return nil, false 90 | } 91 | return o.Error, true 92 | } 93 | 94 | // HasError returns a boolean if a field has been set. 95 | func (o *ForbiddenErrorResponse) HasError() bool { 96 | if o != nil && o.Error != nil { 97 | return true 98 | } 99 | 100 | return false 101 | } 102 | 103 | // SetError gets a reference to the given ForbiddenErrorResponseError and assigns it to the Error field. 104 | func (o *ForbiddenErrorResponse) SetError(v ForbiddenErrorResponseError) { 105 | o.Error = &v 106 | } 107 | 108 | func (o ForbiddenErrorResponse) MarshalJSON() ([]byte, error) { 109 | toSerialize := map[string]interface{}{} 110 | if o.Ok != nil { 111 | toSerialize["ok"] = o.Ok 112 | } 113 | if o.Error != nil { 114 | toSerialize["error"] = o.Error 115 | } 116 | return json.Marshal(toSerialize) 117 | } 118 | 119 | type NullableForbiddenErrorResponse struct { 120 | value *ForbiddenErrorResponse 121 | isSet bool 122 | } 123 | 124 | func (v NullableForbiddenErrorResponse) Get() *ForbiddenErrorResponse { 125 | return v.value 126 | } 127 | 128 | func (v *NullableForbiddenErrorResponse) Set(val *ForbiddenErrorResponse) { 129 | v.value = val 130 | v.isSet = true 131 | } 132 | 133 | func (v NullableForbiddenErrorResponse) IsSet() bool { 134 | return v.isSet 135 | } 136 | 137 | func (v *NullableForbiddenErrorResponse) Unset() { 138 | v.value = nil 139 | v.isSet = false 140 | } 141 | 142 | func NewNullableForbiddenErrorResponse(val *ForbiddenErrorResponse) *NullableForbiddenErrorResponse { 143 | return &NullableForbiddenErrorResponse{value: val, isSet: true} 144 | } 145 | 146 | func (v NullableForbiddenErrorResponse) MarshalJSON() ([]byte, error) { 147 | return json.Marshal(v.value) 148 | } 149 | 150 | func (v *NullableForbiddenErrorResponse) UnmarshalJSON(src []byte) error { 151 | v.isSet = true 152 | return json.Unmarshal(src, &v.value) 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /model_forbidden_error_response_error.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // ForbiddenErrorResponseError struct for ForbiddenErrorResponseError 18 | type ForbiddenErrorResponseError struct { 19 | Name *string `json:"name,omitempty"` 20 | Message *string `json:"message,omitempty"` 21 | } 22 | 23 | // NewForbiddenErrorResponseError instantiates a new ForbiddenErrorResponseError object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewForbiddenErrorResponseError() *ForbiddenErrorResponseError { 28 | this := ForbiddenErrorResponseError{} 29 | var name string = "HTTP Error" 30 | this.Name = &name 31 | return &this 32 | } 33 | 34 | // NewForbiddenErrorResponseErrorWithDefaults instantiates a new ForbiddenErrorResponseError object 35 | // This constructor will only assign default values to properties that have it defined, 36 | // but it doesn't guarantee that properties required by API are set 37 | func NewForbiddenErrorResponseErrorWithDefaults() *ForbiddenErrorResponseError { 38 | this := ForbiddenErrorResponseError{} 39 | var name string = "HTTP Error" 40 | this.Name = &name 41 | return &this 42 | } 43 | 44 | // GetName returns the Name field value if set, zero value otherwise. 45 | func (o *ForbiddenErrorResponseError) GetName() string { 46 | if o == nil || o.Name == nil { 47 | var ret string 48 | return ret 49 | } 50 | return *o.Name 51 | } 52 | 53 | // GetNameOk returns a tuple with the Name field value if set, nil otherwise 54 | // and a boolean to check if the value has been set. 55 | func (o *ForbiddenErrorResponseError) GetNameOk() (*string, bool) { 56 | if o == nil || o.Name == nil { 57 | return nil, false 58 | } 59 | return o.Name, true 60 | } 61 | 62 | // HasName returns a boolean if a field has been set. 63 | func (o *ForbiddenErrorResponseError) HasName() bool { 64 | if o != nil && o.Name != nil { 65 | return true 66 | } 67 | 68 | return false 69 | } 70 | 71 | // SetName gets a reference to the given string and assigns it to the Name field. 72 | func (o *ForbiddenErrorResponseError) SetName(v string) { 73 | o.Name = &v 74 | } 75 | 76 | // GetMessage returns the Message field value if set, zero value otherwise. 77 | func (o *ForbiddenErrorResponseError) GetMessage() string { 78 | if o == nil || o.Message == nil { 79 | var ret string 80 | return ret 81 | } 82 | return *o.Message 83 | } 84 | 85 | // GetMessageOk returns a tuple with the Message field value if set, nil otherwise 86 | // and a boolean to check if the value has been set. 87 | func (o *ForbiddenErrorResponseError) GetMessageOk() (*string, bool) { 88 | if o == nil || o.Message == nil { 89 | return nil, false 90 | } 91 | return o.Message, true 92 | } 93 | 94 | // HasMessage returns a boolean if a field has been set. 95 | func (o *ForbiddenErrorResponseError) HasMessage() bool { 96 | if o != nil && o.Message != nil { 97 | return true 98 | } 99 | 100 | return false 101 | } 102 | 103 | // SetMessage gets a reference to the given string and assigns it to the Message field. 104 | func (o *ForbiddenErrorResponseError) SetMessage(v string) { 105 | o.Message = &v 106 | } 107 | 108 | func (o ForbiddenErrorResponseError) MarshalJSON() ([]byte, error) { 109 | toSerialize := map[string]interface{}{} 110 | if o.Name != nil { 111 | toSerialize["name"] = o.Name 112 | } 113 | if o.Message != nil { 114 | toSerialize["message"] = o.Message 115 | } 116 | return json.Marshal(toSerialize) 117 | } 118 | 119 | type NullableForbiddenErrorResponseError struct { 120 | value *ForbiddenErrorResponseError 121 | isSet bool 122 | } 123 | 124 | func (v NullableForbiddenErrorResponseError) Get() *ForbiddenErrorResponseError { 125 | return v.value 126 | } 127 | 128 | func (v *NullableForbiddenErrorResponseError) Set(val *ForbiddenErrorResponseError) { 129 | v.value = val 130 | v.isSet = true 131 | } 132 | 133 | func (v NullableForbiddenErrorResponseError) IsSet() bool { 134 | return v.isSet 135 | } 136 | 137 | func (v *NullableForbiddenErrorResponseError) Unset() { 138 | v.value = nil 139 | v.isSet = false 140 | } 141 | 142 | func NewNullableForbiddenErrorResponseError(val *ForbiddenErrorResponseError) *NullableForbiddenErrorResponseError { 143 | return &NullableForbiddenErrorResponseError{value: val, isSet: true} 144 | } 145 | 146 | func (v NullableForbiddenErrorResponseError) MarshalJSON() ([]byte, error) { 147 | return json.Marshal(v.value) 148 | } 149 | 150 | func (v *NullableForbiddenErrorResponseError) UnmarshalJSON(src []byte) error { 151 | v.isSet = true 152 | return json.Unmarshal(src, &v.value) 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /model_get_response.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // GetResponse struct for GetResponse 18 | type GetResponse struct { 19 | Ok *bool `json:"ok,omitempty"` 20 | Value *NFT `json:"value,omitempty"` 21 | } 22 | 23 | // NewGetResponse instantiates a new GetResponse object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewGetResponse() *GetResponse { 28 | this := GetResponse{} 29 | var ok bool = true 30 | this.Ok = &ok 31 | return &this 32 | } 33 | 34 | // NewGetResponseWithDefaults instantiates a new GetResponse object 35 | // This constructor will only assign default values to properties that have it defined, 36 | // but it doesn't guarantee that properties required by API are set 37 | func NewGetResponseWithDefaults() *GetResponse { 38 | this := GetResponse{} 39 | var ok bool = true 40 | this.Ok = &ok 41 | return &this 42 | } 43 | 44 | // GetOk returns the Ok field value if set, zero value otherwise. 45 | func (o *GetResponse) GetOk() bool { 46 | if o == nil || o.Ok == nil { 47 | var ret bool 48 | return ret 49 | } 50 | return *o.Ok 51 | } 52 | 53 | // GetOkOk returns a tuple with the Ok field value if set, nil otherwise 54 | // and a boolean to check if the value has been set. 55 | func (o *GetResponse) GetOkOk() (*bool, bool) { 56 | if o == nil || o.Ok == nil { 57 | return nil, false 58 | } 59 | return o.Ok, true 60 | } 61 | 62 | // HasOk returns a boolean if a field has been set. 63 | func (o *GetResponse) HasOk() bool { 64 | if o != nil && o.Ok != nil { 65 | return true 66 | } 67 | 68 | return false 69 | } 70 | 71 | // SetOk gets a reference to the given bool and assigns it to the Ok field. 72 | func (o *GetResponse) SetOk(v bool) { 73 | o.Ok = &v 74 | } 75 | 76 | // GetValue returns the Value field value if set, zero value otherwise. 77 | func (o *GetResponse) GetValue() NFT { 78 | if o == nil || o.Value == nil { 79 | var ret NFT 80 | return ret 81 | } 82 | return *o.Value 83 | } 84 | 85 | // GetValueOk returns a tuple with the Value field value if set, nil otherwise 86 | // and a boolean to check if the value has been set. 87 | func (o *GetResponse) GetValueOk() (*NFT, bool) { 88 | if o == nil || o.Value == nil { 89 | return nil, false 90 | } 91 | return o.Value, true 92 | } 93 | 94 | // HasValue returns a boolean if a field has been set. 95 | func (o *GetResponse) HasValue() bool { 96 | if o != nil && o.Value != nil { 97 | return true 98 | } 99 | 100 | return false 101 | } 102 | 103 | // SetValue gets a reference to the given NFT and assigns it to the Value field. 104 | func (o *GetResponse) SetValue(v NFT) { 105 | o.Value = &v 106 | } 107 | 108 | func (o GetResponse) MarshalJSON() ([]byte, error) { 109 | toSerialize := map[string]interface{}{} 110 | if o.Ok != nil { 111 | toSerialize["ok"] = o.Ok 112 | } 113 | if o.Value != nil { 114 | toSerialize["value"] = o.Value 115 | } 116 | return json.Marshal(toSerialize) 117 | } 118 | 119 | type NullableGetResponse struct { 120 | value *GetResponse 121 | isSet bool 122 | } 123 | 124 | func (v NullableGetResponse) Get() *GetResponse { 125 | return v.value 126 | } 127 | 128 | func (v *NullableGetResponse) Set(val *GetResponse) { 129 | v.value = val 130 | v.isSet = true 131 | } 132 | 133 | func (v NullableGetResponse) IsSet() bool { 134 | return v.isSet 135 | } 136 | 137 | func (v *NullableGetResponse) Unset() { 138 | v.value = nil 139 | v.isSet = false 140 | } 141 | 142 | func NewNullableGetResponse(val *GetResponse) *NullableGetResponse { 143 | return &NullableGetResponse{value: val, isSet: true} 144 | } 145 | 146 | func (v NullableGetResponse) MarshalJSON() ([]byte, error) { 147 | return json.Marshal(v.value) 148 | } 149 | 150 | func (v *NullableGetResponse) UnmarshalJSON(src []byte) error { 151 | v.isSet = true 152 | return json.Unmarshal(src, &v.value) 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /model_links.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // Links struct for Links 18 | type Links struct { 19 | Ipfs *string `json:"ipfs,omitempty"` 20 | Http *string `json:"http,omitempty"` 21 | File *[]LinksFile `json:"file,omitempty"` 22 | } 23 | 24 | // NewLinks instantiates a new Links object 25 | // This constructor will assign default values to properties that have it defined, 26 | // and makes sure properties required by API are set, but the set of arguments 27 | // will change when the set of required properties is changed 28 | func NewLinks() *Links { 29 | this := Links{} 30 | return &this 31 | } 32 | 33 | // NewLinksWithDefaults instantiates a new Links object 34 | // This constructor will only assign default values to properties that have it defined, 35 | // but it doesn't guarantee that properties required by API are set 36 | func NewLinksWithDefaults() *Links { 37 | this := Links{} 38 | return &this 39 | } 40 | 41 | // GetIpfs returns the Ipfs field value if set, zero value otherwise. 42 | func (o *Links) GetIpfs() string { 43 | if o == nil || o.Ipfs == nil { 44 | var ret string 45 | return ret 46 | } 47 | return *o.Ipfs 48 | } 49 | 50 | // GetIpfsOk returns a tuple with the Ipfs field value if set, nil otherwise 51 | // and a boolean to check if the value has been set. 52 | func (o *Links) GetIpfsOk() (*string, bool) { 53 | if o == nil || o.Ipfs == nil { 54 | return nil, false 55 | } 56 | return o.Ipfs, true 57 | } 58 | 59 | // HasIpfs returns a boolean if a field has been set. 60 | func (o *Links) HasIpfs() bool { 61 | if o != nil && o.Ipfs != nil { 62 | return true 63 | } 64 | 65 | return false 66 | } 67 | 68 | // SetIpfs gets a reference to the given string and assigns it to the Ipfs field. 69 | func (o *Links) SetIpfs(v string) { 70 | o.Ipfs = &v 71 | } 72 | 73 | // GetHttp returns the Http field value if set, zero value otherwise. 74 | func (o *Links) GetHttp() string { 75 | if o == nil || o.Http == nil { 76 | var ret string 77 | return ret 78 | } 79 | return *o.Http 80 | } 81 | 82 | // GetHttpOk returns a tuple with the Http field value if set, nil otherwise 83 | // and a boolean to check if the value has been set. 84 | func (o *Links) GetHttpOk() (*string, bool) { 85 | if o == nil || o.Http == nil { 86 | return nil, false 87 | } 88 | return o.Http, true 89 | } 90 | 91 | // HasHttp returns a boolean if a field has been set. 92 | func (o *Links) HasHttp() bool { 93 | if o != nil && o.Http != nil { 94 | return true 95 | } 96 | 97 | return false 98 | } 99 | 100 | // SetHttp gets a reference to the given string and assigns it to the Http field. 101 | func (o *Links) SetHttp(v string) { 102 | o.Http = &v 103 | } 104 | 105 | // GetFile returns the File field value if set, zero value otherwise. 106 | func (o *Links) GetFile() []LinksFile { 107 | if o == nil || o.File == nil { 108 | var ret []LinksFile 109 | return ret 110 | } 111 | return *o.File 112 | } 113 | 114 | // GetFileOk returns a tuple with the File field value if set, nil otherwise 115 | // and a boolean to check if the value has been set. 116 | func (o *Links) GetFileOk() (*[]LinksFile, bool) { 117 | if o == nil || o.File == nil { 118 | return nil, false 119 | } 120 | return o.File, true 121 | } 122 | 123 | // HasFile returns a boolean if a field has been set. 124 | func (o *Links) HasFile() bool { 125 | if o != nil && o.File != nil { 126 | return true 127 | } 128 | 129 | return false 130 | } 131 | 132 | // SetFile gets a reference to the given []LinksFile and assigns it to the File field. 133 | func (o *Links) SetFile(v []LinksFile) { 134 | o.File = &v 135 | } 136 | 137 | func (o Links) MarshalJSON() ([]byte, error) { 138 | toSerialize := map[string]interface{}{} 139 | if o.Ipfs != nil { 140 | toSerialize["ipfs"] = o.Ipfs 141 | } 142 | if o.Http != nil { 143 | toSerialize["http"] = o.Http 144 | } 145 | if o.File != nil { 146 | toSerialize["file"] = o.File 147 | } 148 | return json.Marshal(toSerialize) 149 | } 150 | 151 | type NullableLinks struct { 152 | value *Links 153 | isSet bool 154 | } 155 | 156 | func (v NullableLinks) Get() *Links { 157 | return v.value 158 | } 159 | 160 | func (v *NullableLinks) Set(val *Links) { 161 | v.value = val 162 | v.isSet = true 163 | } 164 | 165 | func (v NullableLinks) IsSet() bool { 166 | return v.isSet 167 | } 168 | 169 | func (v *NullableLinks) Unset() { 170 | v.value = nil 171 | v.isSet = false 172 | } 173 | 174 | func NewNullableLinks(val *Links) *NullableLinks { 175 | return &NullableLinks{value: val, isSet: true} 176 | } 177 | 178 | func (v NullableLinks) MarshalJSON() ([]byte, error) { 179 | return json.Marshal(v.value) 180 | } 181 | 182 | func (v *NullableLinks) UnmarshalJSON(src []byte) error { 183 | v.isSet = true 184 | return json.Unmarshal(src, &v.value) 185 | } 186 | 187 | 188 | -------------------------------------------------------------------------------- /model_links_file.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // LinksFile struct for LinksFile 18 | type LinksFile struct { 19 | Ipfs *string `json:"ipfs,omitempty"` 20 | Http *string `json:"http,omitempty"` 21 | } 22 | 23 | // NewLinksFile instantiates a new LinksFile object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewLinksFile() *LinksFile { 28 | this := LinksFile{} 29 | return &this 30 | } 31 | 32 | // NewLinksFileWithDefaults instantiates a new LinksFile object 33 | // This constructor will only assign default values to properties that have it defined, 34 | // but it doesn't guarantee that properties required by API are set 35 | func NewLinksFileWithDefaults() *LinksFile { 36 | this := LinksFile{} 37 | return &this 38 | } 39 | 40 | // GetIpfs returns the Ipfs field value if set, zero value otherwise. 41 | func (o *LinksFile) GetIpfs() string { 42 | if o == nil || o.Ipfs == nil { 43 | var ret string 44 | return ret 45 | } 46 | return *o.Ipfs 47 | } 48 | 49 | // GetIpfsOk returns a tuple with the Ipfs field value if set, nil otherwise 50 | // and a boolean to check if the value has been set. 51 | func (o *LinksFile) GetIpfsOk() (*string, bool) { 52 | if o == nil || o.Ipfs == nil { 53 | return nil, false 54 | } 55 | return o.Ipfs, true 56 | } 57 | 58 | // HasIpfs returns a boolean if a field has been set. 59 | func (o *LinksFile) HasIpfs() bool { 60 | if o != nil && o.Ipfs != nil { 61 | return true 62 | } 63 | 64 | return false 65 | } 66 | 67 | // SetIpfs gets a reference to the given string and assigns it to the Ipfs field. 68 | func (o *LinksFile) SetIpfs(v string) { 69 | o.Ipfs = &v 70 | } 71 | 72 | // GetHttp returns the Http field value if set, zero value otherwise. 73 | func (o *LinksFile) GetHttp() string { 74 | if o == nil || o.Http == nil { 75 | var ret string 76 | return ret 77 | } 78 | return *o.Http 79 | } 80 | 81 | // GetHttpOk returns a tuple with the Http field value if set, nil otherwise 82 | // and a boolean to check if the value has been set. 83 | func (o *LinksFile) GetHttpOk() (*string, bool) { 84 | if o == nil || o.Http == nil { 85 | return nil, false 86 | } 87 | return o.Http, true 88 | } 89 | 90 | // HasHttp returns a boolean if a field has been set. 91 | func (o *LinksFile) HasHttp() bool { 92 | if o != nil && o.Http != nil { 93 | return true 94 | } 95 | 96 | return false 97 | } 98 | 99 | // SetHttp gets a reference to the given string and assigns it to the Http field. 100 | func (o *LinksFile) SetHttp(v string) { 101 | o.Http = &v 102 | } 103 | 104 | func (o LinksFile) MarshalJSON() ([]byte, error) { 105 | toSerialize := map[string]interface{}{} 106 | if o.Ipfs != nil { 107 | toSerialize["ipfs"] = o.Ipfs 108 | } 109 | if o.Http != nil { 110 | toSerialize["http"] = o.Http 111 | } 112 | return json.Marshal(toSerialize) 113 | } 114 | 115 | type NullableLinksFile struct { 116 | value *LinksFile 117 | isSet bool 118 | } 119 | 120 | func (v NullableLinksFile) Get() *LinksFile { 121 | return v.value 122 | } 123 | 124 | func (v *NullableLinksFile) Set(val *LinksFile) { 125 | v.value = val 126 | v.isSet = true 127 | } 128 | 129 | func (v NullableLinksFile) IsSet() bool { 130 | return v.isSet 131 | } 132 | 133 | func (v *NullableLinksFile) Unset() { 134 | v.value = nil 135 | v.isSet = false 136 | } 137 | 138 | func NewNullableLinksFile(val *LinksFile) *NullableLinksFile { 139 | return &NullableLinksFile{value: val, isSet: true} 140 | } 141 | 142 | func (v NullableLinksFile) MarshalJSON() ([]byte, error) { 143 | return json.Marshal(v.value) 144 | } 145 | 146 | func (v *NullableLinksFile) UnmarshalJSON(src []byte) error { 147 | v.isSet = true 148 | return json.Unmarshal(src, &v.value) 149 | } 150 | 151 | 152 | -------------------------------------------------------------------------------- /model_list_response.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // ListResponse struct for ListResponse 18 | type ListResponse struct { 19 | Ok *bool `json:"ok,omitempty"` 20 | Value *[]NFT `json:"value,omitempty"` 21 | } 22 | 23 | // NewListResponse instantiates a new ListResponse object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewListResponse() *ListResponse { 28 | this := ListResponse{} 29 | var ok bool = true 30 | this.Ok = &ok 31 | return &this 32 | } 33 | 34 | // NewListResponseWithDefaults instantiates a new ListResponse object 35 | // This constructor will only assign default values to properties that have it defined, 36 | // but it doesn't guarantee that properties required by API are set 37 | func NewListResponseWithDefaults() *ListResponse { 38 | this := ListResponse{} 39 | var ok bool = true 40 | this.Ok = &ok 41 | return &this 42 | } 43 | 44 | // GetOk returns the Ok field value if set, zero value otherwise. 45 | func (o *ListResponse) GetOk() bool { 46 | if o == nil || o.Ok == nil { 47 | var ret bool 48 | return ret 49 | } 50 | return *o.Ok 51 | } 52 | 53 | // GetOkOk returns a tuple with the Ok field value if set, nil otherwise 54 | // and a boolean to check if the value has been set. 55 | func (o *ListResponse) GetOkOk() (*bool, bool) { 56 | if o == nil || o.Ok == nil { 57 | return nil, false 58 | } 59 | return o.Ok, true 60 | } 61 | 62 | // HasOk returns a boolean if a field has been set. 63 | func (o *ListResponse) HasOk() bool { 64 | if o != nil && o.Ok != nil { 65 | return true 66 | } 67 | 68 | return false 69 | } 70 | 71 | // SetOk gets a reference to the given bool and assigns it to the Ok field. 72 | func (o *ListResponse) SetOk(v bool) { 73 | o.Ok = &v 74 | } 75 | 76 | // GetValue returns the Value field value if set, zero value otherwise. 77 | func (o *ListResponse) GetValue() []NFT { 78 | if o == nil || o.Value == nil { 79 | var ret []NFT 80 | return ret 81 | } 82 | return *o.Value 83 | } 84 | 85 | // GetValueOk returns a tuple with the Value field value if set, nil otherwise 86 | // and a boolean to check if the value has been set. 87 | func (o *ListResponse) GetValueOk() (*[]NFT, bool) { 88 | if o == nil || o.Value == nil { 89 | return nil, false 90 | } 91 | return o.Value, true 92 | } 93 | 94 | // HasValue returns a boolean if a field has been set. 95 | func (o *ListResponse) HasValue() bool { 96 | if o != nil && o.Value != nil { 97 | return true 98 | } 99 | 100 | return false 101 | } 102 | 103 | // SetValue gets a reference to the given []NFT and assigns it to the Value field. 104 | func (o *ListResponse) SetValue(v []NFT) { 105 | o.Value = &v 106 | } 107 | 108 | func (o ListResponse) MarshalJSON() ([]byte, error) { 109 | toSerialize := map[string]interface{}{} 110 | if o.Ok != nil { 111 | toSerialize["ok"] = o.Ok 112 | } 113 | if o.Value != nil { 114 | toSerialize["value"] = o.Value 115 | } 116 | return json.Marshal(toSerialize) 117 | } 118 | 119 | type NullableListResponse struct { 120 | value *ListResponse 121 | isSet bool 122 | } 123 | 124 | func (v NullableListResponse) Get() *ListResponse { 125 | return v.value 126 | } 127 | 128 | func (v *NullableListResponse) Set(val *ListResponse) { 129 | v.value = val 130 | v.isSet = true 131 | } 132 | 133 | func (v NullableListResponse) IsSet() bool { 134 | return v.isSet 135 | } 136 | 137 | func (v *NullableListResponse) Unset() { 138 | v.value = nil 139 | v.isSet = false 140 | } 141 | 142 | func NewNullableListResponse(val *ListResponse) *NullableListResponse { 143 | return &NullableListResponse{value: val, isSet: true} 144 | } 145 | 146 | func (v NullableListResponse) MarshalJSON() ([]byte, error) { 147 | return json.Marshal(v.value) 148 | } 149 | 150 | func (v *NullableListResponse) UnmarshalJSON(src []byte) error { 151 | v.isSet = true 152 | return json.Unmarshal(src, &v.value) 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /model_nft.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | "time" 16 | ) 17 | 18 | // NFT struct for NFT 19 | type NFT struct { 20 | // Self-describing content-addressed identifiers for distributed systems. Check [spec](https://github.com/multiformats/cid) for more info. 21 | Cid *string `json:"cid,omitempty"` 22 | // Size in bytes of the NFT data. 23 | Size *float32 `json:"size,omitempty"` 24 | // This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. 25 | Created *time.Time `json:"created,omitempty"` 26 | // MIME type of the upload file or 'directory' when uploading multiple files. 27 | Type *string `json:"type,omitempty"` 28 | // Name of the JWT token used to create this NFT. 29 | Scope *string `json:"scope,omitempty"` 30 | Pin *Pin `json:"pin,omitempty"` 31 | // Files in the directory (only if this NFT is a directory). 32 | Files *[]map[string]interface{} `json:"files,omitempty"` 33 | Deals *[]Deal `json:"deals,omitempty"` 34 | } 35 | 36 | // NewNFT instantiates a new NFT object 37 | // This constructor will assign default values to properties that have it defined, 38 | // and makes sure properties required by API are set, but the set of arguments 39 | // will change when the set of required properties is changed 40 | func NewNFT() *NFT { 41 | this := NFT{} 42 | var size float32 = 132614 43 | this.Size = &size 44 | var scope string = "default" 45 | this.Scope = &scope 46 | return &this 47 | } 48 | 49 | // NewNFTWithDefaults instantiates a new NFT object 50 | // This constructor will only assign default values to properties that have it defined, 51 | // but it doesn't guarantee that properties required by API are set 52 | func NewNFTWithDefaults() *NFT { 53 | this := NFT{} 54 | var size float32 = 132614 55 | this.Size = &size 56 | var scope string = "default" 57 | this.Scope = &scope 58 | return &this 59 | } 60 | 61 | // GetCid returns the Cid field value if set, zero value otherwise. 62 | func (o *NFT) GetCid() string { 63 | if o == nil || o.Cid == nil { 64 | var ret string 65 | return ret 66 | } 67 | return *o.Cid 68 | } 69 | 70 | // GetCidOk returns a tuple with the Cid field value if set, nil otherwise 71 | // and a boolean to check if the value has been set. 72 | func (o *NFT) GetCidOk() (*string, bool) { 73 | if o == nil || o.Cid == nil { 74 | return nil, false 75 | } 76 | return o.Cid, true 77 | } 78 | 79 | // HasCid returns a boolean if a field has been set. 80 | func (o *NFT) HasCid() bool { 81 | if o != nil && o.Cid != nil { 82 | return true 83 | } 84 | 85 | return false 86 | } 87 | 88 | // SetCid gets a reference to the given string and assigns it to the Cid field. 89 | func (o *NFT) SetCid(v string) { 90 | o.Cid = &v 91 | } 92 | 93 | // GetSize returns the Size field value if set, zero value otherwise. 94 | func (o *NFT) GetSize() float32 { 95 | if o == nil || o.Size == nil { 96 | var ret float32 97 | return ret 98 | } 99 | return *o.Size 100 | } 101 | 102 | // GetSizeOk returns a tuple with the Size field value if set, nil otherwise 103 | // and a boolean to check if the value has been set. 104 | func (o *NFT) GetSizeOk() (*float32, bool) { 105 | if o == nil || o.Size == nil { 106 | return nil, false 107 | } 108 | return o.Size, true 109 | } 110 | 111 | // HasSize returns a boolean if a field has been set. 112 | func (o *NFT) HasSize() bool { 113 | if o != nil && o.Size != nil { 114 | return true 115 | } 116 | 117 | return false 118 | } 119 | 120 | // SetSize gets a reference to the given float32 and assigns it to the Size field. 121 | func (o *NFT) SetSize(v float32) { 122 | o.Size = &v 123 | } 124 | 125 | // GetCreated returns the Created field value if set, zero value otherwise. 126 | func (o *NFT) GetCreated() time.Time { 127 | if o == nil || o.Created == nil { 128 | var ret time.Time 129 | return ret 130 | } 131 | return *o.Created 132 | } 133 | 134 | // GetCreatedOk returns a tuple with the Created field value if set, nil otherwise 135 | // and a boolean to check if the value has been set. 136 | func (o *NFT) GetCreatedOk() (*time.Time, bool) { 137 | if o == nil || o.Created == nil { 138 | return nil, false 139 | } 140 | return o.Created, true 141 | } 142 | 143 | // HasCreated returns a boolean if a field has been set. 144 | func (o *NFT) HasCreated() bool { 145 | if o != nil && o.Created != nil { 146 | return true 147 | } 148 | 149 | return false 150 | } 151 | 152 | // SetCreated gets a reference to the given time.Time and assigns it to the Created field. 153 | func (o *NFT) SetCreated(v time.Time) { 154 | o.Created = &v 155 | } 156 | 157 | // GetType returns the Type field value if set, zero value otherwise. 158 | func (o *NFT) GetType() string { 159 | if o == nil || o.Type == nil { 160 | var ret string 161 | return ret 162 | } 163 | return *o.Type 164 | } 165 | 166 | // GetTypeOk returns a tuple with the Type field value if set, nil otherwise 167 | // and a boolean to check if the value has been set. 168 | func (o *NFT) GetTypeOk() (*string, bool) { 169 | if o == nil || o.Type == nil { 170 | return nil, false 171 | } 172 | return o.Type, true 173 | } 174 | 175 | // HasType returns a boolean if a field has been set. 176 | func (o *NFT) HasType() bool { 177 | if o != nil && o.Type != nil { 178 | return true 179 | } 180 | 181 | return false 182 | } 183 | 184 | // SetType gets a reference to the given string and assigns it to the Type field. 185 | func (o *NFT) SetType(v string) { 186 | o.Type = &v 187 | } 188 | 189 | // GetScope returns the Scope field value if set, zero value otherwise. 190 | func (o *NFT) GetScope() string { 191 | if o == nil || o.Scope == nil { 192 | var ret string 193 | return ret 194 | } 195 | return *o.Scope 196 | } 197 | 198 | // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise 199 | // and a boolean to check if the value has been set. 200 | func (o *NFT) GetScopeOk() (*string, bool) { 201 | if o == nil || o.Scope == nil { 202 | return nil, false 203 | } 204 | return o.Scope, true 205 | } 206 | 207 | // HasScope returns a boolean if a field has been set. 208 | func (o *NFT) HasScope() bool { 209 | if o != nil && o.Scope != nil { 210 | return true 211 | } 212 | 213 | return false 214 | } 215 | 216 | // SetScope gets a reference to the given string and assigns it to the Scope field. 217 | func (o *NFT) SetScope(v string) { 218 | o.Scope = &v 219 | } 220 | 221 | // GetPin returns the Pin field value if set, zero value otherwise. 222 | func (o *NFT) GetPin() Pin { 223 | if o == nil || o.Pin == nil { 224 | var ret Pin 225 | return ret 226 | } 227 | return *o.Pin 228 | } 229 | 230 | // GetPinOk returns a tuple with the Pin field value if set, nil otherwise 231 | // and a boolean to check if the value has been set. 232 | func (o *NFT) GetPinOk() (*Pin, bool) { 233 | if o == nil || o.Pin == nil { 234 | return nil, false 235 | } 236 | return o.Pin, true 237 | } 238 | 239 | // HasPin returns a boolean if a field has been set. 240 | func (o *NFT) HasPin() bool { 241 | if o != nil && o.Pin != nil { 242 | return true 243 | } 244 | 245 | return false 246 | } 247 | 248 | // SetPin gets a reference to the given Pin and assigns it to the Pin field. 249 | func (o *NFT) SetPin(v Pin) { 250 | o.Pin = &v 251 | } 252 | 253 | // GetFiles returns the Files field value if set, zero value otherwise. 254 | func (o *NFT) GetFiles() []map[string]interface{} { 255 | if o == nil || o.Files == nil { 256 | var ret []map[string]interface{} 257 | return ret 258 | } 259 | return *o.Files 260 | } 261 | 262 | // GetFilesOk returns a tuple with the Files field value if set, nil otherwise 263 | // and a boolean to check if the value has been set. 264 | func (o *NFT) GetFilesOk() (*[]map[string]interface{}, bool) { 265 | if o == nil || o.Files == nil { 266 | return nil, false 267 | } 268 | return o.Files, true 269 | } 270 | 271 | // HasFiles returns a boolean if a field has been set. 272 | func (o *NFT) HasFiles() bool { 273 | if o != nil && o.Files != nil { 274 | return true 275 | } 276 | 277 | return false 278 | } 279 | 280 | // SetFiles gets a reference to the given []map[string]interface{} and assigns it to the Files field. 281 | func (o *NFT) SetFiles(v []map[string]interface{}) { 282 | o.Files = &v 283 | } 284 | 285 | // GetDeals returns the Deals field value if set, zero value otherwise. 286 | func (o *NFT) GetDeals() []Deal { 287 | if o == nil || o.Deals == nil { 288 | var ret []Deal 289 | return ret 290 | } 291 | return *o.Deals 292 | } 293 | 294 | // GetDealsOk returns a tuple with the Deals field value if set, nil otherwise 295 | // and a boolean to check if the value has been set. 296 | func (o *NFT) GetDealsOk() (*[]Deal, bool) { 297 | if o == nil || o.Deals == nil { 298 | return nil, false 299 | } 300 | return o.Deals, true 301 | } 302 | 303 | // HasDeals returns a boolean if a field has been set. 304 | func (o *NFT) HasDeals() bool { 305 | if o != nil && o.Deals != nil { 306 | return true 307 | } 308 | 309 | return false 310 | } 311 | 312 | // SetDeals gets a reference to the given []Deal and assigns it to the Deals field. 313 | func (o *NFT) SetDeals(v []Deal) { 314 | o.Deals = &v 315 | } 316 | 317 | func (o NFT) MarshalJSON() ([]byte, error) { 318 | toSerialize := map[string]interface{}{} 319 | if o.Cid != nil { 320 | toSerialize["cid"] = o.Cid 321 | } 322 | if o.Size != nil { 323 | toSerialize["size"] = o.Size 324 | } 325 | if o.Created != nil { 326 | toSerialize["created"] = o.Created 327 | } 328 | if o.Type != nil { 329 | toSerialize["type"] = o.Type 330 | } 331 | if o.Scope != nil { 332 | toSerialize["scope"] = o.Scope 333 | } 334 | if o.Pin != nil { 335 | toSerialize["pin"] = o.Pin 336 | } 337 | if o.Files != nil { 338 | toSerialize["files"] = o.Files 339 | } 340 | if o.Deals != nil { 341 | toSerialize["deals"] = o.Deals 342 | } 343 | return json.Marshal(toSerialize) 344 | } 345 | 346 | type NullableNFT struct { 347 | value *NFT 348 | isSet bool 349 | } 350 | 351 | func (v NullableNFT) Get() *NFT { 352 | return v.value 353 | } 354 | 355 | func (v *NullableNFT) Set(val *NFT) { 356 | v.value = val 357 | v.isSet = true 358 | } 359 | 360 | func (v NullableNFT) IsSet() bool { 361 | return v.isSet 362 | } 363 | 364 | func (v *NullableNFT) Unset() { 365 | v.value = nil 366 | v.isSet = false 367 | } 368 | 369 | func NewNullableNFT(val *NFT) *NullableNFT { 370 | return &NullableNFT{value: val, isSet: true} 371 | } 372 | 373 | func (v NullableNFT) MarshalJSON() ([]byte, error) { 374 | return json.Marshal(v.value) 375 | } 376 | 377 | func (v *NullableNFT) UnmarshalJSON(src []byte) error { 378 | v.isSet = true 379 | return json.Unmarshal(src, &v.value) 380 | } 381 | 382 | 383 | -------------------------------------------------------------------------------- /model_pin.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | "time" 16 | ) 17 | 18 | // Pin struct for Pin 19 | type Pin struct { 20 | // Self-describing content-addressed identifiers for distributed systems. Check [spec](https://github.com/multiformats/cid) for more info. 21 | Cid *string `json:"cid,omitempty"` 22 | Name *string `json:"name,omitempty"` 23 | Status *PinStatus `json:"status,omitempty"` 24 | // This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: YYYY-MM-DDTHH:MM:SSZ. 25 | Created *time.Time `json:"created,omitempty"` 26 | Size *float32 `json:"size,omitempty"` 27 | } 28 | 29 | // NewPin instantiates a new Pin object 30 | // This constructor will assign default values to properties that have it defined, 31 | // and makes sure properties required by API are set, but the set of arguments 32 | // will change when the set of required properties is changed 33 | func NewPin() *Pin { 34 | this := Pin{} 35 | return &this 36 | } 37 | 38 | // NewPinWithDefaults instantiates a new Pin object 39 | // This constructor will only assign default values to properties that have it defined, 40 | // but it doesn't guarantee that properties required by API are set 41 | func NewPinWithDefaults() *Pin { 42 | this := Pin{} 43 | return &this 44 | } 45 | 46 | // GetCid returns the Cid field value if set, zero value otherwise. 47 | func (o *Pin) GetCid() string { 48 | if o == nil || o.Cid == nil { 49 | var ret string 50 | return ret 51 | } 52 | return *o.Cid 53 | } 54 | 55 | // GetCidOk returns a tuple with the Cid field value if set, nil otherwise 56 | // and a boolean to check if the value has been set. 57 | func (o *Pin) GetCidOk() (*string, bool) { 58 | if o == nil || o.Cid == nil { 59 | return nil, false 60 | } 61 | return o.Cid, true 62 | } 63 | 64 | // HasCid returns a boolean if a field has been set. 65 | func (o *Pin) HasCid() bool { 66 | if o != nil && o.Cid != nil { 67 | return true 68 | } 69 | 70 | return false 71 | } 72 | 73 | // SetCid gets a reference to the given string and assigns it to the Cid field. 74 | func (o *Pin) SetCid(v string) { 75 | o.Cid = &v 76 | } 77 | 78 | // GetName returns the Name field value if set, zero value otherwise. 79 | func (o *Pin) GetName() string { 80 | if o == nil || o.Name == nil { 81 | var ret string 82 | return ret 83 | } 84 | return *o.Name 85 | } 86 | 87 | // GetNameOk returns a tuple with the Name field value if set, nil otherwise 88 | // and a boolean to check if the value has been set. 89 | func (o *Pin) GetNameOk() (*string, bool) { 90 | if o == nil || o.Name == nil { 91 | return nil, false 92 | } 93 | return o.Name, true 94 | } 95 | 96 | // HasName returns a boolean if a field has been set. 97 | func (o *Pin) HasName() bool { 98 | if o != nil && o.Name != nil { 99 | return true 100 | } 101 | 102 | return false 103 | } 104 | 105 | // SetName gets a reference to the given string and assigns it to the Name field. 106 | func (o *Pin) SetName(v string) { 107 | o.Name = &v 108 | } 109 | 110 | // GetStatus returns the Status field value if set, zero value otherwise. 111 | func (o *Pin) GetStatus() PinStatus { 112 | if o == nil || o.Status == nil { 113 | var ret PinStatus 114 | return ret 115 | } 116 | return *o.Status 117 | } 118 | 119 | // GetStatusOk returns a tuple with the Status field value if set, nil otherwise 120 | // and a boolean to check if the value has been set. 121 | func (o *Pin) GetStatusOk() (*PinStatus, bool) { 122 | if o == nil || o.Status == nil { 123 | return nil, false 124 | } 125 | return o.Status, true 126 | } 127 | 128 | // HasStatus returns a boolean if a field has been set. 129 | func (o *Pin) HasStatus() bool { 130 | if o != nil && o.Status != nil { 131 | return true 132 | } 133 | 134 | return false 135 | } 136 | 137 | // SetStatus gets a reference to the given PinStatus and assigns it to the Status field. 138 | func (o *Pin) SetStatus(v PinStatus) { 139 | o.Status = &v 140 | } 141 | 142 | // GetCreated returns the Created field value if set, zero value otherwise. 143 | func (o *Pin) GetCreated() time.Time { 144 | if o == nil || o.Created == nil { 145 | var ret time.Time 146 | return ret 147 | } 148 | return *o.Created 149 | } 150 | 151 | // GetCreatedOk returns a tuple with the Created field value if set, nil otherwise 152 | // and a boolean to check if the value has been set. 153 | func (o *Pin) GetCreatedOk() (*time.Time, bool) { 154 | if o == nil || o.Created == nil { 155 | return nil, false 156 | } 157 | return o.Created, true 158 | } 159 | 160 | // HasCreated returns a boolean if a field has been set. 161 | func (o *Pin) HasCreated() bool { 162 | if o != nil && o.Created != nil { 163 | return true 164 | } 165 | 166 | return false 167 | } 168 | 169 | // SetCreated gets a reference to the given time.Time and assigns it to the Created field. 170 | func (o *Pin) SetCreated(v time.Time) { 171 | o.Created = &v 172 | } 173 | 174 | // GetSize returns the Size field value if set, zero value otherwise. 175 | func (o *Pin) GetSize() float32 { 176 | if o == nil || o.Size == nil { 177 | var ret float32 178 | return ret 179 | } 180 | return *o.Size 181 | } 182 | 183 | // GetSizeOk returns a tuple with the Size field value if set, nil otherwise 184 | // and a boolean to check if the value has been set. 185 | func (o *Pin) GetSizeOk() (*float32, bool) { 186 | if o == nil || o.Size == nil { 187 | return nil, false 188 | } 189 | return o.Size, true 190 | } 191 | 192 | // HasSize returns a boolean if a field has been set. 193 | func (o *Pin) HasSize() bool { 194 | if o != nil && o.Size != nil { 195 | return true 196 | } 197 | 198 | return false 199 | } 200 | 201 | // SetSize gets a reference to the given float32 and assigns it to the Size field. 202 | func (o *Pin) SetSize(v float32) { 203 | o.Size = &v 204 | } 205 | 206 | func (o Pin) MarshalJSON() ([]byte, error) { 207 | toSerialize := map[string]interface{}{} 208 | if o.Cid != nil { 209 | toSerialize["cid"] = o.Cid 210 | } 211 | if o.Name != nil { 212 | toSerialize["name"] = o.Name 213 | } 214 | if o.Status != nil { 215 | toSerialize["status"] = o.Status 216 | } 217 | if o.Created != nil { 218 | toSerialize["created"] = o.Created 219 | } 220 | if o.Size != nil { 221 | toSerialize["size"] = o.Size 222 | } 223 | return json.Marshal(toSerialize) 224 | } 225 | 226 | type NullablePin struct { 227 | value *Pin 228 | isSet bool 229 | } 230 | 231 | func (v NullablePin) Get() *Pin { 232 | return v.value 233 | } 234 | 235 | func (v *NullablePin) Set(val *Pin) { 236 | v.value = val 237 | v.isSet = true 238 | } 239 | 240 | func (v NullablePin) IsSet() bool { 241 | return v.isSet 242 | } 243 | 244 | func (v *NullablePin) Unset() { 245 | v.value = nil 246 | v.isSet = false 247 | } 248 | 249 | func NewNullablePin(val *Pin) *NullablePin { 250 | return &NullablePin{value: val, isSet: true} 251 | } 252 | 253 | func (v NullablePin) MarshalJSON() ([]byte, error) { 254 | return json.Marshal(v.value) 255 | } 256 | 257 | func (v *NullablePin) UnmarshalJSON(src []byte) error { 258 | v.isSet = true 259 | return json.Unmarshal(src, &v.value) 260 | } 261 | 262 | 263 | -------------------------------------------------------------------------------- /model_pin_status.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | "fmt" 16 | ) 17 | 18 | // PinStatus the model 'PinStatus' 19 | type PinStatus string 20 | 21 | // List of PinStatus 22 | const ( 23 | QUEUED PinStatus = "queued" 24 | PINNING PinStatus = "pinning" 25 | PINNED PinStatus = "pinned" 26 | FAILED PinStatus = "failed" 27 | ) 28 | 29 | func (v *PinStatus) UnmarshalJSON(src []byte) error { 30 | var value string 31 | err := json.Unmarshal(src, &value) 32 | if err != nil { 33 | return err 34 | } 35 | enumTypeValue := PinStatus(value) 36 | for _, existing := range []PinStatus{ "queued", "pinning", "pinned", "failed", } { 37 | if existing == enumTypeValue { 38 | *v = enumTypeValue 39 | return nil 40 | } 41 | } 42 | 43 | return fmt.Errorf("%+v is not a valid PinStatus", value) 44 | } 45 | 46 | // Ptr returns reference to PinStatus value 47 | func (v PinStatus) Ptr() *PinStatus { 48 | return &v 49 | } 50 | 51 | type NullablePinStatus struct { 52 | value *PinStatus 53 | isSet bool 54 | } 55 | 56 | func (v NullablePinStatus) Get() *PinStatus { 57 | return v.value 58 | } 59 | 60 | func (v *NullablePinStatus) Set(val *PinStatus) { 61 | v.value = val 62 | v.isSet = true 63 | } 64 | 65 | func (v NullablePinStatus) IsSet() bool { 66 | return v.isSet 67 | } 68 | 69 | func (v *NullablePinStatus) Unset() { 70 | v.value = nil 71 | v.isSet = false 72 | } 73 | 74 | func NewNullablePinStatus(val *PinStatus) *NullablePinStatus { 75 | return &NullablePinStatus{value: val, isSet: true} 76 | } 77 | 78 | func (v NullablePinStatus) MarshalJSON() ([]byte, error) { 79 | return json.Marshal(v.value) 80 | } 81 | 82 | func (v *NullablePinStatus) UnmarshalJSON(src []byte) error { 83 | v.isSet = true 84 | return json.Unmarshal(src, &v.value) 85 | } 86 | 87 | -------------------------------------------------------------------------------- /model_unauthorized_error_response.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // UnauthorizedErrorResponse struct for UnauthorizedErrorResponse 18 | type UnauthorizedErrorResponse struct { 19 | Ok *bool `json:"ok,omitempty"` 20 | Error *UnauthorizedErrorResponseError `json:"error,omitempty"` 21 | } 22 | 23 | // NewUnauthorizedErrorResponse instantiates a new UnauthorizedErrorResponse object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewUnauthorizedErrorResponse() *UnauthorizedErrorResponse { 28 | this := UnauthorizedErrorResponse{} 29 | var ok bool = false 30 | this.Ok = &ok 31 | return &this 32 | } 33 | 34 | // NewUnauthorizedErrorResponseWithDefaults instantiates a new UnauthorizedErrorResponse object 35 | // This constructor will only assign default values to properties that have it defined, 36 | // but it doesn't guarantee that properties required by API are set 37 | func NewUnauthorizedErrorResponseWithDefaults() *UnauthorizedErrorResponse { 38 | this := UnauthorizedErrorResponse{} 39 | var ok bool = false 40 | this.Ok = &ok 41 | return &this 42 | } 43 | 44 | // GetOk returns the Ok field value if set, zero value otherwise. 45 | func (o *UnauthorizedErrorResponse) GetOk() bool { 46 | if o == nil || o.Ok == nil { 47 | var ret bool 48 | return ret 49 | } 50 | return *o.Ok 51 | } 52 | 53 | // GetOkOk returns a tuple with the Ok field value if set, nil otherwise 54 | // and a boolean to check if the value has been set. 55 | func (o *UnauthorizedErrorResponse) GetOkOk() (*bool, bool) { 56 | if o == nil || o.Ok == nil { 57 | return nil, false 58 | } 59 | return o.Ok, true 60 | } 61 | 62 | // HasOk returns a boolean if a field has been set. 63 | func (o *UnauthorizedErrorResponse) HasOk() bool { 64 | if o != nil && o.Ok != nil { 65 | return true 66 | } 67 | 68 | return false 69 | } 70 | 71 | // SetOk gets a reference to the given bool and assigns it to the Ok field. 72 | func (o *UnauthorizedErrorResponse) SetOk(v bool) { 73 | o.Ok = &v 74 | } 75 | 76 | // GetError returns the Error field value if set, zero value otherwise. 77 | func (o *UnauthorizedErrorResponse) GetError() UnauthorizedErrorResponseError { 78 | if o == nil || o.Error == nil { 79 | var ret UnauthorizedErrorResponseError 80 | return ret 81 | } 82 | return *o.Error 83 | } 84 | 85 | // GetErrorOk returns a tuple with the Error field value if set, nil otherwise 86 | // and a boolean to check if the value has been set. 87 | func (o *UnauthorizedErrorResponse) GetErrorOk() (*UnauthorizedErrorResponseError, bool) { 88 | if o == nil || o.Error == nil { 89 | return nil, false 90 | } 91 | return o.Error, true 92 | } 93 | 94 | // HasError returns a boolean if a field has been set. 95 | func (o *UnauthorizedErrorResponse) HasError() bool { 96 | if o != nil && o.Error != nil { 97 | return true 98 | } 99 | 100 | return false 101 | } 102 | 103 | // SetError gets a reference to the given UnauthorizedErrorResponseError and assigns it to the Error field. 104 | func (o *UnauthorizedErrorResponse) SetError(v UnauthorizedErrorResponseError) { 105 | o.Error = &v 106 | } 107 | 108 | func (o UnauthorizedErrorResponse) MarshalJSON() ([]byte, error) { 109 | toSerialize := map[string]interface{}{} 110 | if o.Ok != nil { 111 | toSerialize["ok"] = o.Ok 112 | } 113 | if o.Error != nil { 114 | toSerialize["error"] = o.Error 115 | } 116 | return json.Marshal(toSerialize) 117 | } 118 | 119 | type NullableUnauthorizedErrorResponse struct { 120 | value *UnauthorizedErrorResponse 121 | isSet bool 122 | } 123 | 124 | func (v NullableUnauthorizedErrorResponse) Get() *UnauthorizedErrorResponse { 125 | return v.value 126 | } 127 | 128 | func (v *NullableUnauthorizedErrorResponse) Set(val *UnauthorizedErrorResponse) { 129 | v.value = val 130 | v.isSet = true 131 | } 132 | 133 | func (v NullableUnauthorizedErrorResponse) IsSet() bool { 134 | return v.isSet 135 | } 136 | 137 | func (v *NullableUnauthorizedErrorResponse) Unset() { 138 | v.value = nil 139 | v.isSet = false 140 | } 141 | 142 | func NewNullableUnauthorizedErrorResponse(val *UnauthorizedErrorResponse) *NullableUnauthorizedErrorResponse { 143 | return &NullableUnauthorizedErrorResponse{value: val, isSet: true} 144 | } 145 | 146 | func (v NullableUnauthorizedErrorResponse) MarshalJSON() ([]byte, error) { 147 | return json.Marshal(v.value) 148 | } 149 | 150 | func (v *NullableUnauthorizedErrorResponse) UnmarshalJSON(src []byte) error { 151 | v.isSet = true 152 | return json.Unmarshal(src, &v.value) 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /model_unauthorized_error_response_error.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // UnauthorizedErrorResponseError struct for UnauthorizedErrorResponseError 18 | type UnauthorizedErrorResponseError struct { 19 | Name *string `json:"name,omitempty"` 20 | Message *string `json:"message,omitempty"` 21 | } 22 | 23 | // NewUnauthorizedErrorResponseError instantiates a new UnauthorizedErrorResponseError object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewUnauthorizedErrorResponseError() *UnauthorizedErrorResponseError { 28 | this := UnauthorizedErrorResponseError{} 29 | var name string = "HTTP Error" 30 | this.Name = &name 31 | var message string = "Unauthorized" 32 | this.Message = &message 33 | return &this 34 | } 35 | 36 | // NewUnauthorizedErrorResponseErrorWithDefaults instantiates a new UnauthorizedErrorResponseError object 37 | // This constructor will only assign default values to properties that have it defined, 38 | // but it doesn't guarantee that properties required by API are set 39 | func NewUnauthorizedErrorResponseErrorWithDefaults() *UnauthorizedErrorResponseError { 40 | this := UnauthorizedErrorResponseError{} 41 | var name string = "HTTP Error" 42 | this.Name = &name 43 | var message string = "Unauthorized" 44 | this.Message = &message 45 | return &this 46 | } 47 | 48 | // GetName returns the Name field value if set, zero value otherwise. 49 | func (o *UnauthorizedErrorResponseError) GetName() string { 50 | if o == nil || o.Name == nil { 51 | var ret string 52 | return ret 53 | } 54 | return *o.Name 55 | } 56 | 57 | // GetNameOk returns a tuple with the Name field value if set, nil otherwise 58 | // and a boolean to check if the value has been set. 59 | func (o *UnauthorizedErrorResponseError) GetNameOk() (*string, bool) { 60 | if o == nil || o.Name == nil { 61 | return nil, false 62 | } 63 | return o.Name, true 64 | } 65 | 66 | // HasName returns a boolean if a field has been set. 67 | func (o *UnauthorizedErrorResponseError) HasName() bool { 68 | if o != nil && o.Name != nil { 69 | return true 70 | } 71 | 72 | return false 73 | } 74 | 75 | // SetName gets a reference to the given string and assigns it to the Name field. 76 | func (o *UnauthorizedErrorResponseError) SetName(v string) { 77 | o.Name = &v 78 | } 79 | 80 | // GetMessage returns the Message field value if set, zero value otherwise. 81 | func (o *UnauthorizedErrorResponseError) GetMessage() string { 82 | if o == nil || o.Message == nil { 83 | var ret string 84 | return ret 85 | } 86 | return *o.Message 87 | } 88 | 89 | // GetMessageOk returns a tuple with the Message field value if set, nil otherwise 90 | // and a boolean to check if the value has been set. 91 | func (o *UnauthorizedErrorResponseError) GetMessageOk() (*string, bool) { 92 | if o == nil || o.Message == nil { 93 | return nil, false 94 | } 95 | return o.Message, true 96 | } 97 | 98 | // HasMessage returns a boolean if a field has been set. 99 | func (o *UnauthorizedErrorResponseError) HasMessage() bool { 100 | if o != nil && o.Message != nil { 101 | return true 102 | } 103 | 104 | return false 105 | } 106 | 107 | // SetMessage gets a reference to the given string and assigns it to the Message field. 108 | func (o *UnauthorizedErrorResponseError) SetMessage(v string) { 109 | o.Message = &v 110 | } 111 | 112 | func (o UnauthorizedErrorResponseError) MarshalJSON() ([]byte, error) { 113 | toSerialize := map[string]interface{}{} 114 | if o.Name != nil { 115 | toSerialize["name"] = o.Name 116 | } 117 | if o.Message != nil { 118 | toSerialize["message"] = o.Message 119 | } 120 | return json.Marshal(toSerialize) 121 | } 122 | 123 | type NullableUnauthorizedErrorResponseError struct { 124 | value *UnauthorizedErrorResponseError 125 | isSet bool 126 | } 127 | 128 | func (v NullableUnauthorizedErrorResponseError) Get() *UnauthorizedErrorResponseError { 129 | return v.value 130 | } 131 | 132 | func (v *NullableUnauthorizedErrorResponseError) Set(val *UnauthorizedErrorResponseError) { 133 | v.value = val 134 | v.isSet = true 135 | } 136 | 137 | func (v NullableUnauthorizedErrorResponseError) IsSet() bool { 138 | return v.isSet 139 | } 140 | 141 | func (v *NullableUnauthorizedErrorResponseError) Unset() { 142 | v.value = nil 143 | v.isSet = false 144 | } 145 | 146 | func NewNullableUnauthorizedErrorResponseError(val *UnauthorizedErrorResponseError) *NullableUnauthorizedErrorResponseError { 147 | return &NullableUnauthorizedErrorResponseError{value: val, isSet: true} 148 | } 149 | 150 | func (v NullableUnauthorizedErrorResponseError) MarshalJSON() ([]byte, error) { 151 | return json.Marshal(v.value) 152 | } 153 | 154 | func (v *NullableUnauthorizedErrorResponseError) UnmarshalJSON(src []byte) error { 155 | v.isSet = true 156 | return json.Unmarshal(src, &v.value) 157 | } 158 | 159 | 160 | -------------------------------------------------------------------------------- /model_upload_response.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | ) 16 | 17 | // UploadResponse struct for UploadResponse 18 | type UploadResponse struct { 19 | Ok *bool `json:"ok,omitempty"` 20 | Value *NFT `json:"value,omitempty"` 21 | } 22 | 23 | // NewUploadResponse instantiates a new UploadResponse object 24 | // This constructor will assign default values to properties that have it defined, 25 | // and makes sure properties required by API are set, but the set of arguments 26 | // will change when the set of required properties is changed 27 | func NewUploadResponse() *UploadResponse { 28 | this := UploadResponse{} 29 | var ok bool = true 30 | this.Ok = &ok 31 | return &this 32 | } 33 | 34 | // NewUploadResponseWithDefaults instantiates a new UploadResponse object 35 | // This constructor will only assign default values to properties that have it defined, 36 | // but it doesn't guarantee that properties required by API are set 37 | func NewUploadResponseWithDefaults() *UploadResponse { 38 | this := UploadResponse{} 39 | var ok bool = true 40 | this.Ok = &ok 41 | return &this 42 | } 43 | 44 | // GetOk returns the Ok field value if set, zero value otherwise. 45 | func (o *UploadResponse) GetOk() bool { 46 | if o == nil || o.Ok == nil { 47 | var ret bool 48 | return ret 49 | } 50 | return *o.Ok 51 | } 52 | 53 | // GetOkOk returns a tuple with the Ok field value if set, nil otherwise 54 | // and a boolean to check if the value has been set. 55 | func (o *UploadResponse) GetOkOk() (*bool, bool) { 56 | if o == nil || o.Ok == nil { 57 | return nil, false 58 | } 59 | return o.Ok, true 60 | } 61 | 62 | // HasOk returns a boolean if a field has been set. 63 | func (o *UploadResponse) HasOk() bool { 64 | if o != nil && o.Ok != nil { 65 | return true 66 | } 67 | 68 | return false 69 | } 70 | 71 | // SetOk gets a reference to the given bool and assigns it to the Ok field. 72 | func (o *UploadResponse) SetOk(v bool) { 73 | o.Ok = &v 74 | } 75 | 76 | // GetValue returns the Value field value if set, zero value otherwise. 77 | func (o *UploadResponse) GetValue() NFT { 78 | if o == nil || o.Value == nil { 79 | var ret NFT 80 | return ret 81 | } 82 | return *o.Value 83 | } 84 | 85 | // GetValueOk returns a tuple with the Value field value if set, nil otherwise 86 | // and a boolean to check if the value has been set. 87 | func (o *UploadResponse) GetValueOk() (*NFT, bool) { 88 | if o == nil || o.Value == nil { 89 | return nil, false 90 | } 91 | return o.Value, true 92 | } 93 | 94 | // HasValue returns a boolean if a field has been set. 95 | func (o *UploadResponse) HasValue() bool { 96 | if o != nil && o.Value != nil { 97 | return true 98 | } 99 | 100 | return false 101 | } 102 | 103 | // SetValue gets a reference to the given NFT and assigns it to the Value field. 104 | func (o *UploadResponse) SetValue(v NFT) { 105 | o.Value = &v 106 | } 107 | 108 | func (o UploadResponse) MarshalJSON() ([]byte, error) { 109 | toSerialize := map[string]interface{}{} 110 | if o.Ok != nil { 111 | toSerialize["ok"] = o.Ok 112 | } 113 | if o.Value != nil { 114 | toSerialize["value"] = o.Value 115 | } 116 | return json.Marshal(toSerialize) 117 | } 118 | 119 | type NullableUploadResponse struct { 120 | value *UploadResponse 121 | isSet bool 122 | } 123 | 124 | func (v NullableUploadResponse) Get() *UploadResponse { 125 | return v.value 126 | } 127 | 128 | func (v *NullableUploadResponse) Set(val *UploadResponse) { 129 | v.value = val 130 | v.isSet = true 131 | } 132 | 133 | func (v NullableUploadResponse) IsSet() bool { 134 | return v.isSet 135 | } 136 | 137 | func (v *NullableUploadResponse) Unset() { 138 | v.value = nil 139 | v.isSet = false 140 | } 141 | 142 | func NewNullableUploadResponse(val *UploadResponse) *NullableUploadResponse { 143 | return &NullableUploadResponse{value: val, isSet: true} 144 | } 145 | 146 | func (v NullableUploadResponse) MarshalJSON() ([]byte, error) { 147 | return json.Marshal(v.value) 148 | } 149 | 150 | func (v *NullableUploadResponse) UnmarshalJSON(src []byte) error { 151 | v.isSet = true 152 | return json.Unmarshal(src, &v.value) 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /response.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "net/http" 15 | ) 16 | 17 | // APIResponse stores the API response returned by the server. 18 | type APIResponse struct { 19 | *http.Response `json:"-"` 20 | Message string `json:"message,omitempty"` 21 | // Operation is the name of the OpenAPI operation. 22 | Operation string `json:"operation,omitempty"` 23 | // RequestURL is the request URL. This value is always available, even if the 24 | // embedded *http.Response is nil. 25 | RequestURL string `json:"url,omitempty"` 26 | // Method is the HTTP method used for the request. This value is always 27 | // available, even if the embedded *http.Response is nil. 28 | Method string `json:"method,omitempty"` 29 | // Payload holds the contents of the response body (which may be nil or empty). 30 | // This is provided here as the raw response.Body() reader will have already 31 | // been drained. 32 | Payload []byte `json:"-"` 33 | } 34 | 35 | // NewAPIResponse returns a new APIResonse object. 36 | func NewAPIResponse(r *http.Response) *APIResponse { 37 | 38 | response := &APIResponse{Response: r} 39 | return response 40 | } 41 | 42 | // NewAPIResponseWithError returns a new APIResponse object with the provided error message. 43 | func NewAPIResponseWithError(errorMessage string) *APIResponse { 44 | 45 | response := &APIResponse{Message: errorMessage} 46 | return response 47 | } 48 | -------------------------------------------------------------------------------- /utils.go: -------------------------------------------------------------------------------- 1 | /* 2 | * NFT Storage API 3 | * 4 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 | * 6 | * API version: 1.0 7 | */ 8 | 9 | // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 | 11 | package nftstorage 12 | 13 | import ( 14 | "encoding/json" 15 | "time" 16 | ) 17 | 18 | // PtrBool is a helper routine that returns a pointer to given boolean value. 19 | func PtrBool(v bool) *bool { return &v } 20 | 21 | // PtrInt is a helper routine that returns a pointer to given integer value. 22 | func PtrInt(v int) *int { return &v } 23 | 24 | // PtrInt32 is a helper routine that returns a pointer to given integer value. 25 | func PtrInt32(v int32) *int32 { return &v } 26 | 27 | // PtrInt64 is a helper routine that returns a pointer to given integer value. 28 | func PtrInt64(v int64) *int64 { return &v } 29 | 30 | // PtrFloat32 is a helper routine that returns a pointer to given float value. 31 | func PtrFloat32(v float32) *float32 { return &v } 32 | 33 | // PtrFloat64 is a helper routine that returns a pointer to given float value. 34 | func PtrFloat64(v float64) *float64 { return &v } 35 | 36 | // PtrString is a helper routine that returns a pointer to given string value. 37 | func PtrString(v string) *string { return &v } 38 | 39 | // PtrTime is helper routine that returns a pointer to given Time value. 40 | func PtrTime(v time.Time) *time.Time { return &v } 41 | 42 | type NullableBool struct { 43 | value *bool 44 | isSet bool 45 | } 46 | 47 | func (v NullableBool) Get() *bool { 48 | return v.value 49 | } 50 | 51 | func (v *NullableBool) Set(val *bool) { 52 | v.value = val 53 | v.isSet = true 54 | } 55 | 56 | func (v NullableBool) IsSet() bool { 57 | return v.isSet 58 | } 59 | 60 | func (v *NullableBool) Unset() { 61 | v.value = nil 62 | v.isSet = false 63 | } 64 | 65 | func NewNullableBool(val *bool) *NullableBool { 66 | return &NullableBool{value: val, isSet: true} 67 | } 68 | 69 | func (v NullableBool) MarshalJSON() ([]byte, error) { 70 | return json.Marshal(v.value) 71 | } 72 | 73 | func (v *NullableBool) UnmarshalJSON(src []byte) error { 74 | v.isSet = true 75 | return json.Unmarshal(src, &v.value) 76 | } 77 | 78 | type NullableInt struct { 79 | value *int 80 | isSet bool 81 | } 82 | 83 | func (v NullableInt) Get() *int { 84 | return v.value 85 | } 86 | 87 | func (v *NullableInt) Set(val *int) { 88 | v.value = val 89 | v.isSet = true 90 | } 91 | 92 | func (v NullableInt) IsSet() bool { 93 | return v.isSet 94 | } 95 | 96 | func (v *NullableInt) Unset() { 97 | v.value = nil 98 | v.isSet = false 99 | } 100 | 101 | func NewNullableInt(val *int) *NullableInt { 102 | return &NullableInt{value: val, isSet: true} 103 | } 104 | 105 | func (v NullableInt) MarshalJSON() ([]byte, error) { 106 | return json.Marshal(v.value) 107 | } 108 | 109 | func (v *NullableInt) UnmarshalJSON(src []byte) error { 110 | v.isSet = true 111 | return json.Unmarshal(src, &v.value) 112 | } 113 | 114 | type NullableInt32 struct { 115 | value *int32 116 | isSet bool 117 | } 118 | 119 | func (v NullableInt32) Get() *int32 { 120 | return v.value 121 | } 122 | 123 | func (v *NullableInt32) Set(val *int32) { 124 | v.value = val 125 | v.isSet = true 126 | } 127 | 128 | func (v NullableInt32) IsSet() bool { 129 | return v.isSet 130 | } 131 | 132 | func (v *NullableInt32) Unset() { 133 | v.value = nil 134 | v.isSet = false 135 | } 136 | 137 | func NewNullableInt32(val *int32) *NullableInt32 { 138 | return &NullableInt32{value: val, isSet: true} 139 | } 140 | 141 | func (v NullableInt32) MarshalJSON() ([]byte, error) { 142 | return json.Marshal(v.value) 143 | } 144 | 145 | func (v *NullableInt32) UnmarshalJSON(src []byte) error { 146 | v.isSet = true 147 | return json.Unmarshal(src, &v.value) 148 | } 149 | 150 | type NullableInt64 struct { 151 | value *int64 152 | isSet bool 153 | } 154 | 155 | func (v NullableInt64) Get() *int64 { 156 | return v.value 157 | } 158 | 159 | func (v *NullableInt64) Set(val *int64) { 160 | v.value = val 161 | v.isSet = true 162 | } 163 | 164 | func (v NullableInt64) IsSet() bool { 165 | return v.isSet 166 | } 167 | 168 | func (v *NullableInt64) Unset() { 169 | v.value = nil 170 | v.isSet = false 171 | } 172 | 173 | func NewNullableInt64(val *int64) *NullableInt64 { 174 | return &NullableInt64{value: val, isSet: true} 175 | } 176 | 177 | func (v NullableInt64) MarshalJSON() ([]byte, error) { 178 | return json.Marshal(v.value) 179 | } 180 | 181 | func (v *NullableInt64) UnmarshalJSON(src []byte) error { 182 | v.isSet = true 183 | return json.Unmarshal(src, &v.value) 184 | } 185 | 186 | type NullableFloat32 struct { 187 | value *float32 188 | isSet bool 189 | } 190 | 191 | func (v NullableFloat32) Get() *float32 { 192 | return v.value 193 | } 194 | 195 | func (v *NullableFloat32) Set(val *float32) { 196 | v.value = val 197 | v.isSet = true 198 | } 199 | 200 | func (v NullableFloat32) IsSet() bool { 201 | return v.isSet 202 | } 203 | 204 | func (v *NullableFloat32) Unset() { 205 | v.value = nil 206 | v.isSet = false 207 | } 208 | 209 | func NewNullableFloat32(val *float32) *NullableFloat32 { 210 | return &NullableFloat32{value: val, isSet: true} 211 | } 212 | 213 | func (v NullableFloat32) MarshalJSON() ([]byte, error) { 214 | return json.Marshal(v.value) 215 | } 216 | 217 | func (v *NullableFloat32) UnmarshalJSON(src []byte) error { 218 | v.isSet = true 219 | return json.Unmarshal(src, &v.value) 220 | } 221 | 222 | type NullableFloat64 struct { 223 | value *float64 224 | isSet bool 225 | } 226 | 227 | func (v NullableFloat64) Get() *float64 { 228 | return v.value 229 | } 230 | 231 | func (v *NullableFloat64) Set(val *float64) { 232 | v.value = val 233 | v.isSet = true 234 | } 235 | 236 | func (v NullableFloat64) IsSet() bool { 237 | return v.isSet 238 | } 239 | 240 | func (v *NullableFloat64) Unset() { 241 | v.value = nil 242 | v.isSet = false 243 | } 244 | 245 | func NewNullableFloat64(val *float64) *NullableFloat64 { 246 | return &NullableFloat64{value: val, isSet: true} 247 | } 248 | 249 | func (v NullableFloat64) MarshalJSON() ([]byte, error) { 250 | return json.Marshal(v.value) 251 | } 252 | 253 | func (v *NullableFloat64) UnmarshalJSON(src []byte) error { 254 | v.isSet = true 255 | return json.Unmarshal(src, &v.value) 256 | } 257 | 258 | type NullableString struct { 259 | value *string 260 | isSet bool 261 | } 262 | 263 | func (v NullableString) Get() *string { 264 | return v.value 265 | } 266 | 267 | func (v *NullableString) Set(val *string) { 268 | v.value = val 269 | v.isSet = true 270 | } 271 | 272 | func (v NullableString) IsSet() bool { 273 | return v.isSet 274 | } 275 | 276 | func (v *NullableString) Unset() { 277 | v.value = nil 278 | v.isSet = false 279 | } 280 | 281 | func NewNullableString(val *string) *NullableString { 282 | return &NullableString{value: val, isSet: true} 283 | } 284 | 285 | func (v NullableString) MarshalJSON() ([]byte, error) { 286 | return json.Marshal(v.value) 287 | } 288 | 289 | func (v *NullableString) UnmarshalJSON(src []byte) error { 290 | v.isSet = true 291 | return json.Unmarshal(src, &v.value) 292 | } 293 | 294 | type NullableTime struct { 295 | value *time.Time 296 | isSet bool 297 | } 298 | 299 | func (v NullableTime) Get() *time.Time { 300 | return v.value 301 | } 302 | 303 | func (v *NullableTime) Set(val *time.Time) { 304 | v.value = val 305 | v.isSet = true 306 | } 307 | 308 | func (v NullableTime) IsSet() bool { 309 | return v.isSet 310 | } 311 | 312 | func (v *NullableTime) Unset() { 313 | v.value = nil 314 | v.isSet = false 315 | } 316 | 317 | func NewNullableTime(val *time.Time) *NullableTime { 318 | return &NullableTime{value: val, isSet: true} 319 | } 320 | 321 | func (v NullableTime) MarshalJSON() ([]byte, error) { 322 | return v.value.MarshalJSON() 323 | } 324 | 325 | func (v *NullableTime) UnmarshalJSON(src []byte) error { 326 | v.isSet = true 327 | return json.Unmarshal(src, &v.value) 328 | } 329 | --------------------------------------------------------------------------------