Skip to content

Commit

Permalink
asked changes done
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali authored and alidevhere committed Dec 28, 2022
1 parent 49f753e commit 7e6570e
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 8 deletions.
12 changes: 6 additions & 6 deletions github/actions_cache.go
Expand Up @@ -52,8 +52,8 @@ type ActionsCacheUsageList struct {
//
// GitHub API docs: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#get-github-actions-cache-usage-for-an-enterprise
type TotalCacheUsage struct {
TotalActiveCacheUsageSizeInBytes int64 `json:"total_active_caches_size_in_bytes"`
TotalActiveCachesCount int `json:"total_active_caches_count"`
TotalActiveCachesUsageSizeInBytes int64 `json:"total_active_caches_size_in_bytes"`
TotalActiveCachesCount int `json:"total_active_caches_count"`
}

// ActionsCacheListOptions represents a list of all possible optional Query parameters for ListCaches method.
Expand All @@ -64,12 +64,12 @@ type ActionsCacheListOptions struct {
// The Git reference for the results you want to list.
// The ref for a branch can be formatted either as refs/heads/<branch name>
// or simply <branch name>. To reference a pull request use refs/pull/<number>/merge
Ref string `url:"ref,omitempty"`
Key string `url:"key,omitempty"`
Ref *string `url:"ref,omitempty"`
Key *string `url:"key,omitempty"`
// Can be one of: "created_at", "last_accessed_at", "size_in_bytes". Default: "last_accessed_at"
Sort string `url:"sort,omitempty"`
Sort *string `url:"sort,omitempty"`
// Can be one of: "asc", "desc" Default: desc
Direction string `url:"direction,omitempty"`
Direction *string `url:"direction,omitempty"`
}

// ListCaches lists the GitHub Actions caches for a repository.
Expand Down
4 changes: 2 additions & 2 deletions github/actions_cache_test.go
Expand Up @@ -394,7 +394,7 @@ func TestActionsService_GetCacheUsageForOrg(t *testing.T) {
t.Errorf("Actions.GetTotalCacheUsageForOrg returned error: %v", err)
}

want := &TotalCacheUsage{TotalActiveCacheUsageSizeInBytes: 1000, TotalActiveCachesCount: 1}
want := &TotalCacheUsage{TotalActiveCachesUsageSizeInBytes: 1000, TotalActiveCachesCount: 1}
if !cmp.Equal(cache, want) {
t.Errorf("Actions.GetTotalCacheUsageForOrg returned %+v, want %+v", cache, want)
}
Expand Down Expand Up @@ -465,7 +465,7 @@ func TestActionsService_GetCacheUsageForEnterprise(t *testing.T) {
t.Errorf("Actions.GetTotalCacheUsageForEnterprise returned error: %v", err)
}

want := &TotalCacheUsage{TotalActiveCacheUsageSizeInBytes: 1000, TotalActiveCachesCount: 1}
want := &TotalCacheUsage{TotalActiveCachesUsageSizeInBytes: 1000, TotalActiveCachesCount: 1}
if !cmp.Equal(cache, want) {
t.Errorf("Actions.GetTotalCacheUsageForEnterprise returned %+v, want %+v", cache, want)
}
Expand Down
32 changes: 32 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7e6570e

Please sign in to comment.