Api/FlyOneDrivePoliciesApi.ps1
|
# # Fly SDK API # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # Version: 1.0 # Contact: support@avepoint.com # Generated by OpenAPI Generator: https://openapi-generator.tech # <# .SYNOPSIS create a new OneDrive policy .DESCRIPTION No description available. .PARAMETER OneDrivePolicyCreationModel No description available. .PARAMETER ReturnType Select the return type (optional): application/json, text/json, application/*+json .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 Add-FlyOneDrivePolicy { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [PSCustomObject] ${OneDrivePolicyCreationModel}, [String] [ValidateSet("application/json", "text/json", "application/*+json")] $ReturnType, [Switch] $WithHttpInfo ) Process { 'Calling method: Add-FlyOneDrivePolicy' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null $Configuration = Get-FlyConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('application/json', 'text/json', 'application/*+json') if ($ReturnType) { # use the return type (MIME) provided by the user $LocalVarAccepts = @($ReturnType) } # HTTP header 'Content-Type' $LocalVarContentTypes = @('application/json') $LocalVarUri = '/policies/onedrive' $LocalVarBodyParameter = ConvertTo-Json $OneDrivePolicyCreationModel -Depth 100 if ($Configuration["AccessToken"]) { $LocalVarHeaderParameters['Authorization'] = "Bearer " + $Configuration["AccessToken"] Write-Verbose ("Using Bearer authentication in {0}" -f $MyInvocation.MyCommand) } $LocalVarResult = Invoke-FlyApiClient -Method 'POST' ` -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 get OneDrive policy by id .DESCRIPTION No description available. .PARAMETER Id No description available. .PARAMETER ReturnType Select the return type (optional): text/plain, application/json, text/json, application/*+json .PARAMETER WithHttpInfo A switch when turned on will return a hash table of Response, StatusCode and Headers instead of just the Response .OUTPUTS OneDrivePolicyModel #> function Get-FlyOneDrivePolicy { [CmdletBinding()] Param ( [Parameter(Position = 0, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, Mandatory = $false)] [String] ${Id}, [String] [ValidateSet("text/plain", "application/json", "text/json", "application/*+json")] $ReturnType, [Switch] $WithHttpInfo ) Process { 'Calling method: Get-FlyOneDrivePolicy' | Write-Debug $PSBoundParameters | Out-DebugParameter | Write-Debug $LocalVarAccepts = @() $LocalVarContentTypes = @() $LocalVarQueryParameters = @{} $LocalVarHeaderParameters = @{} $LocalVarFormParameters = @{} $LocalVarPathParameters = @{} $LocalVarCookieParameters = @{} $LocalVarBodyParameter = $null $Configuration = Get-FlyConfiguration # HTTP header 'Accept' (if needed) $LocalVarAccepts = @('text/plain', 'application/json', 'text/json', 'application/*+json') if ($ReturnType) { # use the return type (MIME) provided by the user $LocalVarAccepts = @($ReturnType) } $LocalVarUri = '/policies/onedrive/{id}' if (!$Id) { throw "Error! The required parameter `Id` missing when calling getOneDrivePolicy." } $LocalVarUri = $LocalVarUri.replace('{id}', [System.Web.HTTPUtility]::UrlEncode($Id)) if ($Configuration["AccessToken"]) { $LocalVarHeaderParameters['Authorization'] = "Bearer " + $Configuration["AccessToken"] Write-Verbose ("Using Bearer authentication in {0}" -f $MyInvocation.MyCommand) } $LocalVarResult = Invoke-FlyApiClient -Method 'GET' ` -Uri $LocalVarUri ` -Accepts $LocalVarAccepts ` -ContentTypes $LocalVarContentTypes ` -Body $LocalVarBodyParameter ` -HeaderParameters $LocalVarHeaderParameters ` -QueryParameters $LocalVarQueryParameters ` -FormParameters $LocalVarFormParameters ` -CookieParameters $LocalVarCookieParameters ` -ReturnType "OneDrivePolicyModel" ` -IsBodyNullable $false if ($WithHttpInfo.IsPresent) { return $LocalVarResult } else { return $LocalVarResult["Response"] } } } |