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
25 type PlanLimitsService struct {
26 client *Client
27 }
28
29
30
31
32 type PlanLimit struct {
33 ConanMaxFileSize int `json:"conan_max_file_size,omitempty"`
34 GenericPackagesMaxFileSize int `json:"generic_packages_max_file_size,omitempty"`
35 HelmMaxFileSize int `json:"helm_max_file_size,omitempty"`
36 MavenMaxFileSize int `json:"maven_max_file_size,omitempty"`
37 NPMMaxFileSize int `json:"npm_max_file_size,omitempty"`
38 NugetMaxFileSize int `json:"nuget_max_file_size,omitempty"`
39 PyPiMaxFileSize int `json:"pypi_max_file_size,omitempty"`
40 TerraformModuleMaxFileSize int `json:"terraform_module_max_file_size,omitempty"`
41 }
42
43
44
45
46
47
48 type GetCurrentPlanLimitsOptions struct {
49 PlanName *string `url:"plan_name,omitempty" json:"plan_name,omitempty"`
50 }
51
52
53
54
55
56 func (s *PlanLimitsService) GetCurrentPlanLimits(opt *GetCurrentPlanLimitsOptions, options ...RequestOptionFunc) (*PlanLimit, *Response, error) {
57 req, err := s.client.NewRequest(http.MethodGet, "application/plan_limits", opt, options)
58 if err != nil {
59 return nil, nil, err
60 }
61
62 pl := new(PlanLimit)
63 resp, err := s.client.Do(req, pl)
64 if err != nil {
65 return nil, resp, err
66 }
67
68 return pl, resp, nil
69 }
70
71
72
73
74
75 type ChangePlanLimitOptions struct {
76 PlanName *string `url:"plan_name,omitempty" json:"plan_name,omitempty"`
77 ConanMaxFileSize *int `url:"conan_max_file_size,omitempty" json:"conan_max_file_size,omitempty"`
78 GenericPackagesMaxFileSize *int `url:"generic_packages_max_file_size,omitempty" json:"generic_packages_max_file_size,omitempty"`
79 HelmMaxFileSize *int `url:"helm_max_file_size,omitempty" json:"helm_max_file_size,omitempty"`
80 MavenMaxFileSize *int `url:"maven_max_file_size,omitempty" json:"maven_max_file_size,omitempty"`
81 NPMMaxFileSize *int `url:"npm_max_file_size,omitempty" json:"npm_max_file_size,omitempty"`
82 NugetMaxFileSize *int `url:"nuget_max_file_size,omitempty" json:"nuget_max_file_size,omitempty"`
83 PyPiMaxFileSize *int `url:"pypi_max_file_size,omitempty" json:"pypi_max_file_size,omitempty"`
84 TerraformModuleMaxFileSize *int `url:"terraform_module_max_file_size,omitempty" json:"terraform_module_max_file_size,omitempty"`
85 }
86
87
88
89
90
91 func (s *PlanLimitsService) ChangePlanLimits(opt *ChangePlanLimitOptions, options ...RequestOptionFunc) (*PlanLimit, *Response, error) {
92 req, err := s.client.NewRequest(http.MethodPut, "application/plan_limits", opt, options)
93 if err != nil {
94 return nil, nil, err
95 }
96
97 pl := new(PlanLimit)
98 resp, err := s.client.Do(req, pl)
99 if err != nil {
100 return nil, resp, err
101 }
102
103 return pl, resp, nil
104 }
105
View as plain text