Skip to content

Commit 77ac2d7

Browse files
🩹 [Patch]: Set default 'PerPage' value in the GitHubContext (#206)
## Description - Set default `PerPage` value in the `GitHubContext` - Fixes #31 ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 76807b9 commit 77ac2d7

File tree

53 files changed

+109
-102
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+109
-102
lines changed

src/classes/public/Context/GitHubContext.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class GitHubContext : Context {
5353
# The default value for the Repo parameter.
5454
[string] $Repo
5555

56+
# The default value for the 'per_page' API parameter used in 'Get' functions that support paging.
57+
[int] $PerPage
58+
5659
# Simple parameterless constructor
5760
GitHubContext() {}
5861

src/functions/private/Organization/Blocking/Get-GitHubBlockedUserByOrganization.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
# The number of results per page (max 100).
2828
[Parameter()]
29-
[ValidateRange(1, 100)]
30-
[int] $PerPage = 30,
29+
[ValidateRange(0, 100)]
30+
[int] $PerPage,
3131

3232
# The context to run the command in. Used to get the details for the API call.
3333
# Can be either a string or a GitHubContext object.

src/functions/private/Organization/Get-GitHubAllOrganization.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
# The number of results per page (max 100).
3030
[Parameter()]
31-
[ValidateRange(1, 100)]
32-
[int] $PerPage = 30,
31+
[ValidateRange(0, 100)]
32+
[int] $PerPage,
3333

3434
# The context to run the command in. Used to get the details for the API call.
3535
# Can be either a string or a GitHubContext object.

src/functions/private/Organization/Get-GitHubMyOrganization.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
param(
2828
# The number of results per page (max 100).
2929
[Parameter()]
30-
[ValidateRange(1, 100)]
31-
[int] $PerPage = 30,
30+
[ValidateRange(0, 100)]
31+
[int] $PerPage,
3232

3333
# The context to run the command in. Used to get the details for the API call.
3434
# Can be either a string or a GitHubContext object.

src/functions/private/Organization/Get-GitHubUserOrganization.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
# The number of results per page (max 100).
3131
[Parameter()]
32-
[ValidateRange(1, 100)]
33-
[int] $PerPage = 30,
32+
[ValidateRange(0, 100)]
33+
[int] $PerPage,
3434

3535
# The context to run the command in. Used to get the details for the API call.
3636
# Can be either a string or a GitHubContext object.

src/functions/private/Releases/Assets/Get-GitHubReleaseAssetByReleaseID.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
# The number of results per page (max 100).
3737
[Parameter()]
38-
[ValidateRange(1, 100)]
39-
[int] $PerPage = 30,
38+
[ValidateRange(0, 100)]
39+
[int] $PerPage,
4040

4141
# The context to run the command in. Used to get the details for the API call.
4242
# Can be either a string or a GitHubContext object.

src/functions/private/Releases/Releases/Get-GitHubReleaseAll.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
# The number of results per page (max 100).
3131
[Parameter(ParameterSetName = 'AllUsers')]
32-
[ValidateRange(1, 100)]
33-
[int] $PerPage = 30,
32+
[ValidateRange(0, 100)]
33+
[int] $PerPage,
3434

3535
# The context to run the command in. Used to get the details for the API call.
3636
# Can be either a string or a GitHubContext object.

src/functions/private/Repositories/Repositories/Get-GitHubMyRepositories.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696

9797
# The number of results per page (max 100).
9898
[Parameter()]
99-
[ValidateRange(1, 100)]
100-
[int] $PerPage = 30,
99+
[ValidateRange(0, 100)]
100+
[int] $PerPage,
101101

102102
# Only show repositories updated after the given time.
103103
[Parameter()]

src/functions/private/Repositories/Repositories/Get-GitHubRepositoryListByOrg.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353

5454
# The number of results per page (max 100).
5555
[Parameter()]
56-
[ValidateRange(1, 100)]
57-
[int] $PerPage = 30,
56+
[ValidateRange(0, 100)]
57+
[int] $PerPage,
5858

5959
# The context to run the command in. Used to get the details for the API call.
6060
# Can be either a string or a GitHubContext object.

src/functions/private/Repositories/Repositories/Get-GitHubRepositoryListByUser.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555

5656
# The number of results per page (max 100).
5757
[Parameter()]
58-
[ValidateRange(1, 100)]
59-
[int] $PerPage = 30,
58+
[ValidateRange(0, 100)]
59+
[int] $PerPage,
6060

6161
# The context to run the command in. Used to get the details for the API call.
6262
# Can be either a string or a GitHubContext object.

0 commit comments

Comments
 (0)