feat: init
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-07-28 22:36:17 +02:00
commit e4ade9c758
453 changed files with 126868 additions and 0 deletions

8
.drone.yml Normal file
View File

@ -0,0 +1,8 @@
---
kind: pipeline
name: gtslib
steps:
- name: build
image: golang:1.21
commands:
- go build -v ./...

15
LICENSE Normal file
View File

@ -0,0 +1,15 @@
gtslib: Go API bindings for GoToSocial
Copyright (C) 2024 decentral1se
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Affero General Public License for more
details.
You should have received a copy of the GNU Affero General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>.

28
README.md Normal file
View File

@ -0,0 +1,28 @@
# gtslib
[![Build Status](https://build.coopcloud.tech/api/badges/decentral1se/gtslib/status.svg?ref=refs/heads/main)](https://build.coopcloud.tech/decentral1se/gtslib)
> Go API bindings for GoToSocial
[GoToSocial](https://gotosocial.org) is still **alpha** software and so are these bindings. I have no grand schemes beyond updating the bindings to match the latest releases of GtS as things progress. Current version generated from this [`swagger.yml`](https://github.com/superseriousbusiness/gotosocial/blob/368c97f0f85f243796a0407960dc5a2ccad24bab/docs/api/swagger.yaml).
## Generate
You'll need to install [`go-swagger`](https://goswagger.io/install.html).
```
go generate ./...
# apply workaround for https://github.com/go-swagger/go-swagger/issues/2997
patch -u -p1 -i filter-context.diff
```
## ACK
Made possible by the good work of [`slurp`](https://github.com/VyrCossont/slurp).
## License
<a href="https://git.coopcloud.tech/decentral1se/gtslib/src/branch/main/LICENSE">
<img src="https://www.gnu.org/graphics/agplv3-with-text-162x68.png" />
</a>

View File

@ -0,0 +1,156 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountAliasParams creates a new AccountAliasParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountAliasParams() *AccountAliasParams {
return &AccountAliasParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountAliasParamsWithTimeout creates a new AccountAliasParams object
// with the ability to set a timeout on a request.
func NewAccountAliasParamsWithTimeout(timeout time.Duration) *AccountAliasParams {
return &AccountAliasParams{
timeout: timeout,
}
}
// NewAccountAliasParamsWithContext creates a new AccountAliasParams object
// with the ability to set a context for a request.
func NewAccountAliasParamsWithContext(ctx context.Context) *AccountAliasParams {
return &AccountAliasParams{
Context: ctx,
}
}
// NewAccountAliasParamsWithHTTPClient creates a new AccountAliasParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountAliasParamsWithHTTPClient(client *http.Client) *AccountAliasParams {
return &AccountAliasParams{
HTTPClient: client,
}
}
/*
AccountAliasParams contains all the parameters to send to the API endpoint
for the account alias operation.
Typically these are written to a http.Request.
*/
type AccountAliasParams struct {
/* AlsoKnownAsUris.
ActivityPub URI/IDs of target accounts to which this account is being aliased. Eg., `["https://example.org/users/some_account"]`.
Use an empty array to unset alsoKnownAs, clearing the aliases.
*/
AlsoKnownAsUris string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account alias params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountAliasParams) WithDefaults() *AccountAliasParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account alias params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountAliasParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account alias params
func (o *AccountAliasParams) WithTimeout(timeout time.Duration) *AccountAliasParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account alias params
func (o *AccountAliasParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account alias params
func (o *AccountAliasParams) WithContext(ctx context.Context) *AccountAliasParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account alias params
func (o *AccountAliasParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account alias params
func (o *AccountAliasParams) WithHTTPClient(client *http.Client) *AccountAliasParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account alias params
func (o *AccountAliasParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAlsoKnownAsUris adds the alsoKnownAsUris to the account alias params
func (o *AccountAliasParams) WithAlsoKnownAsUris(alsoKnownAsUris string) *AccountAliasParams {
o.SetAlsoKnownAsUris(alsoKnownAsUris)
return o
}
// SetAlsoKnownAsUris adds the alsoKnownAsUris to the account alias params
func (o *AccountAliasParams) SetAlsoKnownAsUris(alsoKnownAsUris string) {
o.AlsoKnownAsUris = alsoKnownAsUris
}
// WriteToRequest writes these params to a swagger request
func (o *AccountAliasParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// form param also_known_as_uris
frAlsoKnownAsUris := o.AlsoKnownAsUris
fAlsoKnownAsUris := frAlsoKnownAsUris
if fAlsoKnownAsUris != "" {
if err := r.SetFormParam("also_known_as_uris", fAlsoKnownAsUris); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,478 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountAliasReader is a Reader for the AccountAlias structure.
type AccountAliasReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountAliasReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountAliasOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountAliasBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountAliasUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountAliasNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountAliasNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewAccountAliasUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountAliasInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /api/v1/accounts/alias] accountAlias", response, response.Code())
}
}
// NewAccountAliasOK creates a AccountAliasOK with default headers values
func NewAccountAliasOK() *AccountAliasOK {
return &AccountAliasOK{}
}
/*
AccountAliasOK describes a response with status code 200, with default header values.
The newly updated account.
*/
type AccountAliasOK struct {
Payload *models.Account
}
// IsSuccess returns true when this account alias o k response has a 2xx status code
func (o *AccountAliasOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account alias o k response has a 3xx status code
func (o *AccountAliasOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account alias o k response has a 4xx status code
func (o *AccountAliasOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account alias o k response has a 5xx status code
func (o *AccountAliasOK) IsServerError() bool {
return false
}
// IsCode returns true when this account alias o k response a status code equal to that given
func (o *AccountAliasOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account alias o k response
func (o *AccountAliasOK) Code() int {
return 200
}
func (o *AccountAliasOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasOK %s", 200, payload)
}
func (o *AccountAliasOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasOK %s", 200, payload)
}
func (o *AccountAliasOK) GetPayload() *models.Account {
return o.Payload
}
func (o *AccountAliasOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Account)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountAliasBadRequest creates a AccountAliasBadRequest with default headers values
func NewAccountAliasBadRequest() *AccountAliasBadRequest {
return &AccountAliasBadRequest{}
}
/*
AccountAliasBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountAliasBadRequest struct {
}
// IsSuccess returns true when this account alias bad request response has a 2xx status code
func (o *AccountAliasBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account alias bad request response has a 3xx status code
func (o *AccountAliasBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account alias bad request response has a 4xx status code
func (o *AccountAliasBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account alias bad request response has a 5xx status code
func (o *AccountAliasBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account alias bad request response a status code equal to that given
func (o *AccountAliasBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account alias bad request response
func (o *AccountAliasBadRequest) Code() int {
return 400
}
func (o *AccountAliasBadRequest) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasBadRequest", 400)
}
func (o *AccountAliasBadRequest) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasBadRequest", 400)
}
func (o *AccountAliasBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAliasUnauthorized creates a AccountAliasUnauthorized with default headers values
func NewAccountAliasUnauthorized() *AccountAliasUnauthorized {
return &AccountAliasUnauthorized{}
}
/*
AccountAliasUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountAliasUnauthorized struct {
}
// IsSuccess returns true when this account alias unauthorized response has a 2xx status code
func (o *AccountAliasUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account alias unauthorized response has a 3xx status code
func (o *AccountAliasUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account alias unauthorized response has a 4xx status code
func (o *AccountAliasUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account alias unauthorized response has a 5xx status code
func (o *AccountAliasUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account alias unauthorized response a status code equal to that given
func (o *AccountAliasUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account alias unauthorized response
func (o *AccountAliasUnauthorized) Code() int {
return 401
}
func (o *AccountAliasUnauthorized) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasUnauthorized", 401)
}
func (o *AccountAliasUnauthorized) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasUnauthorized", 401)
}
func (o *AccountAliasUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAliasNotFound creates a AccountAliasNotFound with default headers values
func NewAccountAliasNotFound() *AccountAliasNotFound {
return &AccountAliasNotFound{}
}
/*
AccountAliasNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountAliasNotFound struct {
}
// IsSuccess returns true when this account alias not found response has a 2xx status code
func (o *AccountAliasNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account alias not found response has a 3xx status code
func (o *AccountAliasNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account alias not found response has a 4xx status code
func (o *AccountAliasNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account alias not found response has a 5xx status code
func (o *AccountAliasNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account alias not found response a status code equal to that given
func (o *AccountAliasNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account alias not found response
func (o *AccountAliasNotFound) Code() int {
return 404
}
func (o *AccountAliasNotFound) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasNotFound", 404)
}
func (o *AccountAliasNotFound) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasNotFound", 404)
}
func (o *AccountAliasNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAliasNotAcceptable creates a AccountAliasNotAcceptable with default headers values
func NewAccountAliasNotAcceptable() *AccountAliasNotAcceptable {
return &AccountAliasNotAcceptable{}
}
/*
AccountAliasNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountAliasNotAcceptable struct {
}
// IsSuccess returns true when this account alias not acceptable response has a 2xx status code
func (o *AccountAliasNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account alias not acceptable response has a 3xx status code
func (o *AccountAliasNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account alias not acceptable response has a 4xx status code
func (o *AccountAliasNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account alias not acceptable response has a 5xx status code
func (o *AccountAliasNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account alias not acceptable response a status code equal to that given
func (o *AccountAliasNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account alias not acceptable response
func (o *AccountAliasNotAcceptable) Code() int {
return 406
}
func (o *AccountAliasNotAcceptable) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasNotAcceptable", 406)
}
func (o *AccountAliasNotAcceptable) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasNotAcceptable", 406)
}
func (o *AccountAliasNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAliasUnprocessableEntity creates a AccountAliasUnprocessableEntity with default headers values
func NewAccountAliasUnprocessableEntity() *AccountAliasUnprocessableEntity {
return &AccountAliasUnprocessableEntity{}
}
/*
AccountAliasUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable. Check the response body for more details.
*/
type AccountAliasUnprocessableEntity struct {
}
// IsSuccess returns true when this account alias unprocessable entity response has a 2xx status code
func (o *AccountAliasUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account alias unprocessable entity response has a 3xx status code
func (o *AccountAliasUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this account alias unprocessable entity response has a 4xx status code
func (o *AccountAliasUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this account alias unprocessable entity response has a 5xx status code
func (o *AccountAliasUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this account alias unprocessable entity response a status code equal to that given
func (o *AccountAliasUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the account alias unprocessable entity response
func (o *AccountAliasUnprocessableEntity) Code() int {
return 422
}
func (o *AccountAliasUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasUnprocessableEntity", 422)
}
func (o *AccountAliasUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasUnprocessableEntity", 422)
}
func (o *AccountAliasUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAliasInternalServerError creates a AccountAliasInternalServerError with default headers values
func NewAccountAliasInternalServerError() *AccountAliasInternalServerError {
return &AccountAliasInternalServerError{}
}
/*
AccountAliasInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountAliasInternalServerError struct {
}
// IsSuccess returns true when this account alias internal server error response has a 2xx status code
func (o *AccountAliasInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account alias internal server error response has a 3xx status code
func (o *AccountAliasInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account alias internal server error response has a 4xx status code
func (o *AccountAliasInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account alias internal server error response has a 5xx status code
func (o *AccountAliasInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account alias internal server error response a status code equal to that given
func (o *AccountAliasInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account alias internal server error response
func (o *AccountAliasInternalServerError) Code() int {
return 500
}
func (o *AccountAliasInternalServerError) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasInternalServerError", 500)
}
func (o *AccountAliasInternalServerError) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/alias][%d] accountAliasInternalServerError", 500)
}
func (o *AccountAliasInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,128 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountAvatarDeleteParams creates a new AccountAvatarDeleteParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountAvatarDeleteParams() *AccountAvatarDeleteParams {
return &AccountAvatarDeleteParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountAvatarDeleteParamsWithTimeout creates a new AccountAvatarDeleteParams object
// with the ability to set a timeout on a request.
func NewAccountAvatarDeleteParamsWithTimeout(timeout time.Duration) *AccountAvatarDeleteParams {
return &AccountAvatarDeleteParams{
timeout: timeout,
}
}
// NewAccountAvatarDeleteParamsWithContext creates a new AccountAvatarDeleteParams object
// with the ability to set a context for a request.
func NewAccountAvatarDeleteParamsWithContext(ctx context.Context) *AccountAvatarDeleteParams {
return &AccountAvatarDeleteParams{
Context: ctx,
}
}
// NewAccountAvatarDeleteParamsWithHTTPClient creates a new AccountAvatarDeleteParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountAvatarDeleteParamsWithHTTPClient(client *http.Client) *AccountAvatarDeleteParams {
return &AccountAvatarDeleteParams{
HTTPClient: client,
}
}
/*
AccountAvatarDeleteParams contains all the parameters to send to the API endpoint
for the account avatar delete operation.
Typically these are written to a http.Request.
*/
type AccountAvatarDeleteParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account avatar delete params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountAvatarDeleteParams) WithDefaults() *AccountAvatarDeleteParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account avatar delete params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountAvatarDeleteParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account avatar delete params
func (o *AccountAvatarDeleteParams) WithTimeout(timeout time.Duration) *AccountAvatarDeleteParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account avatar delete params
func (o *AccountAvatarDeleteParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account avatar delete params
func (o *AccountAvatarDeleteParams) WithContext(ctx context.Context) *AccountAvatarDeleteParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account avatar delete params
func (o *AccountAvatarDeleteParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account avatar delete params
func (o *AccountAvatarDeleteParams) WithHTTPClient(client *http.Client) *AccountAvatarDeleteParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account avatar delete params
func (o *AccountAvatarDeleteParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *AccountAvatarDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,416 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountAvatarDeleteReader is a Reader for the AccountAvatarDelete structure.
type AccountAvatarDeleteReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountAvatarDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountAvatarDeleteOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountAvatarDeleteBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountAvatarDeleteUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewAccountAvatarDeleteForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountAvatarDeleteNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountAvatarDeleteInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[DELETE /api/v1/profile/avatar] accountAvatarDelete", response, response.Code())
}
}
// NewAccountAvatarDeleteOK creates a AccountAvatarDeleteOK with default headers values
func NewAccountAvatarDeleteOK() *AccountAvatarDeleteOK {
return &AccountAvatarDeleteOK{}
}
/*
AccountAvatarDeleteOK describes a response with status code 200, with default header values.
The updated account, including profile source information.
*/
type AccountAvatarDeleteOK struct {
Payload *models.Account
}
// IsSuccess returns true when this account avatar delete o k response has a 2xx status code
func (o *AccountAvatarDeleteOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account avatar delete o k response has a 3xx status code
func (o *AccountAvatarDeleteOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account avatar delete o k response has a 4xx status code
func (o *AccountAvatarDeleteOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account avatar delete o k response has a 5xx status code
func (o *AccountAvatarDeleteOK) IsServerError() bool {
return false
}
// IsCode returns true when this account avatar delete o k response a status code equal to that given
func (o *AccountAvatarDeleteOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account avatar delete o k response
func (o *AccountAvatarDeleteOK) Code() int {
return 200
}
func (o *AccountAvatarDeleteOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteOK %s", 200, payload)
}
func (o *AccountAvatarDeleteOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteOK %s", 200, payload)
}
func (o *AccountAvatarDeleteOK) GetPayload() *models.Account {
return o.Payload
}
func (o *AccountAvatarDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Account)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountAvatarDeleteBadRequest creates a AccountAvatarDeleteBadRequest with default headers values
func NewAccountAvatarDeleteBadRequest() *AccountAvatarDeleteBadRequest {
return &AccountAvatarDeleteBadRequest{}
}
/*
AccountAvatarDeleteBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountAvatarDeleteBadRequest struct {
}
// IsSuccess returns true when this account avatar delete bad request response has a 2xx status code
func (o *AccountAvatarDeleteBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account avatar delete bad request response has a 3xx status code
func (o *AccountAvatarDeleteBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account avatar delete bad request response has a 4xx status code
func (o *AccountAvatarDeleteBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account avatar delete bad request response has a 5xx status code
func (o *AccountAvatarDeleteBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account avatar delete bad request response a status code equal to that given
func (o *AccountAvatarDeleteBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account avatar delete bad request response
func (o *AccountAvatarDeleteBadRequest) Code() int {
return 400
}
func (o *AccountAvatarDeleteBadRequest) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteBadRequest", 400)
}
func (o *AccountAvatarDeleteBadRequest) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteBadRequest", 400)
}
func (o *AccountAvatarDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAvatarDeleteUnauthorized creates a AccountAvatarDeleteUnauthorized with default headers values
func NewAccountAvatarDeleteUnauthorized() *AccountAvatarDeleteUnauthorized {
return &AccountAvatarDeleteUnauthorized{}
}
/*
AccountAvatarDeleteUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountAvatarDeleteUnauthorized struct {
}
// IsSuccess returns true when this account avatar delete unauthorized response has a 2xx status code
func (o *AccountAvatarDeleteUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account avatar delete unauthorized response has a 3xx status code
func (o *AccountAvatarDeleteUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account avatar delete unauthorized response has a 4xx status code
func (o *AccountAvatarDeleteUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account avatar delete unauthorized response has a 5xx status code
func (o *AccountAvatarDeleteUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account avatar delete unauthorized response a status code equal to that given
func (o *AccountAvatarDeleteUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account avatar delete unauthorized response
func (o *AccountAvatarDeleteUnauthorized) Code() int {
return 401
}
func (o *AccountAvatarDeleteUnauthorized) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteUnauthorized", 401)
}
func (o *AccountAvatarDeleteUnauthorized) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteUnauthorized", 401)
}
func (o *AccountAvatarDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAvatarDeleteForbidden creates a AccountAvatarDeleteForbidden with default headers values
func NewAccountAvatarDeleteForbidden() *AccountAvatarDeleteForbidden {
return &AccountAvatarDeleteForbidden{}
}
/*
AccountAvatarDeleteForbidden describes a response with status code 403, with default header values.
forbidden
*/
type AccountAvatarDeleteForbidden struct {
}
// IsSuccess returns true when this account avatar delete forbidden response has a 2xx status code
func (o *AccountAvatarDeleteForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account avatar delete forbidden response has a 3xx status code
func (o *AccountAvatarDeleteForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this account avatar delete forbidden response has a 4xx status code
func (o *AccountAvatarDeleteForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this account avatar delete forbidden response has a 5xx status code
func (o *AccountAvatarDeleteForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this account avatar delete forbidden response a status code equal to that given
func (o *AccountAvatarDeleteForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the account avatar delete forbidden response
func (o *AccountAvatarDeleteForbidden) Code() int {
return 403
}
func (o *AccountAvatarDeleteForbidden) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteForbidden", 403)
}
func (o *AccountAvatarDeleteForbidden) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteForbidden", 403)
}
func (o *AccountAvatarDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAvatarDeleteNotAcceptable creates a AccountAvatarDeleteNotAcceptable with default headers values
func NewAccountAvatarDeleteNotAcceptable() *AccountAvatarDeleteNotAcceptable {
return &AccountAvatarDeleteNotAcceptable{}
}
/*
AccountAvatarDeleteNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountAvatarDeleteNotAcceptable struct {
}
// IsSuccess returns true when this account avatar delete not acceptable response has a 2xx status code
func (o *AccountAvatarDeleteNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account avatar delete not acceptable response has a 3xx status code
func (o *AccountAvatarDeleteNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account avatar delete not acceptable response has a 4xx status code
func (o *AccountAvatarDeleteNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account avatar delete not acceptable response has a 5xx status code
func (o *AccountAvatarDeleteNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account avatar delete not acceptable response a status code equal to that given
func (o *AccountAvatarDeleteNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account avatar delete not acceptable response
func (o *AccountAvatarDeleteNotAcceptable) Code() int {
return 406
}
func (o *AccountAvatarDeleteNotAcceptable) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteNotAcceptable", 406)
}
func (o *AccountAvatarDeleteNotAcceptable) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteNotAcceptable", 406)
}
func (o *AccountAvatarDeleteNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountAvatarDeleteInternalServerError creates a AccountAvatarDeleteInternalServerError with default headers values
func NewAccountAvatarDeleteInternalServerError() *AccountAvatarDeleteInternalServerError {
return &AccountAvatarDeleteInternalServerError{}
}
/*
AccountAvatarDeleteInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountAvatarDeleteInternalServerError struct {
}
// IsSuccess returns true when this account avatar delete internal server error response has a 2xx status code
func (o *AccountAvatarDeleteInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account avatar delete internal server error response has a 3xx status code
func (o *AccountAvatarDeleteInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account avatar delete internal server error response has a 4xx status code
func (o *AccountAvatarDeleteInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account avatar delete internal server error response has a 5xx status code
func (o *AccountAvatarDeleteInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account avatar delete internal server error response a status code equal to that given
func (o *AccountAvatarDeleteInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account avatar delete internal server error response
func (o *AccountAvatarDeleteInternalServerError) Code() int {
return 500
}
func (o *AccountAvatarDeleteInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteInternalServerError", 500)
}
func (o *AccountAvatarDeleteInternalServerError) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/avatar][%d] accountAvatarDeleteInternalServerError", 500)
}
func (o *AccountAvatarDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,151 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountBlockParams creates a new AccountBlockParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountBlockParams() *AccountBlockParams {
return &AccountBlockParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountBlockParamsWithTimeout creates a new AccountBlockParams object
// with the ability to set a timeout on a request.
func NewAccountBlockParamsWithTimeout(timeout time.Duration) *AccountBlockParams {
return &AccountBlockParams{
timeout: timeout,
}
}
// NewAccountBlockParamsWithContext creates a new AccountBlockParams object
// with the ability to set a context for a request.
func NewAccountBlockParamsWithContext(ctx context.Context) *AccountBlockParams {
return &AccountBlockParams{
Context: ctx,
}
}
// NewAccountBlockParamsWithHTTPClient creates a new AccountBlockParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountBlockParamsWithHTTPClient(client *http.Client) *AccountBlockParams {
return &AccountBlockParams{
HTTPClient: client,
}
}
/*
AccountBlockParams contains all the parameters to send to the API endpoint
for the account block operation.
Typically these are written to a http.Request.
*/
type AccountBlockParams struct {
/* ID.
The id of the account to block.
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account block params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountBlockParams) WithDefaults() *AccountBlockParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account block params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountBlockParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account block params
func (o *AccountBlockParams) WithTimeout(timeout time.Duration) *AccountBlockParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account block params
func (o *AccountBlockParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account block params
func (o *AccountBlockParams) WithContext(ctx context.Context) *AccountBlockParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account block params
func (o *AccountBlockParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account block params
func (o *AccountBlockParams) WithHTTPClient(client *http.Client) *AccountBlockParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account block params
func (o *AccountBlockParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the account block params
func (o *AccountBlockParams) WithID(id string) *AccountBlockParams {
o.SetID(id)
return o
}
// SetID adds the id to the account block params
func (o *AccountBlockParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *AccountBlockParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,416 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountBlockReader is a Reader for the AccountBlock structure.
type AccountBlockReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountBlockReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountBlockOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountBlockBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountBlockUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountBlockNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountBlockNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountBlockInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /api/v1/accounts/{id}/block] accountBlock", response, response.Code())
}
}
// NewAccountBlockOK creates a AccountBlockOK with default headers values
func NewAccountBlockOK() *AccountBlockOK {
return &AccountBlockOK{}
}
/*
AccountBlockOK describes a response with status code 200, with default header values.
Your relationship to the account.
*/
type AccountBlockOK struct {
Payload *models.Relationship
}
// IsSuccess returns true when this account block o k response has a 2xx status code
func (o *AccountBlockOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account block o k response has a 3xx status code
func (o *AccountBlockOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account block o k response has a 4xx status code
func (o *AccountBlockOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account block o k response has a 5xx status code
func (o *AccountBlockOK) IsServerError() bool {
return false
}
// IsCode returns true when this account block o k response a status code equal to that given
func (o *AccountBlockOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account block o k response
func (o *AccountBlockOK) Code() int {
return 200
}
func (o *AccountBlockOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockOK %s", 200, payload)
}
func (o *AccountBlockOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockOK %s", 200, payload)
}
func (o *AccountBlockOK) GetPayload() *models.Relationship {
return o.Payload
}
func (o *AccountBlockOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Relationship)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountBlockBadRequest creates a AccountBlockBadRequest with default headers values
func NewAccountBlockBadRequest() *AccountBlockBadRequest {
return &AccountBlockBadRequest{}
}
/*
AccountBlockBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountBlockBadRequest struct {
}
// IsSuccess returns true when this account block bad request response has a 2xx status code
func (o *AccountBlockBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account block bad request response has a 3xx status code
func (o *AccountBlockBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account block bad request response has a 4xx status code
func (o *AccountBlockBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account block bad request response has a 5xx status code
func (o *AccountBlockBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account block bad request response a status code equal to that given
func (o *AccountBlockBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account block bad request response
func (o *AccountBlockBadRequest) Code() int {
return 400
}
func (o *AccountBlockBadRequest) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockBadRequest", 400)
}
func (o *AccountBlockBadRequest) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockBadRequest", 400)
}
func (o *AccountBlockBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountBlockUnauthorized creates a AccountBlockUnauthorized with default headers values
func NewAccountBlockUnauthorized() *AccountBlockUnauthorized {
return &AccountBlockUnauthorized{}
}
/*
AccountBlockUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountBlockUnauthorized struct {
}
// IsSuccess returns true when this account block unauthorized response has a 2xx status code
func (o *AccountBlockUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account block unauthorized response has a 3xx status code
func (o *AccountBlockUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account block unauthorized response has a 4xx status code
func (o *AccountBlockUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account block unauthorized response has a 5xx status code
func (o *AccountBlockUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account block unauthorized response a status code equal to that given
func (o *AccountBlockUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account block unauthorized response
func (o *AccountBlockUnauthorized) Code() int {
return 401
}
func (o *AccountBlockUnauthorized) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockUnauthorized", 401)
}
func (o *AccountBlockUnauthorized) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockUnauthorized", 401)
}
func (o *AccountBlockUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountBlockNotFound creates a AccountBlockNotFound with default headers values
func NewAccountBlockNotFound() *AccountBlockNotFound {
return &AccountBlockNotFound{}
}
/*
AccountBlockNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountBlockNotFound struct {
}
// IsSuccess returns true when this account block not found response has a 2xx status code
func (o *AccountBlockNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account block not found response has a 3xx status code
func (o *AccountBlockNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account block not found response has a 4xx status code
func (o *AccountBlockNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account block not found response has a 5xx status code
func (o *AccountBlockNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account block not found response a status code equal to that given
func (o *AccountBlockNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account block not found response
func (o *AccountBlockNotFound) Code() int {
return 404
}
func (o *AccountBlockNotFound) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockNotFound", 404)
}
func (o *AccountBlockNotFound) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockNotFound", 404)
}
func (o *AccountBlockNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountBlockNotAcceptable creates a AccountBlockNotAcceptable with default headers values
func NewAccountBlockNotAcceptable() *AccountBlockNotAcceptable {
return &AccountBlockNotAcceptable{}
}
/*
AccountBlockNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountBlockNotAcceptable struct {
}
// IsSuccess returns true when this account block not acceptable response has a 2xx status code
func (o *AccountBlockNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account block not acceptable response has a 3xx status code
func (o *AccountBlockNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account block not acceptable response has a 4xx status code
func (o *AccountBlockNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account block not acceptable response has a 5xx status code
func (o *AccountBlockNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account block not acceptable response a status code equal to that given
func (o *AccountBlockNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account block not acceptable response
func (o *AccountBlockNotAcceptable) Code() int {
return 406
}
func (o *AccountBlockNotAcceptable) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockNotAcceptable", 406)
}
func (o *AccountBlockNotAcceptable) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockNotAcceptable", 406)
}
func (o *AccountBlockNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountBlockInternalServerError creates a AccountBlockInternalServerError with default headers values
func NewAccountBlockInternalServerError() *AccountBlockInternalServerError {
return &AccountBlockInternalServerError{}
}
/*
AccountBlockInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountBlockInternalServerError struct {
}
// IsSuccess returns true when this account block internal server error response has a 2xx status code
func (o *AccountBlockInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account block internal server error response has a 3xx status code
func (o *AccountBlockInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account block internal server error response has a 4xx status code
func (o *AccountBlockInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account block internal server error response has a 5xx status code
func (o *AccountBlockInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account block internal server error response a status code equal to that given
func (o *AccountBlockInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account block internal server error response
func (o *AccountBlockInternalServerError) Code() int {
return 500
}
func (o *AccountBlockInternalServerError) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockInternalServerError", 500)
}
func (o *AccountBlockInternalServerError) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/block][%d] accountBlockInternalServerError", 500)
}
func (o *AccountBlockInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,334 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewAccountCreateParams creates a new AccountCreateParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountCreateParams() *AccountCreateParams {
return &AccountCreateParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountCreateParamsWithTimeout creates a new AccountCreateParams object
// with the ability to set a timeout on a request.
func NewAccountCreateParamsWithTimeout(timeout time.Duration) *AccountCreateParams {
return &AccountCreateParams{
timeout: timeout,
}
}
// NewAccountCreateParamsWithContext creates a new AccountCreateParams object
// with the ability to set a context for a request.
func NewAccountCreateParamsWithContext(ctx context.Context) *AccountCreateParams {
return &AccountCreateParams{
Context: ctx,
}
}
// NewAccountCreateParamsWithHTTPClient creates a new AccountCreateParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountCreateParamsWithHTTPClient(client *http.Client) *AccountCreateParams {
return &AccountCreateParams{
HTTPClient: client,
}
}
/*
AccountCreateParams contains all the parameters to send to the API endpoint
for the account create operation.
Typically these are written to a http.Request.
*/
type AccountCreateParams struct {
/* Agreement.
The user agrees to the terms, conditions, and policies of the instance.
*/
Agreement *bool
/* Email.
The email address to be used for login.
*/
Email *string
/* Locale.
The language of the confirmation email that will be sent.
*/
Locale *string
/* Password.
The password to be used for login. This will be hashed before storage.
*/
Password *string
/* Reason.
Text that will be reviewed by moderators if registrations require manual approval.
*/
Reason *string
/* Username.
The desired username for the account.
*/
Username *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account create params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountCreateParams) WithDefaults() *AccountCreateParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account create params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountCreateParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account create params
func (o *AccountCreateParams) WithTimeout(timeout time.Duration) *AccountCreateParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account create params
func (o *AccountCreateParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account create params
func (o *AccountCreateParams) WithContext(ctx context.Context) *AccountCreateParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account create params
func (o *AccountCreateParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account create params
func (o *AccountCreateParams) WithHTTPClient(client *http.Client) *AccountCreateParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account create params
func (o *AccountCreateParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAgreement adds the agreement to the account create params
func (o *AccountCreateParams) WithAgreement(agreement *bool) *AccountCreateParams {
o.SetAgreement(agreement)
return o
}
// SetAgreement adds the agreement to the account create params
func (o *AccountCreateParams) SetAgreement(agreement *bool) {
o.Agreement = agreement
}
// WithEmail adds the email to the account create params
func (o *AccountCreateParams) WithEmail(email *string) *AccountCreateParams {
o.SetEmail(email)
return o
}
// SetEmail adds the email to the account create params
func (o *AccountCreateParams) SetEmail(email *string) {
o.Email = email
}
// WithLocale adds the locale to the account create params
func (o *AccountCreateParams) WithLocale(locale *string) *AccountCreateParams {
o.SetLocale(locale)
return o
}
// SetLocale adds the locale to the account create params
func (o *AccountCreateParams) SetLocale(locale *string) {
o.Locale = locale
}
// WithPassword adds the password to the account create params
func (o *AccountCreateParams) WithPassword(password *string) *AccountCreateParams {
o.SetPassword(password)
return o
}
// SetPassword adds the password to the account create params
func (o *AccountCreateParams) SetPassword(password *string) {
o.Password = password
}
// WithReason adds the reason to the account create params
func (o *AccountCreateParams) WithReason(reason *string) *AccountCreateParams {
o.SetReason(reason)
return o
}
// SetReason adds the reason to the account create params
func (o *AccountCreateParams) SetReason(reason *string) {
o.Reason = reason
}
// WithUsername adds the username to the account create params
func (o *AccountCreateParams) WithUsername(username *string) *AccountCreateParams {
o.SetUsername(username)
return o
}
// SetUsername adds the username to the account create params
func (o *AccountCreateParams) SetUsername(username *string) {
o.Username = username
}
// WriteToRequest writes these params to a swagger request
func (o *AccountCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Agreement != nil {
// query param agreement
var qrAgreement bool
if o.Agreement != nil {
qrAgreement = *o.Agreement
}
qAgreement := swag.FormatBool(qrAgreement)
if qAgreement != "" {
if err := r.SetQueryParam("agreement", qAgreement); err != nil {
return err
}
}
}
if o.Email != nil {
// query param email
var qrEmail string
if o.Email != nil {
qrEmail = *o.Email
}
qEmail := qrEmail
if qEmail != "" {
if err := r.SetQueryParam("email", qEmail); err != nil {
return err
}
}
}
if o.Locale != nil {
// query param locale
var qrLocale string
if o.Locale != nil {
qrLocale = *o.Locale
}
qLocale := qrLocale
if qLocale != "" {
if err := r.SetQueryParam("locale", qLocale); err != nil {
return err
}
}
}
if o.Password != nil {
// query param password
var qrPassword string
if o.Password != nil {
qrPassword = *o.Password
}
qPassword := qrPassword
if qPassword != "" {
if err := r.SetQueryParam("password", qPassword); err != nil {
return err
}
}
}
if o.Reason != nil {
// query param reason
var qrReason string
if o.Reason != nil {
qrReason = *o.Reason
}
qReason := qrReason
if qReason != "" {
if err := r.SetQueryParam("reason", qReason); err != nil {
return err
}
}
}
if o.Username != nil {
// query param username
var qrUsername string
if o.Username != nil {
qrUsername = *o.Username
}
qUsername := qrUsername
if qUsername != "" {
if err := r.SetQueryParam("username", qUsername); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,478 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountCreateReader is a Reader for the AccountCreate structure.
type AccountCreateReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountCreateOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountCreateBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountCreateUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountCreateNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountCreateNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewAccountCreateUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountCreateInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /api/v1/accounts] accountCreate", response, response.Code())
}
}
// NewAccountCreateOK creates a AccountCreateOK with default headers values
func NewAccountCreateOK() *AccountCreateOK {
return &AccountCreateOK{}
}
/*
AccountCreateOK describes a response with status code 200, with default header values.
An OAuth2 access token for the newly-created account.
*/
type AccountCreateOK struct {
Payload *models.Token
}
// IsSuccess returns true when this account create o k response has a 2xx status code
func (o *AccountCreateOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account create o k response has a 3xx status code
func (o *AccountCreateOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account create o k response has a 4xx status code
func (o *AccountCreateOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account create o k response has a 5xx status code
func (o *AccountCreateOK) IsServerError() bool {
return false
}
// IsCode returns true when this account create o k response a status code equal to that given
func (o *AccountCreateOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account create o k response
func (o *AccountCreateOK) Code() int {
return 200
}
func (o *AccountCreateOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateOK %s", 200, payload)
}
func (o *AccountCreateOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateOK %s", 200, payload)
}
func (o *AccountCreateOK) GetPayload() *models.Token {
return o.Payload
}
func (o *AccountCreateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Token)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountCreateBadRequest creates a AccountCreateBadRequest with default headers values
func NewAccountCreateBadRequest() *AccountCreateBadRequest {
return &AccountCreateBadRequest{}
}
/*
AccountCreateBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountCreateBadRequest struct {
}
// IsSuccess returns true when this account create bad request response has a 2xx status code
func (o *AccountCreateBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account create bad request response has a 3xx status code
func (o *AccountCreateBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account create bad request response has a 4xx status code
func (o *AccountCreateBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account create bad request response has a 5xx status code
func (o *AccountCreateBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account create bad request response a status code equal to that given
func (o *AccountCreateBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account create bad request response
func (o *AccountCreateBadRequest) Code() int {
return 400
}
func (o *AccountCreateBadRequest) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateBadRequest", 400)
}
func (o *AccountCreateBadRequest) String() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateBadRequest", 400)
}
func (o *AccountCreateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountCreateUnauthorized creates a AccountCreateUnauthorized with default headers values
func NewAccountCreateUnauthorized() *AccountCreateUnauthorized {
return &AccountCreateUnauthorized{}
}
/*
AccountCreateUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountCreateUnauthorized struct {
}
// IsSuccess returns true when this account create unauthorized response has a 2xx status code
func (o *AccountCreateUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account create unauthorized response has a 3xx status code
func (o *AccountCreateUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account create unauthorized response has a 4xx status code
func (o *AccountCreateUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account create unauthorized response has a 5xx status code
func (o *AccountCreateUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account create unauthorized response a status code equal to that given
func (o *AccountCreateUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account create unauthorized response
func (o *AccountCreateUnauthorized) Code() int {
return 401
}
func (o *AccountCreateUnauthorized) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateUnauthorized", 401)
}
func (o *AccountCreateUnauthorized) String() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateUnauthorized", 401)
}
func (o *AccountCreateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountCreateNotFound creates a AccountCreateNotFound with default headers values
func NewAccountCreateNotFound() *AccountCreateNotFound {
return &AccountCreateNotFound{}
}
/*
AccountCreateNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountCreateNotFound struct {
}
// IsSuccess returns true when this account create not found response has a 2xx status code
func (o *AccountCreateNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account create not found response has a 3xx status code
func (o *AccountCreateNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account create not found response has a 4xx status code
func (o *AccountCreateNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account create not found response has a 5xx status code
func (o *AccountCreateNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account create not found response a status code equal to that given
func (o *AccountCreateNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account create not found response
func (o *AccountCreateNotFound) Code() int {
return 404
}
func (o *AccountCreateNotFound) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateNotFound", 404)
}
func (o *AccountCreateNotFound) String() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateNotFound", 404)
}
func (o *AccountCreateNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountCreateNotAcceptable creates a AccountCreateNotAcceptable with default headers values
func NewAccountCreateNotAcceptable() *AccountCreateNotAcceptable {
return &AccountCreateNotAcceptable{}
}
/*
AccountCreateNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountCreateNotAcceptable struct {
}
// IsSuccess returns true when this account create not acceptable response has a 2xx status code
func (o *AccountCreateNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account create not acceptable response has a 3xx status code
func (o *AccountCreateNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account create not acceptable response has a 4xx status code
func (o *AccountCreateNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account create not acceptable response has a 5xx status code
func (o *AccountCreateNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account create not acceptable response a status code equal to that given
func (o *AccountCreateNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account create not acceptable response
func (o *AccountCreateNotAcceptable) Code() int {
return 406
}
func (o *AccountCreateNotAcceptable) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateNotAcceptable", 406)
}
func (o *AccountCreateNotAcceptable) String() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateNotAcceptable", 406)
}
func (o *AccountCreateNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountCreateUnprocessableEntity creates a AccountCreateUnprocessableEntity with default headers values
func NewAccountCreateUnprocessableEntity() *AccountCreateUnprocessableEntity {
return &AccountCreateUnprocessableEntity{}
}
/*
AccountCreateUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable. Your account creation request cannot be processed because either too many accounts have been created on this instance in the last 24h, or the pending account backlog is full.
*/
type AccountCreateUnprocessableEntity struct {
}
// IsSuccess returns true when this account create unprocessable entity response has a 2xx status code
func (o *AccountCreateUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account create unprocessable entity response has a 3xx status code
func (o *AccountCreateUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this account create unprocessable entity response has a 4xx status code
func (o *AccountCreateUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this account create unprocessable entity response has a 5xx status code
func (o *AccountCreateUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this account create unprocessable entity response a status code equal to that given
func (o *AccountCreateUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the account create unprocessable entity response
func (o *AccountCreateUnprocessableEntity) Code() int {
return 422
}
func (o *AccountCreateUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateUnprocessableEntity", 422)
}
func (o *AccountCreateUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateUnprocessableEntity", 422)
}
func (o *AccountCreateUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountCreateInternalServerError creates a AccountCreateInternalServerError with default headers values
func NewAccountCreateInternalServerError() *AccountCreateInternalServerError {
return &AccountCreateInternalServerError{}
}
/*
AccountCreateInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountCreateInternalServerError struct {
}
// IsSuccess returns true when this account create internal server error response has a 2xx status code
func (o *AccountCreateInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account create internal server error response has a 3xx status code
func (o *AccountCreateInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account create internal server error response has a 4xx status code
func (o *AccountCreateInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account create internal server error response has a 5xx status code
func (o *AccountCreateInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account create internal server error response a status code equal to that given
func (o *AccountCreateInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account create internal server error response
func (o *AccountCreateInternalServerError) Code() int {
return 500
}
func (o *AccountCreateInternalServerError) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateInternalServerError", 500)
}
func (o *AccountCreateInternalServerError) String() string {
return fmt.Sprintf("[POST /api/v1/accounts][%d] accountCreateInternalServerError", 500)
}
func (o *AccountCreateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,155 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountDeleteParams creates a new AccountDeleteParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountDeleteParams() *AccountDeleteParams {
return &AccountDeleteParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountDeleteParamsWithTimeout creates a new AccountDeleteParams object
// with the ability to set a timeout on a request.
func NewAccountDeleteParamsWithTimeout(timeout time.Duration) *AccountDeleteParams {
return &AccountDeleteParams{
timeout: timeout,
}
}
// NewAccountDeleteParamsWithContext creates a new AccountDeleteParams object
// with the ability to set a context for a request.
func NewAccountDeleteParamsWithContext(ctx context.Context) *AccountDeleteParams {
return &AccountDeleteParams{
Context: ctx,
}
}
// NewAccountDeleteParamsWithHTTPClient creates a new AccountDeleteParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountDeleteParamsWithHTTPClient(client *http.Client) *AccountDeleteParams {
return &AccountDeleteParams{
HTTPClient: client,
}
}
/*
AccountDeleteParams contains all the parameters to send to the API endpoint
for the account delete operation.
Typically these are written to a http.Request.
*/
type AccountDeleteParams struct {
/* Password.
Password of the account user, for confirmation.
*/
Password string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account delete params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountDeleteParams) WithDefaults() *AccountDeleteParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account delete params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountDeleteParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account delete params
func (o *AccountDeleteParams) WithTimeout(timeout time.Duration) *AccountDeleteParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account delete params
func (o *AccountDeleteParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account delete params
func (o *AccountDeleteParams) WithContext(ctx context.Context) *AccountDeleteParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account delete params
func (o *AccountDeleteParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account delete params
func (o *AccountDeleteParams) WithHTTPClient(client *http.Client) *AccountDeleteParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account delete params
func (o *AccountDeleteParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithPassword adds the password to the account delete params
func (o *AccountDeleteParams) WithPassword(password string) *AccountDeleteParams {
o.SetPassword(password)
return o
}
// SetPassword adds the password to the account delete params
func (o *AccountDeleteParams) SetPassword(password string) {
o.Password = password
}
// WriteToRequest writes these params to a swagger request
func (o *AccountDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// form param password
frPassword := o.Password
fPassword := frPassword
if fPassword != "" {
if err := r.SetFormParam("password", fPassword); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,398 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// AccountDeleteReader is a Reader for the AccountDelete structure.
type AccountDeleteReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 202:
result := NewAccountDeleteAccepted()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountDeleteBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountDeleteUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountDeleteNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountDeleteNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountDeleteInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /api/v1/accounts/delete] accountDelete", response, response.Code())
}
}
// NewAccountDeleteAccepted creates a AccountDeleteAccepted with default headers values
func NewAccountDeleteAccepted() *AccountDeleteAccepted {
return &AccountDeleteAccepted{}
}
/*
AccountDeleteAccepted describes a response with status code 202, with default header values.
The account deletion has been accepted and the account will be deleted.
*/
type AccountDeleteAccepted struct {
}
// IsSuccess returns true when this account delete accepted response has a 2xx status code
func (o *AccountDeleteAccepted) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account delete accepted response has a 3xx status code
func (o *AccountDeleteAccepted) IsRedirect() bool {
return false
}
// IsClientError returns true when this account delete accepted response has a 4xx status code
func (o *AccountDeleteAccepted) IsClientError() bool {
return false
}
// IsServerError returns true when this account delete accepted response has a 5xx status code
func (o *AccountDeleteAccepted) IsServerError() bool {
return false
}
// IsCode returns true when this account delete accepted response a status code equal to that given
func (o *AccountDeleteAccepted) IsCode(code int) bool {
return code == 202
}
// Code gets the status code for the account delete accepted response
func (o *AccountDeleteAccepted) Code() int {
return 202
}
func (o *AccountDeleteAccepted) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteAccepted", 202)
}
func (o *AccountDeleteAccepted) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteAccepted", 202)
}
func (o *AccountDeleteAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountDeleteBadRequest creates a AccountDeleteBadRequest with default headers values
func NewAccountDeleteBadRequest() *AccountDeleteBadRequest {
return &AccountDeleteBadRequest{}
}
/*
AccountDeleteBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountDeleteBadRequest struct {
}
// IsSuccess returns true when this account delete bad request response has a 2xx status code
func (o *AccountDeleteBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account delete bad request response has a 3xx status code
func (o *AccountDeleteBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account delete bad request response has a 4xx status code
func (o *AccountDeleteBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account delete bad request response has a 5xx status code
func (o *AccountDeleteBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account delete bad request response a status code equal to that given
func (o *AccountDeleteBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account delete bad request response
func (o *AccountDeleteBadRequest) Code() int {
return 400
}
func (o *AccountDeleteBadRequest) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteBadRequest", 400)
}
func (o *AccountDeleteBadRequest) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteBadRequest", 400)
}
func (o *AccountDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountDeleteUnauthorized creates a AccountDeleteUnauthorized with default headers values
func NewAccountDeleteUnauthorized() *AccountDeleteUnauthorized {
return &AccountDeleteUnauthorized{}
}
/*
AccountDeleteUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountDeleteUnauthorized struct {
}
// IsSuccess returns true when this account delete unauthorized response has a 2xx status code
func (o *AccountDeleteUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account delete unauthorized response has a 3xx status code
func (o *AccountDeleteUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account delete unauthorized response has a 4xx status code
func (o *AccountDeleteUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account delete unauthorized response has a 5xx status code
func (o *AccountDeleteUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account delete unauthorized response a status code equal to that given
func (o *AccountDeleteUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account delete unauthorized response
func (o *AccountDeleteUnauthorized) Code() int {
return 401
}
func (o *AccountDeleteUnauthorized) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteUnauthorized", 401)
}
func (o *AccountDeleteUnauthorized) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteUnauthorized", 401)
}
func (o *AccountDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountDeleteNotFound creates a AccountDeleteNotFound with default headers values
func NewAccountDeleteNotFound() *AccountDeleteNotFound {
return &AccountDeleteNotFound{}
}
/*
AccountDeleteNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountDeleteNotFound struct {
}
// IsSuccess returns true when this account delete not found response has a 2xx status code
func (o *AccountDeleteNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account delete not found response has a 3xx status code
func (o *AccountDeleteNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account delete not found response has a 4xx status code
func (o *AccountDeleteNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account delete not found response has a 5xx status code
func (o *AccountDeleteNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account delete not found response a status code equal to that given
func (o *AccountDeleteNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account delete not found response
func (o *AccountDeleteNotFound) Code() int {
return 404
}
func (o *AccountDeleteNotFound) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteNotFound", 404)
}
func (o *AccountDeleteNotFound) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteNotFound", 404)
}
func (o *AccountDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountDeleteNotAcceptable creates a AccountDeleteNotAcceptable with default headers values
func NewAccountDeleteNotAcceptable() *AccountDeleteNotAcceptable {
return &AccountDeleteNotAcceptable{}
}
/*
AccountDeleteNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountDeleteNotAcceptable struct {
}
// IsSuccess returns true when this account delete not acceptable response has a 2xx status code
func (o *AccountDeleteNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account delete not acceptable response has a 3xx status code
func (o *AccountDeleteNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account delete not acceptable response has a 4xx status code
func (o *AccountDeleteNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account delete not acceptable response has a 5xx status code
func (o *AccountDeleteNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account delete not acceptable response a status code equal to that given
func (o *AccountDeleteNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account delete not acceptable response
func (o *AccountDeleteNotAcceptable) Code() int {
return 406
}
func (o *AccountDeleteNotAcceptable) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteNotAcceptable", 406)
}
func (o *AccountDeleteNotAcceptable) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteNotAcceptable", 406)
}
func (o *AccountDeleteNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountDeleteInternalServerError creates a AccountDeleteInternalServerError with default headers values
func NewAccountDeleteInternalServerError() *AccountDeleteInternalServerError {
return &AccountDeleteInternalServerError{}
}
/*
AccountDeleteInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountDeleteInternalServerError struct {
}
// IsSuccess returns true when this account delete internal server error response has a 2xx status code
func (o *AccountDeleteInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account delete internal server error response has a 3xx status code
func (o *AccountDeleteInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account delete internal server error response has a 4xx status code
func (o *AccountDeleteInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account delete internal server error response has a 5xx status code
func (o *AccountDeleteInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account delete internal server error response a status code equal to that given
func (o *AccountDeleteInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account delete internal server error response
func (o *AccountDeleteInternalServerError) Code() int {
return 500
}
func (o *AccountDeleteInternalServerError) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteInternalServerError", 500)
}
func (o *AccountDeleteInternalServerError) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/delete][%d] accountDeleteInternalServerError", 500)
}
func (o *AccountDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,232 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewAccountFollowParams creates a new AccountFollowParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountFollowParams() *AccountFollowParams {
return &AccountFollowParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountFollowParamsWithTimeout creates a new AccountFollowParams object
// with the ability to set a timeout on a request.
func NewAccountFollowParamsWithTimeout(timeout time.Duration) *AccountFollowParams {
return &AccountFollowParams{
timeout: timeout,
}
}
// NewAccountFollowParamsWithContext creates a new AccountFollowParams object
// with the ability to set a context for a request.
func NewAccountFollowParamsWithContext(ctx context.Context) *AccountFollowParams {
return &AccountFollowParams{
Context: ctx,
}
}
// NewAccountFollowParamsWithHTTPClient creates a new AccountFollowParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountFollowParamsWithHTTPClient(client *http.Client) *AccountFollowParams {
return &AccountFollowParams{
HTTPClient: client,
}
}
/*
AccountFollowParams contains all the parameters to send to the API endpoint
for the account follow operation.
Typically these are written to a http.Request.
*/
type AccountFollowParams struct {
/* ID.
ID of the account to follow.
*/
ID string
/* Notify.
Notify when this account posts.
*/
Notify *bool
/* Reblogs.
Show reblogs from this account.
Default: true
*/
Reblogs *bool
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account follow params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountFollowParams) WithDefaults() *AccountFollowParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account follow params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountFollowParams) SetDefaults() {
var (
notifyDefault = bool(false)
reblogsDefault = bool(true)
)
val := AccountFollowParams{
Notify: &notifyDefault,
Reblogs: &reblogsDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the account follow params
func (o *AccountFollowParams) WithTimeout(timeout time.Duration) *AccountFollowParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account follow params
func (o *AccountFollowParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account follow params
func (o *AccountFollowParams) WithContext(ctx context.Context) *AccountFollowParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account follow params
func (o *AccountFollowParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account follow params
func (o *AccountFollowParams) WithHTTPClient(client *http.Client) *AccountFollowParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account follow params
func (o *AccountFollowParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the account follow params
func (o *AccountFollowParams) WithID(id string) *AccountFollowParams {
o.SetID(id)
return o
}
// SetID adds the id to the account follow params
func (o *AccountFollowParams) SetID(id string) {
o.ID = id
}
// WithNotify adds the notify to the account follow params
func (o *AccountFollowParams) WithNotify(notify *bool) *AccountFollowParams {
o.SetNotify(notify)
return o
}
// SetNotify adds the notify to the account follow params
func (o *AccountFollowParams) SetNotify(notify *bool) {
o.Notify = notify
}
// WithReblogs adds the reblogs to the account follow params
func (o *AccountFollowParams) WithReblogs(reblogs *bool) *AccountFollowParams {
o.SetReblogs(reblogs)
return o
}
// SetReblogs adds the reblogs to the account follow params
func (o *AccountFollowParams) SetReblogs(reblogs *bool) {
o.Reblogs = reblogs
}
// WriteToRequest writes these params to a swagger request
func (o *AccountFollowParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if o.Notify != nil {
// form param notify
var frNotify bool
if o.Notify != nil {
frNotify = *o.Notify
}
fNotify := swag.FormatBool(frNotify)
if fNotify != "" {
if err := r.SetFormParam("notify", fNotify); err != nil {
return err
}
}
}
if o.Reblogs != nil {
// form param reblogs
var frReblogs bool
if o.Reblogs != nil {
frReblogs = *o.Reblogs
}
fReblogs := swag.FormatBool(frReblogs)
if fReblogs != "" {
if err := r.SetFormParam("reblogs", fReblogs); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,416 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountFollowReader is a Reader for the AccountFollow structure.
type AccountFollowReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountFollowReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountFollowOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountFollowBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountFollowUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountFollowNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountFollowNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountFollowInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /api/v1/accounts/{id}/follow] accountFollow", response, response.Code())
}
}
// NewAccountFollowOK creates a AccountFollowOK with default headers values
func NewAccountFollowOK() *AccountFollowOK {
return &AccountFollowOK{}
}
/*
AccountFollowOK describes a response with status code 200, with default header values.
Your relationship to this account.
*/
type AccountFollowOK struct {
Payload *models.Relationship
}
// IsSuccess returns true when this account follow o k response has a 2xx status code
func (o *AccountFollowOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account follow o k response has a 3xx status code
func (o *AccountFollowOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account follow o k response has a 4xx status code
func (o *AccountFollowOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account follow o k response has a 5xx status code
func (o *AccountFollowOK) IsServerError() bool {
return false
}
// IsCode returns true when this account follow o k response a status code equal to that given
func (o *AccountFollowOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account follow o k response
func (o *AccountFollowOK) Code() int {
return 200
}
func (o *AccountFollowOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowOK %s", 200, payload)
}
func (o *AccountFollowOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowOK %s", 200, payload)
}
func (o *AccountFollowOK) GetPayload() *models.Relationship {
return o.Payload
}
func (o *AccountFollowOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Relationship)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountFollowBadRequest creates a AccountFollowBadRequest with default headers values
func NewAccountFollowBadRequest() *AccountFollowBadRequest {
return &AccountFollowBadRequest{}
}
/*
AccountFollowBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountFollowBadRequest struct {
}
// IsSuccess returns true when this account follow bad request response has a 2xx status code
func (o *AccountFollowBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account follow bad request response has a 3xx status code
func (o *AccountFollowBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account follow bad request response has a 4xx status code
func (o *AccountFollowBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account follow bad request response has a 5xx status code
func (o *AccountFollowBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account follow bad request response a status code equal to that given
func (o *AccountFollowBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account follow bad request response
func (o *AccountFollowBadRequest) Code() int {
return 400
}
func (o *AccountFollowBadRequest) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowBadRequest", 400)
}
func (o *AccountFollowBadRequest) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowBadRequest", 400)
}
func (o *AccountFollowBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowUnauthorized creates a AccountFollowUnauthorized with default headers values
func NewAccountFollowUnauthorized() *AccountFollowUnauthorized {
return &AccountFollowUnauthorized{}
}
/*
AccountFollowUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountFollowUnauthorized struct {
}
// IsSuccess returns true when this account follow unauthorized response has a 2xx status code
func (o *AccountFollowUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account follow unauthorized response has a 3xx status code
func (o *AccountFollowUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account follow unauthorized response has a 4xx status code
func (o *AccountFollowUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account follow unauthorized response has a 5xx status code
func (o *AccountFollowUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account follow unauthorized response a status code equal to that given
func (o *AccountFollowUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account follow unauthorized response
func (o *AccountFollowUnauthorized) Code() int {
return 401
}
func (o *AccountFollowUnauthorized) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowUnauthorized", 401)
}
func (o *AccountFollowUnauthorized) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowUnauthorized", 401)
}
func (o *AccountFollowUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowNotFound creates a AccountFollowNotFound with default headers values
func NewAccountFollowNotFound() *AccountFollowNotFound {
return &AccountFollowNotFound{}
}
/*
AccountFollowNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountFollowNotFound struct {
}
// IsSuccess returns true when this account follow not found response has a 2xx status code
func (o *AccountFollowNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account follow not found response has a 3xx status code
func (o *AccountFollowNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account follow not found response has a 4xx status code
func (o *AccountFollowNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account follow not found response has a 5xx status code
func (o *AccountFollowNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account follow not found response a status code equal to that given
func (o *AccountFollowNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account follow not found response
func (o *AccountFollowNotFound) Code() int {
return 404
}
func (o *AccountFollowNotFound) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowNotFound", 404)
}
func (o *AccountFollowNotFound) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowNotFound", 404)
}
func (o *AccountFollowNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowNotAcceptable creates a AccountFollowNotAcceptable with default headers values
func NewAccountFollowNotAcceptable() *AccountFollowNotAcceptable {
return &AccountFollowNotAcceptable{}
}
/*
AccountFollowNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountFollowNotAcceptable struct {
}
// IsSuccess returns true when this account follow not acceptable response has a 2xx status code
func (o *AccountFollowNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account follow not acceptable response has a 3xx status code
func (o *AccountFollowNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account follow not acceptable response has a 4xx status code
func (o *AccountFollowNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account follow not acceptable response has a 5xx status code
func (o *AccountFollowNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account follow not acceptable response a status code equal to that given
func (o *AccountFollowNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account follow not acceptable response
func (o *AccountFollowNotAcceptable) Code() int {
return 406
}
func (o *AccountFollowNotAcceptable) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowNotAcceptable", 406)
}
func (o *AccountFollowNotAcceptable) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowNotAcceptable", 406)
}
func (o *AccountFollowNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowInternalServerError creates a AccountFollowInternalServerError with default headers values
func NewAccountFollowInternalServerError() *AccountFollowInternalServerError {
return &AccountFollowInternalServerError{}
}
/*
AccountFollowInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountFollowInternalServerError struct {
}
// IsSuccess returns true when this account follow internal server error response has a 2xx status code
func (o *AccountFollowInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account follow internal server error response has a 3xx status code
func (o *AccountFollowInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account follow internal server error response has a 4xx status code
func (o *AccountFollowInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account follow internal server error response has a 5xx status code
func (o *AccountFollowInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account follow internal server error response a status code equal to that given
func (o *AccountFollowInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account follow internal server error response
func (o *AccountFollowInternalServerError) Code() int {
return 500
}
func (o *AccountFollowInternalServerError) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowInternalServerError", 500)
}
func (o *AccountFollowInternalServerError) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/{id}/follow][%d] accountFollowInternalServerError", 500)
}
func (o *AccountFollowInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,301 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewAccountFollowersParams creates a new AccountFollowersParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountFollowersParams() *AccountFollowersParams {
return &AccountFollowersParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountFollowersParamsWithTimeout creates a new AccountFollowersParams object
// with the ability to set a timeout on a request.
func NewAccountFollowersParamsWithTimeout(timeout time.Duration) *AccountFollowersParams {
return &AccountFollowersParams{
timeout: timeout,
}
}
// NewAccountFollowersParamsWithContext creates a new AccountFollowersParams object
// with the ability to set a context for a request.
func NewAccountFollowersParamsWithContext(ctx context.Context) *AccountFollowersParams {
return &AccountFollowersParams{
Context: ctx,
}
}
// NewAccountFollowersParamsWithHTTPClient creates a new AccountFollowersParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountFollowersParamsWithHTTPClient(client *http.Client) *AccountFollowersParams {
return &AccountFollowersParams{
HTTPClient: client,
}
}
/*
AccountFollowersParams contains all the parameters to send to the API endpoint
for the account followers operation.
Typically these are written to a http.Request.
*/
type AccountFollowersParams struct {
/* ID.
Account ID.
*/
ID string
/* Limit.
Number of follower accounts to return.
Default: 40
*/
Limit *int64
/* MaxID.
Return only follower accounts *OLDER* than the given max ID. The follower account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
*/
MaxID *string
/* MinID.
Return only follower accounts *IMMEDIATELY NEWER* than the given min ID. The follower account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
*/
MinID *string
/* SinceID.
Return only follower accounts *NEWER* than the given since ID. The follower account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
*/
SinceID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account followers params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountFollowersParams) WithDefaults() *AccountFollowersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account followers params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountFollowersParams) SetDefaults() {
var (
limitDefault = int64(40)
)
val := AccountFollowersParams{
Limit: &limitDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the account followers params
func (o *AccountFollowersParams) WithTimeout(timeout time.Duration) *AccountFollowersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account followers params
func (o *AccountFollowersParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account followers params
func (o *AccountFollowersParams) WithContext(ctx context.Context) *AccountFollowersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account followers params
func (o *AccountFollowersParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account followers params
func (o *AccountFollowersParams) WithHTTPClient(client *http.Client) *AccountFollowersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account followers params
func (o *AccountFollowersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the account followers params
func (o *AccountFollowersParams) WithID(id string) *AccountFollowersParams {
o.SetID(id)
return o
}
// SetID adds the id to the account followers params
func (o *AccountFollowersParams) SetID(id string) {
o.ID = id
}
// WithLimit adds the limit to the account followers params
func (o *AccountFollowersParams) WithLimit(limit *int64) *AccountFollowersParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the account followers params
func (o *AccountFollowersParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithMaxID adds the maxID to the account followers params
func (o *AccountFollowersParams) WithMaxID(maxID *string) *AccountFollowersParams {
o.SetMaxID(maxID)
return o
}
// SetMaxID adds the maxId to the account followers params
func (o *AccountFollowersParams) SetMaxID(maxID *string) {
o.MaxID = maxID
}
// WithMinID adds the minID to the account followers params
func (o *AccountFollowersParams) WithMinID(minID *string) *AccountFollowersParams {
o.SetMinID(minID)
return o
}
// SetMinID adds the minId to the account followers params
func (o *AccountFollowersParams) SetMinID(minID *string) {
o.MinID = minID
}
// WithSinceID adds the sinceID to the account followers params
func (o *AccountFollowersParams) WithSinceID(sinceID *string) *AccountFollowersParams {
o.SetSinceID(sinceID)
return o
}
// SetSinceID adds the sinceId to the account followers params
func (o *AccountFollowersParams) SetSinceID(sinceID *string) {
o.SinceID = sinceID
}
// WriteToRequest writes these params to a swagger request
func (o *AccountFollowersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if o.Limit != nil {
// query param limit
var qrLimit int64
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := swag.FormatInt64(qrLimit)
if qLimit != "" {
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
if o.MaxID != nil {
// query param max_id
var qrMaxID string
if o.MaxID != nil {
qrMaxID = *o.MaxID
}
qMaxID := qrMaxID
if qMaxID != "" {
if err := r.SetQueryParam("max_id", qMaxID); err != nil {
return err
}
}
}
if o.MinID != nil {
// query param min_id
var qrMinID string
if o.MinID != nil {
qrMinID = *o.MinID
}
qMinID := qrMinID
if qMinID != "" {
if err := r.SetQueryParam("min_id", qMinID); err != nil {
return err
}
}
}
if o.SinceID != nil {
// query param since_id
var qrSinceID string
if o.SinceID != nil {
qrSinceID = *o.SinceID
}
qSinceID := qrSinceID
if qSinceID != "" {
if err := r.SetQueryParam("since_id", qSinceID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,426 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountFollowersReader is a Reader for the AccountFollowers structure.
type AccountFollowersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountFollowersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountFollowersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountFollowersBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountFollowersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountFollowersNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountFollowersNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountFollowersInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/accounts/{id}/followers] accountFollowers", response, response.Code())
}
}
// NewAccountFollowersOK creates a AccountFollowersOK with default headers values
func NewAccountFollowersOK() *AccountFollowersOK {
return &AccountFollowersOK{}
}
/*
AccountFollowersOK describes a response with status code 200, with default header values.
Array of accounts that follow this account.
*/
type AccountFollowersOK struct {
/* Links to the next and previous queries.
*/
Link string
Payload []*models.Account
}
// IsSuccess returns true when this account followers o k response has a 2xx status code
func (o *AccountFollowersOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account followers o k response has a 3xx status code
func (o *AccountFollowersOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account followers o k response has a 4xx status code
func (o *AccountFollowersOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account followers o k response has a 5xx status code
func (o *AccountFollowersOK) IsServerError() bool {
return false
}
// IsCode returns true when this account followers o k response a status code equal to that given
func (o *AccountFollowersOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account followers o k response
func (o *AccountFollowersOK) Code() int {
return 200
}
func (o *AccountFollowersOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersOK %s", 200, payload)
}
func (o *AccountFollowersOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersOK %s", 200, payload)
}
func (o *AccountFollowersOK) GetPayload() []*models.Account {
return o.Payload
}
func (o *AccountFollowersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Link
hdrLink := response.GetHeader("Link")
if hdrLink != "" {
o.Link = hdrLink
}
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountFollowersBadRequest creates a AccountFollowersBadRequest with default headers values
func NewAccountFollowersBadRequest() *AccountFollowersBadRequest {
return &AccountFollowersBadRequest{}
}
/*
AccountFollowersBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountFollowersBadRequest struct {
}
// IsSuccess returns true when this account followers bad request response has a 2xx status code
func (o *AccountFollowersBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account followers bad request response has a 3xx status code
func (o *AccountFollowersBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account followers bad request response has a 4xx status code
func (o *AccountFollowersBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account followers bad request response has a 5xx status code
func (o *AccountFollowersBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account followers bad request response a status code equal to that given
func (o *AccountFollowersBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account followers bad request response
func (o *AccountFollowersBadRequest) Code() int {
return 400
}
func (o *AccountFollowersBadRequest) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersBadRequest", 400)
}
func (o *AccountFollowersBadRequest) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersBadRequest", 400)
}
func (o *AccountFollowersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowersUnauthorized creates a AccountFollowersUnauthorized with default headers values
func NewAccountFollowersUnauthorized() *AccountFollowersUnauthorized {
return &AccountFollowersUnauthorized{}
}
/*
AccountFollowersUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountFollowersUnauthorized struct {
}
// IsSuccess returns true when this account followers unauthorized response has a 2xx status code
func (o *AccountFollowersUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account followers unauthorized response has a 3xx status code
func (o *AccountFollowersUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account followers unauthorized response has a 4xx status code
func (o *AccountFollowersUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account followers unauthorized response has a 5xx status code
func (o *AccountFollowersUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account followers unauthorized response a status code equal to that given
func (o *AccountFollowersUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account followers unauthorized response
func (o *AccountFollowersUnauthorized) Code() int {
return 401
}
func (o *AccountFollowersUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersUnauthorized", 401)
}
func (o *AccountFollowersUnauthorized) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersUnauthorized", 401)
}
func (o *AccountFollowersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowersNotFound creates a AccountFollowersNotFound with default headers values
func NewAccountFollowersNotFound() *AccountFollowersNotFound {
return &AccountFollowersNotFound{}
}
/*
AccountFollowersNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountFollowersNotFound struct {
}
// IsSuccess returns true when this account followers not found response has a 2xx status code
func (o *AccountFollowersNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account followers not found response has a 3xx status code
func (o *AccountFollowersNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account followers not found response has a 4xx status code
func (o *AccountFollowersNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account followers not found response has a 5xx status code
func (o *AccountFollowersNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account followers not found response a status code equal to that given
func (o *AccountFollowersNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account followers not found response
func (o *AccountFollowersNotFound) Code() int {
return 404
}
func (o *AccountFollowersNotFound) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersNotFound", 404)
}
func (o *AccountFollowersNotFound) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersNotFound", 404)
}
func (o *AccountFollowersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowersNotAcceptable creates a AccountFollowersNotAcceptable with default headers values
func NewAccountFollowersNotAcceptable() *AccountFollowersNotAcceptable {
return &AccountFollowersNotAcceptable{}
}
/*
AccountFollowersNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountFollowersNotAcceptable struct {
}
// IsSuccess returns true when this account followers not acceptable response has a 2xx status code
func (o *AccountFollowersNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account followers not acceptable response has a 3xx status code
func (o *AccountFollowersNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account followers not acceptable response has a 4xx status code
func (o *AccountFollowersNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account followers not acceptable response has a 5xx status code
func (o *AccountFollowersNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account followers not acceptable response a status code equal to that given
func (o *AccountFollowersNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account followers not acceptable response
func (o *AccountFollowersNotAcceptable) Code() int {
return 406
}
func (o *AccountFollowersNotAcceptable) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersNotAcceptable", 406)
}
func (o *AccountFollowersNotAcceptable) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersNotAcceptable", 406)
}
func (o *AccountFollowersNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowersInternalServerError creates a AccountFollowersInternalServerError with default headers values
func NewAccountFollowersInternalServerError() *AccountFollowersInternalServerError {
return &AccountFollowersInternalServerError{}
}
/*
AccountFollowersInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountFollowersInternalServerError struct {
}
// IsSuccess returns true when this account followers internal server error response has a 2xx status code
func (o *AccountFollowersInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account followers internal server error response has a 3xx status code
func (o *AccountFollowersInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account followers internal server error response has a 4xx status code
func (o *AccountFollowersInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account followers internal server error response has a 5xx status code
func (o *AccountFollowersInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account followers internal server error response a status code equal to that given
func (o *AccountFollowersInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account followers internal server error response
func (o *AccountFollowersInternalServerError) Code() int {
return 500
}
func (o *AccountFollowersInternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersInternalServerError", 500)
}
func (o *AccountFollowersInternalServerError) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/followers][%d] accountFollowersInternalServerError", 500)
}
func (o *AccountFollowersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,301 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewAccountFollowingParams creates a new AccountFollowingParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountFollowingParams() *AccountFollowingParams {
return &AccountFollowingParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountFollowingParamsWithTimeout creates a new AccountFollowingParams object
// with the ability to set a timeout on a request.
func NewAccountFollowingParamsWithTimeout(timeout time.Duration) *AccountFollowingParams {
return &AccountFollowingParams{
timeout: timeout,
}
}
// NewAccountFollowingParamsWithContext creates a new AccountFollowingParams object
// with the ability to set a context for a request.
func NewAccountFollowingParamsWithContext(ctx context.Context) *AccountFollowingParams {
return &AccountFollowingParams{
Context: ctx,
}
}
// NewAccountFollowingParamsWithHTTPClient creates a new AccountFollowingParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountFollowingParamsWithHTTPClient(client *http.Client) *AccountFollowingParams {
return &AccountFollowingParams{
HTTPClient: client,
}
}
/*
AccountFollowingParams contains all the parameters to send to the API endpoint
for the account following operation.
Typically these are written to a http.Request.
*/
type AccountFollowingParams struct {
/* ID.
Account ID.
*/
ID string
/* Limit.
Number of following accounts to return.
Default: 40
*/
Limit *int64
/* MaxID.
Return only following accounts *OLDER* than the given max ID. The following account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
*/
MaxID *string
/* MinID.
Return only following accounts *IMMEDIATELY NEWER* than the given min ID. The following account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
*/
MinID *string
/* SinceID.
Return only following accounts *NEWER* than the given since ID. The following account with the specified ID will not be included in the response. NOTE: the ID is of the internal follow, NOT any of the returned accounts.
*/
SinceID *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account following params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountFollowingParams) WithDefaults() *AccountFollowingParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account following params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountFollowingParams) SetDefaults() {
var (
limitDefault = int64(40)
)
val := AccountFollowingParams{
Limit: &limitDefault,
}
val.timeout = o.timeout
val.Context = o.Context
val.HTTPClient = o.HTTPClient
*o = val
}
// WithTimeout adds the timeout to the account following params
func (o *AccountFollowingParams) WithTimeout(timeout time.Duration) *AccountFollowingParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account following params
func (o *AccountFollowingParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account following params
func (o *AccountFollowingParams) WithContext(ctx context.Context) *AccountFollowingParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account following params
func (o *AccountFollowingParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account following params
func (o *AccountFollowingParams) WithHTTPClient(client *http.Client) *AccountFollowingParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account following params
func (o *AccountFollowingParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the account following params
func (o *AccountFollowingParams) WithID(id string) *AccountFollowingParams {
o.SetID(id)
return o
}
// SetID adds the id to the account following params
func (o *AccountFollowingParams) SetID(id string) {
o.ID = id
}
// WithLimit adds the limit to the account following params
func (o *AccountFollowingParams) WithLimit(limit *int64) *AccountFollowingParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the account following params
func (o *AccountFollowingParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithMaxID adds the maxID to the account following params
func (o *AccountFollowingParams) WithMaxID(maxID *string) *AccountFollowingParams {
o.SetMaxID(maxID)
return o
}
// SetMaxID adds the maxId to the account following params
func (o *AccountFollowingParams) SetMaxID(maxID *string) {
o.MaxID = maxID
}
// WithMinID adds the minID to the account following params
func (o *AccountFollowingParams) WithMinID(minID *string) *AccountFollowingParams {
o.SetMinID(minID)
return o
}
// SetMinID adds the minId to the account following params
func (o *AccountFollowingParams) SetMinID(minID *string) {
o.MinID = minID
}
// WithSinceID adds the sinceID to the account following params
func (o *AccountFollowingParams) WithSinceID(sinceID *string) *AccountFollowingParams {
o.SetSinceID(sinceID)
return o
}
// SetSinceID adds the sinceId to the account following params
func (o *AccountFollowingParams) SetSinceID(sinceID *string) {
o.SinceID = sinceID
}
// WriteToRequest writes these params to a swagger request
func (o *AccountFollowingParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if o.Limit != nil {
// query param limit
var qrLimit int64
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := swag.FormatInt64(qrLimit)
if qLimit != "" {
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
if o.MaxID != nil {
// query param max_id
var qrMaxID string
if o.MaxID != nil {
qrMaxID = *o.MaxID
}
qMaxID := qrMaxID
if qMaxID != "" {
if err := r.SetQueryParam("max_id", qMaxID); err != nil {
return err
}
}
}
if o.MinID != nil {
// query param min_id
var qrMinID string
if o.MinID != nil {
qrMinID = *o.MinID
}
qMinID := qrMinID
if qMinID != "" {
if err := r.SetQueryParam("min_id", qMinID); err != nil {
return err
}
}
}
if o.SinceID != nil {
// query param since_id
var qrSinceID string
if o.SinceID != nil {
qrSinceID = *o.SinceID
}
qSinceID := qrSinceID
if qSinceID != "" {
if err := r.SetQueryParam("since_id", qSinceID); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,426 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountFollowingReader is a Reader for the AccountFollowing structure.
type AccountFollowingReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountFollowingReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountFollowingOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountFollowingBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountFollowingUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountFollowingNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountFollowingNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountFollowingInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/accounts/{id}/following] accountFollowing", response, response.Code())
}
}
// NewAccountFollowingOK creates a AccountFollowingOK with default headers values
func NewAccountFollowingOK() *AccountFollowingOK {
return &AccountFollowingOK{}
}
/*
AccountFollowingOK describes a response with status code 200, with default header values.
Array of accounts that are followed by this account.
*/
type AccountFollowingOK struct {
/* Links to the next and previous queries.
*/
Link string
Payload []*models.Account
}
// IsSuccess returns true when this account following o k response has a 2xx status code
func (o *AccountFollowingOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account following o k response has a 3xx status code
func (o *AccountFollowingOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account following o k response has a 4xx status code
func (o *AccountFollowingOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account following o k response has a 5xx status code
func (o *AccountFollowingOK) IsServerError() bool {
return false
}
// IsCode returns true when this account following o k response a status code equal to that given
func (o *AccountFollowingOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account following o k response
func (o *AccountFollowingOK) Code() int {
return 200
}
func (o *AccountFollowingOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingOK %s", 200, payload)
}
func (o *AccountFollowingOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingOK %s", 200, payload)
}
func (o *AccountFollowingOK) GetPayload() []*models.Account {
return o.Payload
}
func (o *AccountFollowingOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header Link
hdrLink := response.GetHeader("Link")
if hdrLink != "" {
o.Link = hdrLink
}
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountFollowingBadRequest creates a AccountFollowingBadRequest with default headers values
func NewAccountFollowingBadRequest() *AccountFollowingBadRequest {
return &AccountFollowingBadRequest{}
}
/*
AccountFollowingBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountFollowingBadRequest struct {
}
// IsSuccess returns true when this account following bad request response has a 2xx status code
func (o *AccountFollowingBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account following bad request response has a 3xx status code
func (o *AccountFollowingBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account following bad request response has a 4xx status code
func (o *AccountFollowingBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account following bad request response has a 5xx status code
func (o *AccountFollowingBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account following bad request response a status code equal to that given
func (o *AccountFollowingBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account following bad request response
func (o *AccountFollowingBadRequest) Code() int {
return 400
}
func (o *AccountFollowingBadRequest) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingBadRequest", 400)
}
func (o *AccountFollowingBadRequest) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingBadRequest", 400)
}
func (o *AccountFollowingBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowingUnauthorized creates a AccountFollowingUnauthorized with default headers values
func NewAccountFollowingUnauthorized() *AccountFollowingUnauthorized {
return &AccountFollowingUnauthorized{}
}
/*
AccountFollowingUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountFollowingUnauthorized struct {
}
// IsSuccess returns true when this account following unauthorized response has a 2xx status code
func (o *AccountFollowingUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account following unauthorized response has a 3xx status code
func (o *AccountFollowingUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account following unauthorized response has a 4xx status code
func (o *AccountFollowingUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account following unauthorized response has a 5xx status code
func (o *AccountFollowingUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account following unauthorized response a status code equal to that given
func (o *AccountFollowingUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account following unauthorized response
func (o *AccountFollowingUnauthorized) Code() int {
return 401
}
func (o *AccountFollowingUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingUnauthorized", 401)
}
func (o *AccountFollowingUnauthorized) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingUnauthorized", 401)
}
func (o *AccountFollowingUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowingNotFound creates a AccountFollowingNotFound with default headers values
func NewAccountFollowingNotFound() *AccountFollowingNotFound {
return &AccountFollowingNotFound{}
}
/*
AccountFollowingNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountFollowingNotFound struct {
}
// IsSuccess returns true when this account following not found response has a 2xx status code
func (o *AccountFollowingNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account following not found response has a 3xx status code
func (o *AccountFollowingNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account following not found response has a 4xx status code
func (o *AccountFollowingNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account following not found response has a 5xx status code
func (o *AccountFollowingNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account following not found response a status code equal to that given
func (o *AccountFollowingNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account following not found response
func (o *AccountFollowingNotFound) Code() int {
return 404
}
func (o *AccountFollowingNotFound) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingNotFound", 404)
}
func (o *AccountFollowingNotFound) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingNotFound", 404)
}
func (o *AccountFollowingNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowingNotAcceptable creates a AccountFollowingNotAcceptable with default headers values
func NewAccountFollowingNotAcceptable() *AccountFollowingNotAcceptable {
return &AccountFollowingNotAcceptable{}
}
/*
AccountFollowingNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountFollowingNotAcceptable struct {
}
// IsSuccess returns true when this account following not acceptable response has a 2xx status code
func (o *AccountFollowingNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account following not acceptable response has a 3xx status code
func (o *AccountFollowingNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account following not acceptable response has a 4xx status code
func (o *AccountFollowingNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account following not acceptable response has a 5xx status code
func (o *AccountFollowingNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account following not acceptable response a status code equal to that given
func (o *AccountFollowingNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account following not acceptable response
func (o *AccountFollowingNotAcceptable) Code() int {
return 406
}
func (o *AccountFollowingNotAcceptable) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingNotAcceptable", 406)
}
func (o *AccountFollowingNotAcceptable) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingNotAcceptable", 406)
}
func (o *AccountFollowingNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountFollowingInternalServerError creates a AccountFollowingInternalServerError with default headers values
func NewAccountFollowingInternalServerError() *AccountFollowingInternalServerError {
return &AccountFollowingInternalServerError{}
}
/*
AccountFollowingInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountFollowingInternalServerError struct {
}
// IsSuccess returns true when this account following internal server error response has a 2xx status code
func (o *AccountFollowingInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account following internal server error response has a 3xx status code
func (o *AccountFollowingInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account following internal server error response has a 4xx status code
func (o *AccountFollowingInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account following internal server error response has a 5xx status code
func (o *AccountFollowingInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account following internal server error response a status code equal to that given
func (o *AccountFollowingInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account following internal server error response
func (o *AccountFollowingInternalServerError) Code() int {
return 500
}
func (o *AccountFollowingInternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingInternalServerError", 500)
}
func (o *AccountFollowingInternalServerError) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/following][%d] accountFollowingInternalServerError", 500)
}
func (o *AccountFollowingInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,151 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountGetParams creates a new AccountGetParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountGetParams() *AccountGetParams {
return &AccountGetParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountGetParamsWithTimeout creates a new AccountGetParams object
// with the ability to set a timeout on a request.
func NewAccountGetParamsWithTimeout(timeout time.Duration) *AccountGetParams {
return &AccountGetParams{
timeout: timeout,
}
}
// NewAccountGetParamsWithContext creates a new AccountGetParams object
// with the ability to set a context for a request.
func NewAccountGetParamsWithContext(ctx context.Context) *AccountGetParams {
return &AccountGetParams{
Context: ctx,
}
}
// NewAccountGetParamsWithHTTPClient creates a new AccountGetParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountGetParamsWithHTTPClient(client *http.Client) *AccountGetParams {
return &AccountGetParams{
HTTPClient: client,
}
}
/*
AccountGetParams contains all the parameters to send to the API endpoint
for the account get operation.
Typically these are written to a http.Request.
*/
type AccountGetParams struct {
/* ID.
The id of the requested account.
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountGetParams) WithDefaults() *AccountGetParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountGetParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account get params
func (o *AccountGetParams) WithTimeout(timeout time.Duration) *AccountGetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account get params
func (o *AccountGetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account get params
func (o *AccountGetParams) WithContext(ctx context.Context) *AccountGetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account get params
func (o *AccountGetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account get params
func (o *AccountGetParams) WithHTTPClient(client *http.Client) *AccountGetParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account get params
func (o *AccountGetParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the account get params
func (o *AccountGetParams) WithID(id string) *AccountGetParams {
o.SetID(id)
return o
}
// SetID adds the id to the account get params
func (o *AccountGetParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *AccountGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,416 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountGetReader is a Reader for the AccountGet structure.
type AccountGetReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountGetOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountGetBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountGetUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountGetNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountGetNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountGetInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/accounts/{id}] accountGet", response, response.Code())
}
}
// NewAccountGetOK creates a AccountGetOK with default headers values
func NewAccountGetOK() *AccountGetOK {
return &AccountGetOK{}
}
/*
AccountGetOK describes a response with status code 200, with default header values.
The requested account.
*/
type AccountGetOK struct {
Payload *models.Account
}
// IsSuccess returns true when this account get o k response has a 2xx status code
func (o *AccountGetOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account get o k response has a 3xx status code
func (o *AccountGetOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account get o k response has a 4xx status code
func (o *AccountGetOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account get o k response has a 5xx status code
func (o *AccountGetOK) IsServerError() bool {
return false
}
// IsCode returns true when this account get o k response a status code equal to that given
func (o *AccountGetOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account get o k response
func (o *AccountGetOK) Code() int {
return 200
}
func (o *AccountGetOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetOK %s", 200, payload)
}
func (o *AccountGetOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetOK %s", 200, payload)
}
func (o *AccountGetOK) GetPayload() *models.Account {
return o.Payload
}
func (o *AccountGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Account)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountGetBadRequest creates a AccountGetBadRequest with default headers values
func NewAccountGetBadRequest() *AccountGetBadRequest {
return &AccountGetBadRequest{}
}
/*
AccountGetBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountGetBadRequest struct {
}
// IsSuccess returns true when this account get bad request response has a 2xx status code
func (o *AccountGetBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account get bad request response has a 3xx status code
func (o *AccountGetBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account get bad request response has a 4xx status code
func (o *AccountGetBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account get bad request response has a 5xx status code
func (o *AccountGetBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account get bad request response a status code equal to that given
func (o *AccountGetBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account get bad request response
func (o *AccountGetBadRequest) Code() int {
return 400
}
func (o *AccountGetBadRequest) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetBadRequest", 400)
}
func (o *AccountGetBadRequest) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetBadRequest", 400)
}
func (o *AccountGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountGetUnauthorized creates a AccountGetUnauthorized with default headers values
func NewAccountGetUnauthorized() *AccountGetUnauthorized {
return &AccountGetUnauthorized{}
}
/*
AccountGetUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountGetUnauthorized struct {
}
// IsSuccess returns true when this account get unauthorized response has a 2xx status code
func (o *AccountGetUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account get unauthorized response has a 3xx status code
func (o *AccountGetUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account get unauthorized response has a 4xx status code
func (o *AccountGetUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account get unauthorized response has a 5xx status code
func (o *AccountGetUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account get unauthorized response a status code equal to that given
func (o *AccountGetUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account get unauthorized response
func (o *AccountGetUnauthorized) Code() int {
return 401
}
func (o *AccountGetUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetUnauthorized", 401)
}
func (o *AccountGetUnauthorized) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetUnauthorized", 401)
}
func (o *AccountGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountGetNotFound creates a AccountGetNotFound with default headers values
func NewAccountGetNotFound() *AccountGetNotFound {
return &AccountGetNotFound{}
}
/*
AccountGetNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountGetNotFound struct {
}
// IsSuccess returns true when this account get not found response has a 2xx status code
func (o *AccountGetNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account get not found response has a 3xx status code
func (o *AccountGetNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account get not found response has a 4xx status code
func (o *AccountGetNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account get not found response has a 5xx status code
func (o *AccountGetNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account get not found response a status code equal to that given
func (o *AccountGetNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account get not found response
func (o *AccountGetNotFound) Code() int {
return 404
}
func (o *AccountGetNotFound) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetNotFound", 404)
}
func (o *AccountGetNotFound) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetNotFound", 404)
}
func (o *AccountGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountGetNotAcceptable creates a AccountGetNotAcceptable with default headers values
func NewAccountGetNotAcceptable() *AccountGetNotAcceptable {
return &AccountGetNotAcceptable{}
}
/*
AccountGetNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountGetNotAcceptable struct {
}
// IsSuccess returns true when this account get not acceptable response has a 2xx status code
func (o *AccountGetNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account get not acceptable response has a 3xx status code
func (o *AccountGetNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account get not acceptable response has a 4xx status code
func (o *AccountGetNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account get not acceptable response has a 5xx status code
func (o *AccountGetNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account get not acceptable response a status code equal to that given
func (o *AccountGetNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account get not acceptable response
func (o *AccountGetNotAcceptable) Code() int {
return 406
}
func (o *AccountGetNotAcceptable) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetNotAcceptable", 406)
}
func (o *AccountGetNotAcceptable) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetNotAcceptable", 406)
}
func (o *AccountGetNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountGetInternalServerError creates a AccountGetInternalServerError with default headers values
func NewAccountGetInternalServerError() *AccountGetInternalServerError {
return &AccountGetInternalServerError{}
}
/*
AccountGetInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountGetInternalServerError struct {
}
// IsSuccess returns true when this account get internal server error response has a 2xx status code
func (o *AccountGetInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account get internal server error response has a 3xx status code
func (o *AccountGetInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account get internal server error response has a 4xx status code
func (o *AccountGetInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account get internal server error response has a 5xx status code
func (o *AccountGetInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account get internal server error response a status code equal to that given
func (o *AccountGetInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account get internal server error response
func (o *AccountGetInternalServerError) Code() int {
return 500
}
func (o *AccountGetInternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetInternalServerError", 500)
}
func (o *AccountGetInternalServerError) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}][%d] accountGetInternalServerError", 500)
}
func (o *AccountGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,128 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountHeaderDeleteParams creates a new AccountHeaderDeleteParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountHeaderDeleteParams() *AccountHeaderDeleteParams {
return &AccountHeaderDeleteParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountHeaderDeleteParamsWithTimeout creates a new AccountHeaderDeleteParams object
// with the ability to set a timeout on a request.
func NewAccountHeaderDeleteParamsWithTimeout(timeout time.Duration) *AccountHeaderDeleteParams {
return &AccountHeaderDeleteParams{
timeout: timeout,
}
}
// NewAccountHeaderDeleteParamsWithContext creates a new AccountHeaderDeleteParams object
// with the ability to set a context for a request.
func NewAccountHeaderDeleteParamsWithContext(ctx context.Context) *AccountHeaderDeleteParams {
return &AccountHeaderDeleteParams{
Context: ctx,
}
}
// NewAccountHeaderDeleteParamsWithHTTPClient creates a new AccountHeaderDeleteParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountHeaderDeleteParamsWithHTTPClient(client *http.Client) *AccountHeaderDeleteParams {
return &AccountHeaderDeleteParams{
HTTPClient: client,
}
}
/*
AccountHeaderDeleteParams contains all the parameters to send to the API endpoint
for the account header delete operation.
Typically these are written to a http.Request.
*/
type AccountHeaderDeleteParams struct {
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account header delete params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountHeaderDeleteParams) WithDefaults() *AccountHeaderDeleteParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account header delete params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountHeaderDeleteParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account header delete params
func (o *AccountHeaderDeleteParams) WithTimeout(timeout time.Duration) *AccountHeaderDeleteParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account header delete params
func (o *AccountHeaderDeleteParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account header delete params
func (o *AccountHeaderDeleteParams) WithContext(ctx context.Context) *AccountHeaderDeleteParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account header delete params
func (o *AccountHeaderDeleteParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account header delete params
func (o *AccountHeaderDeleteParams) WithHTTPClient(client *http.Client) *AccountHeaderDeleteParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account header delete params
func (o *AccountHeaderDeleteParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WriteToRequest writes these params to a swagger request
func (o *AccountHeaderDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,416 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountHeaderDeleteReader is a Reader for the AccountHeaderDelete structure.
type AccountHeaderDeleteReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountHeaderDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountHeaderDeleteOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountHeaderDeleteBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountHeaderDeleteUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewAccountHeaderDeleteForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountHeaderDeleteNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountHeaderDeleteInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[DELETE /api/v1/profile/header] accountHeaderDelete", response, response.Code())
}
}
// NewAccountHeaderDeleteOK creates a AccountHeaderDeleteOK with default headers values
func NewAccountHeaderDeleteOK() *AccountHeaderDeleteOK {
return &AccountHeaderDeleteOK{}
}
/*
AccountHeaderDeleteOK describes a response with status code 200, with default header values.
The updated account, including profile source information.
*/
type AccountHeaderDeleteOK struct {
Payload *models.Account
}
// IsSuccess returns true when this account header delete o k response has a 2xx status code
func (o *AccountHeaderDeleteOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account header delete o k response has a 3xx status code
func (o *AccountHeaderDeleteOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account header delete o k response has a 4xx status code
func (o *AccountHeaderDeleteOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account header delete o k response has a 5xx status code
func (o *AccountHeaderDeleteOK) IsServerError() bool {
return false
}
// IsCode returns true when this account header delete o k response a status code equal to that given
func (o *AccountHeaderDeleteOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account header delete o k response
func (o *AccountHeaderDeleteOK) Code() int {
return 200
}
func (o *AccountHeaderDeleteOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteOK %s", 200, payload)
}
func (o *AccountHeaderDeleteOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteOK %s", 200, payload)
}
func (o *AccountHeaderDeleteOK) GetPayload() *models.Account {
return o.Payload
}
func (o *AccountHeaderDeleteOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Account)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountHeaderDeleteBadRequest creates a AccountHeaderDeleteBadRequest with default headers values
func NewAccountHeaderDeleteBadRequest() *AccountHeaderDeleteBadRequest {
return &AccountHeaderDeleteBadRequest{}
}
/*
AccountHeaderDeleteBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountHeaderDeleteBadRequest struct {
}
// IsSuccess returns true when this account header delete bad request response has a 2xx status code
func (o *AccountHeaderDeleteBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account header delete bad request response has a 3xx status code
func (o *AccountHeaderDeleteBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account header delete bad request response has a 4xx status code
func (o *AccountHeaderDeleteBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account header delete bad request response has a 5xx status code
func (o *AccountHeaderDeleteBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account header delete bad request response a status code equal to that given
func (o *AccountHeaderDeleteBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account header delete bad request response
func (o *AccountHeaderDeleteBadRequest) Code() int {
return 400
}
func (o *AccountHeaderDeleteBadRequest) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteBadRequest", 400)
}
func (o *AccountHeaderDeleteBadRequest) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteBadRequest", 400)
}
func (o *AccountHeaderDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountHeaderDeleteUnauthorized creates a AccountHeaderDeleteUnauthorized with default headers values
func NewAccountHeaderDeleteUnauthorized() *AccountHeaderDeleteUnauthorized {
return &AccountHeaderDeleteUnauthorized{}
}
/*
AccountHeaderDeleteUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountHeaderDeleteUnauthorized struct {
}
// IsSuccess returns true when this account header delete unauthorized response has a 2xx status code
func (o *AccountHeaderDeleteUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account header delete unauthorized response has a 3xx status code
func (o *AccountHeaderDeleteUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account header delete unauthorized response has a 4xx status code
func (o *AccountHeaderDeleteUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account header delete unauthorized response has a 5xx status code
func (o *AccountHeaderDeleteUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account header delete unauthorized response a status code equal to that given
func (o *AccountHeaderDeleteUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account header delete unauthorized response
func (o *AccountHeaderDeleteUnauthorized) Code() int {
return 401
}
func (o *AccountHeaderDeleteUnauthorized) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteUnauthorized", 401)
}
func (o *AccountHeaderDeleteUnauthorized) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteUnauthorized", 401)
}
func (o *AccountHeaderDeleteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountHeaderDeleteForbidden creates a AccountHeaderDeleteForbidden with default headers values
func NewAccountHeaderDeleteForbidden() *AccountHeaderDeleteForbidden {
return &AccountHeaderDeleteForbidden{}
}
/*
AccountHeaderDeleteForbidden describes a response with status code 403, with default header values.
forbidden
*/
type AccountHeaderDeleteForbidden struct {
}
// IsSuccess returns true when this account header delete forbidden response has a 2xx status code
func (o *AccountHeaderDeleteForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account header delete forbidden response has a 3xx status code
func (o *AccountHeaderDeleteForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this account header delete forbidden response has a 4xx status code
func (o *AccountHeaderDeleteForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this account header delete forbidden response has a 5xx status code
func (o *AccountHeaderDeleteForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this account header delete forbidden response a status code equal to that given
func (o *AccountHeaderDeleteForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the account header delete forbidden response
func (o *AccountHeaderDeleteForbidden) Code() int {
return 403
}
func (o *AccountHeaderDeleteForbidden) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteForbidden", 403)
}
func (o *AccountHeaderDeleteForbidden) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteForbidden", 403)
}
func (o *AccountHeaderDeleteForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountHeaderDeleteNotAcceptable creates a AccountHeaderDeleteNotAcceptable with default headers values
func NewAccountHeaderDeleteNotAcceptable() *AccountHeaderDeleteNotAcceptable {
return &AccountHeaderDeleteNotAcceptable{}
}
/*
AccountHeaderDeleteNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountHeaderDeleteNotAcceptable struct {
}
// IsSuccess returns true when this account header delete not acceptable response has a 2xx status code
func (o *AccountHeaderDeleteNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account header delete not acceptable response has a 3xx status code
func (o *AccountHeaderDeleteNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account header delete not acceptable response has a 4xx status code
func (o *AccountHeaderDeleteNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account header delete not acceptable response has a 5xx status code
func (o *AccountHeaderDeleteNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account header delete not acceptable response a status code equal to that given
func (o *AccountHeaderDeleteNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account header delete not acceptable response
func (o *AccountHeaderDeleteNotAcceptable) Code() int {
return 406
}
func (o *AccountHeaderDeleteNotAcceptable) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteNotAcceptable", 406)
}
func (o *AccountHeaderDeleteNotAcceptable) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteNotAcceptable", 406)
}
func (o *AccountHeaderDeleteNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountHeaderDeleteInternalServerError creates a AccountHeaderDeleteInternalServerError with default headers values
func NewAccountHeaderDeleteInternalServerError() *AccountHeaderDeleteInternalServerError {
return &AccountHeaderDeleteInternalServerError{}
}
/*
AccountHeaderDeleteInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountHeaderDeleteInternalServerError struct {
}
// IsSuccess returns true when this account header delete internal server error response has a 2xx status code
func (o *AccountHeaderDeleteInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account header delete internal server error response has a 3xx status code
func (o *AccountHeaderDeleteInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account header delete internal server error response has a 4xx status code
func (o *AccountHeaderDeleteInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account header delete internal server error response has a 5xx status code
func (o *AccountHeaderDeleteInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account header delete internal server error response a status code equal to that given
func (o *AccountHeaderDeleteInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account header delete internal server error response
func (o *AccountHeaderDeleteInternalServerError) Code() int {
return 500
}
func (o *AccountHeaderDeleteInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteInternalServerError", 500)
}
func (o *AccountHeaderDeleteInternalServerError) String() string {
return fmt.Sprintf("[DELETE /api/v1/profile/header][%d] accountHeaderDeleteInternalServerError", 500)
}
func (o *AccountHeaderDeleteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,151 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountListsParams creates a new AccountListsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountListsParams() *AccountListsParams {
return &AccountListsParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountListsParamsWithTimeout creates a new AccountListsParams object
// with the ability to set a timeout on a request.
func NewAccountListsParamsWithTimeout(timeout time.Duration) *AccountListsParams {
return &AccountListsParams{
timeout: timeout,
}
}
// NewAccountListsParamsWithContext creates a new AccountListsParams object
// with the ability to set a context for a request.
func NewAccountListsParamsWithContext(ctx context.Context) *AccountListsParams {
return &AccountListsParams{
Context: ctx,
}
}
// NewAccountListsParamsWithHTTPClient creates a new AccountListsParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountListsParamsWithHTTPClient(client *http.Client) *AccountListsParams {
return &AccountListsParams{
HTTPClient: client,
}
}
/*
AccountListsParams contains all the parameters to send to the API endpoint
for the account lists operation.
Typically these are written to a http.Request.
*/
type AccountListsParams struct {
/* ID.
Account ID.
*/
ID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account lists params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountListsParams) WithDefaults() *AccountListsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account lists params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountListsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account lists params
func (o *AccountListsParams) WithTimeout(timeout time.Duration) *AccountListsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account lists params
func (o *AccountListsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account lists params
func (o *AccountListsParams) WithContext(ctx context.Context) *AccountListsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account lists params
func (o *AccountListsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account lists params
func (o *AccountListsParams) WithHTTPClient(client *http.Client) *AccountListsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account lists params
func (o *AccountListsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithID adds the id to the account lists params
func (o *AccountListsParams) WithID(id string) *AccountListsParams {
o.SetID(id)
return o
}
// SetID adds the id to the account lists params
func (o *AccountListsParams) SetID(id string) {
o.ID = id
}
// WriteToRequest writes these params to a swagger request
func (o *AccountListsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param id
if err := r.SetPathParam("id", o.ID); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,414 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountListsReader is a Reader for the AccountLists structure.
type AccountListsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountListsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountListsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountListsBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountListsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountListsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountListsNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountListsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/accounts/{id}/lists] accountLists", response, response.Code())
}
}
// NewAccountListsOK creates a AccountListsOK with default headers values
func NewAccountListsOK() *AccountListsOK {
return &AccountListsOK{}
}
/*
AccountListsOK describes a response with status code 200, with default header values.
Array of all lists containing this account.
*/
type AccountListsOK struct {
Payload []*models.List
}
// IsSuccess returns true when this account lists o k response has a 2xx status code
func (o *AccountListsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account lists o k response has a 3xx status code
func (o *AccountListsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lists o k response has a 4xx status code
func (o *AccountListsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account lists o k response has a 5xx status code
func (o *AccountListsOK) IsServerError() bool {
return false
}
// IsCode returns true when this account lists o k response a status code equal to that given
func (o *AccountListsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account lists o k response
func (o *AccountListsOK) Code() int {
return 200
}
func (o *AccountListsOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsOK %s", 200, payload)
}
func (o *AccountListsOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsOK %s", 200, payload)
}
func (o *AccountListsOK) GetPayload() []*models.List {
return o.Payload
}
func (o *AccountListsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountListsBadRequest creates a AccountListsBadRequest with default headers values
func NewAccountListsBadRequest() *AccountListsBadRequest {
return &AccountListsBadRequest{}
}
/*
AccountListsBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountListsBadRequest struct {
}
// IsSuccess returns true when this account lists bad request response has a 2xx status code
func (o *AccountListsBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lists bad request response has a 3xx status code
func (o *AccountListsBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lists bad request response has a 4xx status code
func (o *AccountListsBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account lists bad request response has a 5xx status code
func (o *AccountListsBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account lists bad request response a status code equal to that given
func (o *AccountListsBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account lists bad request response
func (o *AccountListsBadRequest) Code() int {
return 400
}
func (o *AccountListsBadRequest) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsBadRequest", 400)
}
func (o *AccountListsBadRequest) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsBadRequest", 400)
}
func (o *AccountListsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountListsUnauthorized creates a AccountListsUnauthorized with default headers values
func NewAccountListsUnauthorized() *AccountListsUnauthorized {
return &AccountListsUnauthorized{}
}
/*
AccountListsUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountListsUnauthorized struct {
}
// IsSuccess returns true when this account lists unauthorized response has a 2xx status code
func (o *AccountListsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lists unauthorized response has a 3xx status code
func (o *AccountListsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lists unauthorized response has a 4xx status code
func (o *AccountListsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account lists unauthorized response has a 5xx status code
func (o *AccountListsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account lists unauthorized response a status code equal to that given
func (o *AccountListsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account lists unauthorized response
func (o *AccountListsUnauthorized) Code() int {
return 401
}
func (o *AccountListsUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsUnauthorized", 401)
}
func (o *AccountListsUnauthorized) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsUnauthorized", 401)
}
func (o *AccountListsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountListsNotFound creates a AccountListsNotFound with default headers values
func NewAccountListsNotFound() *AccountListsNotFound {
return &AccountListsNotFound{}
}
/*
AccountListsNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountListsNotFound struct {
}
// IsSuccess returns true when this account lists not found response has a 2xx status code
func (o *AccountListsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lists not found response has a 3xx status code
func (o *AccountListsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lists not found response has a 4xx status code
func (o *AccountListsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account lists not found response has a 5xx status code
func (o *AccountListsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account lists not found response a status code equal to that given
func (o *AccountListsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account lists not found response
func (o *AccountListsNotFound) Code() int {
return 404
}
func (o *AccountListsNotFound) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsNotFound", 404)
}
func (o *AccountListsNotFound) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsNotFound", 404)
}
func (o *AccountListsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountListsNotAcceptable creates a AccountListsNotAcceptable with default headers values
func NewAccountListsNotAcceptable() *AccountListsNotAcceptable {
return &AccountListsNotAcceptable{}
}
/*
AccountListsNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountListsNotAcceptable struct {
}
// IsSuccess returns true when this account lists not acceptable response has a 2xx status code
func (o *AccountListsNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lists not acceptable response has a 3xx status code
func (o *AccountListsNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lists not acceptable response has a 4xx status code
func (o *AccountListsNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account lists not acceptable response has a 5xx status code
func (o *AccountListsNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account lists not acceptable response a status code equal to that given
func (o *AccountListsNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account lists not acceptable response
func (o *AccountListsNotAcceptable) Code() int {
return 406
}
func (o *AccountListsNotAcceptable) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsNotAcceptable", 406)
}
func (o *AccountListsNotAcceptable) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsNotAcceptable", 406)
}
func (o *AccountListsNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountListsInternalServerError creates a AccountListsInternalServerError with default headers values
func NewAccountListsInternalServerError() *AccountListsInternalServerError {
return &AccountListsInternalServerError{}
}
/*
AccountListsInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountListsInternalServerError struct {
}
// IsSuccess returns true when this account lists internal server error response has a 2xx status code
func (o *AccountListsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lists internal server error response has a 3xx status code
func (o *AccountListsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lists internal server error response has a 4xx status code
func (o *AccountListsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account lists internal server error response has a 5xx status code
func (o *AccountListsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account lists internal server error response a status code equal to that given
func (o *AccountListsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account lists internal server error response
func (o *AccountListsInternalServerError) Code() int {
return 500
}
func (o *AccountListsInternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsInternalServerError", 500)
}
func (o *AccountListsInternalServerError) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/{id}/lists][%d] accountListsInternalServerError", 500)
}
func (o *AccountListsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,156 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountLookupGetParams creates a new AccountLookupGetParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountLookupGetParams() *AccountLookupGetParams {
return &AccountLookupGetParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountLookupGetParamsWithTimeout creates a new AccountLookupGetParams object
// with the ability to set a timeout on a request.
func NewAccountLookupGetParamsWithTimeout(timeout time.Duration) *AccountLookupGetParams {
return &AccountLookupGetParams{
timeout: timeout,
}
}
// NewAccountLookupGetParamsWithContext creates a new AccountLookupGetParams object
// with the ability to set a context for a request.
func NewAccountLookupGetParamsWithContext(ctx context.Context) *AccountLookupGetParams {
return &AccountLookupGetParams{
Context: ctx,
}
}
// NewAccountLookupGetParamsWithHTTPClient creates a new AccountLookupGetParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountLookupGetParamsWithHTTPClient(client *http.Client) *AccountLookupGetParams {
return &AccountLookupGetParams{
HTTPClient: client,
}
}
/*
AccountLookupGetParams contains all the parameters to send to the API endpoint
for the account lookup get operation.
Typically these are written to a http.Request.
*/
type AccountLookupGetParams struct {
/* Acct.
The username or Webfinger address to lookup.
*/
Acct string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account lookup get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountLookupGetParams) WithDefaults() *AccountLookupGetParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account lookup get params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountLookupGetParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account lookup get params
func (o *AccountLookupGetParams) WithTimeout(timeout time.Duration) *AccountLookupGetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account lookup get params
func (o *AccountLookupGetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account lookup get params
func (o *AccountLookupGetParams) WithContext(ctx context.Context) *AccountLookupGetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account lookup get params
func (o *AccountLookupGetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account lookup get params
func (o *AccountLookupGetParams) WithHTTPClient(client *http.Client) *AccountLookupGetParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account lookup get params
func (o *AccountLookupGetParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAcct adds the acct to the account lookup get params
func (o *AccountLookupGetParams) WithAcct(acct string) *AccountLookupGetParams {
o.SetAcct(acct)
return o
}
// SetAcct adds the acct to the account lookup get params
func (o *AccountLookupGetParams) SetAcct(acct string) {
o.Acct = acct
}
// WriteToRequest writes these params to a swagger request
func (o *AccountLookupGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// query param acct
qrAcct := o.Acct
qAcct := qrAcct
if qAcct != "" {
if err := r.SetQueryParam("acct", qAcct); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,416 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"git.coopcloud.tech/decentral1se/gtslib/models"
)
// AccountLookupGetReader is a Reader for the AccountLookupGet structure.
type AccountLookupGetReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountLookupGetReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewAccountLookupGetOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountLookupGetBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountLookupGetUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountLookupGetNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountLookupGetNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountLookupGetInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[GET /api/v1/accounts/lookup] accountLookupGet", response, response.Code())
}
}
// NewAccountLookupGetOK creates a AccountLookupGetOK with default headers values
func NewAccountLookupGetOK() *AccountLookupGetOK {
return &AccountLookupGetOK{}
}
/*
AccountLookupGetOK describes a response with status code 200, with default header values.
Result of the lookup.
*/
type AccountLookupGetOK struct {
Payload *models.Account
}
// IsSuccess returns true when this account lookup get o k response has a 2xx status code
func (o *AccountLookupGetOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account lookup get o k response has a 3xx status code
func (o *AccountLookupGetOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lookup get o k response has a 4xx status code
func (o *AccountLookupGetOK) IsClientError() bool {
return false
}
// IsServerError returns true when this account lookup get o k response has a 5xx status code
func (o *AccountLookupGetOK) IsServerError() bool {
return false
}
// IsCode returns true when this account lookup get o k response a status code equal to that given
func (o *AccountLookupGetOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the account lookup get o k response
func (o *AccountLookupGetOK) Code() int {
return 200
}
func (o *AccountLookupGetOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetOK %s", 200, payload)
}
func (o *AccountLookupGetOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetOK %s", 200, payload)
}
func (o *AccountLookupGetOK) GetPayload() *models.Account {
return o.Payload
}
func (o *AccountLookupGetOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(models.Account)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewAccountLookupGetBadRequest creates a AccountLookupGetBadRequest with default headers values
func NewAccountLookupGetBadRequest() *AccountLookupGetBadRequest {
return &AccountLookupGetBadRequest{}
}
/*
AccountLookupGetBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountLookupGetBadRequest struct {
}
// IsSuccess returns true when this account lookup get bad request response has a 2xx status code
func (o *AccountLookupGetBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lookup get bad request response has a 3xx status code
func (o *AccountLookupGetBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lookup get bad request response has a 4xx status code
func (o *AccountLookupGetBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account lookup get bad request response has a 5xx status code
func (o *AccountLookupGetBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account lookup get bad request response a status code equal to that given
func (o *AccountLookupGetBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account lookup get bad request response
func (o *AccountLookupGetBadRequest) Code() int {
return 400
}
func (o *AccountLookupGetBadRequest) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetBadRequest", 400)
}
func (o *AccountLookupGetBadRequest) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetBadRequest", 400)
}
func (o *AccountLookupGetBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountLookupGetUnauthorized creates a AccountLookupGetUnauthorized with default headers values
func NewAccountLookupGetUnauthorized() *AccountLookupGetUnauthorized {
return &AccountLookupGetUnauthorized{}
}
/*
AccountLookupGetUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountLookupGetUnauthorized struct {
}
// IsSuccess returns true when this account lookup get unauthorized response has a 2xx status code
func (o *AccountLookupGetUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lookup get unauthorized response has a 3xx status code
func (o *AccountLookupGetUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lookup get unauthorized response has a 4xx status code
func (o *AccountLookupGetUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account lookup get unauthorized response has a 5xx status code
func (o *AccountLookupGetUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account lookup get unauthorized response a status code equal to that given
func (o *AccountLookupGetUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account lookup get unauthorized response
func (o *AccountLookupGetUnauthorized) Code() int {
return 401
}
func (o *AccountLookupGetUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetUnauthorized", 401)
}
func (o *AccountLookupGetUnauthorized) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetUnauthorized", 401)
}
func (o *AccountLookupGetUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountLookupGetNotFound creates a AccountLookupGetNotFound with default headers values
func NewAccountLookupGetNotFound() *AccountLookupGetNotFound {
return &AccountLookupGetNotFound{}
}
/*
AccountLookupGetNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountLookupGetNotFound struct {
}
// IsSuccess returns true when this account lookup get not found response has a 2xx status code
func (o *AccountLookupGetNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lookup get not found response has a 3xx status code
func (o *AccountLookupGetNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lookup get not found response has a 4xx status code
func (o *AccountLookupGetNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account lookup get not found response has a 5xx status code
func (o *AccountLookupGetNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account lookup get not found response a status code equal to that given
func (o *AccountLookupGetNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account lookup get not found response
func (o *AccountLookupGetNotFound) Code() int {
return 404
}
func (o *AccountLookupGetNotFound) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetNotFound", 404)
}
func (o *AccountLookupGetNotFound) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetNotFound", 404)
}
func (o *AccountLookupGetNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountLookupGetNotAcceptable creates a AccountLookupGetNotAcceptable with default headers values
func NewAccountLookupGetNotAcceptable() *AccountLookupGetNotAcceptable {
return &AccountLookupGetNotAcceptable{}
}
/*
AccountLookupGetNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountLookupGetNotAcceptable struct {
}
// IsSuccess returns true when this account lookup get not acceptable response has a 2xx status code
func (o *AccountLookupGetNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lookup get not acceptable response has a 3xx status code
func (o *AccountLookupGetNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lookup get not acceptable response has a 4xx status code
func (o *AccountLookupGetNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account lookup get not acceptable response has a 5xx status code
func (o *AccountLookupGetNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account lookup get not acceptable response a status code equal to that given
func (o *AccountLookupGetNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account lookup get not acceptable response
func (o *AccountLookupGetNotAcceptable) Code() int {
return 406
}
func (o *AccountLookupGetNotAcceptable) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetNotAcceptable", 406)
}
func (o *AccountLookupGetNotAcceptable) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetNotAcceptable", 406)
}
func (o *AccountLookupGetNotAcceptable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountLookupGetInternalServerError creates a AccountLookupGetInternalServerError with default headers values
func NewAccountLookupGetInternalServerError() *AccountLookupGetInternalServerError {
return &AccountLookupGetInternalServerError{}
}
/*
AccountLookupGetInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AccountLookupGetInternalServerError struct {
}
// IsSuccess returns true when this account lookup get internal server error response has a 2xx status code
func (o *AccountLookupGetInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account lookup get internal server error response has a 3xx status code
func (o *AccountLookupGetInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this account lookup get internal server error response has a 4xx status code
func (o *AccountLookupGetInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this account lookup get internal server error response has a 5xx status code
func (o *AccountLookupGetInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this account lookup get internal server error response a status code equal to that given
func (o *AccountLookupGetInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the account lookup get internal server error response
func (o *AccountLookupGetInternalServerError) Code() int {
return 500
}
func (o *AccountLookupGetInternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetInternalServerError", 500)
}
func (o *AccountLookupGetInternalServerError) String() string {
return fmt.Sprintf("[GET /api/v1/accounts/lookup][%d] accountLookupGetInternalServerError", 500)
}
func (o *AccountLookupGetInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}

View File

@ -0,0 +1,181 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAccountMoveParams creates a new AccountMoveParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAccountMoveParams() *AccountMoveParams {
return &AccountMoveParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountMoveParamsWithTimeout creates a new AccountMoveParams object
// with the ability to set a timeout on a request.
func NewAccountMoveParamsWithTimeout(timeout time.Duration) *AccountMoveParams {
return &AccountMoveParams{
timeout: timeout,
}
}
// NewAccountMoveParamsWithContext creates a new AccountMoveParams object
// with the ability to set a context for a request.
func NewAccountMoveParamsWithContext(ctx context.Context) *AccountMoveParams {
return &AccountMoveParams{
Context: ctx,
}
}
// NewAccountMoveParamsWithHTTPClient creates a new AccountMoveParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountMoveParamsWithHTTPClient(client *http.Client) *AccountMoveParams {
return &AccountMoveParams{
HTTPClient: client,
}
}
/*
AccountMoveParams contains all the parameters to send to the API endpoint
for the account move operation.
Typically these are written to a http.Request.
*/
type AccountMoveParams struct {
/* MovedToURI.
ActivityPub URI/ID of the target account. Eg., `https://example.org/users/some_account`. The target account must be alsoKnownAs the requesting account in order for the move to be successful.
*/
MovedToURI string
/* Password.
Password of the account user, for confirmation.
*/
Password string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account move params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountMoveParams) WithDefaults() *AccountMoveParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account move params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountMoveParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account move params
func (o *AccountMoveParams) WithTimeout(timeout time.Duration) *AccountMoveParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account move params
func (o *AccountMoveParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account move params
func (o *AccountMoveParams) WithContext(ctx context.Context) *AccountMoveParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account move params
func (o *AccountMoveParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account move params
func (o *AccountMoveParams) WithHTTPClient(client *http.Client) *AccountMoveParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account move params
func (o *AccountMoveParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithMovedToURI adds the movedToURI to the account move params
func (o *AccountMoveParams) WithMovedToURI(movedToURI string) *AccountMoveParams {
o.SetMovedToURI(movedToURI)
return o
}
// SetMovedToURI adds the movedToUri to the account move params
func (o *AccountMoveParams) SetMovedToURI(movedToURI string) {
o.MovedToURI = movedToURI
}
// WithPassword adds the password to the account move params
func (o *AccountMoveParams) WithPassword(password string) *AccountMoveParams {
o.SetPassword(password)
return o
}
// SetPassword adds the password to the account move params
func (o *AccountMoveParams) SetPassword(password string) {
o.Password = password
}
// WriteToRequest writes these params to a swagger request
func (o *AccountMoveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// form param moved_to_uri
frMovedToURI := o.MovedToURI
fMovedToURI := frMovedToURI
if fMovedToURI != "" {
if err := r.SetFormParam("moved_to_uri", fMovedToURI); err != nil {
return err
}
}
// form param password
frPassword := o.Password
fPassword := frPassword
if fPassword != "" {
if err := r.SetFormParam("password", fPassword); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,460 @@
// Code generated by go-swagger; DO NOT EDIT.
package accounts
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
)
// AccountMoveReader is a Reader for the AccountMove structure.
type AccountMoveReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AccountMoveReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 202:
result := NewAccountMoveAccepted()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewAccountMoveBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 401:
result := NewAccountMoveUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewAccountMoveNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 406:
result := NewAccountMoveNotAcceptable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewAccountMoveUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAccountMoveInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /api/v1/accounts/move] accountMove", response, response.Code())
}
}
// NewAccountMoveAccepted creates a AccountMoveAccepted with default headers values
func NewAccountMoveAccepted() *AccountMoveAccepted {
return &AccountMoveAccepted{}
}
/*
AccountMoveAccepted describes a response with status code 202, with default header values.
The account move has been accepted and the account will be moved.
*/
type AccountMoveAccepted struct {
}
// IsSuccess returns true when this account move accepted response has a 2xx status code
func (o *AccountMoveAccepted) IsSuccess() bool {
return true
}
// IsRedirect returns true when this account move accepted response has a 3xx status code
func (o *AccountMoveAccepted) IsRedirect() bool {
return false
}
// IsClientError returns true when this account move accepted response has a 4xx status code
func (o *AccountMoveAccepted) IsClientError() bool {
return false
}
// IsServerError returns true when this account move accepted response has a 5xx status code
func (o *AccountMoveAccepted) IsServerError() bool {
return false
}
// IsCode returns true when this account move accepted response a status code equal to that given
func (o *AccountMoveAccepted) IsCode(code int) bool {
return code == 202
}
// Code gets the status code for the account move accepted response
func (o *AccountMoveAccepted) Code() int {
return 202
}
func (o *AccountMoveAccepted) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveAccepted", 202)
}
func (o *AccountMoveAccepted) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveAccepted", 202)
}
func (o *AccountMoveAccepted) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountMoveBadRequest creates a AccountMoveBadRequest with default headers values
func NewAccountMoveBadRequest() *AccountMoveBadRequest {
return &AccountMoveBadRequest{}
}
/*
AccountMoveBadRequest describes a response with status code 400, with default header values.
bad request
*/
type AccountMoveBadRequest struct {
}
// IsSuccess returns true when this account move bad request response has a 2xx status code
func (o *AccountMoveBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account move bad request response has a 3xx status code
func (o *AccountMoveBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this account move bad request response has a 4xx status code
func (o *AccountMoveBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this account move bad request response has a 5xx status code
func (o *AccountMoveBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this account move bad request response a status code equal to that given
func (o *AccountMoveBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the account move bad request response
func (o *AccountMoveBadRequest) Code() int {
return 400
}
func (o *AccountMoveBadRequest) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveBadRequest", 400)
}
func (o *AccountMoveBadRequest) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveBadRequest", 400)
}
func (o *AccountMoveBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountMoveUnauthorized creates a AccountMoveUnauthorized with default headers values
func NewAccountMoveUnauthorized() *AccountMoveUnauthorized {
return &AccountMoveUnauthorized{}
}
/*
AccountMoveUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AccountMoveUnauthorized struct {
}
// IsSuccess returns true when this account move unauthorized response has a 2xx status code
func (o *AccountMoveUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account move unauthorized response has a 3xx status code
func (o *AccountMoveUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this account move unauthorized response has a 4xx status code
func (o *AccountMoveUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this account move unauthorized response has a 5xx status code
func (o *AccountMoveUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this account move unauthorized response a status code equal to that given
func (o *AccountMoveUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the account move unauthorized response
func (o *AccountMoveUnauthorized) Code() int {
return 401
}
func (o *AccountMoveUnauthorized) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveUnauthorized", 401)
}
func (o *AccountMoveUnauthorized) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveUnauthorized", 401)
}
func (o *AccountMoveUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountMoveNotFound creates a AccountMoveNotFound with default headers values
func NewAccountMoveNotFound() *AccountMoveNotFound {
return &AccountMoveNotFound{}
}
/*
AccountMoveNotFound describes a response with status code 404, with default header values.
not found
*/
type AccountMoveNotFound struct {
}
// IsSuccess returns true when this account move not found response has a 2xx status code
func (o *AccountMoveNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account move not found response has a 3xx status code
func (o *AccountMoveNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this account move not found response has a 4xx status code
func (o *AccountMoveNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this account move not found response has a 5xx status code
func (o *AccountMoveNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this account move not found response a status code equal to that given
func (o *AccountMoveNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the account move not found response
func (o *AccountMoveNotFound) Code() int {
return 404
}
func (o *AccountMoveNotFound) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveNotFound", 404)
}
func (o *AccountMoveNotFound) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveNotFound", 404)
}
func (o *AccountMoveNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAccountMoveNotAcceptable creates a AccountMoveNotAcceptable with default headers values
func NewAccountMoveNotAcceptable() *AccountMoveNotAcceptable {
return &AccountMoveNotAcceptable{}
}
/*
AccountMoveNotAcceptable describes a response with status code 406, with default header values.
not acceptable
*/
type AccountMoveNotAcceptable struct {
}
// IsSuccess returns true when this account move not acceptable response has a 2xx status code
func (o *AccountMoveNotAcceptable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this account move not acceptable response has a 3xx status code
func (o *AccountMoveNotAcceptable) IsRedirect() bool {
return false
}
// IsClientError returns true when this account move not acceptable response has a 4xx status code
func (o *AccountMoveNotAcceptable) IsClientError() bool {
return true
}
// IsServerError returns true when this account move not acceptable response has a 5xx status code
func (o *AccountMoveNotAcceptable) IsServerError() bool {
return false
}
// IsCode returns true when this account move not acceptable response a status code equal to that given
func (o *AccountMoveNotAcceptable) IsCode(code int) bool {
return code == 406
}
// Code gets the status code for the account move not acceptable response
func (o *AccountMoveNotAcceptable) Code() int {
return 406
}
func (o *AccountMoveNotAcceptable) Error() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveNotAcceptable", 406)
}
func (o *AccountMoveNotAcceptable) String() string {
return fmt.Sprintf("[POST /api/v1/accounts/move][%d] accountMoveNotAcceptable", 406)
}