-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for subfield arguments (handwritten changes) (#65)
* Prepare for next development iteration * MSSQL cmdlet Updates (#63) * Now works with Host/FCI/ID/List * Allow for filtering by InstanceName * Correct bugs on GetInstance and added ID to GetDatabase * Updates to MSSQL * Update to PR * change log updates * Update TOOLKIT_DEVELOPER_MANUAL.md about operations * Expand interfaces in -AddField and -RemoveField * Patched clusterConnection DETAIL profile * Add support for subfield arguments (handwritten changes) --------- Co-authored-by: Gui <[email protected]> Co-authored-by: Chris Lumnah <[email protected]>
- Loading branch information
1 parent
fd68b1f
commit 1768823
Showing
26 changed files
with
719 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
RubrikSecurityCloud/RubrikSecurityCloud.Common/GraphqlInlineArgsConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
using Newtonsoft.Json.Serialization; | ||
using RubrikSecurityCloud.Types; | ||
|
||
namespace RubrikSecurityCloud | ||
{ | ||
|
||
public class GraphqlInlineArgsConverter : JsonConverter | ||
{ | ||
public override bool CanConvert(Type objectType) | ||
{ | ||
return objectType == typeof(DateTime) || | ||
objectType == typeof(string); | ||
} | ||
|
||
public override object ReadJson( | ||
JsonReader reader, | ||
Type objectType, | ||
object? existingValue, | ||
JsonSerializer serializer | ||
) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public override void WriteJson( | ||
JsonWriter writer, | ||
object? value, | ||
JsonSerializer serializer | ||
) | ||
{ | ||
if (value == null) | ||
{ | ||
writer.WriteNull(); | ||
return; | ||
} | ||
Type objectType = value.GetType(); | ||
if (objectType == typeof(DateTime)) { | ||
DateTime datetime = (DateTime)value; | ||
serializer.Serialize( | ||
writer, | ||
datetime.ToString( | ||
"\"yyyy-MM-ddTHH:mm:sszzz\"", | ||
System.Globalization.CultureInfo.InvariantCulture | ||
) | ||
); | ||
} else | ||
{ | ||
string stringVal = (string)value; | ||
serializer.Serialize( | ||
writer, | ||
"\"" + stringVal + "\"" | ||
); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.