forked from shuheiktgw/go-travis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metadata.go
33 lines (28 loc) · 1.05 KB
/
metadata.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2015 Ableton AG, Berlin. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package travis
const (
standardRepresentation = "standard"
minimalRepresentation = "minimal"
)
// Metadata is a metadata returned from the Travis CI API
type Metadata struct {
// The type of data returned from the API
Type *string `json:"@type,omitempty"`
// The link for data returned from the API
Href *string `json:"@href,omitempty"`
// The representation of data returned from the API, standard or minimal
Representation *string `json:"@representation,omitempty"`
// The permissions of data returned from the API
Permissions *Permissions `json:"@permissions,omitempty"`
}
// IsStandard tells if the struct is in a standard representation
func (m *Metadata) IsStandard() bool {
return *m.Representation == standardRepresentation
}
// IsStandard tells if the struct is in a minimal representation
func (m *Metadata) IsMinimal() bool {
return *m.Representation == minimalRepresentation
}