Skip to content

Commit

Permalink
Roles - class conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Jul 26, 2021
1 parent 8374bf9 commit abf902c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
8 changes: 4 additions & 4 deletions docs/about_topics/roles/about_tssrole.md
@@ -1,18 +1,18 @@
---
title: "TssRole"
title: "Role"
---

# TOPIC
This help topic describes the TssRole class in the Thycotic.SecretServer module
This help topic describes the Thycotic.PowerShell.Roles.Role class in the Thycotic.SecretServer module

# CLASS
TssRole
Thycotic.PowerShell.Roles.Role

# INHERITANCE
None

# DESCRIPTION
The TssRole class represents the RoleModel object returned by Secret Server endpoint GET /roles
The Thycotic.PowerShell.Roles.Role class represents the RoleModel object returned by Secret Server endpoint GET /roles

# CONSTRUCTORS
new()
Expand Down
2 changes: 1 addition & 1 deletion docs/about_topics/roles/readme.md
@@ -1,3 +1,3 @@
# Roles
# Thycotic.PowerShell.Roles.

{% include list.liquid all=true %}
2 changes: 1 addition & 1 deletion docs/commands/roles/Search-TssRole.md
Expand Up @@ -114,7 +114,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### TssRole
### Thycotic.PowerShell.Roles.Role
## NOTES
Requires TssSession object returned by New-TssSession

Expand Down
15 changes: 15 additions & 0 deletions src/Thycotic.SecretServer/classes/roles/Role.cs
@@ -0,0 +1,15 @@
using System;
using System.Threading.Tasks;
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace Thycotic.PowerShell.Roles
{
public class Role
{
public DateTime? Created { get; set; }
public bool Enabled { get; set; }
public int Id { get; set; }
public string Name { get; set; }
}
}
13 changes: 0 additions & 13 deletions src/classes/roles/TssRole.class.ps1

This file was deleted.

4 changes: 2 additions & 2 deletions src/functions/roles/Search-Role.ps1
Expand Up @@ -22,7 +22,7 @@ function Search-Role {
Requires TssSession object returned by New-TssSession
#>
[CmdletBinding(DefaultParameterSetName = 'user')]
[OutputType('TssRole')]
[OutputType('Thycotic.PowerShell.Roles.Role')]
param (
# TssSession object created by New-TssSession for authentication
[Parameter(Mandatory, ValueFromPipeline, Position = 0)]
Expand Down Expand Up @@ -97,7 +97,7 @@ function Search-Role {
Write-Warning 'No Roles found'
}
if ($restResponse.records) {
[TssRole[]]$restResponse.records
[Thycotic.PowerShell.Roles.Role[]]$restResponse.records
}
} else {
Write-Warning 'No valid session found'
Expand Down
4 changes: 2 additions & 2 deletions tests/roles/Search-Role.Tests.ps1
Expand Up @@ -18,8 +18,8 @@ Describe "$commandName verify parameters" {
}
}
Context "Command specific details" {
It "$commandName should set OutputType to TssRole" -TestCases $commandDetails {
$_.OutputType.Name | Should -Be 'TssRole'
It "$commandName should set OutputType to Thycotic.PowerShell.Roles.Role" -TestCases $commandDetails {
$_.OutputType.Name | Should -Be 'Thycotic.PowerShell.Roles.Role'
}
}
}

0 comments on commit abf902c

Please sign in to comment.