Update to powershell SDK docs: 13122455471

This commit is contained in:
developer-relations-sp
2025-02-03 20:42:04 +00:00
parent aeda961e54
commit bdb088c15d
207 changed files with 3520 additions and 8694 deletions

View File

@@ -1,3 +1,4 @@
---
id: beta-segments
title: Segments
@@ -9,7 +10,6 @@ slug: /tools/sdk/powershell/beta/methods/segments
tags: ['SDK', 'Software Development Kit', 'Segments', 'BetaSegments']
---
# Segments
Use this API to implement and customize access request segment functionality.
With this functionality in place, administrators can create and manage access request segments.
@@ -41,9 +41,7 @@ Method | HTTP request | Description
[**Get-BetaSegments**](#list-segments) | **GET** `/segments` | List Segments
[**Update-BetaSegment**](#patch-segment) | **PATCH** `/segments/{id}` | Update Segment
## create-segment
This API creates a segment.
>**Note:** Segment definitions may take time to propagate to all identities.
A token with ORG_ADMIN or API authority is required to call this API.
@@ -54,7 +52,6 @@ Param Type | Name | Data Type | Required | Description
Body | Segment | [**Segment**](../models/segment) | True |
### Return type
[**Segment**](../models/segment)
### Responses
@@ -68,7 +65,6 @@ Code | Description | Data Type
500 | Internal Server Error - Returned if there is an unexpected error. | ErrorResponseDto
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
@@ -98,7 +94,9 @@ $Segment = @"{
"active" : true,
"id" : "0f11f2a4-7c94-4bf3-a2bd-742580fe3bde"
}"@
# Create Segment
try {
$Result = ConvertFrom-JsonToSegment -Json $Segment
New-BetaSegment-BetaSegment $Result
@@ -110,11 +108,8 @@ try {
Write-Host $_.ErrorDetails
}
```
[[Back to top]](#)
## delete-segment
This API deletes the segment specified by the given ID.
>**Note:** Segment deletion may take some time to go into effect.
A token with ORG_ADMIN or API authority is required to call this API.
@@ -125,7 +120,6 @@ Param Type | Name | Data Type | Required | Description
Path | Id | **String** | True | The segment ID to delete.
### Return type
(empty response body)
### Responses
@@ -140,14 +134,15 @@ Code | Description | Data Type
500 | Internal Server Error - Returned if there is an unexpected error. | ErrorResponseDto
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### Example
```powershell
$Id = "ef38f94347e94562b5bb8424a56397d8" # String | The segment ID to delete.
# Delete Segment by ID
try {
Remove-BetaSegment-BetaId $Id
@@ -158,11 +153,8 @@ try {
Write-Host $_.ErrorDetails
}
```
[[Back to top]](#)
## get-segment
This API returns the segment specified by the given ID.
A token with ORG_ADMIN or API authority is required to call this API.
@@ -172,7 +164,6 @@ Param Type | Name | Data Type | Required | Description
Path | Id | **String** | True | The segment ID to retrieve.
### Return type
[**Segment**](../models/segment)
### Responses
@@ -187,14 +178,15 @@ Code | Description | Data Type
500 | Internal Server Error - Returned if there is an unexpected error. | ErrorResponseDto
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### Example
```powershell
$Id = "ef38f94347e94562b5bb8424a56397d8" # String | The segment ID to retrieve.
# Get Segment by ID
try {
Get-BetaSegment-BetaId $Id
@@ -205,11 +197,8 @@ try {
Write-Host $_.ErrorDetails
}
```
[[Back to top]](#)
## list-segments
This API returns a list of all segments.
A token with ORG_ADMIN or API authority is required to call this API.
@@ -221,7 +210,6 @@ Param Type | Name | Data Type | Required | Description
Query | Count | **Boolean** | (optional) (default to $false) | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information.
### Return type
[**Segment[]**](../models/segment)
### Responses
@@ -235,7 +223,6 @@ Code | Description | Data Type
500 | Internal Server Error - Returned if there is an unexpected error. | ErrorResponseDto
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
@@ -244,7 +231,9 @@ Code | Description | Data Type
$Limit = 250 # Int32 | Max number of results to return. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 250)
$Offset = 0 # Int32 | Offset into the full result set. Usually specified with *limit* to paginate through the results. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to 0)
$Count = $true # Boolean | If *true* it will populate the *X-Total-Count* response header with the number of results that would be returned if *limit* and *offset* were ignored. Since requesting a total count can have a performance impact, it is recommended not to send **count=true** if that value will not be used. See [V3 API Standard Collection Parameters](https://developer.sailpoint.com/idn/api/standard-collection-parameters) for more information. (optional) (default to $false)
# List Segments
try {
Get-BetaSegments
@@ -255,11 +244,8 @@ try {
Write-Host $_.ErrorDetails
}
```
[[Back to top]](#)
## patch-segment
Use this API to update segment fields by using the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard.
>**Note:** Changes to a segment may take some time to propagate to all identities.
A token with ORG_ADMIN or API authority is required to call this API.
@@ -271,7 +257,6 @@ Path | Id | **String** | True | The segment ID to modify.
Body | RequestBody | [**[]SystemCollectionsHashtable**](https://learn.microsoft.com/en-us/dotnet/api/system.collections.hashtable?view=net-9.0) | True | A list of segment update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard. The following fields are patchable: * name * description * owner * visibilityCriteria * active
### Return type
[**Segment**](../models/segment)
### Responses
@@ -286,7 +271,6 @@ Code | Description | Data Type
500 | Internal Server Error - Returned if there is an unexpected error. | ErrorResponseDto
### HTTP request headers
- **Content-Type**: application/json-patch+json
- **Accept**: application/json
@@ -294,9 +278,11 @@ Code | Description | Data Type
```powershell
$Id = "ef38f94347e94562b5bb8424a56397d8" # String | The segment ID to modify.
$RequestBody = # SystemCollectionsHashtable[] | A list of segment update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard. The following fields are patchable: * name * description * owner * visibilityCriteria * active
$RequestBody = @"[{op=replace, path=/visibilityCriteria, value={expression={operator=AND, children=[{operator=EQUALS, attribute=location, value={type=STRING, value=Philadelphia}}, {operator=EQUALS, attribute=department, value={type=STRING, value=HR}}]}}}]"@
$RequestBody = @"[{op=replace, path=/visibilityCriteria, value={expression={operator=AND, children=[{operator=EQUALS, attribute=location, value={type=STRING, value=Philadelphia}}, {operator=EQUALS, attribute=department, value={type=STRING, value=HR}}]}}}]"@ # SystemCollectionsHashtable[] | A list of segment update operations according to the [JSON Patch](https://tools.ietf.org/html/rfc6902) standard. The following fields are patchable: * name * description * owner * visibilityCriteria * active
# Update Segment
try {
$Result = ConvertFrom-JsonToRequestBody -Json $RequestBody
Update-BetaSegment-BetaId $Id -BetaRequestBody $Result
@@ -308,7 +294,4 @@ try {
Write-Host $_.ErrorDetails
}
```
[[Back to top]](#)