summaryrefslogtreecommitdiffstats
path: root/golang/gen/models
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-10 18:55:02 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-10 18:55:02 -0700
commite6fedd421bf7644e969072eff9f375ecb58b25e2 (patch)
treebfb0ef710af7a0d6d98b4a75f5265776d69e76d1 /golang/gen/models
parentc6422b49b8b946386ca1068ec6887bbf07a8b166 (diff)
downloadfatcat-e6fedd421bf7644e969072eff9f375ecb58b25e2.tar.gz
fatcat-e6fedd421bf7644e969072eff9f375ecb58b25e2.zip
bunch more API endpoints
Diffstat (limited to 'golang/gen/models')
-rw-r--r--golang/gen/models/changelogentry.go88
-rw-r--r--golang/gen/models/creator_entity.go18
-rw-r--r--golang/gen/models/editgroup.go81
-rw-r--r--golang/gen/models/editor.go64
-rw-r--r--golang/gen/models/success.go64
5 files changed, 313 insertions, 2 deletions
diff --git a/golang/gen/models/changelogentry.go b/golang/gen/models/changelogentry.go
new file mode 100644
index 00000000..acf93e60
--- /dev/null
+++ b/golang/gen/models/changelogentry.go
@@ -0,0 +1,88 @@
+// 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 (
+ strfmt "github.com/go-openapi/strfmt"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// Changelogentry changelogentry
+// swagger:model changelogentry
+type Changelogentry struct {
+
+ // editgroup id
+ EditgroupID int64 `json:"editgroup_id,omitempty"`
+
+ // index
+ // Required: true
+ Index *int64 `json:"index"`
+
+ // timestamp
+ // Format: date-time
+ Timestamp strfmt.DateTime `json:"timestamp,omitempty"`
+}
+
+// Validate validates this changelogentry
+func (m *Changelogentry) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateIndex(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateTimestamp(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *Changelogentry) validateIndex(formats strfmt.Registry) error {
+
+ if err := validate.Required("index", "body", m.Index); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *Changelogentry) validateTimestamp(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.Timestamp) { // not required
+ return nil
+ }
+
+ if err := validate.FormatOf("timestamp", "body", "date-time", m.Timestamp.String(), formats); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *Changelogentry) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *Changelogentry) UnmarshalBinary(b []byte) error {
+ var res Changelogentry
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/golang/gen/models/creator_entity.go b/golang/gen/models/creator_entity.go
index be3bb6d1..0f1532a8 100644
--- a/golang/gen/models/creator_entity.go
+++ b/golang/gen/models/creator_entity.go
@@ -24,7 +24,8 @@ type CreatorEntity struct {
Ident *string `json:"ident"`
// name
- Name string `json:"name,omitempty"`
+ // Required: true
+ Name *string `json:"name"`
// orcid
Orcid string `json:"orcid,omitempty"`
@@ -33,7 +34,7 @@ type CreatorEntity struct {
Redirect string `json:"redirect,omitempty"`
// revision
- Revision string `json:"revision,omitempty"`
+ Revision int64 `json:"revision,omitempty"`
// state
// Required: true
@@ -49,6 +50,10 @@ func (m *CreatorEntity) Validate(formats strfmt.Registry) error {
res = append(res, err)
}
+ if err := m.validateName(formats); err != nil {
+ res = append(res, err)
+ }
+
if err := m.validateState(formats); err != nil {
res = append(res, err)
}
@@ -68,6 +73,15 @@ func (m *CreatorEntity) validateIdent(formats strfmt.Registry) error {
return nil
}
+func (m *CreatorEntity) validateName(formats strfmt.Registry) error {
+
+ if err := validate.Required("name", "body", m.Name); err != nil {
+ return err
+ }
+
+ return nil
+}
+
var creatorEntityTypeStatePropEnum []interface{}
func init() {
diff --git a/golang/gen/models/editgroup.go b/golang/gen/models/editgroup.go
new file mode 100644
index 00000000..67be219c
--- /dev/null
+++ b/golang/gen/models/editgroup.go
@@ -0,0 +1,81 @@
+// 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 (
+ strfmt "github.com/go-openapi/strfmt"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// Editgroup editgroup
+// swagger:model editgroup
+type Editgroup struct {
+
+ // editor id
+ // Required: true
+ EditorID *int64 `json:"editor_id"`
+
+ // id
+ // Required: true
+ ID *int64 `json:"id"`
+}
+
+// Validate validates this editgroup
+func (m *Editgroup) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateEditorID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *Editgroup) validateEditorID(formats strfmt.Registry) error {
+
+ if err := validate.Required("editor_id", "body", m.EditorID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *Editgroup) validateID(formats strfmt.Registry) error {
+
+ if err := validate.Required("id", "body", m.ID); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *Editgroup) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *Editgroup) UnmarshalBinary(b []byte) error {
+ var res Editgroup
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/golang/gen/models/editor.go b/golang/gen/models/editor.go
new file mode 100644
index 00000000..865de3ff
--- /dev/null
+++ b/golang/gen/models/editor.go
@@ -0,0 +1,64 @@
+// 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 (
+ strfmt "github.com/go-openapi/strfmt"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// Editor editor
+// swagger:model editor
+type Editor struct {
+
+ // username
+ // Required: true
+ Username *string `json:"username"`
+}
+
+// Validate validates this editor
+func (m *Editor) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateUsername(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *Editor) validateUsername(formats strfmt.Registry) error {
+
+ if err := validate.Required("username", "body", m.Username); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *Editor) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *Editor) UnmarshalBinary(b []byte) error {
+ var res Editor
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/golang/gen/models/success.go b/golang/gen/models/success.go
new file mode 100644
index 00000000..47aac304
--- /dev/null
+++ b/golang/gen/models/success.go
@@ -0,0 +1,64 @@
+// 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 (
+ strfmt "github.com/go-openapi/strfmt"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// Success success
+// swagger:model success
+type Success struct {
+
+ // message
+ // Required: true
+ Message *string `json:"message"`
+}
+
+// Validate validates this success
+func (m *Success) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateMessage(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *Success) validateMessage(formats strfmt.Registry) error {
+
+ if err := validate.Required("message", "body", m.Message); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *Success) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *Success) UnmarshalBinary(b []byte) error {
+ var res Success
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}