-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#152 Renamed generic OpenApi to OpenApiISH30 to allow room for OpenAp…
…iAM10, restored all funky conversions from Enumerations,IShFields,IShFolder and IShFolders... it compiles... next Refresh spec json, rename Protocols and get folder to work
- Loading branch information
ddemeyer
committed
Dec 29, 2022
1 parent
49fb33b
commit 6617ba2
Showing
14 changed files
with
318 additions
and
109 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
File renamed without changes.
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
96 changes: 48 additions & 48 deletions
96
Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/Folder/AddIshFolder.cs
Large diffs are not rendered by default.
Oops, something went wrong.
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
78 changes: 78 additions & 0 deletions
78
Source/ISHRemote/Trisoft.ISHRemote/ExtensionMethods/OpenApiISH30EnumerationsExtensions.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,78 @@ | ||
/* | ||
* Copyright (c) 2014 All Rights Reserved by the SDL Group. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using static Trisoft.ISHRemote.Objects.Enumerations; | ||
|
||
namespace Trisoft.ISHRemote.ExtensionMethods | ||
{ | ||
internal static class OpenApiISH30EnumerationsExtensions | ||
{ | ||
/// <summary> | ||
/// OpenApi (dd 20211228) implements FieldGroup as derived from ISHRemote RequestedMetadataGroup, should be 1-1 conversion to server-side decide which fields to retrieve | ||
/// </summary> | ||
internal static OpenApiISH30.FieldGroup ToOpenApiISH30FieldGroup(this RequestedMetadataGroup requestedMetadataGroup) | ||
{ | ||
switch (requestedMetadataGroup) | ||
{ | ||
case RequestedMetadataGroup.All: | ||
return OpenApiISH30.FieldGroup.All; | ||
case RequestedMetadataGroup.Basic: | ||
return OpenApiISH30.FieldGroup.Basic; | ||
case RequestedMetadataGroup.Descriptive: | ||
default: | ||
return OpenApiISH30.FieldGroup.Descriptive; | ||
} | ||
|
||
} | ||
|
||
/// <summary> | ||
/// OpenApi (dd 20211228) implements Field Level, needs mapping to ISHRemote levels | ||
/// </summary> | ||
internal static Level ToISHFieldLevel(this OpenApiISH30.Level oLevel) | ||
{ | ||
switch (oLevel) | ||
{ | ||
case OpenApiISH30.Level.None: | ||
return Level.None; | ||
case OpenApiISH30.Level.Logical: | ||
return Level.Logical; | ||
case OpenApiISH30.Level.Version: | ||
return Level.Version; | ||
case OpenApiISH30.Level.Language: | ||
return Level.Lng; | ||
case OpenApiISH30.Level.Data: | ||
return Level.Data; | ||
case OpenApiISH30.Level.Annotation: | ||
return Level.Annotation; | ||
case OpenApiISH30.Level.Reply: | ||
return Level.Reply; | ||
case OpenApiISH30.Level.Progress: | ||
return Level.Progress; | ||
case OpenApiISH30.Level.Detail: | ||
return Level.Detail; | ||
case OpenApiISH30.Level.Object: | ||
case OpenApiISH30.Level.Compute: | ||
default: | ||
throw new ArgumentException($"Enumerations.ToFieldLevel OpenApiISH30.Level[{oLevel}] was unexpected."); | ||
} | ||
} | ||
} | ||
} |
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.