Debian Codegraph @

github/repos_properties.go

raw
1 // Copyright 2023 The go-github AUTHORS. 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
6 package github
7
8 import (
9 "context"
10 "fmt"
11 )
12
13 // GetAllCustomPropertyValues gets all custom property values that are set for a repository.
14 //
15 // GitHub API docs: https://docs.github.com/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository
16 //
17 //meta:operation GET /repos/{owner}/{repo}/properties/values
18 func (s *RepositoriesService) GetAllCustomPropertyValues(ctx context.Context, org, repo string) ([]*CustomPropertyValue, *Response, error) {
19 u := fmt.Sprintf("repos/%v/%v/properties/values", org, repo)
20
21 req, err := s.client.NewRequest("GET", u, nil)
22 if err != nil {
23 return nil, nil, err
24 }
25
26 var customPropertyValues []*CustomPropertyValue
27 resp, err := s.client.Do(ctx, req, &customPropertyValues)
28 if err != nil {
29 return nil, resp, err
30 }
31
32 return customPropertyValues, resp, nil
33 }