Skip to content

Commit 3955646

Browse files
committed
Add Asset API
Update to use the most recent swagger generator. Signed-off-by: David Calavera <[email protected]>
1 parent 532cff2 commit 3955646

File tree

124 files changed

+2344
-6790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+2344
-6790
lines changed

go/models/access_token.go

+15-38
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,38 @@
1-
// Code generated by go-swagger; DO NOT EDIT.
2-
31
package models
42

3+
import "github.com/go-openapi/strfmt"
4+
55
// This file was generated by the swagger tool.
66
// Editing this file might prove futile when you re-run the swagger generate command
77

8-
import (
9-
strfmt "github.com/go-openapi/strfmt"
10-
11-
"github.com/go-openapi/errors"
12-
"github.com/go-openapi/swag"
13-
)
8+
/*AccessToken access token
149
15-
// AccessToken access token
16-
// swagger:model accessToken
10+
swagger:model accessToken
11+
*/
1712
type AccessToken struct {
1813

19-
// access token
14+
/* access token
15+
*/
2016
AccessToken string `json:"access_token,omitempty"`
2117

22-
// created at
18+
/* created at
19+
*/
2320
CreatedAt string `json:"created_at,omitempty"`
2421

25-
// id
22+
/* id
23+
*/
2624
ID string `json:"id,omitempty"`
2725

28-
// user email
26+
/* user email
27+
*/
2928
UserEmail string `json:"user_email,omitempty"`
3029

31-
// user id
30+
/* user id
31+
*/
3232
UserID string `json:"user_id,omitempty"`
3333
}
3434

3535
// Validate validates this access token
3636
func (m *AccessToken) Validate(formats strfmt.Registry) error {
37-
var res []error
38-
39-
if len(res) > 0 {
40-
return errors.CompositeValidationError(res...)
41-
}
42-
return nil
43-
}
44-
45-
// MarshalBinary interface implementation
46-
func (m *AccessToken) MarshalBinary() ([]byte, error) {
47-
if m == nil {
48-
return nil, nil
49-
}
50-
return swag.WriteJSON(m)
51-
}
52-
53-
// UnmarshalBinary interface implementation
54-
func (m *AccessToken) UnmarshalBinary(b []byte) error {
55-
var res AccessToken
56-
if err := swag.ReadJSON(b, &res); err != nil {
57-
return err
58-
}
59-
*m = res
6037
return nil
6138
}

go/models/asset.go

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package models
2+
3+
import "github.com/go-openapi/strfmt"
4+
5+
// This file was generated by the swagger tool.
6+
// Editing this file might prove futile when you re-run the swagger generate command
7+
8+
/*Asset asset
9+
10+
swagger:model asset
11+
*/
12+
type Asset struct {
13+
14+
/* content type
15+
*/
16+
ContentType string `json:"content_type,omitempty"`
17+
18+
/* created at
19+
*/
20+
CreatedAt string `json:"created_at,omitempty"`
21+
22+
/* creator id
23+
*/
24+
CreatorID string `json:"creator_id,omitempty"`
25+
26+
/* id
27+
*/
28+
ID string `json:"id,omitempty"`
29+
30+
/* key
31+
*/
32+
Key string `json:"key,omitempty"`
33+
34+
/* name
35+
*/
36+
Name string `json:"name,omitempty"`
37+
38+
/* site id
39+
*/
40+
SiteID string `json:"site_id,omitempty"`
41+
42+
/* size
43+
*/
44+
Size int64 `json:"size,omitempty"`
45+
46+
/* state
47+
*/
48+
State string `json:"state,omitempty"`
49+
50+
/* updated at
51+
*/
52+
UpdatedAt string `json:"updated_at,omitempty"`
53+
54+
/* url
55+
*/
56+
URL string `json:"url,omitempty"`
57+
58+
/* visibility
59+
*/
60+
Visibility string `json:"visibility,omitempty"`
61+
}
62+
63+
// Validate validates this asset
64+
func (m *Asset) Validate(formats strfmt.Registry) error {
65+
return nil
66+
}

go/models/asset_form.go

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package models
2+
3+
// This file was generated by the swagger tool.
4+
// Editing this file might prove futile when you re-run the swagger generate command
5+
6+
import (
7+
strfmt "github.com/go-openapi/strfmt"
8+
"github.com/go-openapi/swag"
9+
10+
"github.com/go-openapi/errors"
11+
"github.com/go-openapi/validate"
12+
)
13+
14+
/*AssetForm asset form
15+
16+
swagger:model assetForm
17+
*/
18+
type AssetForm struct {
19+
20+
/* fields
21+
*/
22+
Fields map[string]string `json:"fields,omitempty"`
23+
24+
/* url
25+
*/
26+
URL string `json:"url,omitempty"`
27+
}
28+
29+
// Validate validates this asset form
30+
func (m *AssetForm) Validate(formats strfmt.Registry) error {
31+
var res []error
32+
33+
if err := m.validateFields(formats); err != nil {
34+
// prop
35+
res = append(res, err)
36+
}
37+
38+
if len(res) > 0 {
39+
return errors.CompositeValidationError(res...)
40+
}
41+
return nil
42+
}
43+
44+
func (m *AssetForm) validateFields(formats strfmt.Registry) error {
45+
46+
if swag.IsZero(m.Fields) { // not required
47+
return nil
48+
}
49+
50+
if err := validate.Required("fields", "body", m.Fields); err != nil {
51+
return err
52+
}
53+
54+
return nil
55+
}

