aboutsummaryrefslogtreecommitdiffstats
path: root/golang/gen
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-10 19:57:16 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-10 19:57:16 -0700
commit63dc69bbcdbee264383b919f9a8a3b1a83358be7 (patch)
tree1b74955ed3b9938f2e7d2b690ab59c9f33c91c99 /golang/gen
parent71c6b0a4418511a6c0046742512066fc27e51b21 (diff)
downloadfatcat-63dc69bbcdbee264383b919f9a8a3b1a83358be7.tar.gz
fatcat-63dc69bbcdbee264383b919f9a8a3b1a83358be7.zip
a bunch more skeleton
Diffstat (limited to 'golang/gen')
-rw-r--r--golang/gen/models/release_entity.go136
-rw-r--r--golang/gen/restapi/configure_fatcat.go20
-rw-r--r--golang/gen/restapi/embedded_spec.go106
3 files changed, 261 insertions, 1 deletions
diff --git a/golang/gen/models/release_entity.go b/golang/gen/models/release_entity.go
new file mode 100644
index 00000000..fa6a345c
--- /dev/null
+++ b/golang/gen/models/release_entity.go
@@ -0,0 +1,136 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package models
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "encoding/json"
+
+ strfmt "github.com/go-openapi/strfmt"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// ReleaseEntity release entity
+// swagger:model release_entity
+type ReleaseEntity struct {
+
+ // ident
+ // Required: true
+ Ident *string `json:"ident"`
+
+ // name
+ Name string `json:"name,omitempty"`
+
+ // orcid
+ Orcid string `json:"orcid,omitempty"`
+
+ // redirect
+ Redirect string `json:"redirect,omitempty"`
+
+ // revision
+ Revision int64 `json:"revision,omitempty"`
+
+ // state
+ // Required: true
+ // Enum: [wip active redirect deleted]
+ State *string `json:"state"`
+}
+
+// Validate validates this release entity
+func (m *ReleaseEntity) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateIdent(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateState(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *ReleaseEntity) validateIdent(formats strfmt.Registry) error {
+
+ if err := validate.Required("ident", "body", m.Ident); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+var releaseEntityTypeStatePropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["wip","active","redirect","deleted"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ releaseEntityTypeStatePropEnum = append(releaseEntityTypeStatePropEnum, v)
+ }
+}
+
+const (
+
+ // ReleaseEntityStateWip captures enum value "wip"
+ ReleaseEntityStateWip string = "wip"
+
+ // ReleaseEntityStateActive captures enum value "active"
+ ReleaseEntityStateActive string = "active"
+
+ // ReleaseEntityStateRedirect captures enum value "redirect"
+ ReleaseEntityStateRedirect string = "redirect"
+
+ // ReleaseEntityStateDeleted captures enum value "deleted"
+ ReleaseEntityStateDeleted string = "deleted"
+)
+
+// prop value enum
+func (m *ReleaseEntity) validateStateEnum(path, location string, value string) error {
+ if err := validate.Enum(path, location, value, releaseEntityTypeStatePropEnum); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *ReleaseEntity) validateState(formats strfmt.Registry) error {
+
+ if err := validate.Required("state", "body", m.State); err != nil {
+ return err
+ }
+
+ // value enum
+ if err := m.validateStateEnum("state", "body", *m.State); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *ReleaseEntity) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *ReleaseEntity) UnmarshalBinary(b []byte) error {
+ var res ReleaseEntity
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/golang/gen/restapi/configure_fatcat.go b/golang/gen/restapi/configure_fatcat.go
index 94e7f3e2..e101a019 100644
--- a/golang/gen/restapi/configure_fatcat.go
+++ b/golang/gen/restapi/configure_fatcat.go
@@ -14,7 +14,7 @@ import (
"git.archive.org/bnewbold/fatcat/golang/gen/restapi/operations"
)
-//go:generate swagger generate server --target ../gen --name fatcat --spec ../fatcat-openapi2.yml --exclude-main
+//go:generate swagger generate server --target ../gen --name fatcat --spec ../fatcat-openapi2.json --exclude-main
func configureFlags(api *operations.FatcatAPI) {
// api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... }
@@ -37,9 +37,27 @@ func configureAPI(api *operations.FatcatAPI) http.Handler {
api.GetCreatorIDHandler = operations.GetCreatorIDHandlerFunc(func(params operations.GetCreatorIDParams) middleware.Responder {
return middleware.NotImplemented("operation .GetCreatorID has not yet been implemented")
})
+ api.GetCreatorLookupHandler = operations.GetCreatorLookupHandlerFunc(func(params operations.GetCreatorLookupParams) middleware.Responder {
+ return middleware.NotImplemented("operation .GetCreatorLookup has not yet been implemented")
+ })
+ api.GetEditgroupIDHandler = operations.GetEditgroupIDHandlerFunc(func(params operations.GetEditgroupIDParams) middleware.Responder {
+ return middleware.NotImplemented("operation .GetEditgroupID has not yet been implemented")
+ })
+ api.GetEditorUsernameHandler = operations.GetEditorUsernameHandlerFunc(func(params operations.GetEditorUsernameParams) middleware.Responder {
+ return middleware.NotImplemented("operation .GetEditorUsername has not yet been implemented")
+ })
+ api.GetEditorUsernameChangelogHandler = operations.GetEditorUsernameChangelogHandlerFunc(func(params operations.GetEditorUsernameChangelogParams) middleware.Responder {
+ return middleware.NotImplemented("operation .GetEditorUsernameChangelog has not yet been implemented")
+ })
api.PostCreatorHandler = operations.PostCreatorHandlerFunc(func(params operations.PostCreatorParams) middleware.Responder {
return middleware.NotImplemented("operation .PostCreator has not yet been implemented")
})
+ api.PostEditgroupHandler = operations.PostEditgroupHandlerFunc(func(params operations.PostEditgroupParams) middleware.Responder {
+ return middleware.NotImplemented("operation .PostEditgroup has not yet been implemented")
+ })
+ api.PostEditgroupIDAcceptHandler = operations.PostEditgroupIDAcceptHandlerFunc(func(params operations.PostEditgroupIDAcceptParams) middleware.Responder {
+ return middleware.NotImplemented("operation .PostEditgroupIDAccept has not yet been implemented")
+ })
api.ServerShutdown = func() {}
diff --git a/golang/gen/restapi/embedded_spec.go b/golang/gen/restapi/embedded_spec.go
index 32753475..8e2a9ac4 100644
--- a/golang/gen/restapi/embedded_spec.go
+++ b/golang/gen/restapi/embedded_spec.go
@@ -382,6 +382,39 @@ func init() {
}
}
},
+ "release_entity": {
+ "type": "object",
+ "required": [
+ "ident",
+ "state"
+ ],
+ "properties": {
+ "ident": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "orcid": {
+ "type": "string"
+ },
+ "redirect": {
+ "type": "string"
+ },
+ "revision": {
+ "type": "integer"
+ },
+ "state": {
+ "type": "string",
+ "enum": [
+ "wip",
+ "active",
+ "redirect",
+ "deleted"
+ ]
+ }
+ }
+ },
"success": {
"type": "object",
"required": [
@@ -393,6 +426,26 @@ func init() {
}
}
}
+ },
+ "x-entity-props": {
+ "ident": {
+ "type": "string"
+ },
+ "redirect": {
+ "type": "string"
+ },
+ "revision": {
+ "type": "integer"
+ },
+ "state": {
+ "enum": [
+ "wip",
+ "active",
+ "redirect",
+ "deleted"
+ ],
+ "type": "string"
+ }
}
}`))
FlatSwaggerJSON = json.RawMessage([]byte(`{
@@ -760,6 +813,39 @@ func init() {
}
}
},
+ "release_entity": {
+ "type": "object",
+ "required": [
+ "ident",
+ "state"
+ ],
+ "properties": {
+ "ident": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "orcid": {
+ "type": "string"
+ },
+ "redirect": {
+ "type": "string"
+ },
+ "revision": {
+ "type": "integer"
+ },
+ "state": {
+ "type": "string",
+ "enum": [
+ "wip",
+ "active",
+ "redirect",
+ "deleted"
+ ]
+ }
+ }
+ },
"success": {
"type": "object",
"required": [
@@ -771,6 +857,26 @@ func init() {
}
}
}
+ },
+ "x-entity-props": {
+ "ident": {
+ "type": "string"
+ },
+ "redirect": {
+ "type": "string"
+ },
+ "revision": {
+ "type": "integer"
+ },
+ "state": {
+ "enum": [
+ "wip",
+ "active",
+ "redirect",
+ "deleted"
+ ],
+ "type": "string"
+ }
}
}`))
}