Skip to content

Commit

Permalink
TssSecretDetailState - migrate and update --> Thycotic.PowerShell.Sec…
Browse files Browse the repository at this point in the history
…rets.DetailState
  • Loading branch information
wsmelton committed Jul 20, 2021
1 parent cc6a162 commit 4f85ad2
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 86 deletions.
8 changes: 4 additions & 4 deletions docs/about_topics/secrets/about_tsssecretdetailstate.md
@@ -1,18 +1,18 @@
---
title: "TssSecretDetailState"
title: "Thycotic.PowerShell.Secrets.DetailState"
---

# TOPIC
This help topic describes the TssSecretDetailState class in the Thycotic.SecretServer module
This help topic describes the Thycotic.PowerShell.Secrets.DetailState class in the Thycotic.SecretServer module

# CLASS
TssSecretDetailState
Thycotic.PowerShell.Secrets.DetailState

# INHERITANCE
None

# DESCRIPTION
The TssSecretDetailState class represents the SecretDetailViewModel returned by Secret Server endpoint GET /secrets/{id}/state
The Thycotic.PowerShell.Secrets.DetailState class represents the SecretDetailViewModel returned by Secret Server endpoint GET /secrets/{id}/state

# CONSTRUCTORS
new()
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/secrets/Get-TssSecretState.md
Expand Up @@ -61,7 +61,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### TssSecretDetailState
### Thycotic.PowerShell.Secrets.DetailState
## NOTES
Requires TssSession object returned by New-TssSession

Expand Down
2 changes: 1 addition & 1 deletion src/Thycotic.SecretServer.Types.ps1xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-16"?>
<Types>
<Type>
<Name>TssSecretDetailState</Name>
<Name>Thycotic.PowerShell.Secrets.DetailState</Name>
<Members>
<AliasProperty>
<Name>SecretId</Name>
Expand Down
57 changes: 57 additions & 0 deletions src/Thycotic.SecretServer/classes/secrets/DetailState.cs
@@ -0,0 +1,57 @@
using System;
using System.Threading.Tasks;
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace Thycotic.PowerShell.Secrest
{
public class DetailState
{
public string[] Actions { get; set; }
public string CheckedOutUserDisplayname { get; set; }
public int CheckedOutUserId { get; set; }
public int CheckOutIntervalMinutes { get; set; }
public int FolderId { get; set; }
public string FolderName { get; set; }
public int Id { get; set; }
public bool IsActive { get; set; }
public bool IsCheckedOut { get; set; }
public bool IsCheckedOutByCurrentUser { get; set; }
public bool PasswordChangePending { get; set; }
public string Role { get; set; }
public string SecretName { get; set; }
public string SecretState { get; set; }

public bool TestAction(string ActionName)
{
bool foundIt = false;
foreach (string a in Actions)
{
if (a.Equals(ActionName, StringComparison.OrdinalIgnoreCase))
{
foundIt = true;
}
}
if (foundIt)
{
return true;
}
else
{
return false;
}
}

public bool TestState(string State)
{
if (this.SecretState.Equals(State, StringComparison.OrdinalIgnoreCase))
{
return true;
}
else
{
return false;
}
}
}
}
75 changes: 0 additions & 75 deletions src/classes/secrets/TssSecretDetailState.class.ps1

This file was deleted.

4 changes: 2 additions & 2 deletions src/functions/secrets/Get-SecretState.ps1
Expand Up @@ -22,7 +22,7 @@ function Get-SecretState {
Requires TssSession object returned by New-TssSession
#>
[CmdletBinding()]
[OutputType('TssSecretDetailState')]
[OutputType('Thycotic.PowerShell.Secrets.DetailState')]
param (
# TssSession object created by New-TssSession for authentication
[Parameter(Mandatory, ValueFromPipeline, Position = 0)]
Expand Down Expand Up @@ -60,7 +60,7 @@ function Get-SecretState {
}

if ($restResponse) {
[TssSecretDetailState]$restResponse
[Thycotic.PowerShell.Secrets.DetailState]$restResponse
}
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/parts/GetSecretState.ps1
Expand Up @@ -25,6 +25,6 @@ process {
}

if ($restResponse) {
[TssSecretDetailState]$restResponse
[Thycotic.PowerShell.Secrets.DetailState]$restResponse
}
}
4 changes: 2 additions & 2 deletions tests/secrets/Get-SecretState.Tests.ps1
Expand Up @@ -18,8 +18,8 @@ Describe "$commandName verify parameters" {
}
}
Context "Command specific details" {
It "$commandName should set OutputType to TssSecretDetailState" -TestCases $commandDetails {
$_.OutputType.Name | Should -Be 'TssSecretDetailState'
It "$commandName should set OutputType to Thycotic.PowerShell.Secrets.DetailState" -TestCases $commandDetails {
$_.OutputType.Name | Should -Be 'Thycotic.PowerShell.Secrets.DetailState'
}
}
}

0 comments on commit 4f85ad2

Please sign in to comment.