go/models/asset_public_signature.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package models
2+
3+
import "github.com/go-openapi/strfmt"
4+
5+
// This file was generated by the swagger tool.
6+
// Editing this file might prove futile when you re-run the swagger generate command
7+
8+
/*AssetPublicSignature asset public signature
9+
10+
swagger:model assetPublicSignature
11+
*/
12+
type AssetPublicSignature struct {
13+
14+
/* url
15+
*/
16+
URL string `json:"url,omitempty"`
17+
}
18+
19+
// Validate validates this asset public signature
20+
func (m *AssetPublicSignature) Validate(formats strfmt.Registry) error {
21+
return nil
22+
}

go/models/asset_signature.go

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package models
2+
3+
import "github.com/go-openapi/strfmt"
4+
5+
// This file was generated by the swagger tool.
6+
// Editing this file might prove futile when you re-run the swagger generate command
7+
8+
/*AssetSignature asset signature
9+
10+
swagger:model assetSignature
11+
*/
12+
type AssetSignature struct {
13+
14+
/* asset
15+
*/
16+
Asset *Asset `json:"asset,omitempty"`
17+
18+
/* form
19+
*/
20+
Form *AssetForm `json:"form,omitempty"`
21+
}
22+
23+
// Validate validates this asset signature
24+
func (m *AssetSignature) Validate(formats strfmt.Registry) error {
25+
return nil
26+
}

go/models/build.go

+17-39
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,42 @@
1-
// Code generated by go-swagger; DO NOT EDIT.
2-
31
package models
42

3+
import "github.com/go-openapi/strfmt"
4+
55
// This file was generated by the swagger tool.
66
// Editing this file might prove futile when you re-run the swagger generate command
77

8-
import (
9-
strfmt "github.com/go-openapi/strfmt"
10-
11-
"github.com/go-openapi/errors"
12-
"github.com/go-openapi/swag"
13-
)
8+
/*Build build
149
15-
// Build build
16-
// swagger:model build
10+
swagger:model build
11+
*/
1712
type Build struct {
1813

19-
// created at
14+
/* created at
15+
*/
2016
CreatedAt string `json:"created_at,omitempty"`
2117

22-
// deploy id
18+
/* deploy id
19+
*/
2320
DeployID string `json:"deploy_id,omitempty"`
2421

25-
// done
22+
/* done
23+
*/
2624
Done bool `json:"done,omitempty"`
2725

28-
// error
26+
/* error
27+
*/
2928
Error string `json:"error,omitempty"`
3029

31-
// id
30+
/* id
31+
*/
3232
ID string `json:"id,omitempty"`
3333

34-
// sha
34+
/* sha
35+
*/
3536
Sha string `json:"sha,omitempty"`
3637
}
3738

3839
// Validate validates this build
3940
func (m *Build) Validate(formats strfmt.Registry) error {
40-
var res []error
41-
42-
if len(res) > 0 {
43-
return errors.CompositeValidationError(res...)
44-
}
45-
return nil
46-
}
47-
48-
// MarshalBinary interface implementation
49-
func (m *Build) MarshalBinary() ([]byte, error) {
50-
if m == nil {
51-
return nil, nil
52-
}
53-
return swag.WriteJSON(m)
54-
}
55-
56-
// UnmarshalBinary interface implementation
57-
func (m *Build) UnmarshalBinary(b []byte) error {
58-
var res Build
59-
if err := swag.ReadJSON(b, &res); err != nil {
60-
return err
61-
}
62-
*m = res
6341
return nil
6442
}

go/models/build_log_msg.go

+9-35
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,26 @@
1-
// Code generated by go-swagger; DO NOT EDIT.
2-
31
package models
42

3+
import "github.com/go-openapi/strfmt"
4+
55
// This file was generated by the swagger tool.
66
// Editing this file might prove futile when you re-run the swagger generate command
77

8-
import (
9-
strfmt "github.com/go-openapi/strfmt"
10-
11-
"github.com/go-openapi/errors"
12-
"github.com/go-openapi/swag"
13-
)
8+
/*BuildLogMsg build log msg
149
15-
// BuildLogMsg build log msg
16-
// swagger:model buildLogMsg
10+
swagger:model buildLogMsg
11+
*/
1712
type BuildLogMsg struct {
1813

19-
// error
14+
/* error
15+
*/
2016
Error bool `json:"error,omitempty"`
2117

22-
// message
18+
/* message
19+
*/
2320
Message string `json:"message,omitempty"`
2421
}
2522

2623
// Validate validates this build log msg
2724
func (m *BuildLogMsg) Validate(formats strfmt.Registry) error {
28-
var res []error
29-
30-
if len(res) > 0 {
31-
return errors.CompositeValidationError(res...)
32-
}
33-
return nil
34-
}
35-
36-
// MarshalBinary interface implementation
37-
func (m *BuildLogMsg) MarshalBinary() ([]byte, error) {
38-
if m == nil {
39-
return nil, nil
40-
}
41-
return swag.WriteJSON(m)
42-
}
43-
44-
// UnmarshalBinary interface implementation
45-
func (m *BuildLogMsg) UnmarshalBinary(b []byte) error {
46-
var res BuildLogMsg
47-
if err := swag.ReadJSON(b, &res); err != nil {
48-
return err
49-
}
50-
*m = res
5125
return nil
5226
}

0 commit comments

Comments
 (0)