Skip to content

Add Asset API #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 15 additions & 38 deletions go/models/access_token.go
Original file line number Diff line number Diff line change
@@ -1,61 +1,38 @@
// Code generated by go-swagger; DO NOT EDIT.

package models

import "github.com/go-openapi/strfmt"

// 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"
)
/*AccessToken access token

// AccessToken access token
// swagger:model accessToken
swagger:model accessToken
*/
type AccessToken struct {

// access token
/* access token
*/
AccessToken string `json:"access_token,omitempty"`

// created at
/* created at
*/
CreatedAt string `json:"created_at,omitempty"`

// id
/* id
*/
ID string `json:"id,omitempty"`

// user email
/* user email
*/
UserEmail string `json:"user_email,omitempty"`

// user id
/* user id
*/
UserID string `json:"user_id,omitempty"`
}

// Validate validates this access token
func (m *AccessToken) Validate(formats strfmt.Registry) error {
var res []error

if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

// MarshalBinary interface implementation
func (m *AccessToken) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *AccessToken) UnmarshalBinary(b []byte) error {
var res AccessToken
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
66 changes: 66 additions & 0 deletions go/models/asset.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package models

import "github.com/go-openapi/strfmt"

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

/*Asset asset

swagger:model asset
*/
type Asset struct {

/* content type
*/
ContentType string `json:"content_type,omitempty"`

/* created at
*/
CreatedAt string `json:"created_at,omitempty"`

/* creator id
*/
CreatorID string `json:"creator_id,omitempty"`

/* id
*/
ID string `json:"id,omitempty"`

/* key
*/
Key string `json:"key,omitempty"`

/* name
*/
Name string `json:"name,omitempty"`

/* site id
*/
SiteID string `json:"site_id,omitempty"`

/* size
*/
Size int64 `json:"size,omitempty"`

/* state
*/
State string `json:"state,omitempty"`

/* updated at
*/
UpdatedAt string `json:"updated_at,omitempty"`

/* url
*/
URL string `json:"url,omitempty"`

/* visibility
*/
Visibility string `json:"visibility,omitempty"`
}

// Validate validates this asset
func (m *Asset) Validate(formats strfmt.Registry) error {
return nil
}
55 changes: 55 additions & 0 deletions go/models/asset_form.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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/swag"

"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)

/*AssetForm asset form

swagger:model assetForm
*/
type AssetForm struct {

/* fields
*/
Fields map[string]string `json:"fields,omitempty"`

/* url
*/
URL string `json:"url,omitempty"`
}

// Validate validates this asset form
func (m *AssetForm) Validate(formats strfmt.Registry) error {
var res []error

if err := m.validateFields(formats); err != nil {
// prop
res = append(res, err)
}

if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

func (m *AssetForm) validateFields(formats strfmt.Registry) error {

if swag.IsZero(m.Fields) { // not required
return nil
}

if err := validate.Required("fields", "body", m.Fields); err != nil {
return err
}

return nil
}
22 changes: 22 additions & 0 deletions go/models/asset_public_signature.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package models

import "github.com/go-openapi/strfmt"

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

/*AssetPublicSignature asset public signature

swagger:model assetPublicSignature
*/
type AssetPublicSignature struct {

/* url
*/
URL string `json:"url,omitempty"`
}

// Validate validates this asset public signature
func (m *AssetPublicSignature) Validate(formats strfmt.Registry) error {
return nil
}
26 changes: 26 additions & 0 deletions go/models/asset_signature.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package models

import "github.com/go-openapi/strfmt"

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

/*AssetSignature asset signature

swagger:model assetSignature
*/
type AssetSignature struct {

/* asset
*/
Asset *Asset `json:"asset,omitempty"`

/* form
*/
Form *AssetForm `json:"form,omitempty"`
}

// Validate validates this asset signature
func (m *AssetSignature) Validate(formats strfmt.Registry) error {
return nil
}
56 changes: 17 additions & 39 deletions go/models/build.go
Original file line number Diff line number Diff line change
@@ -1,64 +1,42 @@
// Code generated by go-swagger; DO NOT EDIT.

package models

import "github.com/go-openapi/strfmt"

// 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"
)
/*Build build

// Build build
// swagger:model build
swagger:model build
*/
type Build struct {

// created at
/* created at
*/
CreatedAt string `json:"created_at,omitempty"`

// deploy id
/* deploy id
*/
DeployID string `json:"deploy_id,omitempty"`

// done
/* done
*/
Done bool `json:"done,omitempty"`

// error
/* error
*/
Error string `json:"error,omitempty"`

// id
/* id
*/
ID string `json:"id,omitempty"`

// sha
/* sha
*/
Sha string `json:"sha,omitempty"`
}

// Validate validates this build
func (m *Build) Validate(formats strfmt.Registry) error {
var res []error

if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

// MarshalBinary interface implementation
func (m *Build) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *Build) UnmarshalBinary(b []byte) error {
var res Build
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
44 changes: 9 additions & 35 deletions go/models/build_log_msg.go
Original file line number Diff line number Diff line change
@@ -1,52 +1,26 @@
// Code generated by go-swagger; DO NOT EDIT.

package models

import "github.com/go-openapi/strfmt"

// 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"
)
/*BuildLogMsg build log msg

// BuildLogMsg build log msg
// swagger:model buildLogMsg
swagger:model buildLogMsg
*/
type BuildLogMsg struct {

// error
/* error
*/
Error bool `json:"error,omitempty"`

// message
/* message
*/
Message string `json:"message,omitempty"`
}

// Validate validates this build log msg
func (m *BuildLogMsg) Validate(formats strfmt.Registry) error {
var res []error

if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

// MarshalBinary interface implementation
func (m *BuildLogMsg) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *BuildLogMsg) UnmarshalBinary(b []byte) error {
var res BuildLogMsg
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
Loading