Skip to content

Commit

Permalink
Merge pull request #157 from hypar-io/people
Browse files Browse the repository at this point in the history
Update and stream the People.
  • Loading branch information
ikeough authored Nov 9, 2023
2 parents eff8ec6 + 9265304 commit 9e8fb2d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
8 changes: 4 additions & 4 deletions People/dependencies/People.Dependencies.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="1.4.0" />
<PackageReference Include="Hypar.Functions" Version="1.3.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hypar.Elements" Version="2.1.0" />
<PackageReference Include="Hypar.Functions" Version="1.10.0" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions People/dependencies/PeopleInputs.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ namespace People

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.1.21.0 (Newtonsoft.Json v13.0.0.0)")]

public class PeopleInputs : S3Args
public class PeopleInputs : ArgsBase

{
[Newtonsoft.Json.JsonConstructor]

public PeopleInputs(double @peoplePerFloor, bool @includeSeatedPeople, string bucketName, string uploadsBucket, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(bucketName, uploadsBucket, modelInputKeys, gltfKey, elementsKey, ifcKey)
public PeopleInputs(double @peoplePerFloor, bool @includeSeatedPeople, Dictionary<string, string> modelInputKeys, string gltfKey, string elementsKey, string ifcKey):
base(modelInputKeys, gltfKey, elementsKey, ifcKey)
{
var validator = Validator.Instance.GetFirstValidatorForType<PeopleInputs>();
if(validator != null)
Expand Down
3 changes: 0 additions & 3 deletions People/dependencies/PeopleOutputs.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ namespace People
public class PeopleOutputs: SystemResults
{


/// <summary>
/// Construct a PeopleOutputs with default inputs.
/// This should be used for testing only.
/// </summary>
public PeopleOutputs() : base()
{

}


}
}
1 change: 1 addition & 0 deletions People/hypar.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"name": "People",
"description": "Distribute people on all floors.",
"language": "C#",
"stream_model": true,
"model_dependencies": [
{
"autohide": false,
Expand Down
10 changes: 5 additions & 5 deletions People/src/Function.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Edits to this code will be overwritten the next time you run 'hypar init'.
// DO NOT EDIT THIS FILE.

using Amazon;
using Amazon.Lambda.Core;
using Hypar.Functions.Execution;
using Hypar.Functions.Execution.AWS;
Expand All @@ -19,9 +18,9 @@ public class Function
{
// Cache the model store for use by subsequent
// executions of this lambda.
private IModelStore<PeopleInputs> store;
private UrlModelStore<PeopleInputs> store;

public async Task<PeopleOutputs> Handler(PeopleInputs args, ILambdaContext context)
public async Task<PeopleOutputs> Handler(PeopleInputs args)
{
// Preload dependencies (if they exist),
// so that they are available during model deserialization.
Expand Down Expand Up @@ -62,10 +61,11 @@ public async Task<PeopleOutputs> Handler(PeopleInputs args, ILambdaContext conte

if(this.store == null)
{
this.store = new S3ModelStore<PeopleInputs>(RegionEndpoint.GetBySystemName("us-west-1"));
this.store = new UrlModelStore<PeopleInputs>();
}


var l = new InvocationWrapper<PeopleInputs,PeopleOutputs>(store, People.Execute);
var l = new InvocationWrapper<PeopleInputs,PeopleOutputs> (store, People.Execute);
var output = await l.InvokeAsync(args);
return output;
}
Expand Down

0 comments on commit 9e8fb2d

Please sign in to comment.