2018-02-19 22:24:10 +00:00
|
|
|
// Copyright 2018 Drone.IO Inc.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
2016-06-25 23:45:33 +00:00
|
|
|
package internal
|
|
|
|
|
|
|
|
type User struct {
|
|
|
|
Active bool `json:"active"`
|
|
|
|
DisplayName string `json:"displayName"`
|
|
|
|
EmailAddress string `json:"emailAddress"`
|
|
|
|
ID int `json:"id"`
|
|
|
|
Links struct {
|
2016-06-26 05:27:09 +00:00
|
|
|
Self []struct {
|
|
|
|
Href string `json:"href"`
|
|
|
|
} `json:"self"`
|
|
|
|
} `json:"links"`
|
2016-06-25 23:45:33 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Slug string `json:"slug"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
}
|
|
|
|
|
2016-08-12 22:54:36 +00:00
|
|
|
type CloneLink struct {
|
|
|
|
Href string `json:"href"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SelfRefLink struct {
|
|
|
|
Href string `json:"href"`
|
|
|
|
}
|
|
|
|
|
2016-08-14 02:06:15 +00:00
|
|
|
type BuildStatus struct {
|
|
|
|
State string `json:"state"`
|
|
|
|
Key string `json:"key"`
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
Url string `json:"url"`
|
|
|
|
Desc string `json:"description,omitempty"`
|
|
|
|
}
|
|
|
|
|
2016-07-24 21:07:44 +00:00
|
|
|
type Repo struct {
|
2016-06-25 23:45:33 +00:00
|
|
|
Forkable bool `json:"forkable"`
|
|
|
|
ID int `json:"id"`
|
|
|
|
Links struct {
|
2016-08-13 06:07:45 +00:00
|
|
|
Clone []CloneLink `json:"clone"`
|
|
|
|
Self []struct {
|
2016-06-26 05:27:09 +00:00
|
|
|
Href string `json:"href"`
|
|
|
|
} `json:"self"`
|
|
|
|
} `json:"links"`
|
2016-06-25 23:45:33 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
Project struct {
|
2016-06-26 05:27:09 +00:00
|
|
|
Description string `json:"description"`
|
|
|
|
ID int `json:"id"`
|
|
|
|
Key string `json:"key"`
|
|
|
|
Links struct {
|
2016-08-12 22:54:36 +00:00
|
|
|
Self []SelfRefLink `json:"self"`
|
2016-06-26 05:27:09 +00:00
|
|
|
} `json:"links"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Public bool `json:"public"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
} `json:"project"`
|
2016-06-25 23:45:33 +00:00
|
|
|
Public bool `json:"public"`
|
|
|
|
ScmID string `json:"scmId"`
|
|
|
|
Slug string `json:"slug"`
|
|
|
|
State string `json:"state"`
|
|
|
|
StatusMessage string `json:"statusMessage"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Repos struct {
|
2016-07-24 21:07:44 +00:00
|
|
|
IsLastPage bool `json:"isLastPage"`
|
|
|
|
Limit int `json:"limit"`
|
|
|
|
Size int `json:"size"`
|
|
|
|
Start int `json:"start"`
|
|
|
|
Values []*Repo `json:"values"`
|
2016-06-25 23:45:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Hook struct {
|
|
|
|
Enabled bool `json:"enabled"`
|
|
|
|
Details *HookDetail `json:"details"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type HookDetail struct {
|
|
|
|
Key string `json:"key"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
ConfigFormKey string `json:"configFormKey"`
|
2016-06-26 05:27:09 +00:00
|
|
|
}
|
2016-07-24 21:07:44 +00:00
|
|
|
|
2016-08-12 22:54:36 +00:00
|
|
|
type Value struct {
|
|
|
|
Changes struct {
|
2016-08-13 06:07:45 +00:00
|
|
|
Filter interface{} `json:"filter"`
|
|
|
|
IsLastPage bool `json:"isLastPage"`
|
|
|
|
Limit int `json:"limit"`
|
|
|
|
Size int `json:"size"`
|
|
|
|
Start int `json:"start"`
|
|
|
|
Values []struct {
|
|
|
|
ContentID string `json:"contentId"`
|
|
|
|
Executable bool `json:"executable"`
|
|
|
|
Link struct {
|
|
|
|
Rel string `json:"rel"`
|
|
|
|
URL string `json:"url"`
|
|
|
|
} `json:"link"`
|
|
|
|
NodeType string `json:"nodeType"`
|
|
|
|
Path struct {
|
|
|
|
Components []string `json:"components"`
|
|
|
|
Extension string `json:"extension"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Parent string `json:"parent"`
|
|
|
|
ToString string `json:"toString"`
|
|
|
|
} `json:"path"`
|
|
|
|
PercentUnchanged int `json:"percentUnchanged"`
|
|
|
|
SrcExecutable bool `json:"srcExecutable"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
} `json:"values"`
|
|
|
|
} `json:"changes"`
|
2016-08-12 22:54:36 +00:00
|
|
|
FromCommit struct {
|
2016-08-13 06:07:45 +00:00
|
|
|
DisplayID string `json:"displayId"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
} `json:"fromCommit"`
|
2016-08-12 22:54:36 +00:00
|
|
|
Link struct {
|
2016-08-13 06:07:45 +00:00
|
|
|
Rel string `json:"rel"`
|
|
|
|
URL string `json:"url"`
|
|
|
|
} `json:"link"`
|
2016-08-12 22:54:36 +00:00
|
|
|
ToCommit struct {
|
2016-08-13 06:07:45 +00:00
|
|
|
Author struct {
|
|
|
|
EmailAddress string `json:"emailAddress"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
} `json:"author"`
|
|
|
|
AuthorTimestamp int `json:"authorTimestamp"`
|
|
|
|
DisplayID string `json:"displayId"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
Parents []struct {
|
|
|
|
DisplayID string `json:"displayId"`
|
|
|
|
ID string `json:"id"`
|
|
|
|
} `json:"parents"`
|
|
|
|
} `json:"toCommit"`
|
2016-08-12 22:54:36 +00:00
|
|
|
}
|
|
|
|
|
2016-07-24 21:07:44 +00:00
|
|
|
type PostHook struct {
|
|
|
|
Changesets struct {
|
|
|
|
Filter interface{} `json:"filter"`
|
|
|
|
IsLastPage bool `json:"isLastPage"`
|
|
|
|
Limit int `json:"limit"`
|
|
|
|
Size int `json:"size"`
|
|
|
|
Start int `json:"start"`
|
2016-08-13 06:07:45 +00:00
|
|
|
Values []Value `json:"values"`
|
2016-07-24 21:07:44 +00:00
|
|
|
} `json:"changesets"`
|
2016-08-12 22:54:36 +00:00
|
|
|
RefChanges []RefChange `json:"refChanges"`
|
2016-07-24 21:07:44 +00:00
|
|
|
Repository struct {
|
|
|
|
Forkable bool `json:"forkable"`
|
|
|
|
ID int `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Project struct {
|
|
|
|
ID int `json:"id"`
|
|
|
|
IsPersonal bool `json:"isPersonal"`
|
|
|
|
Key string `json:"key"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Public bool `json:"public"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
} `json:"project"`
|
|
|
|
Public bool `json:"public"`
|
|
|
|
ScmID string `json:"scmId"`
|
|
|
|
Slug string `json:"slug"`
|
|
|
|
State string `json:"state"`
|
|
|
|
StatusMessage string `json:"statusMessage"`
|
|
|
|
} `json:"repository"`
|
|
|
|
}
|
2016-08-12 22:54:36 +00:00
|
|
|
|
2016-08-13 06:07:45 +00:00
|
|
|
type RefChange struct {
|
2016-08-12 22:54:36 +00:00
|
|
|
FromHash string `json:"fromHash"`
|
|
|
|
RefID string `json:"refId"`
|
|
|
|
ToHash string `json:"toHash"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
}
|
2017-02-04 23:16:30 +00:00
|
|
|
|
2017-02-23 21:12:31 +00:00
|
|
|
type HookPluginDetails struct {
|
|
|
|
Details struct {
|
2017-02-23 21:21:47 +00:00
|
|
|
Key string `json:"key"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Description string `json:"description"`
|
|
|
|
Version string `json:"version"`
|
|
|
|
ConfigFormKey string `json:"configFormKey"`
|
|
|
|
} `json:"details"`
|
|
|
|
Enabled bool `json:"enabled"`
|
2017-02-23 21:12:31 +00:00
|
|
|
Configured bool `json:"configured"`
|
|
|
|
}
|
|
|
|
|
2017-02-04 23:16:30 +00:00
|
|
|
type HookSettings struct {
|
|
|
|
HookURL0 string `json:"hook-url-0,omitempty"`
|
|
|
|
HookURL1 string `json:"hook-url-1,omitempty"`
|
|
|
|
HookURL2 string `json:"hook-url-2,omitempty"`
|
|
|
|
HookURL3 string `json:"hook-url-3,omitempty"`
|
|
|
|
HookURL4 string `json:"hook-url-4,omitempty"`
|
|
|
|
HookURL5 string `json:"hook-url-5,omitempty"`
|
|
|
|
HookURL6 string `json:"hook-url-6,omitempty"`
|
|
|
|
HookURL7 string `json:"hook-url-7,omitempty"`
|
|
|
|
HookURL8 string `json:"hook-url-8,omitempty"`
|
|
|
|
HookURL9 string `json:"hook-url-9,omitempty"`
|
|
|
|
HookURL10 string `json:"hook-url-10,omitempty"`
|
|
|
|
HookURL11 string `json:"hook-url-11,omitempty"`
|
|
|
|
HookURL12 string `json:"hook-url-12,omitempty"`
|
|
|
|
HookURL13 string `json:"hook-url-13,omitempty"`
|
|
|
|
HookURL14 string `json:"hook-url-14,omitempty"`
|
|
|
|
HookURL15 string `json:"hook-url-15,omitempty"`
|
|
|
|
HookURL16 string `json:"hook-url-16,omitempty"`
|
|
|
|
HookURL17 string `json:"hook-url-17,omitempty"`
|
|
|
|
HookURL18 string `json:"hook-url-18,omitempty"`
|
|
|
|
HookURL19 string `json:"hook-url-19,omitempty"`
|
|
|
|
}
|