Skip to content

Commit 7dcd064

Browse files
committed
Renamed APIs
Signed-off-by: abhishek <abhishek@exaforce.com>
1 parent 6ea9fac commit 7dcd064

6 files changed

Lines changed: 114 additions & 114 deletions

File tree

github/copilot.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,19 +356,19 @@ func (s *CopilotService) ListCopilotEnterpriseSeats(ctx context.Context, enterpr
356356
return copilotSeats, resp, nil
357357
}
358358

359-
// ListCopilotCodingAgentRepositoriesResponse represents the response from listing
359+
// ListOrganizationCopilotCodingAgentRepositoriesResponse represents the response from listing
360360
// repositories enabled for the Copilot coding agent in an organization.
361-
type ListCopilotCodingAgentRepositoriesResponse struct {
361+
type ListOrganizationCopilotCodingAgentRepositoriesResponse struct {
362362
TotalCount int `json:"total_count"`
363363
Repositories []*Repository `json:"repositories"`
364364
}
365365

366-
// ListCopilotCodingAgentRepositories lists repositories enabled for the Copilot coding agent in an organization.
366+
// ListOrganizationCodingAgentRepositories lists repositories enabled for the Copilot coding agent in an organization.
367367
//
368368
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-coding-agent-management?apiVersion=2022-11-28#list-repositories-enabled-for-copilot-coding-agent-in-an-organization
369369
//
370370
//meta:operation GET /orgs/{org}/copilot/coding-agent/permissions/repositories
371-
func (s *CopilotService) ListCopilotCodingAgentRepositories(ctx context.Context, org string, opts *ListOptions) (*ListCopilotCodingAgentRepositoriesResponse, *Response, error) {
371+
func (s *CopilotService) ListOrganizationCodingAgentRepositories(ctx context.Context, org string, opts *ListOptions) (*ListOrganizationCopilotCodingAgentRepositoriesResponse, *Response, error) {
372372
u := fmt.Sprintf("orgs/%v/copilot/coding-agent/permissions/repositories", org)
373373
u, err := addOptions(u, opts)
374374
if err != nil {
@@ -380,7 +380,7 @@ func (s *CopilotService) ListCopilotCodingAgentRepositories(ctx context.Context,
380380
return nil, nil, err
381381
}
382382

383-
var result *ListCopilotCodingAgentRepositoriesResponse
383+
var result *ListOrganizationCopilotCodingAgentRepositoriesResponse
384384
resp, err := s.client.Do(ctx, req, &result)
385385
if err != nil {
386386
return nil, resp, err
@@ -394,12 +394,12 @@ func (s *CopilotService) ListCopilotCodingAgentRepositories(ctx context.Context,
394394
// list of file paths excluded from Copilot for that repository.
395395
type CopilotOrganizationContentExclusionDetails map[string][]string
396396

397-
// GetCopilotOrganizationContentExclusionDetails gets the Copilot content exclusion rules for an organization.
397+
// GetOrganizationContentExclusionDetails gets the Copilot content exclusion rules for an organization.
398398
//
399399
// GitHub API docs: https://docs.github.com/rest/copilot/copilot-content-exclusion-management?apiVersion=2022-11-28#get-copilot-content-exclusion-rules-for-an-organization
400400
//
401401
//meta:operation GET /orgs/{org}/copilot/content_exclusion
402-
func (s *CopilotService) GetCopilotOrganizationContentExclusionDetails(ctx context.Context, org string) (CopilotOrganizationContentExclusionDetails, *Response, error) {
402+
func (s *CopilotService) GetOrganizationContentExclusionDetails(ctx context.Context, org string) (CopilotOrganizationContentExclusionDetails, *Response, error) {
403403
u := fmt.Sprintf("orgs/%v/copilot/content_exclusion", org)
404404

405405
req, err := s.client.NewRequest("GET", u, nil)

github/copilot_test.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ func TestCopilotService_ListCopilotEnterpriseSeats(t *testing.T) {
776776
})
777777
}
778778

779-
func TestCopilotService_ListCopilotCodingAgentRepositories(t *testing.T) {
779+
func TestCopilotService_ListOrganizationCodingAgentRepositories(t *testing.T) {
780780
t.Parallel()
781781
client, mux, _ := setup(t)
782782

@@ -797,39 +797,39 @@ func TestCopilotService_ListCopilotCodingAgentRepositories(t *testing.T) {
797797

798798
ctx := t.Context()
799799
opts := &ListOptions{Page: 1, PerPage: 100}
800-
got, _, err := client.Copilot.ListCopilotCodingAgentRepositories(ctx, "o", opts)
800+
got, _, err := client.Copilot.ListOrganizationCodingAgentRepositories(ctx, "o", opts)
801801
if err != nil {
802-
t.Errorf("Copilot.ListCopilotCodingAgentRepositories returned error: %v", err)
802+
t.Errorf("Copilot.ListOrganizationCodingAgentRepositories returned error: %v", err)
803803
}
804804

805-
want := &ListCopilotCodingAgentRepositoriesResponse{
805+
want := &ListOrganizationCopilotCodingAgentRepositoriesResponse{
806806
TotalCount: 2,
807807
Repositories: []*Repository{
808808
{ID: Ptr(int64(1)), Name: Ptr("Hello-World"), FullName: Ptr("octocat/Hello-World")},
809809
{ID: Ptr(int64(2)), Name: Ptr("Hello-World-2"), FullName: Ptr("octocat/Hello-World-2")},
810810
},
811811
}
812812
if !cmp.Equal(got, want) {
813-
t.Errorf("Copilot.ListCopilotCodingAgentRepositories returned %+v, want %+v", got, want)
813+
t.Errorf("Copilot.ListOrganizationCodingAgentRepositories returned %+v, want %+v", got, want)
814814
}
815815

816-
const methodName = "ListCopilotCodingAgentRepositories"
816+
const methodName = "ListOrganizationCodingAgentRepositories"
817817

818818
testBadOptions(t, methodName, func() (err error) {
819-
_, _, err = client.Copilot.ListCopilotCodingAgentRepositories(ctx, "\n", opts)
819+
_, _, err = client.Copilot.ListOrganizationCodingAgentRepositories(ctx, "\n", opts)
820820
return err
821821
})
822822

823823
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
824-
got, resp, err := client.Copilot.ListCopilotCodingAgentRepositories(ctx, "o", opts)
824+
got, resp, err := client.Copilot.ListOrganizationCodingAgentRepositories(ctx, "o", opts)
825825
if got != nil {
826-
t.Errorf("Copilot.ListCopilotCodingAgentRepositories returned %+v, want nil", got)
826+
t.Errorf("Copilot.ListOrganizationCodingAgentRepositories returned %+v, want nil", got)
827827
}
828828
return resp, err
829829
})
830830
}
831831

832-
func TestCopilotService_GetCopilotOrganizationContentExclusionDetails(t *testing.T) {
832+
func TestCopilotService_GetOrganizationContentExclusionDetails(t *testing.T) {
833833
t.Parallel()
834834
client, mux, _ := setup(t)
835835

@@ -842,40 +842,40 @@ func TestCopilotService_GetCopilotOrganizationContentExclusionDetails(t *testing
842842
})
843843

844844
ctx := t.Context()
845-
got, _, err := client.Copilot.GetCopilotOrganizationContentExclusionDetails(ctx, "o")
845+
got, _, err := client.Copilot.GetOrganizationContentExclusionDetails(ctx, "o")
846846
if err != nil {
847-
t.Errorf("Copilot.GetCopilotOrganizationContentExclusionDetails returned error: %v", err)
847+
t.Errorf("Copilot.GetOrganizationContentExclusionDetails returned error: %v", err)
848848
}
849849

850850
want := CopilotOrganizationContentExclusionDetails{
851851
"octo-repo": {"/src/some-dir/kernel.rs"},
852852
"octo-repo-2": {"/docs/secret.md", "**/*.env"},
853853
}
854854
if !cmp.Equal(got, want) {
855-
t.Errorf("Copilot.GetCopilotOrganizationContentExclusionDetails returned %+v, want %+v", got, want)
855+
t.Errorf("Copilot.GetOrganizationContentExclusionDetails returned %+v, want %+v", got, want)
856856
}
857857

858-
const methodName = "GetCopilotOrganizationContentExclusionDetails"
858+
const methodName = "GetOrganizationContentExclusionDetails"
859859

860860
testBadOptions(t, methodName, func() (err error) {
861-
_, _, err = client.Copilot.GetCopilotOrganizationContentExclusionDetails(ctx, "\n")
861+
_, _, err = client.Copilot.GetOrganizationContentExclusionDetails(ctx, "\n")
862862
return err
863863
})
864864

865865
testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
866-
got, resp, err := client.Copilot.GetCopilotOrganizationContentExclusionDetails(ctx, "o")
866+
got, resp, err := client.Copilot.GetOrganizationContentExclusionDetails(ctx, "o")
867867
if got != nil {
868-
t.Errorf("Copilot.GetCopilotOrganizationContentExclusionDetails returned %+v, want nil", got)
868+
t.Errorf("Copilot.GetOrganizationContentExclusionDetails returned %+v, want nil", got)
869869
}
870870
return resp, err
871871
})
872872
}
873873

874-
func TestListCopilotCodingAgentRepositoriesResponse_Marshal(t *testing.T) {
874+
func TestListOrganizationCopilotCodingAgentRepositoriesResponse_Marshal(t *testing.T) {
875875
t.Parallel()
876-
testJSONMarshal(t, &ListCopilotCodingAgentRepositoriesResponse{}, `{"total_count":0,"repositories":null}`)
876+
testJSONMarshal(t, &ListOrganizationCopilotCodingAgentRepositoriesResponse{}, `{"total_count":0,"repositories":null}`)
877877

878-
r := &ListCopilotCodingAgentRepositoriesResponse{
878+
r := &ListOrganizationCopilotCodingAgentRepositoriesResponse{
879879
TotalCount: 1,
880880
Repositories: []*Repository{
881881
{ID: Ptr(int64(1)), Name: Ptr("Hello-World"), FullName: Ptr("octocat/Hello-World")},

github/github-accessors.go

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-iterators.go

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)