1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package gitlab
18
19 import "net/http"
20
21
22
23
24 type AppearanceService struct {
25 client *Client
26 }
27
28
29
30
31 type Appearance struct {
32 Title string `json:"title"`
33 Description string `json:"description"`
34 PWAName string `json:"pwa_name"`
35 PWAShortName string `json:"pwa_short_name"`
36 PWADescription string `json:"pwa_description"`
37 PWAIcon string `json:"pwa_icon"`
38 Logo string `json:"logo"`
39 HeaderLogo string `json:"header_logo"`
40 Favicon string `json:"favicon"`
41 NewProjectGuidelines string `json:"new_project_guidelines"`
42 ProfileImageGuidelines string `json:"profile_image_guidelines"`
43 HeaderMessage string `json:"header_message"`
44 FooterMessage string `json:"footer_message"`
45 MessageBackgroundColor string `json:"message_background_color"`
46 MessageFontColor string `json:"message_font_color"`
47 EmailHeaderAndFooterEnabled bool `json:"email_header_and_footer_enabled"`
48 }
49
50
51
52
53
54 func (s *AppearanceService) GetAppearance(options ...RequestOptionFunc) (*Appearance, *Response, error) {
55 req, err := s.client.NewRequest(http.MethodGet, "application/appearance", nil, options)
56 if err != nil {
57 return nil, nil, err
58 }
59
60 as := new(Appearance)
61 resp, err := s.client.Do(req, as)
62 if err != nil {
63 return nil, resp, err
64 }
65
66 return as, resp, nil
67 }
68
69
70
71
72
73 type ChangeAppearanceOptions struct {
74 Title *string `url:"title,omitempty" json:"title,omitempty"`
75 Description *string `url:"description,omitempty" json:"description,omitempty"`
76 PWAName *string `url:"pwa_name,omitempty" json:"pwa_name,omitempty"`
77 PWAShortName *string `url:"pwa_short_name,omitempty" json:"pwa_short_name,omitempty"`
78 PWADescription *string `url:"pwa_description,omitempty" json:"pwa_description,omitempty"`
79 PWAIcon *string `url:"pwa_icon,omitempty" json:"pwa_icon,omitempty"`
80 Logo *string `url:"logo,omitempty" json:"logo,omitempty"`
81 HeaderLogo *string `url:"header_logo,omitempty" json:"header_logo,omitempty"`
82 Favicon *string `url:"favicon,omitempty" json:"favicon,omitempty"`
83 NewProjectGuidelines *string `url:"new_project_guidelines,omitempty" json:"new_project_guidelines,omitempty"`
84 ProfileImageGuidelines *string `url:"profile_image_guidelines,omitempty" json:"profile_image_guidelines,omitempty"`
85 HeaderMessage *string `url:"header_message,omitempty" json:"header_message,omitempty"`
86 FooterMessage *string `url:"footer_message,omitempty" json:"footer_message,omitempty"`
87 MessageBackgroundColor *string `url:"message_background_color,omitempty" json:"message_background_color,omitempty"`
88 MessageFontColor *string `url:"message_font_color,omitempty" json:"message_font_color,omitempty"`
89 EmailHeaderAndFooterEnabled *bool `url:"email_header_and_footer_enabled,omitempty" json:"email_header_and_footer_enabled,omitempty"`
90 URL *string `url:"url,omitempty" json:"url,omitempty"`
91 }
92
93
94
95
96
97 func (s *AppearanceService) ChangeAppearance(opt *ChangeAppearanceOptions, options ...RequestOptionFunc) (*Appearance, *Response, error) {
98 req, err := s.client.NewRequest(http.MethodPut, "application/appearance", opt, options)
99 if err != nil {
100 return nil, nil, err
101 }
102
103 as := new(Appearance)
104 resp, err := s.client.Do(req, as)
105 if err != nil {
106 return nil, resp, err
107 }
108
109 return as, resp, nil
110 }
111
View as plain text