-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Start deep refactor of the client part of the project.
- Loading branch information
1 parent
ba2c40a
commit 9d58564
Showing
70 changed files
with
2,214 additions
and
685 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// This file is part of the ArmoniK project | ||
// | ||
// Copyright (C) ANEO, 2021-2023. All rights reserved. | ||
// | ||
// 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.Runtime.Serialization; | ||
|
||
using JetBrains.Annotations; | ||
|
||
namespace ArmoniK.DevelopmentKit.Client.Common.Submitter.ApiExt; | ||
|
||
/// <inheritdoc /> | ||
[PublicAPI] | ||
public class ArmoniKException : ApplicationException | ||
{ | ||
/// <inheritdoc /> | ||
public ArmoniKException(string? message, | ||
Exception? innerException) | ||
: base(message, | ||
innerException) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public ArmoniKException(string? message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public ArmoniKException(SerializationInfo info, | ||
StreamingContext context) | ||
: base(info, | ||
context) | ||
{ | ||
} | ||
} |
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,31 @@ | ||
// This file is part of the ArmoniK project | ||
// | ||
// Copyright (C) ANEO, 2021-2023. All rights reserved. | ||
// | ||
// 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 JetBrains.Annotations; | ||
|
||
namespace ArmoniK.DevelopmentKit.Client.Common.Submitter.ApiExt; | ||
|
||
/// <summary> | ||
/// Enum representing the status of a result | ||
/// </summary> | ||
[PublicAPI] | ||
public enum ArmoniKResultStatus | ||
{ | ||
Unknown, | ||
Ready, | ||
NotReady, | ||
Error, | ||
} |
37 changes: 37 additions & 0 deletions
37
Client/src/Common/Submitter/ApiExt/ArmoniKResultStatusExt.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,37 @@ | ||
// This file is part of the ArmoniK project | ||
// | ||
// Copyright (C) ANEO, 2021-2023. All rights reserved. | ||
// | ||
// 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 ArmoniK.Api.gRPC.V1; | ||
|
||
namespace ArmoniK.DevelopmentKit.Client.Common.Submitter.ApiExt; | ||
|
||
internal static class ArmoniKResultStatusExt | ||
{ | ||
public static ArmoniKResultStatus ToArmoniKResultStatus(this ResultStatus resultStatus) | ||
=> resultStatus switch | ||
{ | ||
ResultStatus.Unspecified => ArmoniKResultStatus.Unknown, | ||
ResultStatus.Created => ArmoniKResultStatus.NotReady, | ||
ResultStatus.Completed => ArmoniKResultStatus.Ready, | ||
ResultStatus.Aborted => ArmoniKResultStatus.Error, | ||
ResultStatus.Notfound => ArmoniKResultStatus.Error, | ||
_ => throw new ArgumentOutOfRangeException(nameof(resultStatus), | ||
resultStatus, | ||
null), | ||
}; | ||
} |
Oops, something went wrong.