-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
builds_build_icons.go
70 lines (62 loc) · 2.58 KB
/
builds_build_icons.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package asc
import (
"context"
"fmt"
)
// IconAssetType defines model for IconAssetType.
//
// https://developer.apple.com/documentation/appstoreconnectapi/iconassettype
type IconAssetType string
const (
// IconAssetTypeAppStore is an icon asset type for AppStore.
IconAssetTypeAppStore IconAssetType = "APP_STORE"
// IconAssetTypeMessagesAppStore is an icon asset type for MessagesAppStore.
IconAssetTypeMessagesAppStore IconAssetType = "MESSAGES_APP_STORE"
// IconAssetTypeTVOSHomeScreen is an icon asset type for TVOSHomeScreen.
IconAssetTypeTVOSHomeScreen IconAssetType = "TV_OS_HOME_SCREEN"
// IconAssetTypeTVOSTopShelf is an icon asset type for TVOSTopShelf.
IconAssetTypeTVOSTopShelf IconAssetType = "TV_OS_TOP_SHELF"
// IconAssetTypeWatchAppStore is an icon asset type for WatchAppStore.
IconAssetTypeWatchAppStore IconAssetType = "WATCH_APP_STORE"
)
// BuildIcon defines model for BuildIcon.
//
// https://developer.apple.com/documentation/appstoreconnectapi/buildicon
type BuildIcon struct {
Attributes *BuildIconAttributes `json:"attributes,omitempty"`
ID string `json:"id"`
Links ResourceLinks `json:"links"`
Type string `json:"type"`
}
// BuildIconAttributes defines model for BuildIcon.Attributes
//
// https://developer.apple.com/documentation/appstoreconnectapi/buildicon/attributes
type BuildIconAttributes struct {
IconAsset *ImageAsset `json:"iconAsset,omitempty"`
IconType *IconAssetType `json:"iconType,omitempty"`
}
// BuildIconsResponse defines model for BuildIconsResponse.
//
// https://developer.apple.com/documentation/appstoreconnectapi/buildiconsresponse
type BuildIconsResponse struct {
Data []BuildIcon `json:"data"`
Links PagedDocumentLinks `json:"links"`
Meta *PagingInformation `json:"meta,omitempty"`
}
// ListIconsQuery are query options for ListIcons
//
// https://developer.apple.com/documentation/appstoreconnectapi/list_all_icons_for_a_build
type ListIconsQuery struct {
FieldsBuildIcons []string `url:"fields[buildIcons],omitempty"`
Limit int `url:"limit,omitempty"`
Cursor string `url:"cursor,omitempty"`
}
// ListIconsForBuild lists all the icons for various platforms delivered with a build.
//
// https://developer.apple.com/documentation/appstoreconnectapi/list_all_icons_for_a_build
func (s *BuildsService) ListIconsForBuild(ctx context.Context, id string, params *ListIconsQuery) (*BuildIconsResponse, *Response, error) {
url := fmt.Sprintf("builds/%s/icons", id)
res := new(BuildIconsResponse)
resp, err := s.client.get(ctx, url, params, res)
return res, resp, err
}