Skip to content

Commit

Permalink
update sample project
Browse files Browse the repository at this point in the history
  • Loading branch information
cuteribs committed Mar 8, 2024
1 parent 6575eb6 commit a56f877
Show file tree
Hide file tree
Showing 10 changed files with 128 additions and 84 deletions.
4 changes: 2 additions & 2 deletions src/ApiTester/ApiTester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>netcoreapp3.1;net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UserSecretsId>40d4c3dd-1286-4dad-afd8-2d1de12ef270</UserSecretsId>
<UserSecretsId>$(MSBuildProjectName)</UserSecretsId>
</PropertyGroup>

<ItemGroup>
Expand Down
14 changes: 10 additions & 4 deletions src/ApiTester/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using System.Net;
using Veracode.ApiClients.ApplicationsApi;
using Veracode.ApiClients.Helper;
using Veracode.ApiClients.IdentityApi;
Expand Down Expand Up @@ -29,6 +30,8 @@ static void Main(string[] args)
.AddUserSecrets<Program>()
.Build();

HttpClient.DefaultProxy = new WebProxy("http://localhost:10082");

GetUsers();

GetApplications();
Expand All @@ -47,10 +50,13 @@ static void GetUsers()
var serviceProvider = services.BuildServiceProvider();
var client = serviceProvider.GetRequiredService<IIdentityApiClient>();

var response = client.GetUserApiCredsUsingGET();
var result = response;
var users = client.GetUserApiCredsUsingGET();
Console.WriteLine("Users");
Console.WriteLine(JsonConvert.SerializeObject(result, Formatting.Indented));
Console.WriteLine(JsonConvert.SerializeObject(users, Formatting.Indented));

var teams = client.GetTeamsUsingGET();
Console.WriteLine("Teams");
Console.WriteLine(JsonConvert.SerializeObject(teams, Formatting.Indented));
}

static void GetApplications()
Expand All @@ -64,7 +70,7 @@ static void GetApplications()
var serviceProvider = services.BuildServiceProvider();
var client = serviceProvider.GetRequiredService<IApplicationsApiClient>();

