Api/NERMProfilesApi.ps1
|
# # NERM API # The NERM API accesss and modifies resources in your environment. # Version: 1.0.0 # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS Create multiple profiles .DESCRIPTION Create multiple profiles .PARAMETER CreateProfilesRequest No description available. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS SearchAdvancedSearch200Response #> function New-NERMProfiles { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${CreateProfilesRequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: New-NERMProfiles' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') $LocalVarUri = '/profiles' if (!$CreateProfilesRequest) { throw "Error! The required parameter `CreateProfilesRequest` missing when calling createProfiles." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($CreateProfilesRequest -is [array])) { $LocalVarBodyParameter = $CreateProfilesRequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $CreateProfilesRequest | ForEach-Object { # Get array of names of object properties that can be cast to boolean TRUE # PSObject.Properties - https://msdn.microsoft.com/en-us/library/system.management.automation.psobject.properties.aspx $NonEmptyProperties = $_.psobject.Properties | Where-Object {$null -ne $_.Value} | Select-Object -ExpandProperty Name # Convert object to JSON with only non-empty properties $_ | Select-Object -Property $NonEmptyProperties | ConvertTo-Json -Depth 100 } } $LocalVarResult = Invoke-NERMApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "SearchAdvancedSearch200Response" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Delete a single profile .DESCRIPTION Delete a single profile .PARAMETER Id ID of the object to retrieve, update, or delete .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS None #> function Remove-NERMProfileById { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Switch] $WithHttpInfo ) Process { 'Calling method: Remove-NERMProfileById' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/profiles/{id}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling deleteProfileById." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) $LocalVarResult = Invoke-NERMApiClient -Method 'DELETE' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Delete multiple profiles .DESCRIPTION Delete multiple profiles .PARAMETER CreateProfilesRequest No description available. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS DeleteProfiles200Response #> function Remove-NERMProfiles { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${CreateProfilesRequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Remove-NERMProfiles' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') $LocalVarUri = '/profiles' if (!$CreateProfilesRequest) { throw "Error! The required parameter `CreateProfilesRequest` missing when calling deleteProfiles." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($CreateProfilesRequest -is [array])) { $LocalVarBodyParameter = $CreateProfilesRequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $CreateProfilesRequest | ForEach-Object { # Get array of names of object properties that can be cast to boolean TRUE # PSObject.Properties - https://msdn.microsoft.com/en-us/library/system.management.automation.psobject.properties.aspx $NonEmptyProperties = $_.psobject.Properties | Where-Object {$null -ne $_.Value} | Select-Object -ExpandProperty Name # Convert object to JSON with only non-empty properties $_ | Select-Object -Property $NonEmptyProperties | ConvertTo-Json -Depth 100 } } $LocalVarResult = Invoke-NERMApiClient -Method 'DELETE' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "DeleteProfiles200Response" ` -IsBodyNullable $false # process oneOf response $LocalVarResult["Response"] = ConvertFrom-NERMJsonToDeleteProfiles200Response (ConvertTo-Json $LocalVarResult["Response"] -Depth 100) if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Retrieves profile avatar URL .DESCRIPTION Retrieves the URL of the profile avatar .PARAMETER Id ID of the object to retrieve, update, or delete .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS Url #> function Get-NERMProfileAvatar { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Switch] $WithHttpInfo ) Process { 'Calling method: Get-NERMProfileAvatar' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/profiles/{id}/avatar' if (!$Id) { throw "Error! The required parameter `Id` missing when calling getProfileAvatar." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) $LocalVarResult = Invoke-NERMApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Url" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Find profile by id .DESCRIPTION Find profile by id .PARAMETER Id ID of the object to retrieve, update, or delete .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS GetSingleSchemaMappedProfile200Response #> function Get-NERMProfileById { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Switch] $WithHttpInfo ) Process { 'Calling method: Get-NERMProfileById' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/profiles/{id}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling getProfileById." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) $LocalVarResult = Invoke-NERMApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "GetSingleSchemaMappedProfile200Response" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Retrieves profile attribute attachment URL .DESCRIPTION Retrieves the URL of an attachment attribute value from a profile .PARAMETER Id ID of the object to retrieve, update, or delete .PARAMETER AttributeId The id of the attachment attribute .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS Url #> function Get-NERMProfileUpload { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${AttributeId}, [Switch] $WithHttpInfo ) Process { 'Calling method: Get-NERMProfileUpload' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/profiles/{id}/upload/{attribute_id}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling getProfileUpload." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if (!$AttributeId) { throw "Error! The required parameter `AttributeId` missing when calling getProfileUpload." } $LocalVarUri = $LocalVarUri.replace('{attribute_id}', [System.Web.HTTPUtility]::UrlEncode($AttributeId)) $LocalVarResult = Invoke-NERMApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Url" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Get profiles .DESCRIPTION Get profiles .PARAMETER Limit The maximum number of items to return. .PARAMETER Offset The number of items to skip before starting to collect the result set. .PARAMETER Order The field to order results by. .PARAMETER ExcludeAttributes Allows for optimization by not returning the associated attribute data for the returned profiles .PARAMETER Name object name for filtering .PARAMETER ProfileTypeId Profile Type ID for filtering .PARAMETER Status status value for filtering .PARAMETER Metadata Returns batching metadata in the response. This includes `total` as the total quantity, `next` as the path of the following query url, `limit` and `after_id` (if requested) with the next following id (null if it is the last ""page""). .PARAMETER AfterId Represents the ID where the query should begin from. If blank, it represents the first ID. When used, forces sorting by ID ascending and does not allow use of `offset`. When `after_id` is specified it changes the mode of the API such that any filter parameters other than `profile_type_id`, `limit`, and `offset` are not supported and will be either silently ignored or result in an HTTP 400 error. For example you can not include an `after_id` along with an `archived=false` in the same request. Can be used alongside `metadata` parameter. .PARAMETER UpdatedAfter Adds support for filtering profiles based on the date of the latest modification made on them. Can be used alongside the after_id parameter. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS GetSchemaMappedProfilesCollection200Response #> function Get-NERMProfiles { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Int32]] ${Limit}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Int32]] ${Offset}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Order}, [Parameter(Position = 3, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${ExcludeAttributes}, [Parameter(Position = 4, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Name}, [Parameter(Position = 5, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${ProfileTypeId}, [Parameter(Position = 6, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [ValidateSet("Active", "Inactive", "On Leave", "Terminated")] [String] ${Status}, [Parameter(Position = 7, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[Boolean]] ${Metadata}, [Parameter(Position = 8, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${AfterId}, [Parameter(Position = 9, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.Nullable[System.DateTime]] ${UpdatedAfter}, [Switch] $WithHttpInfo ) Process { 'Calling method: Get-NERMProfiles' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') $LocalVarUri = '/profiles' if ($Limit) { $LocalVarQueryParameters['limit'] = $Limit } if ($Offset) { $LocalVarQueryParameters['offset'] = $Offset } if ($Order) { $LocalVarQueryParameters['order'] = $Order } if ($ExcludeAttributes) { $LocalVarQueryParameters['exclude_attributes'] = $ExcludeAttributes } if ($Name) { $LocalVarQueryParameters['name'] = $Name } if ($ProfileTypeId) { $LocalVarQueryParameters['profile_type_id'] = $ProfileTypeId } if ($Status) { $LocalVarQueryParameters['status'] = $Status } if ($Metadata) { $LocalVarQueryParameters['metadata'] = $Metadata } if ($AfterId) { $LocalVarQueryParameters['after_id'] = $AfterId } if ($UpdatedAfter) { $LocalVarQueryParameters['updated_after'] = $UpdatedAfter } $LocalVarResult = Invoke-NERMApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "GetSchemaMappedProfilesCollection200Response" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Update a profile by id .DESCRIPTION Update a profile by id .PARAMETER Id ID of the object to retrieve, update, or delete .PARAMETER SubmitProfileRequest No description available. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS GetSingleSchemaMappedProfile200Response #> function Update-NERMProfileById { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${SubmitProfileRequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Update-NERMProfileById' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') $LocalVarUri = '/profiles/{id}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling patchProfileById." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if (!$SubmitProfileRequest) { throw "Error! The required parameter `SubmitProfileRequest` missing when calling patchProfileById." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($SubmitProfileRequest -is [array])) { $LocalVarBodyParameter = $SubmitProfileRequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $SubmitProfileRequest | ForEach-Object { # Get array of names of object properties that can be cast to boolean TRUE # PSObject.Properties - https://msdn.microsoft.com/en-us/library/system.management.automation.psobject.properties.aspx $NonEmptyProperties = $_.psobject.Properties | Where-Object {$null -ne $_.Value} | Select-Object -ExpandProperty Name # Convert object to JSON with only non-empty properties $_ | Select-Object -Property $NonEmptyProperties | ConvertTo-Json -Depth 100 } } $LocalVarResult = Invoke-NERMApiClient -Method 'PATCH' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "GetSingleSchemaMappedProfile200Response" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Update multiple profiles .DESCRIPTION Update multiple profiles .PARAMETER CreateProfilesRequest No description available. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS SearchAdvancedSearch200Response #> function Update-NERMProfiles { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${CreateProfilesRequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Update-NERMProfiles' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') $LocalVarUri = '/profiles' if (!$CreateProfilesRequest) { throw "Error! The required parameter `CreateProfilesRequest` missing when calling patchProfiles." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($CreateProfilesRequest -is [array])) { $LocalVarBodyParameter = $CreateProfilesRequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $CreateProfilesRequest | ForEach-Object { # Get array of names of object properties that can be cast to boolean TRUE # PSObject.Properties - https://msdn.microsoft.com/en-us/library/system.management.automation.psobject.properties.aspx $NonEmptyProperties = $_.psobject.Properties | Where-Object {$null -ne $_.Value} | Select-Object -ExpandProperty Name # Convert object to JSON with only non-empty properties $_ | Select-Object -Property $NonEmptyProperties | ConvertTo-Json -Depth 100 } } $LocalVarResult = Invoke-NERMApiClient -Method 'PATCH' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "SearchAdvancedSearch200Response" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Create a profile .DESCRIPTION Create a profile .PARAMETER SubmitProfileRequest No description available. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS GetSingleSchemaMappedProfile200Response #> function Submit-NERMProfile { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${SubmitProfileRequest}, [Switch] $WithHttpInfo ) Process { 'Calling method: Submit-NERMProfile' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') $LocalVarUri = '/profile' if (!$SubmitProfileRequest) { throw "Error! The required parameter `SubmitProfileRequest` missing when calling submitProfile." } if ($LocalVarContentTypes.Contains('application/json-patch+json') -or ($SubmitProfileRequest -is [array])) { $LocalVarBodyParameter = $SubmitProfileRequest | ConvertTo-Json -AsArray -Depth 100 } else { $LocalVarBodyParameter = $SubmitProfileRequest | ForEach-Object { # Get array of names of object properties that can be cast to boolean TRUE # PSObject.Properties - https://msdn.microsoft.com/en-us/library/system.management.automation.psobject.properties.aspx $NonEmptyProperties = $_.psobject.Properties | Where-Object {$null -ne $_.Value} | Select-Object -ExpandProperty Name # Convert object to JSON with only non-empty properties $_ | Select-Object -Property $NonEmptyProperties | ConvertTo-Json -Depth 100 } } $LocalVarResult = Invoke-NERMApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "GetSingleSchemaMappedProfile200Response" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Uploads new profile avatar .DESCRIPTION Uploads a new profile avatar .PARAMETER Id ID of the object to retrieve, update, or delete .PARAMETER File No description available. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS Url #> function Submit-NERMProfileAvatar { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.IO.FileInfo] ${File}, [Switch] $WithHttpInfo ) Process { 'Calling method: Submit-NERMProfileAvatar' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') # HTTP header 'Content-Type' $LocalVarContentTypes = @('multipart/form-data') $LocalVarUri = '/profiles/{id}/avatar' if (!$Id) { throw "Error! The required parameter `Id` missing when calling submitProfileAvatar." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if ($File) { $LocalVarFormParameters['file'] = $File | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) } } $LocalVarResult = Invoke-NERMApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Url" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } <# .SYNOPSIS Uploads profile attachment attribute .DESCRIPTION Uploads a new attachment attribute value to a profile. The upload must be a FORM data type; this is not a JSON API. The upload must include the binary content of the payload under the 'file' named form element. The upload must not attempt to include the file name or its content type as a other form or JSON as parameters. The upload must not attempt to upload the file body as the POST body payload; it has to arrive as a FORM parameter. Do not use a `File/Binary` payload type for the POST operation in your API client. .PARAMETER Id ID of the object to retrieve, update, or delete .PARAMETER AttributeId The id of the attachment attribute .PARAMETER File No description available. .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS Url #> function Submit-NERMProfileUpload { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [Parameter(Position = 1, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${AttributeId}, [Parameter(Position = 2, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [System.IO.FileInfo] ${File}, [Switch] $WithHttpInfo ) Process { 'Calling method: Submit-NERMProfileUpload' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json') # HTTP header 'Content-Type' $LocalVarContentTypes = @('multipart/form-data') $LocalVarUri = '/profiles/{id}/upload/{attribute_id}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling submitProfileUpload." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if (!$AttributeId) { throw "Error! The required parameter `AttributeId` missing when calling submitProfileUpload." } $LocalVarUri = $LocalVarUri.replace('{attribute_id}', [System.Web.HTTPUtility]::UrlEncode($AttributeId)) if ($File) { $LocalVarFormParameters['file'] = $File | Foreach-Object { [System.IO.FileInfo]$executionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($_) } } $LocalVarResult = Invoke-NERMApiClient -Method 'POST' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "Url" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } |