diff options
Diffstat (limited to 'golang/gen/restapi/operations')
33 files changed, 0 insertions, 3500 deletions
diff --git a/golang/gen/restapi/operations/fatcat_api.go b/golang/gen/restapi/operations/fatcat_api.go deleted file mode 100644 index 1b6b465d..00000000 --- a/golang/gen/restapi/operations/fatcat_api.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - "strings" - - errors "github.com/go-openapi/errors" - loads "github.com/go-openapi/loads" - runtime "github.com/go-openapi/runtime" - middleware "github.com/go-openapi/runtime/middleware" - security "github.com/go-openapi/runtime/security" - spec "github.com/go-openapi/spec" - strfmt "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewFatcatAPI creates a new Fatcat instance -func NewFatcatAPI(spec *loads.Document) *FatcatAPI { - return &FatcatAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - ServerShutdown: func() {}, - spec: spec, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - JSONConsumer: runtime.JSONConsumer(), - JSONProducer: runtime.JSONProducer(), - GetCreatorIDHandler: GetCreatorIDHandlerFunc(func(params GetCreatorIDParams) middleware.Responder { - return middleware.NotImplemented("operation GetCreatorID has not yet been implemented") - }), - GetCreatorLookupHandler: GetCreatorLookupHandlerFunc(func(params GetCreatorLookupParams) middleware.Responder { - return middleware.NotImplemented("operation GetCreatorLookup has not yet been implemented") - }), - GetEditgroupIDHandler: GetEditgroupIDHandlerFunc(func(params GetEditgroupIDParams) middleware.Responder { - return middleware.NotImplemented("operation GetEditgroupID has not yet been implemented") - }), - GetEditorUsernameHandler: GetEditorUsernameHandlerFunc(func(params GetEditorUsernameParams) middleware.Responder { - return middleware.NotImplemented("operation GetEditorUsername has not yet been implemented") - }), - GetEditorUsernameChangelogHandler: GetEditorUsernameChangelogHandlerFunc(func(params GetEditorUsernameChangelogParams) middleware.Responder { - return middleware.NotImplemented("operation GetEditorUsernameChangelog has not yet been implemented") - }), - PostCreatorHandler: PostCreatorHandlerFunc(func(params PostCreatorParams) middleware.Responder { - return middleware.NotImplemented("operation PostCreator has not yet been implemented") - }), - PostEditgroupHandler: PostEditgroupHandlerFunc(func(params PostEditgroupParams) middleware.Responder { - return middleware.NotImplemented("operation PostEditgroup has not yet been implemented") - }), - PostEditgroupIDAcceptHandler: PostEditgroupIDAcceptHandlerFunc(func(params PostEditgroupIDAcceptParams) middleware.Responder { - return middleware.NotImplemented("operation PostEditgroupIDAccept has not yet been implemented") - }), - } -} - -/*FatcatAPI A scalable, versioned, API-oriented catalog of bibliographic entities and file metadata */ -type FatcatAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implemention in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implemention in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implemention in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for a "application/json" mime type - JSONConsumer runtime.Consumer - - // JSONProducer registers a producer for a "application/json" mime type - JSONProducer runtime.Producer - - // GetCreatorIDHandler sets the operation handler for the get creator ID operation - GetCreatorIDHandler GetCreatorIDHandler - // GetCreatorLookupHandler sets the operation handler for the get creator lookup operation - GetCreatorLookupHandler GetCreatorLookupHandler - // GetEditgroupIDHandler sets the operation handler for the get editgroup ID operation - GetEditgroupIDHandler GetEditgroupIDHandler - // GetEditorUsernameHandler sets the operation handler for the get editor username operation - GetEditorUsernameHandler GetEditorUsernameHandler - // GetEditorUsernameChangelogHandler sets the operation handler for the get editor username changelog operation - GetEditorUsernameChangelogHandler GetEditorUsernameChangelogHandler - // PostCreatorHandler sets the operation handler for the post creator operation - PostCreatorHandler PostCreatorHandler - // PostEditgroupHandler sets the operation handler for the post editgroup operation - PostEditgroupHandler PostEditgroupHandler - // PostEditgroupIDAcceptHandler sets the operation handler for the post editgroup ID accept operation - PostEditgroupIDAcceptHandler PostEditgroupIDAcceptHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// SetDefaultProduces sets the default produces media type -func (o *FatcatAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *FatcatAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *FatcatAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *FatcatAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *FatcatAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *FatcatAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *FatcatAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the FatcatAPI -func (o *FatcatAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.GetCreatorIDHandler == nil { - unregistered = append(unregistered, "GetCreatorIDHandler") - } - - if o.GetCreatorLookupHandler == nil { - unregistered = append(unregistered, "GetCreatorLookupHandler") - } - - if o.GetEditgroupIDHandler == nil { - unregistered = append(unregistered, "GetEditgroupIDHandler") - } - - if o.GetEditorUsernameHandler == nil { - unregistered = append(unregistered, "GetEditorUsernameHandler") - } - - if o.GetEditorUsernameChangelogHandler == nil { - unregistered = append(unregistered, "GetEditorUsernameChangelogHandler") - } - - if o.PostCreatorHandler == nil { - unregistered = append(unregistered, "PostCreatorHandler") - } - - if o.PostEditgroupHandler == nil { - unregistered = append(unregistered, "PostEditgroupHandler") - } - - if o.PostEditgroupIDAcceptHandler == nil { - unregistered = append(unregistered, "PostEditgroupIDAcceptHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *FatcatAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *FatcatAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - - return nil - -} - -// Authorizer returns the registered authorizer -func (o *FatcatAPI) Authorizer() runtime.Authorizer { - - return nil - -} - -// ConsumersFor gets the consumers for the specified media types -func (o *FatcatAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - - result := make(map[string]runtime.Consumer) - for _, mt := range mediaTypes { - switch mt { - - case "application/json": - result["application/json"] = o.JSONConsumer - - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result - -} - -// ProducersFor gets the producers for the specified media types -func (o *FatcatAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - - result := make(map[string]runtime.Producer) - for _, mt := range mediaTypes { - switch mt { - - case "application/json": - result["application/json"] = o.JSONProducer - - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result - -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *FatcatAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the fatcat API -func (o *FatcatAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *FatcatAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/creator/{id}"] = NewGetCreatorID(o.context, o.GetCreatorIDHandler) - - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/creator/lookup"] = NewGetCreatorLookup(o.context, o.GetCreatorLookupHandler) - - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/editgroup/{id}"] = NewGetEditgroupID(o.context, o.GetEditgroupIDHandler) - - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/editor/{username}"] = NewGetEditorUsername(o.context, o.GetEditorUsernameHandler) - - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/editor/{username}/changelog"] = NewGetEditorUsernameChangelog(o.context, o.GetEditorUsernameChangelogHandler) - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/creator"] = NewPostCreator(o.context, o.PostCreatorHandler) - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/editgroup"] = NewPostEditgroup(o.context, o.PostEditgroupHandler) - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/editgroup/{id}/accept"] = NewPostEditgroupIDAccept(o.context, o.PostEditgroupIDAcceptHandler) - -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *FatcatAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *FatcatAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *FatcatAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *FatcatAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} diff --git a/golang/gen/restapi/operations/get_creator_id.go b/golang/gen/restapi/operations/get_creator_id.go deleted file mode 100644 index 90185374..00000000 --- a/golang/gen/restapi/operations/get_creator_id.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - middleware "github.com/go-openapi/runtime/middleware" -) - -// GetCreatorIDHandlerFunc turns a function with the right signature into a get creator ID handler -type GetCreatorIDHandlerFunc func(GetCreatorIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCreatorIDHandlerFunc) Handle(params GetCreatorIDParams) middleware.Responder { - return fn(params) -} - -// GetCreatorIDHandler interface for that can handle valid get creator ID params -type GetCreatorIDHandler interface { - Handle(GetCreatorIDParams) middleware.Responder -} - -// NewGetCreatorID creates a new http.Handler for the get creator ID operation -func NewGetCreatorID(ctx *middleware.Context, handler GetCreatorIDHandler) *GetCreatorID { - return &GetCreatorID{Context: ctx, Handler: handler} -} - -/*GetCreatorID swagger:route GET /creator/{id} getCreatorId - -GetCreatorID get creator ID API - -*/ -type GetCreatorID struct { - Context *middleware.Context - Handler GetCreatorIDHandler -} - -func (o *GetCreatorID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewGetCreatorIDParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/golang/gen/restapi/operations/get_creator_id_parameters.go b/golang/gen/restapi/operations/get_creator_id_parameters.go deleted file mode 100644 index f1e338b6..00000000 --- a/golang/gen/restapi/operations/get_creator_id_parameters.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewGetCreatorIDParams creates a new GetCreatorIDParams object -// no default values defined in spec. -func NewGetCreatorIDParams() GetCreatorIDParams { - - return GetCreatorIDParams{} -} - -// GetCreatorIDParams contains all the bound params for the get creator ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetCreatorID -type GetCreatorIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCreatorIDParams() beforehand. -func (o *GetCreatorIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetCreatorIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - o.ID = raw - - return nil -} diff --git a/golang/gen/restapi/operations/get_creator_id_responses.go b/golang/gen/restapi/operations/get_creator_id_responses.go deleted file mode 100644 index 58dcb687..00000000 --- a/golang/gen/restapi/operations/get_creator_id_responses.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// GetCreatorIDOKCode is the HTTP code returned for type GetCreatorIDOK -const GetCreatorIDOKCode int = 200 - -/*GetCreatorIDOK fetch a single creator by id - -swagger:response getCreatorIdOK -*/ -type GetCreatorIDOK struct { - - /* - In: Body - */ - Payload *models.CreatorEntity `json:"body,omitempty"` -} - -// NewGetCreatorIDOK creates GetCreatorIDOK with default headers values -func NewGetCreatorIDOK() *GetCreatorIDOK { - - return &GetCreatorIDOK{} -} - -// WithPayload adds the payload to the get creator Id o k response -func (o *GetCreatorIDOK) WithPayload(payload *models.CreatorEntity) *GetCreatorIDOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get creator Id o k response -func (o *GetCreatorIDOK) SetPayload(payload *models.CreatorEntity) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCreatorIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCreatorIDNotFoundCode is the HTTP code returned for type GetCreatorIDNotFound -const GetCreatorIDNotFoundCode int = 404 - -/*GetCreatorIDNotFound no such creator - -swagger:response getCreatorIdNotFound -*/ -type GetCreatorIDNotFound struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetCreatorIDNotFound creates GetCreatorIDNotFound with default headers values -func NewGetCreatorIDNotFound() *GetCreatorIDNotFound { - - return &GetCreatorIDNotFound{} -} - -// WithPayload adds the payload to the get creator Id not found response -func (o *GetCreatorIDNotFound) WithPayload(payload *models.Error) *GetCreatorIDNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get creator Id not found response -func (o *GetCreatorIDNotFound) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCreatorIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -/*GetCreatorIDDefault generic error response - -swagger:response getCreatorIdDefault -*/ -type GetCreatorIDDefault struct { - _statusCode int - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetCreatorIDDefault creates GetCreatorIDDefault with default headers values -func NewGetCreatorIDDefault(code int) *GetCreatorIDDefault { - if code <= 0 { - code = 500 - } - - return &GetCreatorIDDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the get creator ID default response -func (o *GetCreatorIDDefault) WithStatusCode(code int) *GetCreatorIDDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the get creator ID default response -func (o *GetCreatorIDDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WithPayload adds the payload to the get creator ID default response -func (o *GetCreatorIDDefault) WithPayload(payload *models.Error) *GetCreatorIDDefault { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get creator ID default response -func (o *GetCreatorIDDefault) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCreatorIDDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/golang/gen/restapi/operations/get_creator_id_urlbuilder.go b/golang/gen/restapi/operations/get_creator_id_urlbuilder.go deleted file mode 100644 index 8f23373f..00000000 --- a/golang/gen/restapi/operations/get_creator_id_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetCreatorIDURL generates an URL for the get creator ID operation -type GetCreatorIDURL struct { - ID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCreatorIDURL) WithBasePath(bp string) *GetCreatorIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCreatorIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCreatorIDURL) Build() (*url.URL, error) { - var result url.URL - - var _path = "/creator/{id}" - - id := o.ID - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("ID is required on GetCreatorIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/v0" - } - result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCreatorIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCreatorIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCreatorIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCreatorIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCreatorIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCreatorIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/golang/gen/restapi/operations/get_creator_lookup.go b/golang/gen/restapi/operations/get_creator_lookup.go deleted file mode 100644 index 3e371ceb..00000000 --- a/golang/gen/restapi/operations/get_creator_lookup.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - middleware "github.com/go-openapi/runtime/middleware" -) - -// GetCreatorLookupHandlerFunc turns a function with the right signature into a get creator lookup handler -type GetCreatorLookupHandlerFunc func(GetCreatorLookupParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCreatorLookupHandlerFunc) Handle(params GetCreatorLookupParams) middleware.Responder { - return fn(params) -} - -// GetCreatorLookupHandler interface for that can handle valid get creator lookup params -type GetCreatorLookupHandler interface { - Handle(GetCreatorLookupParams) middleware.Responder -} - -// NewGetCreatorLookup creates a new http.Handler for the get creator lookup operation -func NewGetCreatorLookup(ctx *middleware.Context, handler GetCreatorLookupHandler) *GetCreatorLookup { - return &GetCreatorLookup{Context: ctx, Handler: handler} -} - -/*GetCreatorLookup swagger:route GET /creator/lookup getCreatorLookup - -GetCreatorLookup get creator lookup API - -*/ -type GetCreatorLookup struct { - Context *middleware.Context - Handler GetCreatorLookupHandler -} - -func (o *GetCreatorLookup) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewGetCreatorLookupParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/golang/gen/restapi/operations/get_creator_lookup_parameters.go b/golang/gen/restapi/operations/get_creator_lookup_parameters.go deleted file mode 100644 index 3b133cbf..00000000 --- a/golang/gen/restapi/operations/get_creator_lookup_parameters.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewGetCreatorLookupParams creates a new GetCreatorLookupParams object -// no default values defined in spec. -func NewGetCreatorLookupParams() GetCreatorLookupParams { - - return GetCreatorLookupParams{} -} - -// GetCreatorLookupParams contains all the bound params for the get creator lookup operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetCreatorLookup -type GetCreatorLookupParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: query - */ - Orcid string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCreatorLookupParams() beforehand. -func (o *GetCreatorLookupParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qOrcid, qhkOrcid, _ := qs.GetOK("orcid") - if err := o.bindOrcid(qOrcid, qhkOrcid, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetCreatorLookupParams) bindOrcid(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("orcid", "query") - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - if err := validate.RequiredString("orcid", "query", raw); err != nil { - return err - } - - o.Orcid = raw - - return nil -} diff --git a/golang/gen/restapi/operations/get_creator_lookup_responses.go b/golang/gen/restapi/operations/get_creator_lookup_responses.go deleted file mode 100644 index f4dc7f12..00000000 --- a/golang/gen/restapi/operations/get_creator_lookup_responses.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// GetCreatorLookupOKCode is the HTTP code returned for type GetCreatorLookupOK -const GetCreatorLookupOKCode int = 200 - -/*GetCreatorLookupOK find a single creator by external identifer - -swagger:response getCreatorLookupOK -*/ -type GetCreatorLookupOK struct { - - /* - In: Body - */ - Payload *models.CreatorEntity `json:"body,omitempty"` -} - -// NewGetCreatorLookupOK creates GetCreatorLookupOK with default headers values -func NewGetCreatorLookupOK() *GetCreatorLookupOK { - - return &GetCreatorLookupOK{} -} - -// WithPayload adds the payload to the get creator lookup o k response -func (o *GetCreatorLookupOK) WithPayload(payload *models.CreatorEntity) *GetCreatorLookupOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get creator lookup o k response -func (o *GetCreatorLookupOK) SetPayload(payload *models.CreatorEntity) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCreatorLookupOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCreatorLookupNotFoundCode is the HTTP code returned for type GetCreatorLookupNotFound -const GetCreatorLookupNotFoundCode int = 404 - -/*GetCreatorLookupNotFound no such creator - -swagger:response getCreatorLookupNotFound -*/ -type GetCreatorLookupNotFound struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetCreatorLookupNotFound creates GetCreatorLookupNotFound with default headers values -func NewGetCreatorLookupNotFound() *GetCreatorLookupNotFound { - - return &GetCreatorLookupNotFound{} -} - -// WithPayload adds the payload to the get creator lookup not found response -func (o *GetCreatorLookupNotFound) WithPayload(payload *models.Error) *GetCreatorLookupNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get creator lookup not found response -func (o *GetCreatorLookupNotFound) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCreatorLookupNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -/*GetCreatorLookupDefault generic error response - -swagger:response getCreatorLookupDefault -*/ -type GetCreatorLookupDefault struct { - _statusCode int - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetCreatorLookupDefault creates GetCreatorLookupDefault with default headers values -func NewGetCreatorLookupDefault(code int) *GetCreatorLookupDefault { - if code <= 0 { - code = 500 - } - - return &GetCreatorLookupDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the get creator lookup default response -func (o *GetCreatorLookupDefault) WithStatusCode(code int) *GetCreatorLookupDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the get creator lookup default response -func (o *GetCreatorLookupDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WithPayload adds the payload to the get creator lookup default response -func (o *GetCreatorLookupDefault) WithPayload(payload *models.Error) *GetCreatorLookupDefault { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get creator lookup default response -func (o *GetCreatorLookupDefault) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCreatorLookupDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/golang/gen/restapi/operations/get_creator_lookup_urlbuilder.go b/golang/gen/restapi/operations/get_creator_lookup_urlbuilder.go deleted file mode 100644 index 6f4782d5..00000000 --- a/golang/gen/restapi/operations/get_creator_lookup_urlbuilder.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetCreatorLookupURL generates an URL for the get creator lookup operation -type GetCreatorLookupURL struct { - Orcid string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCreatorLookupURL) WithBasePath(bp string) *GetCreatorLookupURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCreatorLookupURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCreatorLookupURL) Build() (*url.URL, error) { - var result url.URL - - var _path = "/creator/lookup" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/v0" - } - result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - orcid := o.Orcid - if orcid != "" { - qs.Set("orcid", orcid) - } - - result.RawQuery = qs.Encode() - - return &result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCreatorLookupURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCreatorLookupURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCreatorLookupURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCreatorLookupURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCreatorLookupURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCreatorLookupURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/golang/gen/restapi/operations/get_editgroup_id.go b/golang/gen/restapi/operations/get_editgroup_id.go deleted file mode 100644 index 451193ec..00000000 --- a/golang/gen/restapi/operations/get_editgroup_id.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - middleware "github.com/go-openapi/runtime/middleware" -) - -// GetEditgroupIDHandlerFunc turns a function with the right signature into a get editgroup ID handler -type GetEditgroupIDHandlerFunc func(GetEditgroupIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetEditgroupIDHandlerFunc) Handle(params GetEditgroupIDParams) middleware.Responder { - return fn(params) -} - -// GetEditgroupIDHandler interface for that can handle valid get editgroup ID params -type GetEditgroupIDHandler interface { - Handle(GetEditgroupIDParams) middleware.Responder -} - -// NewGetEditgroupID creates a new http.Handler for the get editgroup ID operation -func NewGetEditgroupID(ctx *middleware.Context, handler GetEditgroupIDHandler) *GetEditgroupID { - return &GetEditgroupID{Context: ctx, Handler: handler} -} - -/*GetEditgroupID swagger:route GET /editgroup/{id} getEditgroupId - -GetEditgroupID get editgroup ID API - -*/ -type GetEditgroupID struct { - Context *middleware.Context - Handler GetEditgroupIDHandler -} - -func (o *GetEditgroupID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewGetEditgroupIDParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/golang/gen/restapi/operations/get_editgroup_id_parameters.go b/golang/gen/restapi/operations/get_editgroup_id_parameters.go deleted file mode 100644 index 41903ebc..00000000 --- a/golang/gen/restapi/operations/get_editgroup_id_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewGetEditgroupIDParams creates a new GetEditgroupIDParams object -// no default values defined in spec. -func NewGetEditgroupIDParams() GetEditgroupIDParams { - - return GetEditgroupIDParams{} -} - -// GetEditgroupIDParams contains all the bound params for the get editgroup ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetEditgroupID -type GetEditgroupIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetEditgroupIDParams() beforehand. -func (o *GetEditgroupIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetEditgroupIDParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/golang/gen/restapi/operations/get_editgroup_id_responses.go b/golang/gen/restapi/operations/get_editgroup_id_responses.go deleted file mode 100644 index 313be0ca..00000000 --- a/golang/gen/restapi/operations/get_editgroup_id_responses.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// GetEditgroupIDOKCode is the HTTP code returned for type GetEditgroupIDOK -const GetEditgroupIDOKCode int = 200 - -/*GetEditgroupIDOK fetch editgroup by identifier - -swagger:response getEditgroupIdOK -*/ -type GetEditgroupIDOK struct { - - /* - In: Body - */ - Payload *models.Editgroup `json:"body,omitempty"` -} - -// NewGetEditgroupIDOK creates GetEditgroupIDOK with default headers values -func NewGetEditgroupIDOK() *GetEditgroupIDOK { - - return &GetEditgroupIDOK{} -} - -// WithPayload adds the payload to the get editgroup Id o k response -func (o *GetEditgroupIDOK) WithPayload(payload *models.Editgroup) *GetEditgroupIDOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editgroup Id o k response -func (o *GetEditgroupIDOK) SetPayload(payload *models.Editgroup) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditgroupIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEditgroupIDNotFoundCode is the HTTP code returned for type GetEditgroupIDNotFound -const GetEditgroupIDNotFoundCode int = 404 - -/*GetEditgroupIDNotFound no such editgroup - -swagger:response getEditgroupIdNotFound -*/ -type GetEditgroupIDNotFound struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetEditgroupIDNotFound creates GetEditgroupIDNotFound with default headers values -func NewGetEditgroupIDNotFound() *GetEditgroupIDNotFound { - - return &GetEditgroupIDNotFound{} -} - -// WithPayload adds the payload to the get editgroup Id not found response -func (o *GetEditgroupIDNotFound) WithPayload(payload *models.Error) *GetEditgroupIDNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editgroup Id not found response -func (o *GetEditgroupIDNotFound) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditgroupIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -/*GetEditgroupIDDefault generic error response - -swagger:response getEditgroupIdDefault -*/ -type GetEditgroupIDDefault struct { - _statusCode int - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetEditgroupIDDefault creates GetEditgroupIDDefault with default headers values -func NewGetEditgroupIDDefault(code int) *GetEditgroupIDDefault { - if code <= 0 { - code = 500 - } - - return &GetEditgroupIDDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the get editgroup ID default response -func (o *GetEditgroupIDDefault) WithStatusCode(code int) *GetEditgroupIDDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the get editgroup ID default response -func (o *GetEditgroupIDDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WithPayload adds the payload to the get editgroup ID default response -func (o *GetEditgroupIDDefault) WithPayload(payload *models.Error) *GetEditgroupIDDefault { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editgroup ID default response -func (o *GetEditgroupIDDefault) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditgroupIDDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/golang/gen/restapi/operations/get_editgroup_id_urlbuilder.go b/golang/gen/restapi/operations/get_editgroup_id_urlbuilder.go deleted file mode 100644 index 70484a35..00000000 --- a/golang/gen/restapi/operations/get_editgroup_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// GetEditgroupIDURL generates an URL for the get editgroup ID operation -type GetEditgroupIDURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEditgroupIDURL) WithBasePath(bp string) *GetEditgroupIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEditgroupIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetEditgroupIDURL) Build() (*url.URL, error) { - var result url.URL - - var _path = "/editgroup/{id}" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("ID is required on GetEditgroupIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/v0" - } - result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetEditgroupIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetEditgroupIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetEditgroupIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetEditgroupIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetEditgroupIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetEditgroupIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/golang/gen/restapi/operations/get_editor_username.go b/golang/gen/restapi/operations/get_editor_username.go deleted file mode 100644 index 3fd18839..00000000 --- a/golang/gen/restapi/operations/get_editor_username.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - middleware "github.com/go-openapi/runtime/middleware" -) - -// GetEditorUsernameHandlerFunc turns a function with the right signature into a get editor username handler -type GetEditorUsernameHandlerFunc func(GetEditorUsernameParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetEditorUsernameHandlerFunc) Handle(params GetEditorUsernameParams) middleware.Responder { - return fn(params) -} - -// GetEditorUsernameHandler interface for that can handle valid get editor username params -type GetEditorUsernameHandler interface { - Handle(GetEditorUsernameParams) middleware.Responder -} - -// NewGetEditorUsername creates a new http.Handler for the get editor username operation -func NewGetEditorUsername(ctx *middleware.Context, handler GetEditorUsernameHandler) *GetEditorUsername { - return &GetEditorUsername{Context: ctx, Handler: handler} -} - -/*GetEditorUsername swagger:route GET /editor/{username} getEditorUsername - -GetEditorUsername get editor username API - -*/ -type GetEditorUsername struct { - Context *middleware.Context - Handler GetEditorUsernameHandler -} - -func (o *GetEditorUsername) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewGetEditorUsernameParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/golang/gen/restapi/operations/get_editor_username_changelog.go b/golang/gen/restapi/operations/get_editor_username_changelog.go deleted file mode 100644 index dbb8ddfc..00000000 --- a/golang/gen/restapi/operations/get_editor_username_changelog.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - middleware "github.com/go-openapi/runtime/middleware" -) - -// GetEditorUsernameChangelogHandlerFunc turns a function with the right signature into a get editor username changelog handler -type GetEditorUsernameChangelogHandlerFunc func(GetEditorUsernameChangelogParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetEditorUsernameChangelogHandlerFunc) Handle(params GetEditorUsernameChangelogParams) middleware.Responder { - return fn(params) -} - -// GetEditorUsernameChangelogHandler interface for that can handle valid get editor username changelog params -type GetEditorUsernameChangelogHandler interface { - Handle(GetEditorUsernameChangelogParams) middleware.Responder -} - -// NewGetEditorUsernameChangelog creates a new http.Handler for the get editor username changelog operation -func NewGetEditorUsernameChangelog(ctx *middleware.Context, handler GetEditorUsernameChangelogHandler) *GetEditorUsernameChangelog { - return &GetEditorUsernameChangelog{Context: ctx, Handler: handler} -} - -/*GetEditorUsernameChangelog swagger:route GET /editor/{username}/changelog getEditorUsernameChangelog - -GetEditorUsernameChangelog get editor username changelog API - -*/ -type GetEditorUsernameChangelog struct { - Context *middleware.Context - Handler GetEditorUsernameChangelogHandler -} - -func (o *GetEditorUsernameChangelog) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewGetEditorUsernameChangelogParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/golang/gen/restapi/operations/get_editor_username_changelog_parameters.go b/golang/gen/restapi/operations/get_editor_username_changelog_parameters.go deleted file mode 100644 index d9958921..00000000 --- a/golang/gen/restapi/operations/get_editor_username_changelog_parameters.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewGetEditorUsernameChangelogParams creates a new GetEditorUsernameChangelogParams object -// no default values defined in spec. -func NewGetEditorUsernameChangelogParams() GetEditorUsernameChangelogParams { - - return GetEditorUsernameChangelogParams{} -} - -// GetEditorUsernameChangelogParams contains all the bound params for the get editor username changelog operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetEditorUsernameChangelog -type GetEditorUsernameChangelogParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - Username string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetEditorUsernameChangelogParams() beforehand. -func (o *GetEditorUsernameChangelogParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rUsername, rhkUsername, _ := route.Params.GetOK("username") - if err := o.bindUsername(rUsername, rhkUsername, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetEditorUsernameChangelogParams) bindUsername(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - o.Username = raw - - return nil -} diff --git a/golang/gen/restapi/operations/get_editor_username_changelog_responses.go b/golang/gen/restapi/operations/get_editor_username_changelog_responses.go deleted file mode 100644 index 6e0fb3e1..00000000 --- a/golang/gen/restapi/operations/get_editor_username_changelog_responses.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// GetEditorUsernameChangelogOKCode is the HTTP code returned for type GetEditorUsernameChangelogOK -const GetEditorUsernameChangelogOKCode int = 200 - -/*GetEditorUsernameChangelogOK find changes (editgroups) by this editor which have been merged - -swagger:response getEditorUsernameChangelogOK -*/ -type GetEditorUsernameChangelogOK struct { - - /* - In: Body - */ - Payload *models.Changelogentry `json:"body,omitempty"` -} - -// NewGetEditorUsernameChangelogOK creates GetEditorUsernameChangelogOK with default headers values -func NewGetEditorUsernameChangelogOK() *GetEditorUsernameChangelogOK { - - return &GetEditorUsernameChangelogOK{} -} - -// WithPayload adds the payload to the get editor username changelog o k response -func (o *GetEditorUsernameChangelogOK) WithPayload(payload *models.Changelogentry) *GetEditorUsernameChangelogOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editor username changelog o k response -func (o *GetEditorUsernameChangelogOK) SetPayload(payload *models.Changelogentry) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditorUsernameChangelogOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEditorUsernameChangelogNotFoundCode is the HTTP code returned for type GetEditorUsernameChangelogNotFound -const GetEditorUsernameChangelogNotFoundCode int = 404 - -/*GetEditorUsernameChangelogNotFound username not found - -swagger:response getEditorUsernameChangelogNotFound -*/ -type GetEditorUsernameChangelogNotFound struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetEditorUsernameChangelogNotFound creates GetEditorUsernameChangelogNotFound with default headers values -func NewGetEditorUsernameChangelogNotFound() *GetEditorUsernameChangelogNotFound { - - return &GetEditorUsernameChangelogNotFound{} -} - -// WithPayload adds the payload to the get editor username changelog not found response -func (o *GetEditorUsernameChangelogNotFound) WithPayload(payload *models.Error) *GetEditorUsernameChangelogNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editor username changelog not found response -func (o *GetEditorUsernameChangelogNotFound) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditorUsernameChangelogNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -/*GetEditorUsernameChangelogDefault generic error response - -swagger:response getEditorUsernameChangelogDefault -*/ -type GetEditorUsernameChangelogDefault struct { - _statusCode int - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetEditorUsernameChangelogDefault creates GetEditorUsernameChangelogDefault with default headers values -func NewGetEditorUsernameChangelogDefault(code int) *GetEditorUsernameChangelogDefault { - if code <= 0 { - code = 500 - } - - return &GetEditorUsernameChangelogDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the get editor username changelog default response -func (o *GetEditorUsernameChangelogDefault) WithStatusCode(code int) *GetEditorUsernameChangelogDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the get editor username changelog default response -func (o *GetEditorUsernameChangelogDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WithPayload adds the payload to the get editor username changelog default response -func (o *GetEditorUsernameChangelogDefault) WithPayload(payload *models.Error) *GetEditorUsernameChangelogDefault { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editor username changelog default response -func (o *GetEditorUsernameChangelogDefault) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditorUsernameChangelogDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/golang/gen/restapi/operations/get_editor_username_changelog_urlbuilder.go b/golang/gen/restapi/operations/get_editor_username_changelog_urlbuilder.go deleted file mode 100644 index d77e7fdc..00000000 --- a/golang/gen/restapi/operations/get_editor_username_changelog_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetEditorUsernameChangelogURL generates an URL for the get editor username changelog operation -type GetEditorUsernameChangelogURL struct { - Username string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEditorUsernameChangelogURL) WithBasePath(bp string) *GetEditorUsernameChangelogURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEditorUsernameChangelogURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetEditorUsernameChangelogURL) Build() (*url.URL, error) { - var result url.URL - - var _path = "/editor/{username}/changelog" - - username := o.Username - if username != "" { - _path = strings.Replace(_path, "{username}", username, -1) - } else { - return nil, errors.New("Username is required on GetEditorUsernameChangelogURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/v0" - } - result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetEditorUsernameChangelogURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetEditorUsernameChangelogURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetEditorUsernameChangelogURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetEditorUsernameChangelogURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetEditorUsernameChangelogURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetEditorUsernameChangelogURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/golang/gen/restapi/operations/get_editor_username_parameters.go b/golang/gen/restapi/operations/get_editor_username_parameters.go deleted file mode 100644 index c8f57ff7..00000000 --- a/golang/gen/restapi/operations/get_editor_username_parameters.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewGetEditorUsernameParams creates a new GetEditorUsernameParams object -// no default values defined in spec. -func NewGetEditorUsernameParams() GetEditorUsernameParams { - - return GetEditorUsernameParams{} -} - -// GetEditorUsernameParams contains all the bound params for the get editor username operation -// typically these are obtained from a http.Request -// -// swagger:parameters GetEditorUsername -type GetEditorUsernameParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - Username string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetEditorUsernameParams() beforehand. -func (o *GetEditorUsernameParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rUsername, rhkUsername, _ := route.Params.GetOK("username") - if err := o.bindUsername(rUsername, rhkUsername, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *GetEditorUsernameParams) bindUsername(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - o.Username = raw - - return nil -} diff --git a/golang/gen/restapi/operations/get_editor_username_responses.go b/golang/gen/restapi/operations/get_editor_username_responses.go deleted file mode 100644 index 44b06340..00000000 --- a/golang/gen/restapi/operations/get_editor_username_responses.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// GetEditorUsernameOKCode is the HTTP code returned for type GetEditorUsernameOK -const GetEditorUsernameOKCode int = 200 - -/*GetEditorUsernameOK fetch generic information about an editor - -swagger:response getEditorUsernameOK -*/ -type GetEditorUsernameOK struct { - - /* - In: Body - */ - Payload *models.Editor `json:"body,omitempty"` -} - -// NewGetEditorUsernameOK creates GetEditorUsernameOK with default headers values -func NewGetEditorUsernameOK() *GetEditorUsernameOK { - - return &GetEditorUsernameOK{} -} - -// WithPayload adds the payload to the get editor username o k response -func (o *GetEditorUsernameOK) WithPayload(payload *models.Editor) *GetEditorUsernameOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editor username o k response -func (o *GetEditorUsernameOK) SetPayload(payload *models.Editor) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditorUsernameOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEditorUsernameNotFoundCode is the HTTP code returned for type GetEditorUsernameNotFound -const GetEditorUsernameNotFoundCode int = 404 - -/*GetEditorUsernameNotFound username not found - -swagger:response getEditorUsernameNotFound -*/ -type GetEditorUsernameNotFound struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetEditorUsernameNotFound creates GetEditorUsernameNotFound with default headers values -func NewGetEditorUsernameNotFound() *GetEditorUsernameNotFound { - - return &GetEditorUsernameNotFound{} -} - -// WithPayload adds the payload to the get editor username not found response -func (o *GetEditorUsernameNotFound) WithPayload(payload *models.Error) *GetEditorUsernameNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editor username not found response -func (o *GetEditorUsernameNotFound) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditorUsernameNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -/*GetEditorUsernameDefault generic error response - -swagger:response getEditorUsernameDefault -*/ -type GetEditorUsernameDefault struct { - _statusCode int - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewGetEditorUsernameDefault creates GetEditorUsernameDefault with default headers values -func NewGetEditorUsernameDefault(code int) *GetEditorUsernameDefault { - if code <= 0 { - code = 500 - } - - return &GetEditorUsernameDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the get editor username default response -func (o *GetEditorUsernameDefault) WithStatusCode(code int) *GetEditorUsernameDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the get editor username default response -func (o *GetEditorUsernameDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WithPayload adds the payload to the get editor username default response -func (o *GetEditorUsernameDefault) WithPayload(payload *models.Error) *GetEditorUsernameDefault { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get editor username default response -func (o *GetEditorUsernameDefault) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEditorUsernameDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/golang/gen/restapi/operations/get_editor_username_urlbuilder.go b/golang/gen/restapi/operations/get_editor_username_urlbuilder.go deleted file mode 100644 index fa8597fb..00000000 --- a/golang/gen/restapi/operations/get_editor_username_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetEditorUsernameURL generates an URL for the get editor username operation -type GetEditorUsernameURL struct { - Username string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEditorUsernameURL) WithBasePath(bp string) *GetEditorUsernameURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEditorUsernameURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetEditorUsernameURL) Build() (*url.URL, error) { - var result url.URL - - var _path = "/editor/{username}" - - username := o.Username - if username != "" { - _path = strings.Replace(_path, "{username}", username, -1) - } else { - return nil, errors.New("Username is required on GetEditorUsernameURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/v0" - } - result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetEditorUsernameURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetEditorUsernameURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetEditorUsernameURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetEditorUsernameURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetEditorUsernameURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetEditorUsernameURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/golang/gen/restapi/operations/post_creator.go b/golang/gen/restapi/operations/post_creator.go deleted file mode 100644 index b33694f1..00000000 --- a/golang/gen/restapi/operations/post_creator.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - middleware "github.com/go-openapi/runtime/middleware" -) - -// PostCreatorHandlerFunc turns a function with the right signature into a post creator handler -type PostCreatorHandlerFunc func(PostCreatorParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostCreatorHandlerFunc) Handle(params PostCreatorParams) middleware.Responder { - return fn(params) -} - -// PostCreatorHandler interface for that can handle valid post creator params -type PostCreatorHandler interface { - Handle(PostCreatorParams) middleware.Responder -} - -// NewPostCreator creates a new http.Handler for the post creator operation -func NewPostCreator(ctx *middleware.Context, handler PostCreatorHandler) *PostCreator { - return &PostCreator{Context: ctx, Handler: handler} -} - -/*PostCreator swagger:route POST /creator postCreator - -PostCreator post creator API - -*/ -type PostCreator struct { - Context *middleware.Context - Handler PostCreatorHandler -} - -func (o *PostCreator) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewPostCreatorParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/golang/gen/restapi/operations/post_creator_parameters.go b/golang/gen/restapi/operations/post_creator_parameters.go deleted file mode 100644 index f35cf2d5..00000000 --- a/golang/gen/restapi/operations/post_creator_parameters.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// NewPostCreatorParams creates a new PostCreatorParams object -// no default values defined in spec. -func NewPostCreatorParams() PostCreatorParams { - - return PostCreatorParams{} -} - -// PostCreatorParams contains all the bound params for the post creator operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostCreator -type PostCreatorParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *models.CreatorEntity -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostCreatorParams() beforehand. -func (o *PostCreatorParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body models.CreatorEntity - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/golang/gen/restapi/operations/post_creator_responses.go b/golang/gen/restapi/operations/post_creator_responses.go deleted file mode 100644 index ee95d2e4..00000000 --- a/golang/gen/restapi/operations/post_creator_responses.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// PostCreatorCreatedCode is the HTTP code returned for type PostCreatorCreated -const PostCreatorCreatedCode int = 201 - -/*PostCreatorCreated created - -swagger:response postCreatorCreated -*/ -type PostCreatorCreated struct { - - /* - In: Body - */ - Payload *models.EntityEdit `json:"body,omitempty"` -} - -// NewPostCreatorCreated creates PostCreatorCreated with default headers values -func NewPostCreatorCreated() *PostCreatorCreated { - - return &PostCreatorCreated{} -} - -// WithPayload adds the payload to the post creator created response -func (o *PostCreatorCreated) WithPayload(payload *models.EntityEdit) *PostCreatorCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post creator created response -func (o *PostCreatorCreated) SetPayload(payload *models.EntityEdit) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostCreatorCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostCreatorBadRequestCode is the HTTP code returned for type PostCreatorBadRequest -const PostCreatorBadRequestCode int = 400 - -/*PostCreatorBadRequest bad request - -swagger:response postCreatorBadRequest -*/ -type PostCreatorBadRequest struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewPostCreatorBadRequest creates PostCreatorBadRequest with default headers values -func NewPostCreatorBadRequest() *PostCreatorBadRequest { - - return &PostCreatorBadRequest{} -} - -// WithPayload adds the payload to the post creator bad request response -func (o *PostCreatorBadRequest) WithPayload(payload *models.Error) *PostCreatorBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post creator bad request response -func (o *PostCreatorBadRequest) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostCreatorBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -/*PostCreatorDefault generic error response - -swagger:response postCreatorDefault -*/ -type PostCreatorDefault struct { - _statusCode int - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewPostCreatorDefault creates PostCreatorDefault with default headers values -func NewPostCreatorDefault(code int) *PostCreatorDefault { - if code <= 0 { - code = 500 - } - - return &PostCreatorDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the post creator default response -func (o *PostCreatorDefault) WithStatusCode(code int) *PostCreatorDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the post creator default response -func (o *PostCreatorDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WithPayload adds the payload to the post creator default response -func (o *PostCreatorDefault) WithPayload(payload *models.Error) *PostCreatorDefault { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post creator default response -func (o *PostCreatorDefault) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostCreatorDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/golang/gen/restapi/operations/post_creator_urlbuilder.go b/golang/gen/restapi/operations/post_creator_urlbuilder.go deleted file mode 100644 index 901edeb6..00000000 --- a/golang/gen/restapi/operations/post_creator_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// PostCreatorURL generates an URL for the post creator operation -type PostCreatorURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostCreatorURL) WithBasePath(bp string) *PostCreatorURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostCreatorURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostCreatorURL) Build() (*url.URL, error) { - var result url.URL - - var _path = "/creator" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/v0" - } - result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostCreatorURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostCreatorURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostCreatorURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostCreatorURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostCreatorURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostCreatorURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/golang/gen/restapi/operations/post_editgroup.go b/golang/gen/restapi/operations/post_editgroup.go deleted file mode 100644 index 1b938ba1..00000000 --- a/golang/gen/restapi/operations/post_editgroup.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - middleware "github.com/go-openapi/runtime/middleware" -) - -// PostEditgroupHandlerFunc turns a function with the right signature into a post editgroup handler -type PostEditgroupHandlerFunc func(PostEditgroupParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostEditgroupHandlerFunc) Handle(params PostEditgroupParams) middleware.Responder { - return fn(params) -} - -// PostEditgroupHandler interface for that can handle valid post editgroup params -type PostEditgroupHandler interface { - Handle(PostEditgroupParams) middleware.Responder -} - -// NewPostEditgroup creates a new http.Handler for the post editgroup operation -func NewPostEditgroup(ctx *middleware.Context, handler PostEditgroupHandler) *PostEditgroup { - return &PostEditgroup{Context: ctx, Handler: handler} -} - -/*PostEditgroup swagger:route POST /editgroup postEditgroup - -PostEditgroup post editgroup API - -*/ -type PostEditgroup struct { - Context *middleware.Context - Handler PostEditgroupHandler -} - -func (o *PostEditgroup) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewPostEditgroupParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/golang/gen/restapi/operations/post_editgroup_id_accept.go b/golang/gen/restapi/operations/post_editgroup_id_accept.go deleted file mode 100644 index 121e58cc..00000000 --- a/golang/gen/restapi/operations/post_editgroup_id_accept.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - middleware "github.com/go-openapi/runtime/middleware" -) - -// PostEditgroupIDAcceptHandlerFunc turns a function with the right signature into a post editgroup ID accept handler -type PostEditgroupIDAcceptHandlerFunc func(PostEditgroupIDAcceptParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PostEditgroupIDAcceptHandlerFunc) Handle(params PostEditgroupIDAcceptParams) middleware.Responder { - return fn(params) -} - -// PostEditgroupIDAcceptHandler interface for that can handle valid post editgroup ID accept params -type PostEditgroupIDAcceptHandler interface { - Handle(PostEditgroupIDAcceptParams) middleware.Responder -} - -// NewPostEditgroupIDAccept creates a new http.Handler for the post editgroup ID accept operation -func NewPostEditgroupIDAccept(ctx *middleware.Context, handler PostEditgroupIDAcceptHandler) *PostEditgroupIDAccept { - return &PostEditgroupIDAccept{Context: ctx, Handler: handler} -} - -/*PostEditgroupIDAccept swagger:route POST /editgroup/{id}/accept postEditgroupIdAccept - -PostEditgroupIDAccept post editgroup ID accept API - -*/ -type PostEditgroupIDAccept struct { - Context *middleware.Context - Handler PostEditgroupIDAcceptHandler -} - -func (o *PostEditgroupIDAccept) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - r = rCtx - } - var Params = NewPostEditgroupIDAcceptParams() - - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/golang/gen/restapi/operations/post_editgroup_id_accept_parameters.go b/golang/gen/restapi/operations/post_editgroup_id_accept_parameters.go deleted file mode 100644 index 967c35e7..00000000 --- a/golang/gen/restapi/operations/post_editgroup_id_accept_parameters.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewPostEditgroupIDAcceptParams creates a new PostEditgroupIDAcceptParams object -// no default values defined in spec. -func NewPostEditgroupIDAcceptParams() PostEditgroupIDAcceptParams { - - return PostEditgroupIDAcceptParams{} -} - -// PostEditgroupIDAcceptParams contains all the bound params for the post editgroup ID accept operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostEditgroupIDAccept -type PostEditgroupIDAcceptParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ID int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostEditgroupIDAcceptParams() beforehand. -func (o *PostEditgroupIDAcceptParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rID, rhkID, _ := route.Params.GetOK("id") - if err := o.bindID(rID, rhkID, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *PostEditgroupIDAcceptParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("id", "path", "int64", raw) - } - o.ID = value - - return nil -} diff --git a/golang/gen/restapi/operations/post_editgroup_id_accept_responses.go b/golang/gen/restapi/operations/post_editgroup_id_accept_responses.go deleted file mode 100644 index a414fc1b..00000000 --- a/golang/gen/restapi/operations/post_editgroup_id_accept_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// PostEditgroupIDAcceptOKCode is the HTTP code returned for type PostEditgroupIDAcceptOK -const PostEditgroupIDAcceptOKCode int = 200 - -/*PostEditgroupIDAcceptOK merged editgroup successfully ("live") - -swagger:response postEditgroupIdAcceptOK -*/ -type PostEditgroupIDAcceptOK struct { - - /* - In: Body - */ - Payload *models.Success `json:"body,omitempty"` -} - -// NewPostEditgroupIDAcceptOK creates PostEditgroupIDAcceptOK with default headers values -func NewPostEditgroupIDAcceptOK() *PostEditgroupIDAcceptOK { - - return &PostEditgroupIDAcceptOK{} -} - -// WithPayload adds the payload to the post editgroup Id accept o k response -func (o *PostEditgroupIDAcceptOK) WithPayload(payload *models.Success) *PostEditgroupIDAcceptOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post editgroup Id accept o k response -func (o *PostEditgroupIDAcceptOK) SetPayload(payload *models.Success) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEditgroupIDAcceptOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostEditgroupIDAcceptBadRequestCode is the HTTP code returned for type PostEditgroupIDAcceptBadRequest -const PostEditgroupIDAcceptBadRequestCode int = 400 - -/*PostEditgroupIDAcceptBadRequest editgroup is in an unmergable state - -swagger:response postEditgroupIdAcceptBadRequest -*/ -type PostEditgroupIDAcceptBadRequest struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewPostEditgroupIDAcceptBadRequest creates PostEditgroupIDAcceptBadRequest with default headers values -func NewPostEditgroupIDAcceptBadRequest() *PostEditgroupIDAcceptBadRequest { - - return &PostEditgroupIDAcceptBadRequest{} -} - -// WithPayload adds the payload to the post editgroup Id accept bad request response -func (o *PostEditgroupIDAcceptBadRequest) WithPayload(payload *models.Error) *PostEditgroupIDAcceptBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post editgroup Id accept bad request response -func (o *PostEditgroupIDAcceptBadRequest) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEditgroupIDAcceptBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostEditgroupIDAcceptNotFoundCode is the HTTP code returned for type PostEditgroupIDAcceptNotFound -const PostEditgroupIDAcceptNotFoundCode int = 404 - -/*PostEditgroupIDAcceptNotFound no such editgroup - -swagger:response postEditgroupIdAcceptNotFound -*/ -type PostEditgroupIDAcceptNotFound struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewPostEditgroupIDAcceptNotFound creates PostEditgroupIDAcceptNotFound with default headers values -func NewPostEditgroupIDAcceptNotFound() *PostEditgroupIDAcceptNotFound { - - return &PostEditgroupIDAcceptNotFound{} -} - -// WithPayload adds the payload to the post editgroup Id accept not found response -func (o *PostEditgroupIDAcceptNotFound) WithPayload(payload *models.Error) *PostEditgroupIDAcceptNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post editgroup Id accept not found response -func (o *PostEditgroupIDAcceptNotFound) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEditgroupIDAcceptNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -/*PostEditgroupIDAcceptDefault generic error response - -swagger:response postEditgroupIdAcceptDefault -*/ -type PostEditgroupIDAcceptDefault struct { - _statusCode int - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewPostEditgroupIDAcceptDefault creates PostEditgroupIDAcceptDefault with default headers values -func NewPostEditgroupIDAcceptDefault(code int) *PostEditgroupIDAcceptDefault { - if code <= 0 { - code = 500 - } - - return &PostEditgroupIDAcceptDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the post editgroup ID accept default response -func (o *PostEditgroupIDAcceptDefault) WithStatusCode(code int) *PostEditgroupIDAcceptDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the post editgroup ID accept default response -func (o *PostEditgroupIDAcceptDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WithPayload adds the payload to the post editgroup ID accept default response -func (o *PostEditgroupIDAcceptDefault) WithPayload(payload *models.Error) *PostEditgroupIDAcceptDefault { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post editgroup ID accept default response -func (o *PostEditgroupIDAcceptDefault) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEditgroupIDAcceptDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/golang/gen/restapi/operations/post_editgroup_id_accept_urlbuilder.go b/golang/gen/restapi/operations/post_editgroup_id_accept_urlbuilder.go deleted file mode 100644 index 1c7362f6..00000000 --- a/golang/gen/restapi/operations/post_editgroup_id_accept_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// PostEditgroupIDAcceptURL generates an URL for the post editgroup ID accept operation -type PostEditgroupIDAcceptURL struct { - ID int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostEditgroupIDAcceptURL) WithBasePath(bp string) *PostEditgroupIDAcceptURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostEditgroupIDAcceptURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostEditgroupIDAcceptURL) Build() (*url.URL, error) { - var result url.URL - - var _path = "/editgroup/{id}/accept" - - id := swag.FormatInt64(o.ID) - if id != "" { - _path = strings.Replace(_path, "{id}", id, -1) - } else { - return nil, errors.New("ID is required on PostEditgroupIDAcceptURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/v0" - } - result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostEditgroupIDAcceptURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostEditgroupIDAcceptURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostEditgroupIDAcceptURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostEditgroupIDAcceptURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostEditgroupIDAcceptURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostEditgroupIDAcceptURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/golang/gen/restapi/operations/post_editgroup_parameters.go b/golang/gen/restapi/operations/post_editgroup_parameters.go deleted file mode 100644 index 261e3209..00000000 --- a/golang/gen/restapi/operations/post_editgroup_parameters.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewPostEditgroupParams creates a new PostEditgroupParams object -// no default values defined in spec. -func NewPostEditgroupParams() PostEditgroupParams { - - return PostEditgroupParams{} -} - -// PostEditgroupParams contains all the bound params for the post editgroup operation -// typically these are obtained from a http.Request -// -// swagger:parameters PostEditgroup -type PostEditgroupParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPostEditgroupParams() beforehand. -func (o *PostEditgroupParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/golang/gen/restapi/operations/post_editgroup_responses.go b/golang/gen/restapi/operations/post_editgroup_responses.go deleted file mode 100644 index ae563d88..00000000 --- a/golang/gen/restapi/operations/post_editgroup_responses.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - models "git.archive.org/bnewbold/fatcat/golang/gen/models" -) - -// PostEditgroupCreatedCode is the HTTP code returned for type PostEditgroupCreated -const PostEditgroupCreatedCode int = 201 - -/*PostEditgroupCreated successfully created - -swagger:response postEditgroupCreated -*/ -type PostEditgroupCreated struct { - - /* - In: Body - */ - Payload *models.Editgroup `json:"body,omitempty"` -} - -// NewPostEditgroupCreated creates PostEditgroupCreated with default headers values -func NewPostEditgroupCreated() *PostEditgroupCreated { - - return &PostEditgroupCreated{} -} - -// WithPayload adds the payload to the post editgroup created response -func (o *PostEditgroupCreated) WithPayload(payload *models.Editgroup) *PostEditgroupCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post editgroup created response -func (o *PostEditgroupCreated) SetPayload(payload *models.Editgroup) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEditgroupCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PostEditgroupBadRequestCode is the HTTP code returned for type PostEditgroupBadRequest -const PostEditgroupBadRequestCode int = 400 - -/*PostEditgroupBadRequest invalid request parameters - -swagger:response postEditgroupBadRequest -*/ -type PostEditgroupBadRequest struct { - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewPostEditgroupBadRequest creates PostEditgroupBadRequest with default headers values -func NewPostEditgroupBadRequest() *PostEditgroupBadRequest { - - return &PostEditgroupBadRequest{} -} - -// WithPayload adds the payload to the post editgroup bad request response -func (o *PostEditgroupBadRequest) WithPayload(payload *models.Error) *PostEditgroupBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post editgroup bad request response -func (o *PostEditgroupBadRequest) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEditgroupBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -/*PostEditgroupDefault generic error response - -swagger:response postEditgroupDefault -*/ -type PostEditgroupDefault struct { - _statusCode int - - /* - In: Body - */ - Payload *models.Error `json:"body,omitempty"` -} - -// NewPostEditgroupDefault creates PostEditgroupDefault with default headers values -func NewPostEditgroupDefault(code int) *PostEditgroupDefault { - if code <= 0 { - code = 500 - } - - return &PostEditgroupDefault{ - _statusCode: code, - } -} - -// WithStatusCode adds the status to the post editgroup default response -func (o *PostEditgroupDefault) WithStatusCode(code int) *PostEditgroupDefault { - o._statusCode = code - return o -} - -// SetStatusCode sets the status to the post editgroup default response -func (o *PostEditgroupDefault) SetStatusCode(code int) { - o._statusCode = code -} - -// WithPayload adds the payload to the post editgroup default response -func (o *PostEditgroupDefault) WithPayload(payload *models.Error) *PostEditgroupDefault { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the post editgroup default response -func (o *PostEditgroupDefault) SetPayload(payload *models.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PostEditgroupDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(o._statusCode) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/golang/gen/restapi/operations/post_editgroup_urlbuilder.go b/golang/gen/restapi/operations/post_editgroup_urlbuilder.go deleted file mode 100644 index 9a636968..00000000 --- a/golang/gen/restapi/operations/post_editgroup_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// PostEditgroupURL generates an URL for the post editgroup operation -type PostEditgroupURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostEditgroupURL) WithBasePath(bp string) *PostEditgroupURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PostEditgroupURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PostEditgroupURL) Build() (*url.URL, error) { - var result url.URL - - var _path = "/editgroup" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/v0" - } - result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PostEditgroupURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PostEditgroupURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PostEditgroupURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PostEditgroupURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PostEditgroupURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PostEditgroupURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} |