Coder Social home page Coder Social logo

pkrull / simulation-csharp-client Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 3dsim/simulation-csharp-client

0.0 0.0 0.0 459 KB

c# client for use with the 3DSIM simulation api

License: MIT License

C# 99.85% Dockerfile 0.04% Shell 0.10%

simulation-csharp-client's Introduction

SimulationCSharpClient

The SimulationCSharpClient is a client for the 3DSIM simulation API. The model and client objects are auto generated using NSwag and the swagger 2.0 API Specification from https://github.com/3DSIM/simulation-api-specification

Technical Specifications

Platforms Supported

MacOS, Windows, and Linux

Usage

See simulation-api-specification repo for constructor values: https://github.com/3DSIM/simulation-api-specification

var simulationClient = new SimulationClient(Credentials.BaseURL, <Auth0TokenURL>, <Client ID>, <UserName>, <Password>, <connection>);

var simulations = this.simulationClient.AssumedStrainSimulationsGetAsync(2, null, null, 0, 10).Result;

foreach(var simulation in simulations)
{
	// do stuff with simulations
}

Tools

nswag - https://github.com/RSuter/NSwag

nswag can be installed using npm

npm install nswag -g

Currently using nswag version to generate client:

NSwag version: v11.12.7.0
NJsonSchema version: v9.10.6.0 (Newtonsoft.Json v9.0.0.0)

Creating swagger.json from swagger.yaml

Goto swagger.io and open the online editor. Paste the swagger.yaml from the https://github.com/3DSIM/simulation-api-specification project. In the file menu, select "Convert and Save as Json"

Reference this created json file in the next section

Regenerating from swagger.json

To generate the client, run nswag in the project root folder using the swagger specification converted to json. You can convert the yaml file at editor.swagger.io by pasting the text into the editor window then downloading as json.

If converting from local file, copy json version of spec, swagger.json in this case, into root folder then run:

nswag swagger2csclient /input:swagger.json /classname:SimulationClient /namespace:SimulationCSharpClient.Client /output:src/SimulationCSharpClient/Client/SimulationClientGenerated.cs /generateclientinterfaces:true /injecthttpclient:true /ResponseArrayType:System.Collections.ObjectModel.ObservableCollection

Contributing code

Read this article and follow the steps they outline: http://scottchacon.com/2011/08/31/github-flow.html

Contributors

  • Tim Sublette
  • Ryan Walls
  • Chad Queen
  • Pete Krull
  • Alex Drinkwater

Original release

September 2017

simulation-csharp-client's People

Contributors

madhukar-agsft avatar pkrull-ansys avatar alexdrinkwater avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.