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