Public/DirectoryInsights/Get-JCEvent.ps1

<#
.Synopsis
Query the API for Directory Insights events
.Description
Query the API for Directory Insights events
.Example
Get-JCEvent -Service:(<string[]>) -StartTime:(<datetime>) -EndTime:(<datetime>) -ExactMatch:(<string>) -Fields:(<string[]>) -Limit:(<long>) -Q:(<string>) -SearchAfter:(<string[]>) -SearchTermAnd:(<hashtable>) -SearchTermNot:(<hashtable>) -SearchTermOr:(<hashtable>) -Skip:(<long>) -Sort:(<string>)
.Example
Get-JCEvent -Body:(<JumpCloud.SDK.DirectoryInsights.Models.EventQuery>)

.Inputs
JumpCloud.SDK.DirectoryInsights.Models.IEventQuery
.Outputs
JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem
.Notes
COMPLEX PARAMETER PROPERTIES

To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.

BODY <IEventQuery>: EventQuery is the users' command to search our auth logs
  Service <List<String>>: service name to query.
  StartTime <DateTime>: query start time, UTC in RFC3339 format
  [EndTime <DateTime?>]: optional query end time, UTC in RFC3339 format
  [ExactMatch <String>]: optional string for specifying exact match query, do not use with full text query
  [Fields <List<String>>]: optional list of fields to return from query
  [Limit <Int64?>]: Max number of rows to return
  [Q <String>]: optional string for specifying a full text query
  [SearchAfter <List<String>>]: Specific query to search after, see x-* response headers for next values
  [SearchTermAnd <ITermConjunction>]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values
    [(Any) <Object>]: This indicates any property can be added to this object.
  [SearchTermNot <ITermConjunction>]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values
  [SearchTermOr <ITermConjunction>]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values
  [Skip <Int64?>]: optional offset into the result set to start with when returning
  [Sort <String>]: ASC or DESC order for timestamp
.Link
https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md
#>

Function Get-JCEvent {
    [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])]
    [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
    Param(
        [Parameter(ParameterSetName='GetExpanded', Mandatory)]
        [AllowEmptyCollection()]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [System.String[]]
        # service name to query.
        ${Service},
        
        [Parameter(ParameterSetName='GetExpanded', Mandatory)]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [System.DateTime]
        # query start time, UTC in RFC3339 format
        ${StartTime},
        
        [Parameter(ParameterSetName='GetExpanded')]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [System.DateTime]
        # optional query end time, UTC in RFC3339 format
        ${EndTime},
        
        [Parameter(ParameterSetName='GetExpanded')]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [System.String]
        # optional string for specifying exact match query, do not use with full text query
        ${ExactMatch},
        
        [Parameter(ParameterSetName='GetExpanded')]
        [AllowEmptyCollection()]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [System.String[]]
        # 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]
        # optional string for specifying a full text query
        ${Q},
        
        [Parameter(ParameterSetName='GetExpanded')]
        [AllowEmptyCollection()]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [System.String[]]
        # Specific query to search after, see x-* response headers for next values
        ${SearchAfter},
        
        [Parameter(ParameterSetName='GetExpanded')]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))]
        [System.Collections.Hashtable]
        # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values
        ${SearchTermAnd},
        
        [Parameter(ParameterSetName='GetExpanded')]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))]
        [System.Collections.Hashtable]
        # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values
        ${SearchTermNot},
        
        [Parameter(ParameterSetName='GetExpanded')]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))]
        [System.Collections.Hashtable]
        # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values
        ${SearchTermOr},
        
        [Parameter(ParameterSetName='GetExpanded')]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [System.String]
        # ASC or DESC order for timestamp
        ${Sort},
        
        [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)]
        [JumpCloud.SDK.DirectoryInsights.Category('Body')]
        [JumpCloud.SDK.DirectoryInsights.Models.IEventQuery]
        # EventQuery is the users' command to search our auth logs
        ${Body}
    )
    Begin {
        Connect-JCOnline -force | Out-Null
        $Results = @()
    }
    Process {
        $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEvent @PSBoundParameters
    }
    End {
        Return $Results
    }
}