Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUT-4040: Limit Param for DI Functions #75

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions BuildCustomFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ Try {
$skipToken = $($CustomPaginationMap.$NewCommandName.nextToken)

} else {
$ParameterContent = ($Params.Matches.Value | Where-Object { $_ -notlike '*${Limit}*' -and $_ -notlike '*${Skip}*' })
if ($NewCommandName -eq 'Get-JcSdkEvent') {
$ParameterContent = ($Params.Matches.Value)
} else {
$ParameterContent = ($Params.Matches.Value | Where-Object { $_ -notlike '*${Limit}*' -and $_ -notlike '*${Skip}*' })
}
$ContainsLimit = $Params.Matches.Value | Where-Object { $_ -like '*Limit*' }
$ContainsSkip = $Params.Matches.Value | Where-Object { $_ -like '*Skip*' }
$skip = 'Skip'
Expand Down Expand Up @@ -208,7 +212,10 @@ Try {
}
Start-Sleep -Seconds (`$resultCounter * 5)
} while (`$resultCounter -lt `$maxRetries)
If (`$JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If (`$limit) {
`$Results += `$Result
Break
} elseif (`$JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If (-not [System.String]::IsNullOrEmpty(`$Result)) {
`$XResultSearchAfter = (`$JCHttpResponse.Result.Headers.GetValues('X-Search_after') | ConvertFrom-Json);
If ([System.String]::IsNullOrEmpty(`$PSBoundParameters.SearchAfter)) {
Expand Down
2 changes: 1 addition & 1 deletion Configs/JumpCloud.SDK.DirectoryInsights.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ input-file:
module-name: JumpCloud.SDK.DirectoryInsights
namespace: JumpCloud.SDK.DirectoryInsights
sample-generation: true
module-version: 0.0.30
module-version: 0.0.31
dll-name: JumpCloud.SDK.DirectoryInsights.private

directive:
Expand Down
2 changes: 1 addition & 1 deletion Configs/JumpCloud.SDK.V1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ input-file:
module-name: JumpCloud.SDK.V1
namespace: JumpCloud.SDK.V1
sample-generation: true
module-version: 0.0.42
module-version: 0.0.43
dll-name: JumpCloud.SDK.V1.private

directive:
Expand Down
2 changes: 1 addition & 1 deletion Configs/JumpCloud.SDK.V2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ input-file:
module-name: JumpCloud.SDK.V2
namespace: JumpCloud.SDK.V2
sample-generation: true
module-version: 0.0.46
module-version: 0.0.47
dll-name: JumpCloud.SDK.V2.private

directive:
Expand Down
32 changes: 32 additions & 0 deletions JumpCloud.SDK.DirectoryInsights.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## JumpCloud.SDK.DirectoryInsights-0.0.31
Release Date: June 06, 2024
#### RELEASE NOTES
```
Added the Limit parameter to Get-JcSdkEvent function
```
#### FEATURES:
Added the Limit parameter to Get-JcSdkEvent function
#### IMPROVEMENTS:
NA
#### BUG FIXES:
NA
#### Generated Changes:

<details>
<summary>Functions Added</summary>

No changes
</details>

<details>
<summary>Functions Modified</summary>

No changes
</details>

<details>
<summary>Functions Removed</summary>

No changes
</details>

## JumpCloud.SDK.DirectoryInsights-0.0.30
Release Date: May 15, 2024
#### RELEASE NOTES
Expand Down
32 changes: 32 additions & 0 deletions JumpCloud.SDK.V1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## JumpCloud.SDK.V1-0.0.43
Release Date: June 06, 2024
#### RELEASE NOTES
```
This is a rollup release of the DirectoryInsights Module, no functional changes have been made
```
#### FEATURES:
NA
#### IMPROVEMENTS:
NA
#### BUG FIXES:
NA
#### Generated Changes:

<details>
<summary>Functions Added</summary>

No changes
</details>

<details>
<summary>Functions Modified</summary>

No changes
</details>

<details>
<summary>Functions Removed</summary>

No changes
</details>

## JumpCloud.SDK.V1-0.0.42
Release Date: May 15, 2024
#### RELEASE NOTES
Expand Down
32 changes: 32 additions & 0 deletions JumpCloud.SDK.V2.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## JumpCloud.SDK.V2-0.0.47
Release Date: June 06, 2024
#### RELEASE NOTES
```
This is a rollup release of the DirectoryInsights Module, no functional changes have been made
```
#### FEATURES:
NA
#### IMPROVEMENTS:
NA
#### BUG FIXES:
NA
#### Generated Changes:

<details>
<summary>Functions Added</summary>

No changes
</details>

<details>
<summary>Functions Modified</summary>

No changes
</details>

<details>
<summary>Functions Removed</summary>

No changes
</details>

## JumpCloud.SDK.V2-0.0.46
Release Date: May 15, 2024
#### RELEASE NOTES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>0.0.30</Version>
<Version>0.0.31</Version>
<LangVersion>7.1</LangVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Library</OutputType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>JumpCloud.SDK.DirectoryInsights</id>
<version>0.0.30</version>
<version>0.0.31</version>
<authors>JumpCloud</authors>
<owners>JumpCloud</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: JumpCloud
#
# Generated on: 5/15/2024
# Generated on: 6/6/2024
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = './JumpCloud.SDK.DirectoryInsights.psm1'

# Version number of this module.
ModuleVersion = '0.0.30'
ModuleVersion = '0.0.31'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ protected async Task<HttpResponseMessage> AddAuthHeaders(HttpRequestMessage requ
request.Headers.Add("Accept", "application/json");
}
// If headers do not contain an "UserAgent" with the correct value fix it
if (request.Headers.UserAgent.ToString() != "JumpCloud_JumpCloud.PowerShell.SDK.DirectoryInsights/0.0.30")
if (request.Headers.UserAgent.ToString() != "JumpCloud_JumpCloud.PowerShell.SDK.DirectoryInsights/0.0.31")
{
request.Headers.UserAgent.Clear();
request.Headers.UserAgent.ParseAdd("JumpCloud_JumpCloud.PowerShell.SDK.DirectoryInsights/0.0.30");
request.Headers.UserAgent.ParseAdd("JumpCloud_JumpCloud.PowerShell.SDK.DirectoryInsights/0.0.31");
}
// // request.Headers.Add("Content-Type", "application/json");
System.Net.Http.HttpResponseMessage response = await next.SendAsync(request, callback);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/Jum
# optional list of fields to return from query
${Fields},

[Parameter(ParameterSetName='GetExpanded')]
[JumpCloud.SDK.DirectoryInsights.Category('Body')]
[System.Int64]
# Max number of rows to return
${Limit},

[Parameter(ParameterSetName='GetExpanded')]
[JumpCloud.SDK.DirectoryInsights.Category('Body')]
[System.String]
Expand Down Expand Up @@ -230,7 +236,10 @@ https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/Jum
}
Start-Sleep -Seconds ($resultCounter * 5)
} while ($resultCounter -lt $maxRetries)
If ($JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If ($limit) {
$Results += $Result
Break
} elseif ($JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If (-not [System.String]::IsNullOrEmpty($Result)) {
$XResultSearchAfter = ($JCHttpResponse.Result.Headers.GetValues('X-Search_after') | ConvertFrom-Json);
If ([System.String]::IsNullOrEmpty($PSBoundParameters.SearchAfter)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/Jum
}
Start-Sleep -Seconds ($resultCounter * 5)
} while ($resultCounter -lt $maxRetries)
If ($JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If ($limit) {
$Results += $Result
Break
} elseif ($JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If (-not [System.String]::IsNullOrEmpty($Result)) {
$XResultSearchAfter = ($JCHttpResponse.Result.Headers.GetValues('X-Search_after') | ConvertFrom-Json);
If ([System.String]::IsNullOrEmpty($PSBoundParameters.SearchAfter)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/Jum
}
Start-Sleep -Seconds ($resultCounter * 5)
} while ($resultCounter -lt $maxRetries)
If ($JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If ($limit) {
$Results += $Result
Break
} elseif ($JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If (-not [System.String]::IsNullOrEmpty($Result)) {
$XResultSearchAfter = ($JCHttpResponse.Result.Headers.GetValues('X-Search_after') | ConvertFrom-Json);
If ([System.String]::IsNullOrEmpty($PSBoundParameters.SearchAfter)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,10 @@ https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/Jum
}
Start-Sleep -Seconds ($resultCounter * 5)
} while ($resultCounter -lt $maxRetries)
If ($JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If ($limit) {
$Results += $Result
Break
} elseif ($JCHttpResponse.Result.Headers.Contains('X-Search_after')) {
If (-not [System.String]::IsNullOrEmpty($Result)) {
$XResultSearchAfter = ($JCHttpResponse.Result.Headers.GetValues('X-Search_after') | ConvertFrom-Json);
If ([System.String]::IsNullOrEmpty($PSBoundParameters.SearchAfter)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events' -H 'Conten
### GetExpanded (Default)
```
Get-JcSdkEvent -Service <String[]> -StartTime <DateTime> [-EndTime <DateTime>] [-Fields <String[]>]
[-Q <String>] [-SearchAfter <String[]>] [-SearchTermAnd <Hashtable>] [-SearchTermNot <Hashtable>]
[-SearchTermOr <Hashtable>] [-Sort <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
[-Limit <Int64>] [-Q <String>] [-SearchAfter <String[]>] [-SearchTermAnd <Hashtable>]
[-SearchTermNot <Hashtable>] [-SearchTermOr <Hashtable>] [-Sort <String>] [-Confirm] [-WhatIf]
[<CommonParameters>]
```

### Get
Expand Down Expand Up @@ -141,6 +142,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Limit
Max number of rows to return

```yaml
Type: System.Int64
Parameter Sets: GetExpanded
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Q
optional string for specifying a full text query

Expand Down
2 changes: 1 addition & 1 deletion SDKs/PowerShell/JumpCloud.SDK.V1/JumpCloud.SDK.V1.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>0.0.42</Version>
<Version>0.0.43</Version>
<LangVersion>7.1</LangVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<OutputType>Library</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion SDKs/PowerShell/JumpCloud.SDK.V1/JumpCloud.SDK.V1.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>JumpCloud.SDK.V1</id>
<version>0.0.42</version>
<version>0.0.43</version>
<authors>JumpCloud</authors>
<owners>JumpCloud</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand Down
4 changes: 2 additions & 2 deletions SDKs/PowerShell/JumpCloud.SDK.V1/JumpCloud.SDK.V1.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: JumpCloud
#
# Generated on: 5/15/2024
# Generated on: 6/6/2024
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = './JumpCloud.SDK.V1.psm1'

# Version number of this module.
ModuleVersion = '0.0.42'
ModuleVersion = '0.0.43'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'
Expand Down
Loading
Loading