var response = client.GetApplicationsUsingGET(team: "Veracity-Maritime-OVD");
var response = client.GetApplicationsUsingGET(team: "Veracity-OVD");
var result = response._embedded.Applications.Select(a => new
{
AppId = a.Id,
Expand Down
1 change: 0 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>Latest</LangVersion>
<Version>1.0.1</Version>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AutoRest.ApiClients.Common" Version="1.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

</Project>
161 changes: 89 additions & 72 deletions src/Veracode.ApiClients.sln
Original file line number Diff line number Diff line change
@@ -1,72 +1,89 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33502.350
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiTester", "ApiTester\ApiTester.csproj", "{DDC36AF6-B321-40FF-88AE-D113FF867351}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.SCAAgentApi", "Veracode.ApiClients.SCAAgentApi\Veracode.ApiClients.SCAAgentApi.csproj", "{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.ApplicationsApi", "Veracode.ApiClients.ApplicationsApi\Veracode.ApiClients.ApplicationsApi.csproj", "{8822BF15-4B22-48AC-9D71-C1A929C19B87}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.Helper", "Veracode.ApiClients.Helper\Veracode.ApiClients.Helper.csproj", "{F5FA54B4-319D-4679-ACDD-F4B80113B34A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.SummaryReportApi", "Veracode.ApiClients.SummaryReportApi\Veracode.ApiClients.SummaryReportApi.csproj", "{11C21C6B-502E-4A47-A59D-FC9595D72374}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.FindingsApi", "Veracode.ApiClients.FindingsApi\Veracode.ApiClients.FindingsApi.csproj", "{6A39E497-D8D8-4B37-AA41-4D9D12554547}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.DynamicFlawApi", "Veracode.ApiClients.DynamicFlawApi\Veracode.ApiClients.DynamicFlawApi.csproj", "{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.IdentityApi", "Veracode.ApiClients.IdentityApi\Veracode.ApiClients.IdentityApi.csproj", "{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{691542A2-7461-4F56-9FFE-E843607017AA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DDC36AF6-B321-40FF-88AE-D113FF867351}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDC36AF6-B321-40FF-88AE-D113FF867351}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDC36AF6-B321-40FF-88AE-D113FF867351}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDC36AF6-B321-40FF-88AE-D113FF867351}.Release|Any CPU.Build.0 = Release|Any CPU
{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}.Release|Any CPU.Build.0 = Release|Any CPU
{8822BF15-4B22-48AC-9D71-C1A929C19B87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8822BF15-4B22-48AC-9D71-C1A929C19B87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8822BF15-4B22-48AC-9D71-C1A929C19B87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8822BF15-4B22-48AC-9D71-C1A929C19B87}.Release|Any CPU.Build.0 = Release|Any CPU
{F5FA54B4-319D-4679-ACDD-F4B80113B34A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5FA54B4-319D-4679-ACDD-F4B80113B34A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5FA54B4-319D-4679-ACDD-F4B80113B34A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5FA54B4-319D-4679-ACDD-F4B80113B34A}.Release|Any CPU.Build.0 = Release|Any CPU
{11C21C6B-502E-4A47-A59D-FC9595D72374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11C21C6B-502E-4A47-A59D-FC9595D72374}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11C21C6B-502E-4A47-A59D-FC9595D72374}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11C21C6B-502E-4A47-A59D-FC9595D72374}.Release|Any CPU.Build.0 = Release|Any CPU
{6A39E497-D8D8-4B37-AA41-4D9D12554547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6A39E497-D8D8-4B37-AA41-4D9D12554547}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A39E497-D8D8-4B37-AA41-4D9D12554547}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A39E497-D8D8-4B37-AA41-4D9D12554547}.Release|Any CPU.Build.0 = Release|Any CPU
{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}.Release|Any CPU.Build.0 = Release|Any CPU
{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E7E030D1-26E4-49E3-8A01-9A8FD0AECC59}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33502.350
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApiTester", "ApiTester\ApiTester.csproj", "{DDC36AF6-B321-40FF-88AE-D113FF867351}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.SCAAgentApi", "Veracode.ApiClients.SCAAgentApi\Veracode.ApiClients.SCAAgentApi.csproj", "{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.ApplicationsApi", "Veracode.ApiClients.ApplicationsApi\Veracode.ApiClients.ApplicationsApi.csproj", "{8822BF15-4B22-48AC-9D71-C1A929C19B87}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.Helper", "Veracode.ApiClients.Helper\Veracode.ApiClients.Helper.csproj", "{F5FA54B4-319D-4679-ACDD-F4B80113B34A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.SummaryReportApi", "Veracode.ApiClients.SummaryReportApi\Veracode.ApiClients.SummaryReportApi.csproj", "{11C21C6B-502E-4A47-A59D-FC9595D72374}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.FindingsApi", "Veracode.ApiClients.FindingsApi\Veracode.ApiClients.FindingsApi.csproj", "{6A39E497-D8D8-4B37-AA41-4D9D12554547}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.DynamicFlawApi", "Veracode.ApiClients.DynamicFlawApi\Veracode.ApiClients.DynamicFlawApi.csproj", "{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Veracode.ApiClients.IdentityApi", "Veracode.ApiClients.IdentityApi\Veracode.ApiClients.IdentityApi.csproj", "{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{691542A2-7461-4F56-9FFE-E843607017AA}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{C6B4B6E3-4A4A-4882-8092-C2DE8B6BE87C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{FFDC7AA8-F01C-4BEB-89B0-02D28C124817}"
ProjectSection(SolutionItems) = preProject
..\.github\workflows\Veracode.ApiClients.ApplicationsApi.publish.yml = ..\.github\workflows\Veracode.ApiClients.ApplicationsApi.publish.yml
..\.github\workflows\Veracode.ApiClients.DynamicFlawApi.publish.yml = ..\.github\workflows\Veracode.ApiClients.DynamicFlawApi.publish.yml
..\.github\workflows\Veracode.ApiClients.FindingsApi.publish.yml = ..\.github\workflows\Veracode.ApiClients.FindingsApi.publish.yml
..\.github\workflows\Veracode.ApiClients.Helper.publish.yml = ..\.github\workflows\Veracode.ApiClients.Helper.publish.yml
..\.github\workflows\Veracode.ApiClients.IdentityApi.publish.yml = ..\.github\workflows\Veracode.ApiClients.IdentityApi.publish.yml
..\.github\workflows\Veracode.ApiClients.SCAAgentApi.publish.yml = ..\.github\workflows\Veracode.ApiClients.SCAAgentApi.publish.yml
..\.github\workflows\Veracode.ApiClients.SummaryReportApi.publish.yml = ..\.github\workflows\Veracode.ApiClients.SummaryReportApi.publish.yml
..\.github\workflows\_publish.yml = ..\.github\workflows\_publish.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DDC36AF6-B321-40FF-88AE-D113FF867351}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDC36AF6-B321-40FF-88AE-D113FF867351}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDC36AF6-B321-40FF-88AE-D113FF867351}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDC36AF6-B321-40FF-88AE-D113FF867351}.Release|Any CPU.Build.0 = Release|Any CPU
{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C23F0593-896F-4B88-AD4C-5D0145A5CA2C}.Release|Any CPU.Build.0 = Release|Any CPU
{8822BF15-4B22-48AC-9D71-C1A929C19B87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8822BF15-4B22-48AC-9D71-C1A929C19B87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8822BF15-4B22-48AC-9D71-C1A929C19B87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8822BF15-4B22-48AC-9D71-C1A929C19B87}.Release|Any CPU.Build.0 = Release|Any CPU
{F5FA54B4-319D-4679-ACDD-F4B80113B34A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5FA54B4-319D-4679-ACDD-F4B80113B34A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5FA54B4-319D-4679-ACDD-F4B80113B34A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5FA54B4-319D-4679-ACDD-F4B80113B34A}.Release|Any CPU.Build.0 = Release|Any CPU
{11C21C6B-502E-4A47-A59D-FC9595D72374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11C21C6B-502E-4A47-A59D-FC9595D72374}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11C21C6B-502E-4A47-A59D-FC9595D72374}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11C21C6B-502E-4A47-A59D-FC9595D72374}.Release|Any CPU.Build.0 = Release|Any CPU
{6A39E497-D8D8-4B37-AA41-4D9D12554547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6A39E497-D8D8-4B37-AA41-4D9D12554547}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6A39E497-D8D8-4B37-AA41-4D9D12554547}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6A39E497-D8D8-4B37-AA41-4D9D12554547}.Release|Any CPU.Build.0 = Release|Any CPU
{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDF594CF-2A78-4E29-BFC1-8D64B72209EF}.Release|Any CPU.Build.0 = Release|Any CPU
{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{220309AF-E7CE-4BB8-BF0A-F8D77D7FCECA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{FFDC7AA8-F01C-4BEB-89B0-02D28C124817} = {C6B4B6E3-4A4A-4882-8092-C2DE8B6BE87C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E7E030D1-26E4-49E3-8A01-9A8FD0AECC59}
EndGlobalSection
EndGlobal

0 comments on commit a56f877

Please sign in to comment.