diff --git a/Ginger/Ginger.sln b/Ginger/Ginger.sln index deea8249c2..0a083df49a 100644 --- a/Ginger/Ginger.sln +++ b/Ginger/Ginger.sln @@ -62,12 +62,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GingerRuntime", "GingerRunt EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ginger", "Ginger\Ginger.csproj", "{A2CA2D7B-93FA-4D15-AB9F-5B0B6024335F}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualRegressionTracker", "VisualRegressionTracker\VisualRegressionTracker.csproj", "{DAB57806-607C-409F-ABA1-29CD6A9C5368}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GingerTest", "GingerTest\GingerTest.csproj", "{0DDA6DC8-0F6A-4955-8425-2077C658EB7C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GingerATS", "GingerATS\GingerATS.csproj", "{2FE010E3-F1BD-4F8D-91BA-E3C452FD62BD}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -207,24 +203,12 @@ Global {A2CA2D7B-93FA-4D15-AB9F-5B0B6024335F}.Release|Any CPU.Build.0 = Release|Any CPU {A2CA2D7B-93FA-4D15-AB9F-5B0B6024335F}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU {A2CA2D7B-93FA-4D15-AB9F-5B0B6024335F}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU - {DAB57806-607C-409F-ABA1-29CD6A9C5368}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DAB57806-607C-409F-ABA1-29CD6A9C5368}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DAB57806-607C-409F-ABA1-29CD6A9C5368}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DAB57806-607C-409F-ABA1-29CD6A9C5368}.Release|Any CPU.Build.0 = Release|Any CPU - {DAB57806-607C-409F-ABA1-29CD6A9C5368}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU - {DAB57806-607C-409F-ABA1-29CD6A9C5368}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU {0DDA6DC8-0F6A-4955-8425-2077C658EB7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0DDA6DC8-0F6A-4955-8425-2077C658EB7C}.Debug|Any CPU.Build.0 = Debug|Any CPU {0DDA6DC8-0F6A-4955-8425-2077C658EB7C}.Release|Any CPU.ActiveCfg = Release|Any CPU {0DDA6DC8-0F6A-4955-8425-2077C658EB7C}.Release|Any CPU.Build.0 = Release|Any CPU {0DDA6DC8-0F6A-4955-8425-2077C658EB7C}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU {0DDA6DC8-0F6A-4955-8425-2077C658EB7C}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU - {2FE010E3-F1BD-4F8D-91BA-E3C452FD62BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2FE010E3-F1BD-4F8D-91BA-E3C452FD62BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2FE010E3-F1BD-4F8D-91BA-E3C452FD62BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2FE010E3-F1BD-4F8D-91BA-E3C452FD62BD}.Release|Any CPU.Build.0 = Release|Any CPU - {2FE010E3-F1BD-4F8D-91BA-E3C452FD62BD}.RemoteDebug|Any CPU.ActiveCfg = Debug|Any CPU - {2FE010E3-F1BD-4F8D-91BA-E3C452FD62BD}.RemoteDebug|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Ginger/GingerATS/GingerATS.cs b/Ginger/GingerATS/GingerATS.cs deleted file mode 100644 index 78765326a0..0000000000 --- a/Ginger/GingerATS/GingerATS.cs +++ /dev/null @@ -1,312 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace GingerATS -{ - /// - /// Reflects the process end status - /// - public enum ResultStatus - { - /// - /// The process ended successfully - /// - Success, - /// - /// Error occurred during the process - /// - Fail, - /// - /// Failed to connect to source control- process aborted - /// - SVNConnectionError, - /// - /// Failed to get/update the repository data from SVN - /// - SVNDataPullError, - /// - /// Failed to create/update the repository indexer - /// - RefreshRepositoryIndexerError, - } - - public class GingerATS - { - /// - /// The function supposed to be used for checking the automation status of QC Test Cases/s in a specific Ginger Solution - /// - /// Path of ATS logs folder to create/update the GingerATSLog file with function run information - /// Connection details for the Ginger Source Control Solution - /// List of QC Test Cases to check their automation status - public static ResultStatus GetAutomationStatus(string logsFolderPath, SourceConnectionDetails sourceConnectionDetails, - ref Dictionary testCases) - { - GingerATSLog Logger = null; - string solutionFullLocalPath = string.Empty; - List IndexerRecords = null; - try - { - //Logger creation - Logger = new GingerATSLog(logsFolderPath); - Logger.AddLineToLog(eLogLineType.INFO, "####################### UPDATED GingerATS version for new XMLs format ########################"); - Logger.AddLineToLog(eLogLineType.INFO, "####################### GetAutomationStatus Function Called for Solution: '" + sourceConnectionDetails.GingerSolutionName + "' ########################"); - - //Update local repository with solution data from source control - Logger.AddLineToLog(eLogLineType.INFO, "#####>>>>> Get/Update Solution Shared Repository Data from SVN:"); - if (sourceConnectionDetails != null) - { - Logger.AddLineToLog(eLogLineType.INFO, "Input Details:" + Environment.NewLine + - "SourceURL= " + sourceConnectionDetails.SourceURL + Environment.NewLine + - "SourceUserName= " + sourceConnectionDetails.SourceUserName + Environment.NewLine + - "SourceUserPass= " + sourceConnectionDetails.SourceUserPass + Environment.NewLine + - "GingerSolutionName= " + sourceConnectionDetails.GingerSolutionName + Environment.NewLine + - "GingerSolutionLocalPath= " + sourceConnectionDetails.GingerSolutionLocalPath); - - solutionFullLocalPath = Path.Combine(sourceConnectionDetails.GingerSolutionLocalPath, sourceConnectionDetails.GingerSolutionName); - try - { - GingerATSSVNSourceControl sourceControl = new GingerATSSVNSourceControl(sourceConnectionDetails, solutionFullLocalPath) - { - Logger = Logger - }; - - //Check if require to get the full solution data or only update it - if (!Directory.Exists(solutionFullLocalPath)) - { - //get full solution - Logger.AddLineToLog(eLogLineType.INFO, "Getting all Solution shared repository data from SVN into: '" + solutionFullLocalPath + "'"); - sourceControl.GetProject(); - } - else - { - //update solution - Logger.AddLineToLog(eLogLineType.INFO, "Updating the Solution shared repository data from SVN into: '" + solutionFullLocalPath + "'"); - sourceControl.GetLatest(); - } - - if (sourceControl.OperationResult != null && sourceControl.OperationResult.Revision != -1) - { - Logger.AddLineToLog(eLogLineType.INFO, "SVN Result: Local copy was updated to Revision number: " + sourceControl.OperationResult.Revision.ToString()); - } - else - { - Logger.AddLineToLog(eLogLineType.WARNING, "SVN Result: No result value returned, probably error occurred."); - } - } - catch (Exception ex) - { - Logger.AddLineToLog(eLogLineType.ERROR, "Error occurred while trying to get/update the data from SVN source", ex); - Logger.WriteToLogFile(); - return ResultStatus.SVNDataPullError; - } - } - else - { - Logger.AddLineToLog(eLogLineType.ERROR, "The provided SVN connection details object is NULL"); - Logger.WriteToLogFile(); - return ResultStatus.SVNConnectionError; - } - - //Create or Update the Solution Repository Indexer - Logger.AddLineToLog(eLogLineType.INFO, "#####>>>>> Create/Update the Solution Repository Indexer:"); - GingerATSRepositoryIndexer RepositoryIndexer = null; - try - { - RepositoryIndexer = new GingerATSRepositoryIndexer(solutionFullLocalPath); - if (!RepositoryIndexer.IsIndexerExist) - { - Logger.AddLineToLog(eLogLineType.INFO, "Creating the Repository Indexer in path: '" + RepositoryIndexer.IndexerPath + "'"); - RepositoryIndexer.CreateRepositoryIndexer(); - } - else - { - Logger.AddLineToLog(eLogLineType.INFO, "Updating the Repository Indexer which in path: '" + RepositoryIndexer.IndexerPath + "'"); - RepositoryIndexer.UpdateRepositoryIndexer(); - } - - IndexerRecords = RepositoryIndexer.ReadRepositoryIndexerData(); - } - catch (Exception ex) - { - Logger.AddLineToLog(eLogLineType.ERROR, "Error occurred while creating/refreshing the Solution Repository Indexer", ex); - Logger.WriteToLogFile(); - return ResultStatus.RefreshRepositoryIndexerError; - } - - //Check the automation status of each TC in the provided list by ATS - Logger.AddLineToLog(eLogLineType.INFO, "#####>>>>> Check the automation status of each TC in the provided list by ATS:"); - if (testCases != null) - { - int tcsCounter = 0; - foreach (TestCaseAutoStatus tc in testCases.Values) - { - tcsCounter++; - if (tc == null) - { - continue; - } - - Logger.AddLineToLog(eLogLineType.INFO, "Checking the automation status of TC ID: " + tc.ID + " (" + tcsCounter + "/" + testCases.Count + ")"); - //Search for the TC in the Activities Group reposiotry - GingerRepositoryItem tc_ActivitiesGroup = null; - try - { - tc_ActivitiesGroup = RepositoryIndexer.GetGingerRepositoryItem(eGingerRepoItemType.ActivitiesGroup, tc.ID.ToString(), IndexerRecords); - } - catch (Exception ex) - { - Logger.AddLineToLog(eLogLineType.ERROR, "Error Occurred while trying to get the repository details for TC (Activities Group) ID: " + tc.ID, ex); - } - if (tc_ActivitiesGroup != null) - { - //Activities Group xml was found - tc.KnownByGinger = true; - - //Check for each TC step if it was automated for the specific parameter value - if (tc.Steps != null) - { - foreach (StepAutoStatus step in tc.Steps.Values) - { - //Search for the TC Step (Activity) in the Activity's reposiotry - GingerRepositoryItem step_Activity = null; - try - { - step_Activity = RepositoryIndexer.GetGingerRepositoryItem(eGingerRepoItemType.Activity, step.ID.ToString(), IndexerRecords); - } - catch (Exception ex) - { - Logger.AddLineToLog(eLogLineType.ERROR, "Error Occurred while trying to get the repository details for TC_Step (Activity) ID: " + step.ID, ex); - } - if (step_Activity != null) - { - //Check if the step/activity was automated - string activityAutomationStatus = - GingerATSXmlReader.GetNodeAttributeValue(step_Activity.FilePath, - GingerRepositoryItem.GetRepoItemMainXmlNodeName(step_Activity.Type), - GingerRepositoryItem.ActivityAutomationStatusAttributeName); - if (activityAutomationStatus != null && activityAutomationStatus == GingerRepositoryItem.ActivityAutomationStatusAutomatedValue) - { - //Step/activity was automated - step.AutomatedByGinger = true; - - //Check for each step param if the selected value is supported and automated - if (step.Parameters != null) - { - //pull the variables section from XML- workaround because sometimes (when the Activity - Actions includes Variables Dependencies) the XmlReader is fails to get to the Variables node from some reason - string step_Activity_VariablesXml = GingerATSXmlReader.GetXmlFileNodeContent(step_Activity.FilePath, GingerRepositoryItem.ActivityVariablesAttributeName); - - foreach (StepParamAutoStatus param in step.Parameters.Values) - { - if (param.SelectedValue == null || param.SelectedValue == string.Empty) //was added to support empty value as an option - { - param.SelectedValue = ""; - } - - //check if the variable is known to Ginger - List variableExistsAttributes = - [ - new NodeAttributeValidation(GingerRepositoryItem.ActivityVariableNameAttribute, param.Name), - ]; - if (GingerATSXmlReader.ValidateNodeAttributsValue(step_Activity_VariablesXml, - GingerRepositoryItem.ActivityVariablesAttributeName, variableExistsAttributes, true)) - { - //Variable Exist - //check if it from typeSelection List - List variableIsSelectionListAttributes = - [ - new NodeAttributeValidation(GingerRepositoryItem.VariableSelectionListNameAttribute, param.Name), - ]; - if (GingerATSXmlReader.ValidateNodeAttributsValue(step_Activity_VariablesXml, - GingerRepositoryItem.VariableSelectionListNodeName, variableIsSelectionListAttributes, true)) - { - //Selection List - //check if the parameter value is supported - List variableSelectionListValueAttributes = - [ - new NodeAttributeValidation(GingerRepositoryItem.VariableSelectionListNameAttribute, param.Name), - new NodeAttributeValidation(GingerRepositoryItem.VariableSelectionListOptionalValuesAttribute, - param.SelectedValue, NodeAttributeValidation.eNodeAttributeValidationType.NewLineSeperatedListValue, true), - ]; - if (GingerATSXmlReader.ValidateNodeAttributsValue(step_Activity_VariablesXml, - GingerRepositoryItem.VariableSelectionListNodeName, variableSelectionListValueAttributes, true)) - { - //supported - param.AutomatedByGinger = true; - } - else - { - //not supported - param.AutomatedByGinger = false; - } - } - else - { - //Not Selection List - param.AutomatedByGinger = true;//supported no matter what is the value - } - } - else - { - //Variable Not Exist - param.AutomatedByGinger = false; - } - } - } - } - else - { - //Step/activity was not automated - step.AutomatedByGinger = false; - } - } - else - { - //Tc step was not found in the Activity's reposiotry- so it was not automated - step.AutomatedByGinger = false; - } - } - } - } - else - { - //tc was not found in the Activities Group reposiotry- it was not automated - tc.KnownByGinger = false; - } - } - } - else - { - Logger.AddLineToLog(eLogLineType.ERROR, "The provided Test Cases list object is NULL"); - Logger.WriteToLogFile(); - return ResultStatus.Fail; - } - - Logger.AddLineToLog(eLogLineType.INFO, "####################### Checking the Automation status ended successfully."); - Logger.WriteToLogFile(); - return ResultStatus.Success; - } - catch (Exception ex) - { - Logger.AddLineToLog(eLogLineType.ERROR, "Error occurred while checking the automation status of provided Test Cases", ex); - Logger.WriteToLogFile(); - return ResultStatus.Fail; - } - } - } -} \ No newline at end of file diff --git a/Ginger/GingerATS/GingerATS.csproj b/Ginger/GingerATS/GingerATS.csproj deleted file mode 100644 index e30fb5206a..0000000000 --- a/Ginger/GingerATS/GingerATS.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - net8.0 - enable - enable - - - - - - - - diff --git a/Ginger/GingerATS/GingerATSLog.cs b/Ginger/GingerATS/GingerATSLog.cs deleted file mode 100644 index a0071392be..0000000000 --- a/Ginger/GingerATS/GingerATSLog.cs +++ /dev/null @@ -1,100 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace GingerATS -{ - public enum eLogLineType - { - INFO, WARNING, ERROR - } - - public class GingerATSLog - { - string mGingerATSLogPath; - List mGingerATSLogLines; - - public GingerATSLog(string logsFolderPath) - { - mGingerATSLogPath = logsFolderPath + @"\GingerATSLog.txt"; - mGingerATSLogLines = []; - } - - public void AddLineToLog(eLogLineType logLineType, string logLineContent, Exception ex = null) - { - try - { - mGingerATSLogLines.Add(DateTime.Now.ToString("dd-MMM-yyyy HH:mm:ss") + " | " + logLineType.ToString()); - if (logLineContent != null && logLineContent != string.Empty) - { - mGingerATSLogLines.Add(logLineContent); - } - - if (ex != null) - { - mGingerATSLogLines.Add("## Exception Details: "); - mGingerATSLogLines.Add("Message: " + ex.Message); - mGingerATSLogLines.Add("Source: " + ex.Source); - mGingerATSLogLines.Add("InnerException: " + ex.InnerException); - mGingerATSLogLines.Add("StackTrace: " + ex.StackTrace); - } - } - catch (Exception) - { - //failed to write to log - } - } - - public void WriteToLogFile() - { - //limit the log file size to 10 MB - try - { - if (File.Exists(mGingerATSLogPath)) - { - if (ConvertBytesToMegabytes(new FileInfo(mGingerATSLogPath).Length) > 10) - { - File.Delete(mGingerATSLogPath); - } - } - } - catch (Exception) { } - - bool succeedWritingFile = false; - int tryingCounter = 1; - while (succeedWritingFile == false && tryingCounter <= 3) - { - try - { - File.AppendAllLines(mGingerATSLogPath, mGingerATSLogLines); - succeedWritingFile = true; - } - catch (Exception) - { - Thread.Sleep(1000); - tryingCounter++; - } - } - } - - static double ConvertBytesToMegabytes(long bytes) - { - return (bytes / 1024f) / 1024f; - } - } -} diff --git a/Ginger/GingerATS/GingerATSRepositoryIndexer.cs b/Ginger/GingerATS/GingerATSRepositoryIndexer.cs deleted file mode 100644 index 0a6e7f69e7..0000000000 --- a/Ginger/GingerATS/GingerATSRepositoryIndexer.cs +++ /dev/null @@ -1,313 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -using System.Xml; - -namespace GingerATS -{ - public class GingerATSRepositoryIndexer - { - string mSolutionFolderPath = string.Empty; - string mRepositoryFolderPath = string.Empty; - string mIndexerFilePath = string.Empty; - - public bool IsIndexerExist - { - get - { - return (File.Exists(mIndexerFilePath)); - } - } - - public string IndexerPath - { - get - { - return (mIndexerFilePath); - } - } - - public GingerATSRepositoryIndexer(string solutionFolderPath) - { - mSolutionFolderPath = solutionFolderPath; - mRepositoryFolderPath = Path.Combine(mSolutionFolderPath, "SharedRepository"); - mIndexerFilePath = Path.Combine(mSolutionFolderPath, "SharedRepository", "RepositoryIndexer.txt"); - } - - public void RefreshRepositoryIndexer() - { - //check if repo file exist - if (IsIndexerExist == false) - { - CreateRepositoryIndexer(); - } - else - { - UpdateRepositoryIndexer(); - } - } - - public void CreateRepositoryIndexer() - { - List indexerRecords = []; - List repoItems; - - repoItems = GetAllRepositoryFiles(); - if (repoItems != null && repoItems.Count > 0) - { - foreach (GingerRepositoryItem repoItem in repoItems) - { - SetRepositoryItemDetails(repoItem); - if (repoItem.XmlFileDetails != null && repoItem.XmlFileDetails != string.Empty) - { - indexerRecords.Add(repoItem.XmlFileDetails); - } - } - } - - //write to file - WriteRepositoryIndexerData(indexerRecords); - } - - - public void UpdateRepositoryIndexer() - { - DateTime indexLastRan = File.GetLastWriteTime(mIndexerFilePath); - List UpdatedIndexerRecords = []; - //Get the current file records which was not deleted/changed - List currentIndexerRecords = ReadRepositoryIndexerData(); - foreach (string line in currentIndexerRecords) - { - //check if file exists - string[] indexItems = line.Split(';'); - if (File.Exists(indexItems[4]) && File.GetLastWriteTime(indexItems[4]) <= indexLastRan) - { - UpdatedIndexerRecords.Add(line); - } - } - - //Add new/updated repo items - List repoItems; - repoItems = GetAllRepositoryFiles(); - if (repoItems != null && repoItems.Count > 0) - { - foreach (GingerRepositoryItem repoItem in repoItems) - { - if (File.GetLastWriteTime(repoItem.FilePath) > indexLastRan) - { - SetRepositoryItemDetails(repoItem); - if (repoItem.XmlFileDetails != null && repoItem.XmlFileDetails != string.Empty) - { - UpdatedIndexerRecords.Add(repoItem.XmlFileDetails); - } - } - } - } - - WriteRepositoryIndexerData(UpdatedIndexerRecords); - } - - private void WriteRepositoryIndexerData(List dataToWrite) - { - bool succeedWritingFile = false; - int tryingCounter = 1; - Exception savedEx = null; - while (succeedWritingFile == false && tryingCounter <= 3) //TODO: implement better way to syncronaize the calls to this function - { - try - { - File.WriteAllLines(mIndexerFilePath, dataToWrite); - succeedWritingFile = true; - } - catch (Exception ex) - { - Thread.Sleep(1000); - tryingCounter++; - savedEx = ex; - } - - if (succeedWritingFile == false && tryingCounter > 3 && savedEx != null) - { - throw savedEx; - } - } - } - - public List ReadRepositoryIndexerData() - { - List IndexerLines = []; - bool succeedReadingFile = false; - int tryingCounter = 1; - Exception savedEx = null; - while (succeedReadingFile == false && tryingCounter <= 3) //TODO: implement better way to syncronaize the calls to this function - { - try - { - System.IO.StreamReader file = new System.IO.StreamReader(mIndexerFilePath); - IndexerLines = (file.ReadToEnd()).Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); //fastest avg 702 ticks while ((indexLine = file.ReadLine()) != null) //this way is 100xs slower average 6124 ticks. - file.Close(); - succeedReadingFile = true; - } - catch (Exception) - { - Thread.Sleep(1000); - tryingCounter++; - } - } - - if (succeedReadingFile == false && tryingCounter > 3 && savedEx != null) - { - throw savedEx; - } - else - { - return IndexerLines; - } - } - - private List GetAllRepositoryFiles() - { - List repoFilesList = []; - - //Get the ActivitiesGroups items - string activitiesGroupsFolderPath = mRepositoryFolderPath + @"\" + - GingerRepositoryItem.GetRepoItemMainFolderName(eGingerRepoItemType.ActivitiesGroup) + @"\"; - if (Directory.Exists(activitiesGroupsFolderPath)) - { - string[] files = Directory.GetFiles(activitiesGroupsFolderPath, "*", SearchOption.AllDirectories); - if (files != null && files.Length > 0) - { - foreach (string filePath in files) - { - if (!filePath.ToUpper().Contains("PREVVERSIONS") && !filePath.ToUpper().Contains(".SVN") && Path.GetExtension(filePath).ToUpper() == ".XML") - { - GingerRepositoryItem activitiesGroupItem = new GingerRepositoryItem(eGingerRepoItemType.ActivitiesGroup) - { - FilePath = filePath - }; - repoFilesList.Add(activitiesGroupItem); - } - } - } - } - - //Get the Activities items - string activitiesFolderPath = mRepositoryFolderPath + @"\" + - GingerRepositoryItem.GetRepoItemMainFolderName(eGingerRepoItemType.Activity) + @"\"; - if (Directory.Exists(activitiesFolderPath)) - { - string[] files = Directory.GetFiles(activitiesFolderPath, "*", SearchOption.AllDirectories); - if (files != null && files.Length > 0) - { - foreach (string filePath in files) - { - if (!filePath.ToUpper().Contains("PREVVERSIONS") && !filePath.ToUpper().Contains(".SVN") && Path.GetExtension(filePath).ToUpper() == ".XML") - { - GingerRepositoryItem activityItem = new GingerRepositoryItem(eGingerRepoItemType.Activity) - { - FilePath = filePath - }; - repoFilesList.Add(activityItem); - } - } - } - } - - //TODO: Get the Actions items if needed for Ginger-ATS integration - - //TODO: Get the Variables items if needed for Ginger-ATS integration - - return repoFilesList; - } - - private void SetRepositoryItemDetails(GingerRepositoryItem repoItem) - { - //get the XML reader - XmlReader xmlReader = GingerATSXmlReader.GetXMLReaderFromFile(repoItem.FilePath); - if (xmlReader != null) - { - //get the details from the xml - if (GingerATSXmlReader.MoveXmlReaderToSpecificNode(xmlReader, GingerRepositoryItem.GetRepoItemMainXmlNodeName(repoItem.Type))) - { - repoItem.Name = xmlReader.GetAttribute(GingerRepositoryItem.GetRepoItemNameFieldLabel(repoItem.Type)); - repoItem.GUID = xmlReader.GetAttribute(eGeneralGingerRepoAttributes.Guid.ToString()); - repoItem.ExternalID = xmlReader.GetAttribute(eGeneralGingerRepoAttributes.ExternalID.ToString()); - if (repoItem.ExternalID == null) - { - repoItem.ExternalID = "Null"; - } - - repoItem.LastUpdated = xmlReader.GetAttribute(eGeneralGingerRepoAttributes.LastUpdate.ToString()); - - repoItem.XmlFileDetails = GingerRepositoryItem.GetRepoItemTypeLabelInIndexer(repoItem.Type) + ";" + - repoItem.Name + ";" + - repoItem.GUID + ";" + - repoItem.ExternalID + ";" + - repoItem.FilePath + ";" + - repoItem.LastUpdated; - } - } - - xmlReader.Close(); - } - - public GingerRepositoryItem GetGingerRepositoryItem(eGingerRepoItemType itemType, string itemExternalID, List indexerRecords = null) - { - GingerRepositoryItem repoItem = null; - if (indexerRecords == null) - { - indexerRecords = ReadRepositoryIndexerData(); - } - - foreach (string indexerRecord in indexerRecords) - { - string[] indexerRecordDetails = indexerRecord.Split(';'); - if (indexerRecordDetails != null && indexerRecordDetails.Length == 6) - { - string aTSExternalID = String.Empty; - if ((indexerRecordDetails.Length > 3) && (indexerRecordDetails[3] != null) && (indexerRecordDetails[3].ToString() != string.Empty)) - { - if ((indexerRecordDetails[3].Contains('|')) && (indexerRecordDetails[3].Contains('='))) - { - aTSExternalID = indexerRecordDetails[3].Split('|').Last().Split('=').Last(); - } - else - { - aTSExternalID = indexerRecordDetails[3]; - } - } - if ((indexerRecordDetails[0] == GingerRepositoryItem.GetRepoItemTypeLabelInIndexer(itemType)) && - (aTSExternalID == itemExternalID)) - { - repoItem = new GingerRepositoryItem(itemType) - { - Name = indexerRecordDetails[1], - GUID = indexerRecordDetails[2], - ExternalID = aTSExternalID, - FilePath = indexerRecordDetails[4], - LastUpdated = indexerRecordDetails[5] - }; - break; - } - } - } - - return repoItem; - } - } -} diff --git a/Ginger/GingerATS/GingerATSSVNSourceControl.cs b/Ginger/GingerATS/GingerATSSVNSourceControl.cs deleted file mode 100644 index 908a80fdad..0000000000 --- a/Ginger/GingerATS/GingerATSSVNSourceControl.cs +++ /dev/null @@ -1,105 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -using SharpSvn; - -namespace GingerATS -{ - public class GingerATSSVNSourceControl - { - public GingerATSLog Logger = null; - private SvnClient mClient; - public SourceConnectionDetails mSourceConnectionDetails { get; set; } - string mSolutionFullLocalPath = string.Empty; - private SvnUpdateResult mOperationResult; - public SvnUpdateResult OperationResult { get { return mOperationResult; } set { mOperationResult = value; } } - - public GingerATSSVNSourceControl(SourceConnectionDetails sourceConnectionDetails, string solutionFullLocalPath) - { - mSourceConnectionDetails = sourceConnectionDetails; - mSolutionFullLocalPath = solutionFullLocalPath; - } - - public void Init() - { - try - { - mClient = new SvnClient(); - - //Configure the client profile folder - string configPath = Path.Combine(Path.GetTempPath(), "sharpsvn"); - if (!Directory.Exists(configPath)) - { - Directory.CreateDirectory(configPath); - } - mClient.LoadConfiguration(configPath, true); - - mClient.Authentication.DefaultCredentials = - new System.Net.NetworkCredential(mSourceConnectionDetails.SourceUserName, mSourceConnectionDetails.SourceUserPass); - } - catch (Exception ex) - { - mClient = null; - throw ex; - } - } - - public void GetProject() - { - if (mClient == null) - { - Init(); - } - - try - { - mClient.CheckOut(new Uri(mSourceConnectionDetails.SourceURL + - mSourceConnectionDetails.GingerSolutionName + @"/SharedRepository"), - mSolutionFullLocalPath + @"/SharedRepository", out mOperationResult); - } - catch (Exception ex) - { - Logger.AddLineToLog(eLogLineType.ERROR, "Failed to Clone the Repository to local, Error: " + ex.Message); - mClient = null; - throw ex; - } - } - - /// - /// Get all files in path recursive - /// - public void GetLatest() - { - if (mClient == null) - { - Init(); - } - - try - { - mClient.Update(Path.Combine(mSolutionFullLocalPath, "SharedRepository"), out mOperationResult); - } - catch (Exception ex) - { - Logger.AddLineToLog(eLogLineType.ERROR, "Failed to Update the Repository to local, Error: " + ex.Message); - mClient = null; - throw ex; - } - } - } -} diff --git a/Ginger/GingerATS/GingerATSXmlReader.cs b/Ginger/GingerATS/GingerATSXmlReader.cs deleted file mode 100644 index e375d2497a..0000000000 --- a/Ginger/GingerATS/GingerATSXmlReader.cs +++ /dev/null @@ -1,261 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -using System.Xml; -using System.Xml.Linq; - -namespace GingerATS -{ - public class GingerATSXmlReader - { - public static XmlReader GetXMLReaderFromFile(string xmlFilePath) - { - try - { - using (FileStream fileSteam = File.OpenRead(xmlFilePath)) - { - XmlReaderSettings settings; - - settings = new XmlReaderSettings - { - IgnoreWhitespace = true - }; - XmlReader reader = XmlReader.Create(fileSteam, settings); - return reader; - } - } - catch (Exception) - { - return null; - } - } - - public static XmlReader GetXMLReaderFromString(string xmlString) - { - try - { - XmlReaderSettings settings; - settings = new XmlReaderSettings - { - IgnoreWhitespace = true - }; - XmlReader reader = XmlReader.Create(new StringReader(xmlString), settings); - return reader; - } - catch (Exception) - { - return null; - } - } - - public static bool MoveXmlReaderToSpecificNode(XmlReader xmlReader, string nodeName) - { - try - { - while (xmlReader.Read()) - { - if (xmlReader.Name.ToUpper().Contains(nodeName.ToUpper())) - { - return true; - } - } - return false; - } - catch (Exception ex) - { - return false; - } - } - - public static bool MoveXmlReaderToSpecificNode(XmlReader xmlReader, string nodeName, string attributeName, string attributeValue) - { - try - { - while (xmlReader.Read()) - { - if (xmlReader.Name.ToUpper().Contains(nodeName.ToUpper())) - { - if (xmlReader.GetAttribute(attributeName) == attributeValue) - { - return true; - } - } - } - return false; - } - catch (Exception) - { - return false; - } - } - - public static string GetNodeAttributeValue(string xmlFilePath, string nodeName, string attributeName) - { - XmlReader xmlReader = null; - try - { - xmlReader = GingerATSXmlReader.GetXMLReaderFromFile(xmlFilePath); - if (xmlReader != null) - { - if (GingerATSXmlReader.MoveXmlReaderToSpecificNode(xmlReader, nodeName)) - { - string attributeValue = xmlReader.GetAttribute(attributeName); - xmlReader.Close(); - return attributeValue; - } - } - - xmlReader.Close(); - return null; - } - catch (Exception) - { - if (xmlReader != null) - { - xmlReader.Close(); - } - - return null; - } - } - - public static bool ValidateNodeAttributsValue(string xmlPathOrString, string nodeName, List attributesToValidate, bool getReaderFromString = false) - { - XmlReader xmlReader = null; - try - { - if (!getReaderFromString) - { - xmlReader = GingerATSXmlReader.GetXMLReaderFromFile(xmlPathOrString); - } - else - { - xmlReader = GingerATSXmlReader.GetXMLReaderFromString(xmlPathOrString); - } - - while (GingerATSXmlReader.MoveXmlReaderToSpecificNode(xmlReader, nodeName)) - { - if (attributesToValidate != null && attributesToValidate.Count > 0) - { - int matchingAttributesNum = 0; - foreach (NodeAttributeValidation attributToValidate in attributesToValidate) - { - string attributeValue = xmlReader.GetAttribute(attributToValidate.Name); - if (attributeValue != null && attributToValidate.ValidateInUpperCase) - { - attributeValue = attributeValue.ToUpper(); - attributToValidate.Value = attributToValidate.Value.ToUpper(); - } - switch (attributToValidate.ValidationType) - { - case NodeAttributeValidation.eNodeAttributeValidationType.Equal: - if (attributeValue == attributToValidate.Value) - { - matchingAttributesNum++; - } - - break; - case NodeAttributeValidation.eNodeAttributeValidationType.Contains: - if (attributeValue != null && attributeValue.Contains(attributToValidate.Value)) - { - matchingAttributesNum++; - } - - break; - case NodeAttributeValidation.eNodeAttributeValidationType.CommaSeperatedListValue: - if (attributeValue != null) - { - string[] listValues = attributeValue.Split(';'); - if (listValues.Where(x => x == attributToValidate.Value).FirstOrDefault() != null) - { - matchingAttributesNum++; - } - } - break; - case NodeAttributeValidation.eNodeAttributeValidationType.NewLineSeperatedListValue: - if (attributeValue != null) - { - string[] listValues = attributeValue.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); - if (listValues.Where(x => x == attributToValidate.Value).FirstOrDefault() != null) - { - matchingAttributesNum++; - } - } - break; - } - } - if (matchingAttributesNum == attributesToValidate.Count) - { - xmlReader.Close(); - return true; - } - } - } - - xmlReader.Close(); - return false; - } - catch (Exception) - { - if (xmlReader != null) - { - xmlReader.Close(); - } - - return false; - } - } - - public static string GetXmlFileNodeContent(string xmlFilePath, string nodeName) - { - XDocument doc; - try - { - doc = XDocument.Load(xmlFilePath); - string nodeXml = doc.Root.Element(nodeName).ToString(); - doc = null; - return nodeXml; - } - catch (Exception) - { - doc = null; - return string.Empty; - } - } - } - - public class NodeAttributeValidation - { - public enum eNodeAttributeValidationType { Equal, Contains, CommaSeperatedListValue, NewLineSeperatedListValue } - - public string Name; - public string Value; - public eNodeAttributeValidationType ValidationType; - public bool ValidateInUpperCase; - - public NodeAttributeValidation(string name, string value, - eNodeAttributeValidationType validationType = eNodeAttributeValidationType.Equal, - bool validateInUpperCase = false) - { - this.Name = name; - this.Value = value; - this.ValidationType = validationType; - this.ValidateInUpperCase = validateInUpperCase; - } - } -} diff --git a/Ginger/GingerATS/GingerRepositoryItem.cs b/Ginger/GingerATS/GingerRepositoryItem.cs deleted file mode 100644 index 81e0247ce4..0000000000 --- a/Ginger/GingerATS/GingerRepositoryItem.cs +++ /dev/null @@ -1,105 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace GingerATS -{ - public enum eGingerRepoItemType - { - ActivitiesGroup, Activity, Action, Variable - } - - public enum eGeneralGingerRepoAttributes - { - Guid, ExternalID, LastUpdate - } - - public class GingerRepositoryItem - { - public eGingerRepoItemType Type { get; set; } - public string Name { get; set; } - public string GUID { get; set; } - public string ExternalID { get; set; } - public string FilePath { get; set; } - public string LastUpdated { get; set; } - public string XmlFileDetails { get; set; } - - public static string ActivityAutomationStatusAttributeName { get { return "AutomationStatus"; } } - public static string ActivityAutomationStatusAutomatedValue { get { return "Automated"; } } - - public static string ActivityVariablesAttributeName { get { return "Variables"; } } - public static string ActivityVariableNameAttribute { get { return "Name"; } } - - public static string VariableSelectionListNodeName { get { return ".VariableSelectionList"; } } - public static string VariableSelectionListNameAttribute { get { return "Name"; } } - public static string VariableSelectionListOptionalValuesAttribute { get { return "OptionalValues"; } } - - public GingerRepositoryItem(eGingerRepoItemType type) - { - this.Type = type; - } - - public static string GetRepoItemMainFolderName(eGingerRepoItemType itemType) - { - return itemType switch - { - (eGingerRepoItemType.ActivitiesGroup) => "ActivitiesGroup", - (eGingerRepoItemType.Activity) => "Activities", - (eGingerRepoItemType.Action) => "Actions", - (eGingerRepoItemType.Variable) => "Variables", - _ => string.Empty, - }; - } - - public static string GetRepoItemTypeLabelInIndexer(eGingerRepoItemType itemType) - { - return itemType switch - { - (eGingerRepoItemType.ActivitiesGroup) => "#ACTIVITIES GROUP#", - (eGingerRepoItemType.Activity) => "#ACTIVITY#", - (eGingerRepoItemType.Action) => "#ACTION#", - (eGingerRepoItemType.Variable) => "#VARIABLE#", - _ => string.Empty, - }; - } - - public static string GetRepoItemMainXmlNodeName(eGingerRepoItemType itemType) - { - return itemType switch - { - (eGingerRepoItemType.ActivitiesGroup) => "ActivitiesGroup",//GingerCore.Activities.ActivitiesGroup - (eGingerRepoItemType.Activity) => "Activity",//GingerCore.Activity - (eGingerRepoItemType.Action) => "Act",//been changed for each Action type like: GingerCore.Actions.ActTextBox - (eGingerRepoItemType.Variable) => "Variable",//been changed for each Variable type like: GingerCore.Variables.VariableString - _ => string.Empty, - }; - } - - public static string GetRepoItemNameFieldLabel(eGingerRepoItemType itemType) - { - return itemType switch - { - (eGingerRepoItemType.ActivitiesGroup) => "Name", - (eGingerRepoItemType.Activity) => "ActivityName", - (eGingerRepoItemType.Action) => "Name", - (eGingerRepoItemType.Variable) => "Name", - _ => string.Empty, - }; - } - } -} diff --git a/Ginger/GingerATS/SourceConnectionDetails.cs b/Ginger/GingerATS/SourceConnectionDetails.cs deleted file mode 100644 index 9a7a13e5d0..0000000000 --- a/Ginger/GingerATS/SourceConnectionDetails.cs +++ /dev/null @@ -1,67 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace GingerATS -{ - /// - /// This class is used for grouping the details which required for establish connection to the Ginger source control - /// - public class SourceConnectionDetails - { - /// - /// Source control URL - /// - public string SourceURL { get; set; } - /// - /// Source control User Name - /// - public string SourceUserName { get; set; } - /// - /// Source control User Password - /// - public string SourceUserPass { get; set; } - /// - /// The Ginger Solution name which Ginger supposed to connect to in the source control and pull the automation status - /// - public string GingerSolutionName { get; set; } - /// - /// Local path for storing the data from the source control while analyzing it - /// - public string GingerSolutionLocalPath { get; set; } - - /// - /// This class is used for grouping the details which required for establish connection to the Ginger source control - /// - /// - /// Source control User Name - /// Source control User Password - /// The Ginger Solution name which Ginger supposed to connect to in the source control - /// and pull the automation status - /// Local path for storing the data from the source control while analyzing it - public SourceConnectionDetails(string sourceURL, string sourceUserName, string sourceUserPass, - string gingerSolutionName, string gingerSolutionLocalPath) - { - this.SourceURL = sourceURL; - this.SourceUserName = sourceUserName; - this.SourceUserPass = sourceUserPass; - this.GingerSolutionName = gingerSolutionName; - this.GingerSolutionLocalPath = gingerSolutionLocalPath; - } - } -} diff --git a/Ginger/GingerATS/StepAutoStatus.cs b/Ginger/GingerATS/StepAutoStatus.cs deleted file mode 100644 index be910ddba1..0000000000 --- a/Ginger/GingerATS/StepAutoStatus.cs +++ /dev/null @@ -1,53 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace GingerATS -{ - /// - /// This class is been used for storing the Ginger automation status of a QC Test Case Step - /// - public class StepAutoStatus - { - /// - /// QC Test Case Step ID (DS_ID is required) - /// - public long ID { get; set; } - /// - /// QC Test Case Step Parameters (ATS will store unique key of parameter name-value combination in the dictionary) - /// - public Dictionary Parameters { get; set; } - /// - /// 'False' value means the TC Step is not exist in Ginger repository or it is not automated- all step parameters automation status will be False as well, - /// 'True' value means the TC Step is automated but each step parameter automation status need to be checked separately, - /// 'Null' value means the TC Step automation status was not checked - /// - public bool? AutomatedByGinger { get; set; } - - /// - /// - /// - /// QC Test Case Step ID - public StepAutoStatus(long id) - { - this.ID = id; - this.Parameters = []; - this.AutomatedByGinger = null; - } - } -} diff --git a/Ginger/GingerATS/StepParamAutoStatus.cs b/Ginger/GingerATS/StepParamAutoStatus.cs deleted file mode 100644 index 288798799a..0000000000 --- a/Ginger/GingerATS/StepParamAutoStatus.cs +++ /dev/null @@ -1,53 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -namespace GingerATS -{ - /// - /// This class is been used for storing the Ginger automation status of a QC Test Case Step Parameter Value - /// - public class StepParamAutoStatus - { - /// - /// QC Test Case Step Parameter name as exist in QC - /// - public string Name { get; set; } - /// - /// QC Test Case Step Parameter selected value for execution - /// - public string SelectedValue { get; set; } - /// - /// 'False' value means the TC Step Parameter and/or Parameter Value is not supported by Ginger, - /// 'True' value means the TC Step Parameter and it's selected value is supported by Ginger, - /// 'Null' value means the TC Step Parameter automation status was not checked - /// - public bool? AutomatedByGinger { get; set; } - - /// - /// - /// - /// QC Test Case Step Parameter name as exist in QC - /// QC Test Case Step Parameter selected value for execution - public StepParamAutoStatus(string name, string selectedValue) - { - this.Name = name; - this.SelectedValue = selectedValue; - this.AutomatedByGinger = null; - } - } -} diff --git a/Ginger/GingerATS/TestCaseAutoStatus.cs b/Ginger/GingerATS/TestCaseAutoStatus.cs deleted file mode 100644 index a2ee38ec45..0000000000 --- a/Ginger/GingerATS/TestCaseAutoStatus.cs +++ /dev/null @@ -1,53 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace GingerATS -{ - /// - /// This class is been used for storing the Ginger automation status of a QC Test Case - /// - public class TestCaseAutoStatus - { - /// - /// QC Test Case ID - /// - public long ID { get; set; } - /// - /// QC Test Case Steps - /// - public Dictionary Steps { get; set; } - /// - /// 'False' value means the TC is not exist in Ginger repository so it and all of it steps are not automated, - /// 'True' value means the TC exist in Ginger repository but each step automation status need to be checked separately, - /// 'Null' value means the TC automation status was not checked - /// - public bool? KnownByGinger { get; set; } //if 'False'- no need to check if steps are automated - - /// - /// - /// - /// QC Test Case ID - public TestCaseAutoStatus(long id) - { - this.ID = id; - this.Steps = []; - this.KnownByGinger = null; - } - } -} diff --git a/Ginger/GingerCoreNET/GingerCoreNET.csproj b/Ginger/GingerCoreNET/GingerCoreNET.csproj index 4f03db7ae4..fcac0d1257 100644 --- a/Ginger/GingerCoreNET/GingerCoreNET.csproj +++ b/Ginger/GingerCoreNET/GingerCoreNET.csproj @@ -344,6 +344,7 @@ + @@ -355,7 +356,6 @@ - diff --git a/Ginger/VisualRegressionTracker/Api.json b/Ginger/VisualRegressionTracker/Api.json deleted file mode 100644 index b5dc9a12f5..0000000000 --- a/Ginger/VisualRegressionTracker/Api.json +++ /dev/null @@ -1,1271 +0,0 @@ -{ - "openapi": "3.0.0", - "info": { - "title": "Visual Regression Tracker", - "description": "API Documentation", - "version": "1.0", - "contact": {} - }, - "tags": [], - "servers": [], - "components": { - "securitySchemes": { - "bearer": { - "scheme": "bearer", - "bearerFormat": "JWT", - "type": "http" - }, - "api_key": { - "type": "apiKey", - "in": "header", - "name": "apiKey", - "description": "API Key For External calls" - } - }, - "schemas": { - "CreateUserDto": { - "type": "object", - "properties": { - "email": { - "type": "string" - }, - "password": { - "type": "string" - }, - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - } - }, - "required": [ - "email", - "password", - "firstName", - "lastName" - ] - }, - "UserLoginResponseDto": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "email": { - "type": "string" - }, - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, - "apiKey": { - "type": "string" - }, - "token": { - "type": "string" - } - }, - "required": [ - "id", - "email", - "firstName", - "lastName", - "apiKey", - "token" - ] - }, - "UserLoginRequestDto": { - "type": "object", - "properties": { - "email": { - "type": "string" - }, - "password": { - "type": "string" - } - }, - "required": [ - "email", - "password" - ] - }, - "UpdateUserDto": { - "type": "object", - "properties": { - "email": { - "type": "string" - }, - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - } - }, - "required": [ - "email", - "firstName", - "lastName" - ] - }, - "BuildDto": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "ciBuildId": { - "type": "string", - "nullable": true - }, - "number": { - "type": "number" - }, - "branchName": { - "type": "string" - }, - "status": { - "type": "string" - }, - "projectId": { - "type": "string" - }, - "updatedAt": { - "format": "date-time", - "type": "string" - }, - "createdAt": { - "format": "date-time", - "type": "string" - }, - "userId": { - "type": "string", - "nullable": true - }, - "passedCount": { - "type": "number" - }, - "unresolvedCount": { - "type": "number" - }, - "failedCount": { - "type": "number" - }, - "isRunning": { - "type": "boolean" - } - }, - "required": [ - "id", - "ciBuildId", - "number", - "branchName", - "status", - "projectId", - "updatedAt", - "createdAt", - "userId", - "passedCount", - "unresolvedCount", - "failedCount", - "isRunning" - ] - }, - "CreateBuildDto": { - "type": "object", - "properties": { - "ciBuildId": { - "type": "string" - }, - "branchName": { - "type": "string" - }, - "project": { - "type": "string" - } - }, - "required": [ - "branchName", - "project" - ] - }, - "CommentDto": { - "type": "object", - "properties": { - "comment": { - "type": "string" - } - }, - "required": [ - "comment" - ] - }, - "IgnoreAreaDto": { - "type": "object", - "properties": { - "x": { - "type": "number" - }, - "y": { - "type": "number" - }, - "width": { - "type": "number" - }, - "height": { - "type": "number" - } - }, - "required": [ - "x", - "y", - "width", - "height" - ] - }, - "CreateTestRequestDto": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "os": { - "type": "string" - }, - "browser": { - "type": "string" - }, - "viewport": { - "type": "string" - }, - "device": { - "type": "string" - }, - "customTags": { - "type": "string" - }, - "branchName": { - "type": "string" - }, - "imageBase64": { - "type": "string" - }, - "buildId": { - "type": "string" - }, - "projectId": { - "type": "string" - }, - "diffTollerancePercent": { - "type": "number" - }, - "merge": { - "type": "boolean" - }, - "ignoreAreas": { - "type": "array", - "items": { - "$ref": "#/components/schemas/IgnoreAreaDto" - } - } - }, - "required": [ - "name", - "branchName", - "imageBase64", - "buildId", - "projectId" - ] - }, - "TestRunResultDto": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "imageName": { - "type": "string" - }, - "diffName": { - "type": "string", - "nullable": true - }, - "baselineName": { - "type": "string", - "nullable": true - }, - "diffPercent": { - "type": "number", - "nullable": true - }, - "diffTollerancePercent": { - "type": "number" - }, - "pixelMisMatchCount": { - "type": "number", - "nullable": true - }, - "status": { - "type": "string" - }, - "url": { - "type": "string" - }, - "merge": { - "type": "boolean" - } - }, - "required": [ - "id", - "imageName", - "diffName", - "baselineName", - "diffPercent", - "diffTollerancePercent", - "pixelMisMatchCount", - "status", - "url", - "merge" - ] - }, - "ProjectDto": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "buildsCounter": { - "type": "number" - }, - "name": { - "type": "string" - }, - "mainBranchName": { - "type": "string" - }, - "createdAt": { - "format": "date-time", - "type": "string" - }, - "updatedAt": { - "format": "date-time", - "type": "string" - } - }, - "required": [ - "id", - "buildsCounter", - "name", - "mainBranchName", - "createdAt", - "updatedAt" - ] - }, - "CreateProjectDto": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "mainBranchName": { - "type": "string" - } - }, - "required": [ - "name", - "mainBranchName" - ] - } - } - }, - "paths": { - "/users/register": { - "post": { - "operationId": "UsersController_register", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateUserDto" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserLoginResponseDto" - } - } - } - } - }, - "tags": [ - "users" - ] - } - }, - "/users/login": { - "post": { - "operationId": "UsersController_login", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserLoginRequestDto" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserLoginResponseDto" - } - } - } - } - }, - "tags": [ - "users" - ] - } - }, - "/users/newApiKey": { - "get": { - "operationId": "UsersController_generateNewApiKey", - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "string" - } - } - } - } - }, - "tags": [ - "users" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/users/password": { - "put": { - "operationId": "UsersController_changePassword", - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "boolean" - } - } - } - } - }, - "tags": [ - "users" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/users": { - "put": { - "operationId": "UsersController_update", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UpdateUserDto" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UserLoginResponseDto" - } - } - } - } - }, - "tags": [ - "users" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/builds": { - "get": { - "operationId": "BuildsController_get", - "parameters": [ - { - "name": "projectId", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/BuildDto" - } - } - } - } - } - }, - "tags": [ - "builds" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "post": { - "operationId": "BuildsController_create", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateBuildDto" - } - } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BuildDto" - } - } - } - } - }, - "tags": [ - "builds" - ], - "security": [ - { - "api_key": [] - } - ] - } - }, - "/builds/{id}": { - "delete": { - "operationId": "BuildsController_remove", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "builds" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "patch": { - "operationId": "BuildsController_stop", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BuildDto" - } - } - } - } - }, - "tags": [ - "builds" - ], - "security": [ - { - "bearer": [] - }, - { - "api_key": [] - } - ] - } - }, - "/test-runs": { - "get": { - "operationId": "TestRunsController_get", - "parameters": [ - { - "name": "buildId", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-runs" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "post": { - "operationId": "TestRunsController_postTestRun", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateTestRequestDto" - } - } - } - }, - "responses": { - "201": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TestRunResultDto" - } - } - } - } - }, - "tags": [ - "test-runs" - ], - "security": [ - { - "api_key": [] - } - ] - } - }, - "/test-runs/recalculateDiff/{id}": { - "get": { - "operationId": "TestRunsController_recalculateDiff", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-runs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-runs/approve": { - "get": { - "operationId": "TestRunsController_approveTestRun", - "parameters": [ - { - "name": "id", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "merge", - "required": false, - "in": "query", - "schema": { - "type": "boolean" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-runs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-runs/reject/{id}": { - "get": { - "operationId": "TestRunsController_rejectTestRun", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-runs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-runs/{id}": { - "delete": { - "operationId": "TestRunsController_deleteTestRun", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-runs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-runs/ignoreArea/{testRunId}": { - "put": { - "operationId": "TestRunsController_updateIgnoreAreas", - "parameters": [ - { - "name": "testRunId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-runs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-runs/comment/{testRunId}": { - "put": { - "operationId": "TestRunsController_updateComment", - "parameters": [ - { - "name": "testRunId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CommentDto" - } - } - } - }, - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-runs" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-variations": { - "get": { - "operationId": "TestVariationsController_getList", - "parameters": [ - { - "name": "projectId", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-variations" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-variations/details/{id}": { - "get": { - "operationId": "TestVariationsController_getDetails", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-variations" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-variations/ignoreArea/{variationId}": { - "put": { - "operationId": "TestVariationsController_updateIgnoreAreas", - "parameters": [ - { - "name": "variationId", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-variations" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-variations/comment/{id}": { - "put": { - "operationId": "TestVariationsController_updateComment", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CommentDto" - } - } - } - }, - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-variations" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-variations/merge/": { - "get": { - "operationId": "TestVariationsController_merge", - "parameters": [ - { - "name": "projectId", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "branchName", - "required": true, - "in": "query", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BuildDto" - } - } - } - } - }, - "tags": [ - "test-variations" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/test-variations/{id}": { - "delete": { - "operationId": "TestVariationsController_delete", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "test-variations" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/projects": { - "get": { - "operationId": "ProjectsController_getAll", - "parameters": [], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProjectDto" - } - } - } - } - } - }, - "tags": [ - "projects" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "post": { - "operationId": "ProjectsController_create", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateProjectDto" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectDto" - } - } - } - } - }, - "tags": [ - "projects" - ], - "security": [ - { - "bearer": [] - } - ] - }, - "put": { - "operationId": "ProjectsController_update", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectDto" - } - } - } - }, - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectDto" - } - } - } - } - }, - "tags": [ - "projects" - ], - "security": [ - { - "bearer": [] - } - ] - } - }, - "/projects/{id}": { - "delete": { - "operationId": "ProjectsController_remove", - "parameters": [ - { - "name": "id", - "required": true, - "in": "path", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProjectDto" - } - } - } - } - }, - "tags": [ - "projects" - ], - "security": [ - { - "bearer": [] - } - ] - } - } - } - } \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/ApiClient.cs b/Ginger/VisualRegressionTracker/ApiClient.cs deleted file mode 100644 index d6f552f059..0000000000 --- a/Ginger/VisualRegressionTracker/ApiClient.cs +++ /dev/null @@ -1,37 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -using System.Net.Http; - -namespace VisualRegressionTracker -{ - public partial class ApiClient - { - public ApiClient(string baseUrl) : this(baseUrl, new HttpClient()) { } - - public string ApiKey { get; set; } - public string Project { get; set; } - - - partial void PrepareRequest(HttpClient client, HttpRequestMessage request, string url) - { - request.Headers.Add("apiKey", new[] { ApiKey }); - request.Headers.Add("project", new[] { Project }); - } - } -} \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/Config.cs b/Ginger/VisualRegressionTracker/Config.cs deleted file mode 100644 index 6f20052dd7..0000000000 --- a/Ginger/VisualRegressionTracker/Config.cs +++ /dev/null @@ -1,138 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -using Newtonsoft.Json; -using System; -using System.IO; -using System.Linq; - -namespace VisualRegressionTracker -{ - public class Config - { - private static readonly JsonSerializer serializer = new JsonSerializer(); - public static readonly string DefaultPath = "vrt.json"; - - [JsonProperty("apiUrl")] - public string ApiUrl { get; set; } = "http://10.234.170.81:4200"; - [JsonProperty("ciBuildId")] - public string CiBuildId { get; set; } - [JsonProperty("branchName")] - public string BranchName { get; set; } - [JsonProperty("project")] - public string Project { get; set; } - [JsonProperty("apiKey")] - public string ApiKey { get; set; } - [JsonProperty("enableSoftAssert")] - public bool EnableSoftAssert { get; set; } - - public void CheckComplete() - { - if (string.IsNullOrEmpty(ApiUrl)) - { - throw new MissingConfigurationError(nameof(ApiUrl), $"{nameof(ApiUrl)} is not specified.'"); - } - if (string.IsNullOrEmpty(BranchName)) - { - throw new MissingConfigurationError(nameof(BranchName), $"{nameof(BranchName)} is not specified.'"); - } - if (string.IsNullOrEmpty(Project)) - { - throw new MissingConfigurationError(nameof(Project), $"{nameof(Project)} is not specified.'"); - } - if (string.IsNullOrEmpty(ApiKey)) - { - throw new MissingConfigurationError(nameof(ApiKey), $"{nameof(ApiKey)} is not specified.'"); - } - } - - public static Config GetDefault() - { - return GetDefault(null); - } - - public static Config GetDefault(string path) - { - var default_path = Path.Combine(determine_config_path(), DefaultPath); - Config cfg; - - if (path != null) - { - cfg = FromFile(path); - } - else if (File.Exists(default_path)) - { - cfg = FromFile(default_path); - } - else - { - cfg = new Config(); - } - - cfg.ApplyEnvironment(); - - try - { - cfg.CheckComplete(); - } - catch (MissingConfigurationError ex) - { - throw new MissingConfigurationError( - ex.FieldName, - $"Incomplete configuration, {ex.FieldName} was not specified." - + $"Please provide via the constructor, a config file '{DefaultPath}', or environment variables."); - } - - return cfg; - } - - public static Config FromFile(string path) - { - using (var file = File.OpenText(path)) - { - var config = (Config)serializer.Deserialize(file, typeof(Config)); - return config; - } - } - - public void ApplyEnvironment() - { - maybe_apply_env("VRT_APIURL", v => ApiUrl = v); - maybe_apply_env("VRT_CIBUILDID", v => CiBuildId = v); - maybe_apply_env("VRT_BRANCHNAME", v => BranchName = v); - maybe_apply_env("VRT_PROJECT", v => Project = v); - maybe_apply_env("VRT_APIKEY", v => ApiKey = v); - maybe_apply_env("VRT_ENABLESOFTASSERT", v => - EnableSoftAssert = new[] { "true", "1" }.Contains(v.ToLowerInvariant())); - } - - private static void maybe_apply_env(string name, Action action) - { - var value = Environment.GetEnvironmentVariable(name); - if (!string.IsNullOrEmpty(value)) - { - action(value); - } - } - - private static string determine_config_path() - { - return Directory.GetCurrentDirectory(); - } - } -} \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/MissingConfigurationError.cs b/Ginger/VisualRegressionTracker/MissingConfigurationError.cs deleted file mode 100644 index ef2cc5fcf2..0000000000 --- a/Ginger/VisualRegressionTracker/MissingConfigurationError.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace VisualRegressionTracker -{ - public class MissingConfigurationError : VisualRegressionTrackerError - { - public MissingConfigurationError(string fieldName, string message) : base(message) - { - FieldName = fieldName; - } - - public string FieldName { get; } - } -} \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/TestRunResult.cs b/Ginger/VisualRegressionTracker/TestRunResult.cs deleted file mode 100644 index 69acfb96b9..0000000000 --- a/Ginger/VisualRegressionTracker/TestRunResult.cs +++ /dev/null @@ -1,30 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace VisualRegressionTracker -{ - public class TestRunResult - { - public TestRunStatus Status { get; set; } - public string Url { get; set; } - public string ImageUrl { get; set; } - public string DiffUrl { get; set; } - public string BaselineUrl { get; set; } - } -} \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/TestRunStatus.cs b/Ginger/VisualRegressionTracker/TestRunStatus.cs deleted file mode 100644 index 5e13a22378..0000000000 --- a/Ginger/VisualRegressionTracker/TestRunStatus.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - - -namespace VisualRegressionTracker -{ - public enum TestRunStatus - { - New, - Ok, - Unresolved, - Failed, - Approved, - AutoApproved - } -} \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/VisualRegressionTracker.cs b/Ginger/VisualRegressionTracker/VisualRegressionTracker.cs deleted file mode 100644 index 74191ef659..0000000000 --- a/Ginger/VisualRegressionTracker/VisualRegressionTracker.cs +++ /dev/null @@ -1,279 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -using System.Collections.Generic; -using System.IO; -using System.Net.Http; -using System.Security.Cryptography; -using System.Threading; -using System.Threading.Tasks; - -namespace VisualRegressionTracker -{ - public class VisualRegressionTracker - { - private class Disposer //: IAsyncDisposable - { - private readonly VisualRegressionTracker tracker; - private readonly CancellationToken? cancellationToken; - - public Disposer(VisualRegressionTracker tracker, CancellationToken? cancellationToken) - { - this.tracker = tracker; - this.cancellationToken = cancellationToken; - } - - //public ValueTask DisposeAsync() - //{ - // return tracker.Stop(cancellationToken); - //} - } - - private readonly Config config; - private readonly ApiClient client; - private string buildId; - private string projectId; - - public VisualRegressionTracker() : this(null, null) - { - } - - public VisualRegressionTracker(Config config) : this(config, null) - { - } - - public VisualRegressionTracker(Config config, HttpClient httpClient) - { - this.config = config ?? Config.GetDefault(); - this.config.CheckComplete(); - - var apiUrl = this.config.ApiUrl + (this.config.ApiUrl.EndsWith("/") ? "" : "/"); - - this.client = new ApiClient( - apiUrl, - httpClient ?? new HttpClient() - ) - { - ApiKey = this.config.ApiKey, - Project = this.config.Project - }; - } - - public bool IsStarted => buildId != null && projectId != null; - public string BuildId => buildId; - public string ProjectId => projectId; - - public Task Start() - { - return Start(null); - } - - public Task Start(CancellationToken cancellationToken) - { - return Start((CancellationToken?)cancellationToken); - } - - protected async Task Start(CancellationToken? cancellationToken) - { - try - { - var dto = new CreateBuildDto - { - Project = config.Project, - BranchName = config.BranchName, - CiBuildId = config.CiBuildId - }; - var response = cancellationToken.HasValue - ? await client.BuildsController_createAsync(dto, cancellationToken.Value) - : await client.BuildsController_createAsync(dto); - - buildId = response.Id; - projectId = response.ProjectId; - //return new Disposer(this, cancellationToken); - } - catch (ApiException ex) - { - throw new VisualRegressionTrackerError(ex); - } - catch (HttpRequestException ex) - { - throw new VisualRegressionTrackerError(ex); - } - } - - public Task Stop() - { - return Stop(null); - } - - public Task Stop(CancellationToken cancellationToken) - { - return Stop((CancellationToken?)cancellationToken); - } - - protected async Task Stop(CancellationToken? cancellationToken) - { - if (!IsStarted) - { - throw new VisualRegressionTrackerError("Visual Regression Tracker has not been started"); - } - - try - { - if (cancellationToken.HasValue) - { - await client.BuildsController_stopAsync(buildId, cancellationToken.Value); - } - else - { - await client.BuildsController_stopAsync(buildId); - } - - buildId = null; - projectId = null; - } - catch (ApiException ex) - { - throw new VisualRegressionTrackerError(ex); - } - catch (HttpRequestException ex) - { - throw new VisualRegressionTrackerError(ex); - } - } - - protected async Task SubmitTestRun( - CreateTestRequestDto testRun, CancellationToken? cancellationToken) - { - if (!IsStarted) - { - throw new VisualRegressionTrackerError("Visual Regression Tracker has not been started"); - } - - var response = cancellationToken.HasValue - ? await client.TestRunsController_postTestRunAsync(testRun, cancellationToken.Value) - : await client.TestRunsController_postTestRunAsync(testRun); - var status = TestRunStatus.New; - status = response.Status switch - { - "new" => TestRunStatus.New, - "ok" => TestRunStatus.Ok, - "unresolved" => TestRunStatus.Unresolved, - "failed" => TestRunStatus.Failed, - "approved" => TestRunStatus.Approved, - "autoApproved" => TestRunStatus.AutoApproved, - _ => throw new VisualRegressionTrackerError("Unexpected status"), - }; - var result = new TestRunResult - { - Status = status, - Url = response.Url, - ImageUrl = $"{response.Url}/{response.ImageName}", - BaselineUrl = !string.IsNullOrEmpty(response.BaselineName) - ? $"{response.Url}/{response.BaselineName}" - : null, - DiffUrl = !string.IsNullOrEmpty(response.DiffName) - ? $"{response.Url}/{response.DiffName}" - : null, - }; - - return result; - } - - public async Task Track( - string name, - string imageBase64, - CancellationToken? cancellationToken = null, - string os = null, - string browser = null, - string viewport = null, - string device = null, - string customTags = null, - double? diffTollerancePercent = null, - IEnumerable ignoreAreas = null) - { - var dto = new CreateTestRequestDto - { - BuildId = BuildId, - ProjectId = ProjectId, - BranchName = config.BranchName, - Name = name, - ImageBase64 = imageBase64, - Os = os, - Browser = browser, - Viewport = viewport, - Device = device, - CustomTags = customTags, - DiffTollerancePercent = diffTollerancePercent ?? 0, - IgnoreAreas = ignoreAreas == null ? null : new List(ignoreAreas), - }; - - return await SubmitTestRun(dto, cancellationToken).ConfigureAwait(false); - } - - public Task Track( - string name, - Stream image, - CancellationToken? cancellationToken = null, - string os = null, - string browser = null, - string viewport = null, - string device = null, - string customTags = null, - double? diffTollerancePercent = null, - IEnumerable ignoreAreas = null) - { - using (var base64Stream = new CryptoStream(image, new ToBase64Transform(), CryptoStreamMode.Read)) - { - using (var reader = new StreamReader(base64Stream)) - { - var imageBase64 = reader.ReadToEnd(); - return Track( - name, - imageBase64, - cancellationToken, - os, browser, viewport, device, customTags, diffTollerancePercent, ignoreAreas - ); - } - } - } - - public Task Track( - string name, - byte[] image, - CancellationToken? cancellationToken = null, - string os = null, - string browser = null, - string viewport = null, - string device = null, - string customTags = null, - double? diffTollerancePercent = null, - IEnumerable ignoreAreas = null) - { - using (var memoryStream = new MemoryStream(image)) - { - return Track( - name, - memoryStream, - cancellationToken, - os, browser, viewport, device, customTags, diffTollerancePercent, ignoreAreas - ); - } - } - } -} \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/VisualRegressionTracker.csproj b/Ginger/VisualRegressionTracker/VisualRegressionTracker.csproj deleted file mode 100644 index 17833559c6..0000000000 --- a/Ginger/VisualRegressionTracker/VisualRegressionTracker.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - net8.0 - VisualRegressionTracker - 4.8.0 - Daniel Crowe - Visual Regression Tracker - Apache-2.0 - https://github.com/Visual-Regression-Tracker/Visual-Regression-Tracker - https://github.com/Visual-Regression-Tracker/sdk-dotnet - Open source, self hosted solution for visual testing and managing results of visual testing. - true - - Library - - 6a2532d7-bd00-41ae-a0ca-f02d2e82e569 - - - - - - - - \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/VisualRegressionTrackerError.cs b/Ginger/VisualRegressionTracker/VisualRegressionTrackerError.cs deleted file mode 100644 index cd5e749fb6..0000000000 --- a/Ginger/VisualRegressionTracker/VisualRegressionTrackerError.cs +++ /dev/null @@ -1,28 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -using System; - -namespace VisualRegressionTracker -{ - public class VisualRegressionTrackerError : Exception - { - public VisualRegressionTrackerError(string message) : base(message) { } - public VisualRegressionTrackerError(Exception exception) : base(exception.Message, exception) { } - } -} \ No newline at end of file diff --git a/Ginger/VisualRegressionTracker/src/ApiClient.cs b/Ginger/VisualRegressionTracker/src/ApiClient.cs deleted file mode 100644 index 1ac0945e59..0000000000 --- a/Ginger/VisualRegressionTracker/src/ApiClient.cs +++ /dev/null @@ -1,2439 +0,0 @@ -#region License -/* -Copyright © 2014-2024 European Support Limited - -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. -*/ -#endregion - -//---------------------- -// -// Generated using the NSwag toolchain v13.0.5.0 (NJsonSchema v10.0.22.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." - -namespace VisualRegressionTracker -{ - //[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.0.5.0 (NJsonSchema v10.0.22.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class ApiClient - { - private string _baseUrl = ""; - private System.Net.Http.HttpClient _httpClient; - private System.Lazy _settings; - - public ApiClient(string baseUrl, System.Net.Http.HttpClient httpClient) - { - BaseUrl = baseUrl; - _httpClient = httpClient; - _settings = new System.Lazy(() => - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - }); - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - - /// A server side error occurred. - public System.Threading.Tasks.Task UsersController_registerAsync(CreateUserDto body) - { - return UsersController_registerAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task UsersController_registerAsync(CreateUserDto body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/users/register"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(UserLoginResponseDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task UsersController_loginAsync(UserLoginRequestDto body) - { - return UsersController_loginAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task UsersController_loginAsync(UserLoginRequestDto body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/users/login"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(UserLoginResponseDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task UsersController_generateNewApiKeyAsync() - { - return UsersController_generateNewApiKeyAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task UsersController_generateNewApiKeyAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/users/newApiKey"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(string); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task UsersController_changePasswordAsync() - { - return UsersController_changePasswordAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task UsersController_changePasswordAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/users/password"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("PUT"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(bool); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task UsersController_updateAsync(UpdateUserDto body) - { - return UsersController_updateAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task UsersController_updateAsync(UpdateUserDto body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/users"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(UserLoginResponseDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task> BuildsController_getAsync(string projectId) - { - return BuildsController_getAsync(projectId, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task> BuildsController_getAsync(string projectId, System.Threading.CancellationToken cancellationToken) - { - if (projectId == null) - throw new System.ArgumentNullException("projectId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/builds?"); - urlBuilder_.Append(System.Uri.EscapeDataString("projectId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(projectId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(System.Collections.Generic.ICollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task BuildsController_createAsync(CreateBuildDto body) - { - return BuildsController_createAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task BuildsController_createAsync(CreateBuildDto body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/builds"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(BuildDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task BuildsController_removeAsync(string id) - { - return BuildsController_removeAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task BuildsController_removeAsync(string id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/builds/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task BuildsController_stopAsync(string id) - { - return BuildsController_stopAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task BuildsController_stopAsync(string id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/builds/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); - request_.Method = new System.Net.Http.HttpMethod("PATCH"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(BuildDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestRunsController_getAsync(string buildId) - { - return TestRunsController_getAsync(buildId, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestRunsController_getAsync(string buildId, System.Threading.CancellationToken cancellationToken) - { - if (buildId == null) - throw new System.ArgumentNullException("buildId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-runs?"); - urlBuilder_.Append(System.Uri.EscapeDataString("buildId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(buildId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestRunsController_postTestRunAsync(CreateTestRequestDto body) - { - return TestRunsController_postTestRunAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestRunsController_postTestRunAsync(CreateTestRequestDto body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-runs"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "201") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(TestRunResultDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestRunsController_recalculateDiffAsync(string id) - { - return TestRunsController_recalculateDiffAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestRunsController_recalculateDiffAsync(string id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-runs/recalculateDiff/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestRunsController_approveTestRunAsync(string id, bool? merge) - { - return TestRunsController_approveTestRunAsync(id, merge, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestRunsController_approveTestRunAsync(string id, bool? merge, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-runs/approve?"); - urlBuilder_.Append(System.Uri.EscapeDataString("id") + "=").Append(System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - if (merge != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("merge") + "=").Append(System.Uri.EscapeDataString(ConvertToString(merge, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestRunsController_rejectTestRunAsync(string id) - { - return TestRunsController_rejectTestRunAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestRunsController_rejectTestRunAsync(string id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-runs/reject/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestRunsController_deleteTestRunAsync(string id) - { - return TestRunsController_deleteTestRunAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestRunsController_deleteTestRunAsync(string id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-runs/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestRunsController_updateIgnoreAreasAsync(string testRunId, System.Collections.Generic.IEnumerable body) - { - return TestRunsController_updateIgnoreAreasAsync(testRunId, body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestRunsController_updateIgnoreAreasAsync(string testRunId, System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken) - { - if (testRunId == null) - throw new System.ArgumentNullException("testRunId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-runs/ignoreArea/{testRunId}"); - urlBuilder_.Replace("{testRunId}", System.Uri.EscapeDataString(ConvertToString(testRunId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestRunsController_updateCommentAsync(string testRunId, CommentDto body) - { - return TestRunsController_updateCommentAsync(testRunId, body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestRunsController_updateCommentAsync(string testRunId, CommentDto body, System.Threading.CancellationToken cancellationToken) - { - if (testRunId == null) - throw new System.ArgumentNullException("testRunId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-runs/comment/{testRunId}"); - urlBuilder_.Replace("{testRunId}", System.Uri.EscapeDataString(ConvertToString(testRunId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestVariationsController_getListAsync(string projectId) - { - return TestVariationsController_getListAsync(projectId, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestVariationsController_getListAsync(string projectId, System.Threading.CancellationToken cancellationToken) - { - if (projectId == null) - throw new System.ArgumentNullException("projectId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-variations?"); - urlBuilder_.Append(System.Uri.EscapeDataString("projectId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(projectId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestVariationsController_getDetailsAsync(string id) - { - return TestVariationsController_getDetailsAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestVariationsController_getDetailsAsync(string id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-variations/details/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestVariationsController_updateIgnoreAreasAsync(string variationId, System.Collections.Generic.IEnumerable body) - { - return TestVariationsController_updateIgnoreAreasAsync(variationId, body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestVariationsController_updateIgnoreAreasAsync(string variationId, System.Collections.Generic.IEnumerable body, System.Threading.CancellationToken cancellationToken) - { - if (variationId == null) - throw new System.ArgumentNullException("variationId"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-variations/ignoreArea/{variationId}"); - urlBuilder_.Replace("{variationId}", System.Uri.EscapeDataString(ConvertToString(variationId, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestVariationsController_updateCommentAsync(string id, CommentDto body) - { - return TestVariationsController_updateCommentAsync(id, body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestVariationsController_updateCommentAsync(string id, CommentDto body, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-variations/comment/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestVariationsController_mergeAsync(string projectId, string branchName) - { - return TestVariationsController_mergeAsync(projectId, branchName, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestVariationsController_mergeAsync(string projectId, string branchName, System.Threading.CancellationToken cancellationToken) - { - if (projectId == null) - throw new System.ArgumentNullException("projectId"); - - if (branchName == null) - throw new System.ArgumentNullException("branchName"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-variations/merge/?"); - urlBuilder_.Append(System.Uri.EscapeDataString("projectId") + "=").Append(System.Uri.EscapeDataString(ConvertToString(projectId, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Append(System.Uri.EscapeDataString("branchName") + "=").Append(System.Uri.EscapeDataString(ConvertToString(branchName, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - urlBuilder_.Length--; - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(BuildDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task TestVariationsController_deleteAsync(string id) - { - return TestVariationsController_deleteAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task TestVariationsController_deleteAsync(string id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/test-variations/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - return; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task> ProjectsController_getAllAsync() - { - return ProjectsController_getAllAsync(System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task> ProjectsController_getAllAsync(System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/projects"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync>(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(System.Collections.Generic.ICollection); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task ProjectsController_createAsync(CreateProjectDto body) - { - return ProjectsController_createAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task ProjectsController_createAsync(CreateProjectDto body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/projects"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("POST"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(ProjectDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task ProjectsController_updateAsync(ProjectDto body) - { - return ProjectsController_updateAsync(body, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task ProjectsController_updateAsync(ProjectDto body, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/projects"); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value)); - content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - request_.Content = content_; - request_.Method = new System.Net.Http.HttpMethod("PUT"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(ProjectDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - /// A server side error occurred. - public System.Threading.Tasks.Task ProjectsController_removeAsync(string id) - { - return ProjectsController_removeAsync(id, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// A server side error occurred. - public async System.Threading.Tasks.Task ProjectsController_removeAsync(string id, System.Threading.CancellationToken cancellationToken) - { - if (id == null) - throw new System.ArgumentNullException("id"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/projects/{id}"); - urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); - - var client_ = _httpClient; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - request_.Method = new System.Net.Http.HttpMethod("DELETE"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = ((int)response_.StatusCode).ToString(); - if (status_ == "200") - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_).ConfigureAwait(false); - return objectResponse_.Object; - } - else - if (status_ != "200" && status_ != "204") - { - var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); - throw new ApiException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", (int)response_.StatusCode, responseData_, headers_, null); - } - - return default(ProjectDto); - } - finally - { - if (response_ != null) - response_.Dispose(); - } - } - } - finally - { - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value is System.Enum) - { - string name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - } - } - else if (value is bool) { - return System.Convert.ToString(value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value != null && value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - return System.Convert.ToString(value, cultureInfo); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CreateUserDto - { - [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Email { get; set; } - - [Newtonsoft.Json.JsonProperty("password", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Password { get; set; } - - [Newtonsoft.Json.JsonProperty("firstName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string FirstName { get; set; } - - [Newtonsoft.Json.JsonProperty("lastName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string LastName { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class UserLoginResponseDto - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Email { get; set; } - - [Newtonsoft.Json.JsonProperty("firstName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string FirstName { get; set; } - - [Newtonsoft.Json.JsonProperty("lastName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string LastName { get; set; } - - [Newtonsoft.Json.JsonProperty("apiKey", Required = Newtonsoft.Json.Required.Always)] - //Required - public string ApiKey { get; set; } - - [Newtonsoft.Json.JsonProperty("token", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Token { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class UserLoginRequestDto - { - [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Email { get; set; } - - [Newtonsoft.Json.JsonProperty("password", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Password { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class UpdateUserDto - { - [Newtonsoft.Json.JsonProperty("email", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Email { get; set; } - - [Newtonsoft.Json.JsonProperty("firstName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string FirstName { get; set; } - - [Newtonsoft.Json.JsonProperty("lastName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string LastName { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class BuildDto - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("ciBuildId", Required = Newtonsoft.Json.Required.AllowNull)] - public string CiBuildId { get; set; } - - [Newtonsoft.Json.JsonProperty("number", Required = Newtonsoft.Json.Required.Always)] - public double Number { get; set; } - - [Newtonsoft.Json.JsonProperty("branchName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string BranchName { get; set; } - - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Status { get; set; } - - [Newtonsoft.Json.JsonProperty("projectId", Required = Newtonsoft.Json.Required.Always)] - //Required - public string ProjectId { get; set; } - - [Newtonsoft.Json.JsonProperty("updatedAt", Required = Newtonsoft.Json.Required.Always)] - //Required - public System.DateTimeOffset UpdatedAt { get; set; } - - [Newtonsoft.Json.JsonProperty("createdAt", Required = Newtonsoft.Json.Required.Always)] - //Required - public System.DateTimeOffset CreatedAt { get; set; } - - [Newtonsoft.Json.JsonProperty("userId", Required = Newtonsoft.Json.Required.AllowNull)] - public string UserId { get; set; } - - [Newtonsoft.Json.JsonProperty("passedCount", Required = Newtonsoft.Json.Required.Always)] - public double PassedCount { get; set; } - - [Newtonsoft.Json.JsonProperty("unresolvedCount", Required = Newtonsoft.Json.Required.Always)] - public double UnresolvedCount { get; set; } - - [Newtonsoft.Json.JsonProperty("failedCount", Required = Newtonsoft.Json.Required.Always)] - public double FailedCount { get; set; } - - [Newtonsoft.Json.JsonProperty("isRunning", Required = Newtonsoft.Json.Required.Always)] - public bool IsRunning { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CreateBuildDto - { - [Newtonsoft.Json.JsonProperty("ciBuildId", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string CiBuildId { get; set; } - - [Newtonsoft.Json.JsonProperty("branchName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string BranchName { get; set; } - - [Newtonsoft.Json.JsonProperty("project", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Project { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CommentDto - { - [Newtonsoft.Json.JsonProperty("comment", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Comment { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class IgnoreAreaDto - { - [Newtonsoft.Json.JsonProperty("x", Required = Newtonsoft.Json.Required.Always)] - public double X { get; set; } - - [Newtonsoft.Json.JsonProperty("y", Required = Newtonsoft.Json.Required.Always)] - public double Y { get; set; } - - [Newtonsoft.Json.JsonProperty("width", Required = Newtonsoft.Json.Required.Always)] - public double Width { get; set; } - - [Newtonsoft.Json.JsonProperty("height", Required = Newtonsoft.Json.Required.Always)] - public double Height { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CreateTestRequestDto - { - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("os", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Os { get; set; } - - [Newtonsoft.Json.JsonProperty("browser", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Browser { get; set; } - - [Newtonsoft.Json.JsonProperty("viewport", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Viewport { get; set; } - - [Newtonsoft.Json.JsonProperty("device", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Device { get; set; } - - [Newtonsoft.Json.JsonProperty("customTags", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string CustomTags { get; set; } - - [Newtonsoft.Json.JsonProperty("branchName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string BranchName { get; set; } - - [Newtonsoft.Json.JsonProperty("imageBase64", Required = Newtonsoft.Json.Required.Always)] - //Required - public string ImageBase64 { get; set; } - - [Newtonsoft.Json.JsonProperty("buildId", Required = Newtonsoft.Json.Required.Always)] - //Required - public string BuildId { get; set; } - - [Newtonsoft.Json.JsonProperty("projectId", Required = Newtonsoft.Json.Required.Always)] - //Required - public string ProjectId { get; set; } - - [Newtonsoft.Json.JsonProperty("diffTollerancePercent", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public double DiffTollerancePercent { get; set; } - - //[Newtonsoft.Json.JsonProperty("merge", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - //public bool Merge { get; set; } - - [Newtonsoft.Json.JsonProperty("ignoreAreas", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection IgnoreAreas { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class TestRunResultDto - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("imageName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string ImageName { get; set; } - - [Newtonsoft.Json.JsonProperty("diffName", Required = Newtonsoft.Json.Required.AllowNull)] - public string DiffName { get; set; } - - [Newtonsoft.Json.JsonProperty("baselineName", Required = Newtonsoft.Json.Required.AllowNull)] - public string BaselineName { get; set; } - - [Newtonsoft.Json.JsonProperty("diffPercent", Required = Newtonsoft.Json.Required.AllowNull)] - public double? DiffPercent { get; set; } - - [Newtonsoft.Json.JsonProperty("diffTollerancePercent", Required = Newtonsoft.Json.Required.Always)] - public double DiffTollerancePercent { get; set; } - - [Newtonsoft.Json.JsonProperty("pixelMisMatchCount", Required = Newtonsoft.Json.Required.AllowNull)] - public double? PixelMisMatchCount { get; set; } - - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Status { get; set; } - - [Newtonsoft.Json.JsonProperty("url", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Url { get; set; } - - [Newtonsoft.Json.JsonProperty("merge", Required = Newtonsoft.Json.Required.Always)] - public bool Merge { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ProjectDto - { - [Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Id { get; set; } - - [Newtonsoft.Json.JsonProperty("buildsCounter", Required = Newtonsoft.Json.Required.Always)] - public double BuildsCounter { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("mainBranchName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string MainBranchName { get; set; } - - [Newtonsoft.Json.JsonProperty("createdAt", Required = Newtonsoft.Json.Required.Always)] - //Required - public System.DateTimeOffset CreatedAt { get; set; } - - [Newtonsoft.Json.JsonProperty("updatedAt", Required = Newtonsoft.Json.Required.Always)] - //Required - public System.DateTimeOffset UpdatedAt { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.0.22.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CreateProjectDto - { - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.Always)] - //Required - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("mainBranchName", Required = Newtonsoft.Json.Required.Always)] - //Required - public string MainBranchName { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.0.5.0 (NJsonSchema v10.0.22.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class ApiException : System.Exception - { - public int StatusCode { get; private set; } - - public string Response { get; private set; } - - public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } - - public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Exception innerException) - : base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + response.Substring(0, response.Length >= 512 ? 512 : response.Length), innerException) - { - StatusCode = statusCode; - Response = response; - Headers = headers; - } - - public override string ToString() - { - return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString()); - } - } - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.0.5.0 (NJsonSchema v10.0.22.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class ApiException : ApiException - { - public TResult Result { get; private set; } - - public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary> headers, TResult result, System.Exception innerException) - : base(message, statusCode, response, headers, innerException) - { - Result = result; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 \ No newline at end of file